Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA port spy

Is there a way to programmatically monitor a serial port (without taking control of the port or otherwise interfering with an existing connection)?

 

I know I can use third party applications like Portmon, or NI IO Trace to display (VISA) communication in the NI IO Trace application, but I would like to create my own "terminal window" in LabVIEW to display all messages.  NI IO Trace has a LabVIEW API to start and stop IO Trace, but no API to programmatically access the data stream.

0 Kudos
Message 1 of 10
(5,829 Views)

Hello, are you talking about a serial port sniffer?

Jonathan R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 10
(5,800 Views)

Yes, but something with programmatic access so that I can display the sniffed data on my own GUI.

0 Kudos
Message 3 of 10
(5,791 Views)

Is there a particular reason you want to do this programmatically?  

Jonathan R.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 10
(5,759 Views)

I just want to have a simple HyperTerminal-like display that a user of my program can bring up as needed from withn my (TestStand OI) application.

0 Kudos
Message 5 of 10
(5,748 Views)
For TestStand, you can use a uimessage to write to. You'd have to modify each VI that has VISA Write or Read.
0 Kudos
Message 6 of 10
(5,735 Views)

Dennis,

 

True (for TestStand).  Likewise, in LabVIEW I could send a Notification (or some other communication mechanism), but the key is that I would have to modify each VI that does a VISA write or read.  I would like to do essentially what NI I/O Trace does--display what VISA messages are being sent and received without the application doing the sending/receiving having to know that it is being montored.  If NI I/O Trace provided an API to programmatically access what it is seeing, I would be in good shape; but (as far as I can tell) it doesn't.

 

There are lots of tools out there that spy on serial (and other type of) ports (at a lower level than VISA), but they all seem to be stand-alone programs that are the equivalent to NI I/O Trace--they display and capture the traffic, but don't provide an API.  The next best thing is to figure out how all these tools are using low-level Windows calls, but that seems daunting.

0 Kudos
Message 7 of 10
(5,722 Views)

One possibility is to hide the low level write and read vi's and replace them by a copy of your own that either sends the messages around or just passes the message to the original VISA read and write.

greetings from the Netherlands
0 Kudos
Message 8 of 10
(5,687 Views)

For existing code, I could just search for VISA read and write functions and replace them with my own custom ones.  That might be my best simple option.  But I was really hoping I could find a solution that would allow me to use the VISA or I/O Trace API to directly see the messages without having to modify source code.  It's clearly conceptually possible, but apparantly there is no API that exposes such functionality.  Thanks for everyone's input!

0 Kudos
Message 9 of 10
(5,648 Views)
Please use the Idea Exchange to suggest that an api be made available.
0 Kudos
Message 10 of 10
(5,644 Views)