LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Init vi

Hi All:

I am using an Arduino uno with the latest LIFA set-up. It appears that any of the examples only works the first time after I open LabVIEW and then immediately start the vi (for example "analog read"). When I stop the vi, and then restart it the Arduino starts to blink the RX LED wildly, but the vi is frozen. Quitting LabVIEW and restarting everything fixes the problem. Then the same again...

I followed the vi execution via the 'light bulb' feature, and it seems that the problem is in the init vi at the point where the "sync" string is requested from the Arduino. There it loops with "F" as result until the timout occurs. Then 5003 error output.

It gets stranger: When I press the reset button on the Arduino after starting the VI it works fine, too. Even if I quit the VI before.

This made me think that there is maybe some 'residue' in the serial buffer. I noted that case 0x00 still contains the pre-Arduino 1.0 Serial.flush() command, which now does not flush anymore...but now I am at the end of my (limited) wisdom...

Any input would be greatly appreciated!

Thanks much in advance!

0 Kudos
Message 1 of 4
(4,245 Views)

Hey BG4004,

How are you stopping the VI? By hitting the stop button on the front panel or the abort button on the VI? It sounds like you may not be running the Arduino Close to free up the VISA serial resources at the end of the first execution - this would happen if you used the abort button.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 4
(3,132 Views)

Hi Kevin_F:

Thanks much for your fast reply! I did use the abort button! Excellent point! I will try tonight. Do you understand what the purpose of the Serial.flush() statement in the Arduino sketch is? On the Arduino website it is stated that this  "Waits for the transmission of outgoing serial data to complete"...why is this necessary? One would think that LabVIEW needs to wait until all four "sync" bytes arrive before any further action on the bus would occur. Thanks!

0 Kudos
Message 3 of 4
(3,132 Views)

Hey BG4004, I seem to be having the same problem as you are with the Arduino UNO. Did you manage to solve the problem with the ERROR 5003?

0 Kudos
Message 4 of 4
(3,132 Views)