LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port snooper

I frequently have to do Serial or VISA comms with devices.

I would like to know if anyone has any ideas for creating a VI that runs seperate to an existing VISA session which would "snoop" the (serial/GPIB) VISA port and read traffic going to and from the PC Port, without affecting the operation of the port.

 

1) Is this possible to do this in LabVIEW - if the Comms to the device is also running in LabVIEW?

2) Is it possible without extra hardware?

3) Am I just being a wishful thinker? (it's the Mech Eng talking here) Smiley Tongue

 

(I don't want to have to use any other propreitory S\W, I just want to see the history of the port commands, see the real time commands and possibly log them to a file)

 

Cheers

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 1 of 15
(4,218 Views)

NI-Spy      Ships and installs with VISA (?)

 

Portmon Get it from the MS site.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 15
(4,214 Views)
So there's no clever way using property nodes or duplicate VISA sessions or something just in LabVIEW? you must open another program??? Smiley Sad
CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 15
(4,200 Views)

Under Windows there is a method, that much I do know. I have not used it myself nor do I rememeber the Windows utility or dll that has to be called. When pressed to do something similar (I needed to eaves drop on a GPS feed) I resorted to wiring up a couple of serial connectors and my LV code just acted as a pass through repating what it saw on its send/recieve lines.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 15
(4,180 Views)

You give me heart Ben. Smiley Happy

 

I'm running window's. The number of occasions I've lost the H/W rig or a colleague has been using it and I have needed it and it has been 150miles away is what makes me want to go for a solution in S/W.

 

One based in LabVIEW would be useful to everyone and I am happy to post it here if i ever find out what it is and how to get it working.

 

Alternatively maybe this should be posted in the ideas forum to make serial/Ethernet/TCPIP/VISA comms debuggin that much easier accross all NI platforms - an NI snooper VI which snoops a port as an inbuilt function to work on all operations systems that communications works on. All it requires NI to do is copy the data passing through the port to another location and pass it on as it passes by.

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 15
(4,178 Views)

I don't see why it could not be implemented in LabVIEW.

 

If you have access to the original code that communicates over the serial port and you want to "snoop" into..  Then create an ActionEngine.  Call one copy WRITE-COM.vi and the other READ-COM.vi.  Drop it everywhere in the original code where you write to the port and the other everywhere you read and you can log everything that is "attempted" to write and everything that is read in seperate string buffers.  The ActionEngine would of course have two inputs, the state and the string.  You can do whatever you like within the AE, such as display to string indicator or write to file (or both).

 

Now the only limitation is that you cannot see what is going over the physical serial cable.  That would be the same limitation from using any software solution.

Message 6 of 15
(4,160 Views)

Hi Ray, 

 

I was following you up to "Action Engine"... now I've lost you.

All my comms are Actions Engines with different cases expecting to write and then read certain responses.

 

You've got the idea of what I want to do, but as well as running action engine X on Com port Y, I want to be able to monitor Com Port Y (or N) with a new AE - AE_Z that doesn't need to be dropped all over the code, but can just be dropped in one place and run to monitor comms for a set duration. (e.g. just for a specific test, for a test section or for a whole test sequence from start to finish)

 

I was hoping it would be possible to create a seperate AE (or function) that could snoop on the port traffic in and out of the PC being used by the other AEs like PortMon or TerraTerm can. Am I still dreaming?

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 7 of 15
(4,125 Views)

Well TerraTerm and other terminal emulator applications actually communicate with the port.  The AE that I had in mind would simply grab whatever strings are sent or received to/from the port. 

 

Did you want the ActionEngine to communicate to the serial port(s)?  It would be possible to use the same AE to communicate with multiple ports.  It would be trickier..  And I can visualize the code.  I think that there was an example of such a type of AE in the Advanced LV course...  I'll have to look in the book (which is not near me at the moment).

0 Kudos
Message 8 of 15
(4,090 Views)

I just wanted to read all bytes sent from the PC and sent to the PC on that Port without affecting the functionality of the port.

(Effectivly ghosting the port to scan it)

 

I don't need to be able to communicate with the port, I just need to be able to see what is going through the port (in both directions at the same time would be great) without a H/W solution.

 

It  might help me if I understood ports a bit better and came from an electronics background at this point, but I'm coming from a Mech Eng background taught to do instrument test and use LabVIEW to do so. It's normally the commands that are the problem, and the ability that I would have in LV to swithc display options of a string easily (and program it to change the display format from /s to hex as required whilst still monitoring is what I'm looking for.)

 

I'd love to go on the advanced courses, but it's not going to happen any time soon. 

 

Cheers

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 9 of 15
(4,083 Views)

So if the ActionEngine is not taking care of the serial communication, then the info in the previous post should work. 

Do you understand what an ActionEngine is in this context?  What I am thinking of is a variation from the Functional Global Variable.

0 Kudos
Message 10 of 15
(4,078 Views)