Jump to content


Photo
- - - - -

Implementing PING using wsock32.dll

pxi-rt labview7.1 network external code ping

  • Please log in to reply
2 replies to this topic

#1 g_l_u_p

g_l_u_p

    I've come back for more.

  • Members
  • 2 posts
  • Version:LabVIEW 2011
  • Since:2003

Posted 18 November 2011 - 09:38 AM

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

Attached Files


My C programmer collegue once told me: I love that LabVIEW thing you do. It's so colourful!

#2 g_l_u_p

g_l_u_p

    I've come back for more.

  • Members
  • 2 posts
  • Version:LabVIEW 2011
  • Since:2003

Posted 18 November 2011 - 01:16 PM

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

Attached Files


Edited by g_l_u_p, 18 November 2011 - 01:21 PM.

My C programmer collegue once told me: I love that LabVIEW thing you do. It's so colourful!

#3 JamesMc86

JamesMc86

    Very Active

  • NI
  • 198 posts
  • Location:UK
  • Version:LabVIEW 2012
  • Since:2006

Posted 19 December 2011 - 10:31 PM

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)

James McNally

AE Specialist, NI UK & Ireland & CLA






Also tagged with one or more of these keywords: pxi-rt, labview7.1, network, external code, ping