Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView 3.1.1 Serial port returns empty string

I am working on a Windows 3.1 platform. I use the Serial port init.vi to initialize the port (Baud rate 9600, 8 bytes, no parity, 1 stop bit) and Serial port write.vi to write a string command, Bytes at serial port.vi to find the number of bytes and Serial port read.vi to read the string from the port. The communication is made via RS-232 protocol. The device I am trying to talk to is a PDR 2000 dual capacitance Manometer (a guage controller). The vi runs successfuly but returns empty string even though there is a pressure value displayed on the Manometer. I feel that my vi is too simplistic to perform the operation I want. Could you tell me what might be missing and causing the empty string reading? Thanks.
0 Kudos
Message 1 of 3
(3,348 Views)
With serial, it could be any number of things - incorrect baud rate, cable, commands sent, .etc. First thing to do is to test communications with a terminal emulation program like Hyperterminal (I think it came with win3.1) or Procomm. If that works, verify the commands you're sending in LabVIEW are the same as you got to work in ther terminal emulator. You probably also need to send a termination character after each command. This will typically be a CR or LF. Please note that you have to send the actual term character and not the string CR or LF. Get the characters on the string palette.
0 Kudos
Message 2 of 3
(3,348 Views)
Hello,

I wanted to add a little bit more to Dennis's excellent reply. The terminal emulator in Windows 3.1 is called "Terminal" and I believe is in your "Accessories" program group. This is the best place to start in troubleshooting your serial instrument connection. I would further encourage you to upgrade to the latest version of LabVIEW if possible, as there numerous advances in both programming and serial communication.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(3,348 Views)