LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically determine if a cRIO is connected to your computer

I'm trying to programmatically determine if a specific cRIO is connected to my computer.  What is the best way of going about this (if I know the name and the IP Address)?  The closest I've come is getting a system sessions constant that is a dropdown of all that are connected to the computer, but I can't find a way to access all of the values in the dropdown (only the one that is selected).

 

Thanks, Emily

 

LV2012, Win7, 64-bit

 

dropdown.png

 

 

0 Kudos
Message 1 of 9
(4,478 Views)

I'd use RT Get Target Information, with a relatively short timeout.  If it returns valid information and doesn't time out, then that cRIO is connected.

0 Kudos
Message 2 of 9
(4,474 Views)

I haven't been able to find that VI in LV 2012...  Did they change it between editions or do I need to have some specific add-on (besides the RT module)? Any other suggestions?

0 Kudos
Message 3 of 9
(4,471 Views)

It appears those VIs were replaced by the System Configuration VIs in LabVIEW 2012; sorry, I didn't notice as I haven't installed 2012 yet.

 

Unfortunately the web link on that page that should explain the replacement functions appears to be broken (NI: please fix this!) so you may have to experiment a bit on your own, unless the local help version works.

0 Kudos
Message 4 of 9
(4,469 Views)

Just a note, you may want to make the IP and name that it looks for configurable. This is because both these values can be changed, and if your end user ever modifies them you will think the controller isn't there, even when it is.

0 Kudos
Message 5 of 9
(4,464 Views)

I would love to make them configurable, but unfortunately, I get errors whenever I try to do this programmatically (I'm 99% sure it's because of a firewall issue that cannot be fixed at the moment...).

0 Kudos
Message 6 of 9
(4,445 Views)

Does the controller show up in MAX? I'm assuming so since you know the name. If so, that means the UDP from the controller is getting through so it's probably not a firewall issue. Can you disable the firewall, or allow the controllers IP address through your firewall to verify? Not as a perminent solution, but just to troubleshoot. Or, is that something that falls into the "not possible now" category?

0 Kudos
Message 7 of 9
(4,434 Views)

No, I can't disable the firewall and don't have any control over it... This is a separate issue that other people within my company have been working with our IT department and NI on.  I can see it in MAX if I manually add the IP Address but MAX doesn't automatically discover it. 

I found another way of detecting if it's connected using shared variables, but if anyone knows of another way to do it in LV2012, I would still be interested in hearing about it.

 

 

0 Kudos
Message 8 of 9
(4,429 Views)

@Emily101 wrote:

No, I can't disable the firewall and don't have any control over it... This is a separate issue that other people within my company have been working with our IT department and NI on.  I can see it in MAX if I manually add the IP Address but MAX doesn't automatically discover it. 

I found another way of detecting if it's connected using shared variables, but if anyone knows of another way to do it in LV2012, I would still be interested in hearing about it.

 

 


If MAX doesn't see it, then it is most likely a firewall issue. I believe the way Max discovers controllers is by reading UDP messages the controllers broadcast. If the firewall is blocking it, then you wont' be able to see it. I have run into this at some of our customers sites, although I can't remember exactly what we did to check. I think we were able to ping them still, so we just pinged but didn't look for the controller name specifically, as you are trying to do.

0 Kudos
Message 9 of 9
(4,427 Views)