LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pinging to an outside source with 2 Ethernet cards

Hello to all,
 
I am currently developing an application to talk to an external device with two ethernet adress.
 
To validate this, i am using a COM prompt to ping each of the ethernet addresses to validate them.
 
How can I do this with LabVIEW? Currently I am using the TCP Open port vi to that specific address but no response. Am I going by this the correct way. Please critique my vi.
 
Thanks N Advance.
FredTest
 
 
 
0 Kudos
Message 1 of 5
(3,510 Views)
ping is based on messages of the ICMP protocol a low level protocol in the socket library directly related to the IP protocol part, which means below of the TCP and UDP protocols that can be accessed with the LabVIEW network primitives. The ICMP protocol is usually enabled by default although more and more servers connected directly to the internet disable it, since it can be used to send a device into overload with a targetted DOS attack.
 
But what is most important for you, there is no way to directly cause ping traffic in LabVIEW. Using system exec to issue the ping command on the command line is the prefered way to do that. Other means would require to access system DLLs (that are not available or not the same on all Windows versions) or directly access the socket library with some external code to get the the raw socket needed to do ICMP.
 
In order to use the TCP or UDP VIs you need to connect to a server application on the target that has on a specific port number a bound socket to the desired IP address, meaning the server would need to bind to both IP adresses if you want to use them at teh same time, and servers usually don't bind to more than one IP address at the same time.
 
Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 5
(3,486 Views)
Try writing 2 seperate batch files which ping the addresse, i.e. (ping 192.168.xxx.xxx) and call the then call the batch files with the System Exec vi, if the return code is anything other than 0, then you don't have communication with the sites.
0 Kudos
Message 3 of 5
(3,470 Views)
I've attached a screenshot of the back panel


0 Kudos
Message 4 of 5
(3,466 Views)
Hi FredFred,

This is JimJim.  Some time ago I was attempting to do exactly what you're doing.  I wrote a ping utility that I think may prove to be useful to you.  This utility only tells you that the address responded, but you could easily modify it to return the response time.  I hope it's helpful...

Jim
0 Kudos
Message 5 of 5
(3,458 Views)