Jump to content

Implementing PING using wsock32.dll


Recommended Posts

Hello everyone,

My project:

We have 2 PXI-RT communicated by 2 connections: a fiber optics connection (not Ethernet), and an Ethernet connection. The FO connection is the main connection used to wsend a receive data. The Ethernet connection is only use when the FO connection is lost, in order to check if the "mute PXI" has lost the FO connection but is still on, or if the PXI has been switched off.

The problem:

Originally we used the "RT Ping controllers.vi" on the "Real-Time Utilities", but unluckily we changed the PXI controller and the new one is not supported by the library.

The main issue is the application was developed using LV7.1 and cannot be upgraded.

Options already disscarted:

We tried opening a TCP connection, but the operation takes too long.

I found this great VI, but its for LV2010. I tried it and it works perfectly. (http://forums.ni.com...er/td-p/1535420)

I tried translating it to LV7.1, but something is wrong, because LV closes as soon as I play Run :(

Have any of you worked using wsock32.dll on a PXI?

Best regards,

g_l_u_p

ping_PharLap_LV711.vi

Link to comment

Just found out why my VI was closing LabVIEW. The first "Call Library Function" was using "Calling Conventions = C" instead of "stdcall (WINAPI)". :frusty:

Now, the VI doesn't close LV, but timesout on the call to function "select" (befor the "recvfrom"). It actually behaves the same running on my PC or on PXI-RT.

Could anyone have an idea :lightbulb: ?

Thanks again

g_l_u_p

ping_PharLap_LV711.vi

Edited by g_l_u_p
Link to comment
  • 1 month later...

Could you implement a UDP heartbeat instead? Have the mute controller send hb to a port on the other controller. If it times out waiting for it then the other controller is off/down. This would be a typical alternative to ping and confirms not only that the controller is on but that it is running.

(null)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.