Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Read

In my project i have 2 task

 

(1).Read data of sensor (attached to arduino board) serially  and display on LabVIEW.

(2).Control output(just ON-OFF) pins of arduino using LabVIEW.

 

 

So,for that i am using TAB in labview.created 2 TAB called Oscillospe and Input.

 

If i first start Oscilloscope it work well.

But when i come to Oscilloscope tab after using Input tab.

 

It gives Time out error (VISA read)

 

If i am executing in Highlight mode it works well

 

0 Kudos
Message 1 of 14
(6,053 Views)

Hi,

 

You have the termination character disabled. If your Arduino program always sends 3 characters it could work but you have to wait till those 3 characters are available at the serial port. Now you write something to the Arduino and read 3 characters directly after the write.

Use the property node 'Bytes at serial port' and wait till there are 3 bytes available.

 

Kees

0 Kudos
Message 2 of 14
(6,049 Views)

Why not have the arduino constantly sending the readings back to you?  So you would want to have a loop that just reads the data and then another loop to write the switch positions.  It would make this code A LOT simpler.  You wouldn't need to worry about your tabs at all and you can use an Event Structure so that you only send the switch positions when there is a change.  And then you only need to send that change.

 

Also, you really should have the termination character turned on.  When you do this, set the VISA Read to read more bytes than you would expect in the message.  The read will stop when it finds the termination character, which is an End Of Line.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 14
(6,048 Views)

Hi

The termination character and Arduino have a problem somewhere.

I really tried hard and you know I try not to give up.

But I still use an end character but don't let VISA handle it anymore because this combination crashes windows in a few hours.

 

And this a several pc's and OS's, in a build and in the environment.

 

I did send in a CAR more than a year ago but have to admit I stopped asking a few months ago.

 

 

greetings from the Netherlands
0 Kudos
Message 4 of 14
(6,031 Views)

In my VI once i change to tab Oscilloscope it send char to arduino and arduino start to send data .Even though time out error is coming .If i run VI in highlight mode it read data sucessfully.I also tried for Terminate char but it doesn't  make any sense ..

 

I also check out this using hyper terminal means Arduino code is OK

0 Kudos
Message 5 of 14
(6,021 Views)

I tried using termination character but still persisting same problem..ViSA read shows 0 byte at port even though arduino is sending data continuosly

0 Kudos
Message 6 of 14
(6,002 Views)

I also analyzed that......Once i am using Oscilloscpe Tab for read sensor data itwork well then if i put my Input TAB empty (Means nothing inside this loop -No VISA write operation)and if i switch back to again Oscilloscope TAB it work well..............................Is there any issue with Input TAB(i mean VISA writing effect upcoming read operation)????????????????????

0 Kudos
Message 7 of 14
(5,995 Views)
I am awaiting for your valuable replay.................
0 Kudos
Message 8 of 14
(5,964 Views)

can you publish your vi again?

maybe we understand better what goes wrong.

greetings from the Netherlands
0 Kudos
Message 9 of 14
(5,958 Views)

In this VI if i make INPUT case empty then Oscilloscope case working well....So it may be possible something wrong in INPUT case..But i am confused ...

0 Kudos
Message 10 of 14
(5,954 Views)