Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Port Example

Hello

I am new comer to LabView and am asking if anyone as any RS232 write and read programs for v7?


Neil Cooley
0 Kudos
Message 1 of 6
(4,481 Views)
Hi Neil,

the exaple is attached, hope this help you
Br,Sergei
"Only a life lived in the service to others is worth living..." - Albert Einstein
0 Kudos
Message 2 of 6
(4,480 Views)
Your example has a big problem. You should not wire return count output of VISA Write to byte count input of VISA Read. This will only work if the number of bytes written is greater than the number of bytes you expect to read back. And even in this case, unless you have termination character turned on, you'll get a timeout error. In other cases, you'll only get a partial read of the receive buffer. Better to use VISA Bytes at Serial Port to determine how many actual bytes are available or if the response always has a termination character, enable that and set the byte count to some arbritrarily high number.

There are also a number of shipping examples for serial communication. Open the Example Finder and enter serial as the search paramter.
0 Kudos
Message 3 of 6
(4,469 Views)
Yes, you are right. but this exsample is a simple VI how to use RS-232 with closed loop pins 2 and 3 on the serial port
"Only a life lived in the service to others is worth living..." - Albert Einstein
0 Kudos
Message 4 of 6
(4,464 Views)
Okay, that's fine, but you should clearly indicate that in your message and on the front panel/diagram of the VI. A new user to LabVIEW would end up using the example and then post back asking why they are only reading partial strings from the instrument.
0 Kudos
Message 5 of 6
(4,461 Views)
The fault is mine and I apologize, I've forgotten about the help for VI
"Only a life lived in the service to others is worth living..." - Albert Einstein
0 Kudos
Message 6 of 6
(4,454 Views)