LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read serial output?

A device can be controlled using its computer program through serial port, rs232. How can I detect its commands exported through pin 2? I tried LabView serial examples, but it did not work. What I did is using one computer to run the device program, its output goes to serial pin 2 which is connected to pin 3 in another computer's serial port. And the second computer is set to LabView read condition.

Many thanks, JMC
0 Kudos
Message 1 of 3
(2,783 Views)
JMC,

It sounds as if you're doing the right things, but maybe you're confusing the transmit and receive lines. I think that the transmission would appear on output pin 3 in your case; it typically doesn't matter once you're connected to your device, because you typically use a null-modem cable that swaps 2 and 3 from one end to the other.

I'd highly encourage you to check out the Serial Support page on the NI Support site (http://www.ni.com/support/serlsupp.htm), paying particular attention to the "General Concepts" and "Getting Started" links. These pages provide a lot of good background for what you're trying to do.

In particular, I'd encourage trying a loop-back scenario using a single computer, making sure that works, then graduating to two machines and
a null-modem cable.

Hope it helps,
John Lum
National Instruments
0 Kudos
Message 2 of 3
(2,783 Views)
Giving the pin number on a serial port can be confusing. There are two lines named Rx and Tx and they are on pin 2 and 3. The pins for Tx and Rx are swapped on 9 and 25 pin connectors.
There is another reason why the program wont receive anything. If the device uses hardware handshake with RTS/CTS you have to set the handshake lines to get any data.
Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 3 of 3
(2,783 Views)