LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 Serial Port Sniffer

First, let me apologize for what may be a very basic question.  I've searched extensively on the forum and LavaG but cannot find an example of a serial port sniffer using LabView.  My question is, how do you use LV to sniff out a serial port without causing a sharing violation with the other program?  I know of NI Spy and have used it, but I need a VI specifically for my application.

 

My application is using a PC running Windows 98.  We use older Teradyne in-circuit test machines which is the reason for using such an old operating system.  This means I will have to use LV7 for my app.  The serial port essentially does nothing.  I am simply sending data to it that LabView can read and send on over the network.  Both applications, the Teradyne operating system which is sending the serial data and my app will be running on the same PC.  The reason for using the serial port instead of command-line arguments is that my equipment gives you much more flexability in the type of data you can send serially, such as measured values, test ID, etc., as opposed to using an external program such as an .exe using command-line arguments.  There is no device hooked up to the serial port.  I just need a sniffer to intercept the sent data.

I have considered using an RS-232 to Enternet converter, but there may be compatability issues with our network.

Any time I have tryed this I get sharing violations with the other program.  There may be a simple way to do this but it elludes me.

 

I would appreciate any example sniffer VIs or links to such a program or possbily ideas or suggestions to point me in the right direction.  Thanks in advance for your assistance.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 1 of 16
(15,994 Views)

If you can use a third machine then it is possible. If you want a sniffer VI running on the same PC as the one doing the RS232 communications then I don't think you can use the VISA read/write. You will have to go to a lower level. You might still have problems using the low level RS232 stuff. Using a third PC and an RS232 cable with three ends is probably the easiest thing.

 

I found this http://www.lammertbies.nl/comm/cable/RS-232-spy-monitor.html

 

Edit: If the machine with the LabVIEW RS232 communication VIs has another unused serial port you should be able to sniff using that without problems.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 16
(15,987 Views)


@Steve Chandler wrote:
 

Edit: If the machine with the LabVIEW RS232 communication VIs has another unused serial port you should be able to sniff using that without problems.

_______________________________________________________________________

 

I could use a loopback cable between ports but was wondering if there was a way to do it with one port.  It sounds like it might be possible, but difficult.  I do have the ports available for loopback using a null modem cable.  That will definitely work for this application.  I just didn't want to waste the hw but it might be the best way to do it.  Thanks for your input.

 

 


@Steve Chandler wrote:

 

Using a third PC and an RS232 cable with three ends is probably the easiest thing.

 

I found this http://www.lammertbies.nl/comm/cable/RS-232-spy-monitor.html

 

 


Yes, I am aware of the sniffer cable, but I would still need a second port for reading.  So in my case, I'm back to using a null modem cable.  The problem with using a 3rd PC is I have 8 machines that will require this, and distance between machines is a concern as well, so it's not practical using another PC.

 

Thanks again.

 

Reese

 

 

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 3 of 16
(15,974 Views)

Does anyone know how NI Spy is able to sniff out Com ports without causing a conflict?  I know a lot of functionality and features in Labview were created using VIs.  Perhaps NI Spy was created in a similar fashion.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 16
(15,971 Views)

Have you tried PortMon already?

http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx

Its not LabVIEW-written solution, but able to capture serial interface data without sharing violation.

 

Message 5 of 16
(15,962 Views)
I woul also recomend Portmon 

MoReese wrote:

Yes, I am aware of the sniffer cable, but I would still need a second port for reading.  So in my case, I'm back to using a null modem cable.  The problem with using a 3rd PC is I have 8 machines that will require this, and distance between machines is a concern as well, so it's not practical using another PC. 


It would not have to be a third PC you could always use a second serial port (or USB-Serial adaptor )on the same PC to do the sniffing.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 16
(15,960 Views)

Well, I tryed to get Portmon to work, but the Computer menu went missing and the Capture menu was greyed out.  I could not find anything that showed how to fix this issue.  I did find another program that is free to use at this site.

 

http://www.serial-port-monitor.com/index.html

 

It came right up and worked immediately with no issues.

 

Although this is a good tool to have, I still need something that can interact with LabView.  At this point, it looks like using two ports with Visa Read will be the way to go.  Thanks for the suggestions.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 7 of 16
(15,941 Views)

A device such at this http://www.bb-elec.com/product_family.asp?familyid=33&webSyncID=3e948270-0e0d-6b02-d066-2e1530b3cac5... could come in handy for tapping into and monitoring a serial line.

Message 8 of 16
(15,931 Views)

@MoReese wrote:

Well, I tryed to get Portmon to work, but the Computer menu went missing and the Capture menu was greyed out. 



As far as I remember, you should start PortMon first, then start capture, and only after that start your application. You will see with which parameters port opened, and all data.

If your port already opened, then PortMon may not work.

0 Kudos
Message 9 of 16
(15,908 Views)

@Andrey Dmitriev wrote:



As far as I remember, you should start PortMon first, then start capture, and only after that start your application. You will see with which parameters port opened, and all data.

If your port already opened, then PortMon may not work.


You are correct and that is what I did, except starting capture first.  I tried it again this morning and the Computer menu is still missing and the Capture menu is greyed out.  One site made mention of this and noted that the computer could do this automatically but did not say what that meant or how to fix it.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 10 of 16
(15,906 Views)