build Simulink model (arduino-uno as an input)

Hi all,

I'm using arduino uno with my Waycon sensor.

I'm trying to build a model in simulink where I can show the output result of my arduino-code.

First i succeeded to build this model in order to simulate this code which consist to represent the inpuls number/s of the waycon.

#include <Encoder.h>

Encoder myEnc(2, 3);
// avoid using pins with LEDs attached
void setup() {
Serial.begin(115200);
}
void loop() {
long newPosition = myEnc.read();
Serial.println(newPosition);
delay(10);

related simulink model: see attachment

Now I'm trying to build another Simulink model for this arduino code which consist to represent the inpuls number/s and the compilation time in the same time.

arduino-uno code:

#include <Encoder.h>

Encoder myEnc(2, 3);
// avoid using pins with LEDs attached
void setup() {
Serial.begin(115200);
}
void loop() {
long newPosition = myEnc.read();
Serial.println(newPosition);
delay(10);

unsigned long time;

Serial.print("Time: ");
time = millis();

Serial.println(time);

delay(1000);
}

I tried the same model so i get this error: esponse from instrument was non-numeric.

Could someone help me on this enquiry, how can i manage to show two results from arduino code in one simulink model . I'm quiet new and i already begin working on arduino and simulink :slight_smile:

Many thanks in advance

Unbenannt.PNG