From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-04-2004 05:09 PM
02-05-2004 01:57 AM
02-05-2004 10:45 AM
02-05-2004 11:32 AM
03-13-2007 09:53 PM
03-15-2007 09:35 AM - edited 03-15-2007 09:35 AM
Message Edited by MattP on 03-15-2007 09:35 AM
10-14-2007 12:41 AM
Hello Fellow Pingers,
Belated thanks to m3nth for this valuable tool My multi-threaded app ran into a snag, though; seems one of the WinSock2 calls "blocks" and doesn't allow a ping to be sent while waiting for another. Long story short, to obtain good time-received resolution would have required "polling".
Fortunately the WS2 API can be configured to send a message to a Window on a socket-receive event, and this old utility allows LabVIEW to convert a Windows message into an occurrance - turning the ping-polling loop into a wait for ping-received-event loop.
The attached tool - back-saved to LV 8.0 - is dedicated to m3nth who made it possible and who long ago proved he's a LabVIEW wizard!
P.S. Earlier this year Matt pointed-out that the DOS ping command accessible through a SysExec call. The DOS ping is probably most accurate but unfortunately very limited. Besides (apparently) not able to ping faster than 1Hz, it also blocks (so pings in seperate threads end up running synchronously.)
Cheers!
10-14-2007 07:05 AM
10-14-2007 07:38 PM
Hi nrp,
Good point! The DLL is available from NI here (it's bundled in the .zip).
Cheers!
12-22-2007 03:10 PM
follow-up:
The ws2_32.dll asynchronous-pin code posted-above has been working very reliably except that a Windows-registry-hack was required for non-admin Users. Google "AllowUserRawAccess" for the hack. (This limitation would apply to the original post as well.)
Since posting, a small mod was made to the implementation of the sendto function - to correctly report errors there, and an additional ws2_32 function was implemented in driver - it converts dot-notation string to U32 IP address - in the format expected by ws2_32.dll. This is used to "bind" created sockets to a local IP address.
Cheers.