LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I monitor serial port activity without first sending a command?

In my application I am sending a command through the serial interface and I want to monitor the response. The response is not instant, in fact it is a timeout response indicating the requested action did not work. How do I monitor so I can parse what is coming in over the serial port without necessarily sending a command?
0 Kudos
Message 1 of 5
(2,982 Views)
Use the Bytes at Port property to determine how many charachters have been received, then read that many bytes. You can also set up a timeout on the read functions. One of those or some combination should be able to do what you want.

Lynn
0 Kudos
Message 2 of 5
(2,971 Views)
You can always place a loop where you monitor the number of bytes at the serial port.

After configuring your VISA serial port session, you can create a Property Node to get the number of bytes available at serial port.

You can then process this information, for instance:

1. Establish a timeout because you never get a response.
2. Do serial port read if there is data available.

You can exit the loop with a timeout condition or having processed the data.

-JLV-
Message 3 of 5
(2,970 Views)
Thank you for the responses. I figured it out a little later using the techniques described here. It is working fine.
0 Kudos
Message 4 of 5
(2,957 Views)
You could alternatively use VISA events on the Windows platform.

See the following document for more information.
http://www.ni.com/pdf/manuals/370132c.pdf

Message Edited by Conseils on 05-11-2005 08:14 PM

0 Kudos
Message 5 of 5
(2,955 Views)