LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read serial data from arduino using visa

Hi to all,

       I made a vi to read a analog voltage serially using arduino uno board when i analysing through the arduino serial monitor i can see the volatge variations but when i programmed using serial visa configure port and read the data it is not displaying anything and it shows the error message 'rror -1073807360 occurred at Property Node (arg 😎 in VISA Configure Serial Port (Instr).vi->sample program 2.vi' and i have attached a code to this thread and give some idea on this.

 

Thanks in advance,

Regards,

Dinesh

0 Kudos
Message 1 of 6
(5,680 Views)

That error code means "unknown system error".  That tells me there is something inherently wrong with your serial port or the way you are calling it?  Are you sure your serial port works?  Your VI doesn't have any serial port name saved as a default in the VISA resource name control, so your VI doesn't really help us here.

 

I do see problems with your VI.  "Bytes at Port" is the wrong thing to use about 99% of the time.  Especially when you combine that with a while loop that has no waits in it.  That loop will run infinitely fast pulling 0, 1, 2, 3, .... bytes from the port each time it iterates.  What does your data look like?  If you got a read a random number of bytes, will the data you get make any sense?

 

Good serial port communication will send data and use a termination character such as a line feed or carriage return to tell when the package of data ends.  You didn't share your Arduino code, but my guess that it sends something that is humanly readable that ends with a termination character.  The line feed character is enabled by default in your VISA configure.  So if you just wired a large enough constant to the VISA read and get rid of "Bytes at Port", you should be able to read complete messages that actually make sense.

 

Of course you still have to figure out why you are getting a system error when you try to communicate with whatever serial port name you have using.

0 Kudos
Message 2 of 6
(5,659 Views)

Dinesh,

 

What does your arduino code look like?

 

Also, I see in your VI that all of your serial port settings (baud rate, stop bits, etc.) are not wired. It is generally a good idea to wire these as the default values probably don't match your arduino's serial configuration.

 

Because the error you said occured at VISA Configure Serial Port, it is passed into your while loop to the Read function, which causes it to not run. That's why your data output is blank.

0 Kudos
Message 3 of 6
(5,657 Views)
0 Kudos
Message 4 of 6
(5,647 Views)

First of all thanks for the reply sirwin and i got the output, it was just a simple example program from arduino 'Analog serial inout' using potentiometer and i got the output, i have also attached a modified vi to this you can check it and more thing is, i need simple program to glow a led when ever i switch on using labview and main thing it is 'i only need arduino program not labview' can you send that?

Thanks in advance,

Regards,

Dinesh

 

0 Kudos
Message 5 of 6
(5,632 Views)

First of all thanks for the reply sirwin and i got the output, it was just a simple example program from arduino 'Analog serial inout' using potentiometer and i got the output, i have also attached a modified vi to this you can check it and more thing is, i need simple program to glow a led when ever i switch on using labview and main thing it is 'i only need arduino program not labview' can you send that?

Thanks in advance,

Regards,

Dinesh

 

0 Kudos
Message 6 of 6
(5,646 Views)