07-05-2017 03:17 AM
Hi everybody!
I am trying to read 3 signals in labview but this signals come too slow. I added the function millis() in arduino and try to read it from labview to see what was going on and the thing is that the seconds were going much slower in labview. After five seconds i could see in labview how the value of variable related to millis had only increased in one second...
I am using labview in my MAC...
thank you in advance
Here I add my arduino code...
// put your setup code here, to run once:
Serial.begin(230400);
}
char Buffer[16];
int sensor0 = 0;
int sensor1 = 0;
int sensor2 = 0;
int sensor3 = 0;
void loop() {
// put your main code here, to run repeatedly:
sensor0=analogRead(0);
sensor1=analogRead(1);
sensor2=analogRead(2);
sensor3=millis()/1000 ;
sprintf(Buffer,"%04i\t %04i\t%04i\t%04i",sensor0,sensor1,sensor2,sensor3);
Serial.println (Buffer);
delay(1000);
}
07-05-2017 03:35 AM - edited 07-05-2017 03:36 AM
Hi carlos,
when using \-codes in string constants you should ALWAYS enable the display mode display of the string!
Please set the format string constant to "\-code display", then correct your format string…
Also disabling the TermChar should be done once before the loop, no need to repeat that with each iteration. And keep in mind: the VISAConfigureSerialPort already has an option to do that!
07-05-2017 08:58 AM
You are right! I also take out of the loop the first element of the link side. This made my loop go much slower.
Thank you very much!!