Solution
In real world network-based applications it is important to know if a link is up and running, as well as cable and connector statuses (checking for damage, water intrusion and such...). To obtain such feedback, we can use the built-in Windows OS ping feature. After a successful ping session, you can execute more complicated network tests. The most important step in executing ping commands is to not generate too many requests and to not overload the network, especially if the ping command would be part of automated routing inside a complex application.
Below you can find two different methods to programmatically ping an IP address from LabVIEW.
- The following example utilize the built-in Windows OS ping feature to perform a ping using LabVIEW. This example uses .NET calls.
- You can also ping an IP address programmatically by using the System Exec VI to execute the ping <IP address> command. If the device is connected to the network, you will receive a response, otherwise the request will time out. The System Exec VI behaves differently depending on the computer's OS. Refer to Execute Command Line Arguments from LabVIEW for more details.