LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Real Time Ethernet Sniffer

Solved!
Go to solution

I want to listen and log all ethernet, can and serial channel communication for a system to see all messages are correct. In Labview I wrote a Can sniffer and serial channel sniffer. Is there a way to do it for ethernet( like wireshark)?. Since CAN is a bus I can listen the communication between computers, again for serial channel I can parallel the line, but I want to do it for ethernet.

0 Kudos
Message 1 of 13
(5,213 Views)

Check out this Example: http://www.ni.com/example/27660/en/ It should allow you to do what you want with your program.

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 2 of 13
(5,149 Views)

But I want it to work on Labview Real Time Operating System not on Windows, can It work like that?

0 Kudos
Message 3 of 13
(5,092 Views)

You might need a network tap to get access to the ethernet data.

 

http://www.flukenetworks.com/enterprise-network/network-monitoring/Tap-Solutions-VSS-Monitoring

 

0 Kudos
Message 4 of 13
(5,071 Views)
Solution
Accepted by MichaelAivaliotis

@lawliet wrote:

But I want it to work on Labview Real Time Operating System not on Windows, can It work like that?


You definitely have to do it on a normal computer attached to the network your realtime system is connected to. WinPCap is a Windows driver and can only work in a Windows operating system.

 

LabVIEW Realtime, however is either a Pharlap ETS (some NI embeded devices like the early cRIO and the desktop PC version), a vXWorks system (most other cRIO systems), or a special NI Linux RT version (the latest cRIO devices). None of them can handle Windows device drivers in any way, so WinPCap is no solution for them. There is no standardazed PCap option for any of them, for the first two because nobody has developed it, and for Linux RT, since the RT modified kernel is different enough to a standard Linux kernel, that you can't easily tap into the low level socket interface in the same way as on normal Linux (which requires special high elevated privileges anyway in order to tap into the socket layer like that but doesn't need a special driver otherwise).

Rolf Kalbermatter
My Blog
Message 5 of 13
(5,047 Views)

Several years later . . .  The example no longer works 😕

I have been using this code successfully for some while with only a few adaptations. Now we are 'upgrading' to Windows 10, and it won't load the DLL anymore.

I tried installing Wireshark, in case there was some other dependency, but it never seemed so before, and indeed, that did not help.

I'm looking around for a newer implementation, or maybe just an up-rev'd version of lvwpcap.dll that has the same calls exposed.

Any assistance is most greatly appreciated!

Best day from FLA~

0 Kudos
Message 6 of 13
(3,953 Views)

Did you switch bitness? In my experience, DLL's only work with either 32 or 64 bit LabVIEW, not both. I don't have much experience with DLL's so there may be ways to make them compatible with either bitness. In my experience, the Windows version doesn't matter, just LabVIEW. For example, 64 bit LV can't call a 32 bit DLL.

 

(if I'm wrong I hope someone corrects me 😁)

0 Kudos
Message 7 of 13
(3,951 Views)

Thanks for your reply!

This is part of what has me spooked. I did not change LabVIEW bitness. The only change of which I'm aware is Win10.

I have a test suite running on some Win7 machines. LV2012 f5, 32 bit. We have to rev those machines to Win10 to keep them connected to our shared licenses and version control servers. So I have installed the same environment and code on my desk machine. Now everything based on lvwpcap.dll is broken.

I have a possible cause after speaking with a tech just now. New network policies have turned off UDP, evidently. I'm trying to circumvent that now, in hopes that this is the entire problem.

I will report success / failure here as things come together.


0 Kudos
Message 8 of 13
(3,946 Views)

I went to the WinPcap site to look at this and it said to try the new version https://nmap.org/npcap/ 

 

Bryan

0 Kudos
Message 9 of 13
(3,931 Views)

Fixed it!!

I installed Wireshark which did not allow the DLL to load. Then I got started looking at the *.CPP file included with lvwpcap.dll. It appeared that all the actual code is referenced externally, thru "extcode.h". Then more digging. Then I came across this:

https://forums.ni.com/t5/LabVIEW/Library-not-loading/td-p/3765945

The current version of Wireshark doesn't install the DLL lvwpcap.dll references. I downloaded and installed the WinPcap library from here:

https://www.winpcap.org/install/default.htm

It's version 4.1.3. OS support only claims Win8, but it installed successfully in Win10, and now my old code is back in biz. This might be trouble going forward however, as V4.1.3 slowly rots.

Maybe I retire by then . . . .

0 Kudos
Message 10 of 13
(3,930 Views)