LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with Visa Read.vi

Hi folks. I am a new user to LabView (Base edition 7.1) and have been tasked with using it to automate my company's archaic test and calibration procedures. A lot of the tests require setting various parameters of the unit via serial comms (RS-232).
I have used the vi attached below to achieve basic comms but I am having trouble reading back from the instrument.
Cabling is ok, as is the instrument. Infact the attached vi works when I place a loopback connector on the PC comm port.

I don't know if anyone has had similar problems using the VISA read and VISA write vis?

Any help would be appreciated.
Mark Shead
Sonatest Ltd

LabView (7.1) Novice!
0 Kudos
Message 1 of 4
(2,917 Views)
Your code looks good, so I am not sure where the hangup is. One problem I see is that in certain versions of LabVIEW or VISA "VISA Read" does not behave well when asked to read zero bytes, so in that case I switch it out with a case statement.
0 Kudos
Message 2 of 4
(2,904 Views)
I converted the display representation of the command string constant to show me escaped characters. It says that the last character is \r. I hope that \r is the command terminator, and not \n or \r\n. Communications have been configured to suppress automatic termination characters, and so each communications string has to have the correct protocol.
0 Kudos
Message 3 of 4
(2,893 Views)
Hi,
 
>> I don't know if anyone has had similar problems using the VISA read and VISA write vis?
 
Yeah I did have the same problems, but I've just tried this small change and got it orking -- its basically th same as what's suggested above though, but a bit different.
 
 
0 Kudos
Message 4 of 4
(2,795 Views)