LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A list of IP

Hi, I want to enter a list of IP address to ping to my system at the same time using LabVIEW. What should I do? using a list boxes or something else?

0 Kudos
Message 1 of 6
(2,540 Views)

LabVIEW doesn't have a native ping function. So have you already decided how to do that?

 

The most simple way of using System Exec to call the Windows ping utility won't really be a good solution to try to do multiple ping in parallel: https://forums.ni.com/t5/Example-Code/Ping-IP-Address-using-LabVIEW/ta-p/3512684

 

or by using .Net: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000159SmSAI&l=nl-NL

 

The method using raw sockets unfortunately doesn't work in Windows versions since Windows XP unless your process has elevated admin rights: https://forums.ni.com/t5/LabVIEW/Ping-Ping-Ping-Native-Win2k-LV7-code/m-p/117381

 

Another Windows API call solution that doesn't suffer from the administrative elevation problem as it avoids creating raw sockets in user space would be to call the Windows API function IcmpSendEcho(): https://docs.microsoft.com/en-us/windows/win32/api/icmpapi/nf-icmpapi-icmpsendecho

 

Rolf Kalbermatter
My Blog
Message 2 of 6
(2,497 Views)
  • Is your problem with the "list" or with the "ping"? (Since a list-box cannot ping anything, it almost sounds like you have problems with the list.)
  • Please explain what you mean by "at the same time". (Ethernet is a shared medium and only one packet can be on the wire at any given time. Of course you can send out the ping requests in rapid succession and wait for all responses in parallel. That probably requires some expertise)
  • What kind of list? (individual IP addresses? Ranges? etc.)
  • No matter how you enter them, you need to verify that they are valid in the chosen format (four decimal octets delimited by periods, a hex formatted U32, etc.)
  • What have you tried so far?
  • What problem are you trying to solve?
  • Does it have to be ping? Maybe you can use UDP multicast if all participants are running your own listener code.

 

0 Kudos
Message 3 of 6
(2,463 Views)

If you don't want to use the "System Exec.vi" try like stated by Rolf the WinApi IcmpSendEcho, see file IcmpSendEcho_Ping.llb attached (saved for previous LabView version 9.0). It has been developed in LabView2015 and tested on a Win10-64bit PC, I hope it will work also for you...

Message 4 of 6
(2,389 Views)

Last time I needed to enter a list of IP addresses I used a Table to display the list and had a "Add IP" (and "Remove IP") button to that would pop up a window with a String Control, where you entered the IP address periods and all.

 

Then I checked the entered text to see if it was a valid IP address using the attached VI snippet...

 

IP-Valid.png

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 6
(2,368 Views)

I tried the ICMP vi but cannot seem to get it to work with timeouts < 500ms, any ideas?

0 Kudos
Message 6 of 6
(1,498 Views)