Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication Failure with VISA Read

I am able to successfully communicate with the device, however, the output reads the default value everyother time. The VISA Read function reads the command everyother time instead of the value. When ran consecutively eventually the VI stops running and LabVIEW must be restart in order for the VI to communicate again. What is the cause of this? How can I fix it? Attached are two VI's that display this problem when ran. Thank you.

Download All
0 Kudos
Message 1 of 5
(4,339 Views)

Hi,

 

I think you should start by having a look at the examples for serial communication. There you can see the basics of how it should be.

 

You don't open the COM port. There is no time in between the write and read. You don't know if there are 64 bytes to read.

AND you should not run a VI continuously.

 

Kees

0 Kudos
Message 2 of 5
(4,325 Views)

Where is the serial port initialized?  Where is it closed?  What instrument are you trying to communicate with?  Where is your main loop?


GCentral
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 5
(4,317 Views)

I have looked at many examples and have followed the wire diagrams provided as trusted examples. I am still very much a novice, this is clear, however I have tried adding time between read and write, and with the visa open and close function. What do you mean by open the com port. My current iteration is unable to even communicate with the devise, which is a viscolab 4000. By continuously running the VI I want to be able to call upon this function every time the master program calls upon it. Attached is my modification to the previous VI.

 

0 Kudos
Message 4 of 5
(4,216 Views)

You need to configure the serial port.  Search for Configure Serial Port.vi.  From there, you need to figure out all of the RS-232 settings: baud rate, number of data bits, parity, number of start bits, number of stop bits, etc.  I recommend giving Viscolab a call to get the settings.


GCentral
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 5 of 5
(4,209 Views)