05-02-2023 03:57 AM
Hi
I am working on trying to capture wireshark data using LabVIEW.
I read to do this we need to have NPCAP.
Even after I installed it, I am not finding any dll to code for it labview.
Please help
05-02-2023 04:18 AM
They are in the Windows System directory. Depending how you install the according NPCAP drivers you have also WinPCAP compatible wrapper libraries in your system.
<System32>\Npcap
Note that <System32> is actually SysWOW64 on a 64-bit system if you try to access it from a 32-bit application.
05-02-2023 04:40 AM
Thanks for you reply.
Can we not access wireshark directly in labVIEW?
05-02-2023 05:05 AM - edited 05-02-2023 05:07 AM
You asked about NPCAP! 😁
WireShark is an application and you can of course start it up with System Exec from LabVIEW. It even supports the -g option in the arguments where you can set a specific filter rule to use. But to do more you would need to have some Inter Application Control interface in WireShark. I never checked but I can't seem to find anything specific. You could always write a WireShark plugin in Lua that provides a remote control interface that you can connect to from LabVIEW but I'm not aware of one that is ready made.
05-02-2023 07:54 AM
I used the command line utility the one time I needed this. With System Exec, I opened the utility to capture packets, then killed it with a task manager kill, also called with System Exec. I don't know if that is the best way - just one way.
05-02-2023 10:30 AM
Raw Ethernet Frame Decode and Encode Example contain a library of VIs that work together to wrap various Ethernet packet sniffing functions available from WinPcap, a Windows packet capture program.
05-02-2023 10:47 AM
@ZYOng wrote:
Raw Ethernet Frame Decode and Encode Example contain a library of VIs that work together to wrap various Ethernet packet sniffing functions available from WinPcap, a Windows packet capture program.
The problem with this example is it is supposed to be standalone and swallows all the errors so you really don't know what is going on. It's good to get an idea of how to do it, but I wouldn't use it outright. Also, doing it the way that the example has a clunky way of determining which adpater to monitor. (And if the adapter order ever changes, you're screwed - like when there's a Windows update that adds some kind of virtual adapter. Or at least that's how I remember it.)