LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Ping Hardware via TCP/IP

I need to ping a device to check connectivity via TCP/IP.  I'm currently using a 3rd party control that has a memory leak.  Is there a way to do this within Labview without using a 3rd Party control?
0 Kudos
Message 1 of 8
(23,028 Views)
Assuming you are using a recent version of Windows....
 
One way would be to use the raw socket ping posted here a while ago:
 
Of course you could also use the ping command within system exec and parse the result:
 
(I am not sure how to do these things on a MAC or under Linux.)

Message Edited by altenbach on 03-23-2007 03:35 PM

Message 2 of 8
(23,015 Views)
[SOLVED]

Hi

I need to check several devices by pinging them.
I don't want to use the windows console method with parsing.

If I use the ping.llb described under the second link above the labview runtime is crahing latest after 12 hours without any replies. Ping frequency was 400 ms, 1 second would be OK but not nice.

After all the crashs I decide to use the .net Framework which includes an own Ping class.

Attached you can find this, at the moment test,  VI which is running in a mini project on my PC.

For testing purposes I set the delay time constant low, later my wish is something between 400-100ms.

Problem: If you open the WinXP task manager the used memory of process "labview.exe" is rising rapidly until .net throw an exeption.

How can I prevent that the memory is rising until a crash occur??? If I reduce the time the memory usage is rising as well, just slow....

Here is the link to the class description: http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx

Thanks for your help

Tim

SOLUTION: I connected the "close reference" on the wrong wire....

It seems to run even with 0 ms time constant (for testing). I have attached the corrected version.



Message Edited by computerkammer on 05-17-2008 08:31 AM
Message 3 of 8
(22,666 Views)
Seems you solved the memory problem. Still, it might be more efficient to place the constructor node before the loop and close it after the loop.
 
Also the iteration count is type I32. Hooking up a U64 indicator does not give you any additional headroom. (see the coerecion dot?). If you want to count in U64 (and I don't think it is necessary), you would need another shift register of type U64 that increments at every iteration.
0 Kudos
Message 4 of 8
(22,655 Views)
Hi altenbach,

thanks for your reply. U64 was just for testing...

I used first the constructor and destructors out of the while loop. Without delay inside the while loop the used LabVIEW process memory is rising on my V 8.5.....I didn't check it with realistic time delays.

It do not with my uploaded VI even on 0 ms delay.

Tim
0 Kudos
Message 5 of 8
(22,646 Views)


computerkammer wrote:
I used first the constructor and destructors out of the while loop. Without delay inside the while loop the used LabVIEW process memory is rising on my V 8.5.....I didn't check it with realistic time delays.

You still need to close the reply reference inside the loop, but placing the constructor outside like in the attached modification does NOT increase the memory and is about 25% faster (=more efficient) according to my crude benchmarks. (loop rate 0.68ms vs 0.87ms)
 



Message Edited by altenbach on 05-17-2008 10:13 AM
Message 6 of 8
(22,640 Views)

This looks like exactly what im trying to do but i cant see 

System.Net.NetworkInformation

when using the .NET constructor. Any help??

 

C

0 Kudos
Message 7 of 8
(18,965 Views)

Hi Chris,

 

Try Assembly "System(2.0.0.0)" instead and underneath it: Object "System.Net.NetworkInformation" -> Constructor "Ping()".

 

Cheers,

 

Cerati

Message 8 of 8
(18,958 Views)