11-01-2012 03:34 PM
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
11-01-2012 03:46 PM
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.
11-01-2012 03:55 PM
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?
11-01-2012 04:23 PM
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.
11-01-2012 05:38 PM
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.
11-02-2012 08:25 AM
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...).
11-02-2012 10:14 AM - edited 11-02-2012 10:15 AM
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?
11-02-2012 10:46 AM
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.
11-02-2012 11:10 AM
@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.