08-25-2021 02:57 AM
I'm trying to detect connected and running cRIO in the local network based on the status (Connected - Running/Disconnected). Reason I'm doing it like this is, that when the device is powered off, it still can be found by Find Hardware.vi.
Snipped in the attachment basically does what I'm looking for, but I'm having problem with the Initialize Session.vi which takes from 6s to 50s, when the device is not connected or powered off. No problem when the device is connected and powered on.
Does anyone know why Initialize Session.vi takes so much time?
Could you recommend other solution to searching for cRIO?
Thanks
Solved! Go to Solution.
08-26-2021 01:10 AM
Hello,
It may take that long, because Initialize Session.vi waits for a confirmation from the cRIO, but as the cRIO is not powered on, it waits until timeout event occurs
08-26-2021 01:16 AM
if you are trying to detect if a certain cRIO is connected, you can implement a heartbeat monitoring using a dedicated shared variable, which can store the time it has been modified, and by checking that time you can make sure if the RIO is online.
08-26-2021 01:16 AM - edited 08-26-2021 01:19 AM
Hi hy_,
I understand this and would say that it is expected behavior, but Initialize Session.vi has Connect Timeout (4000 ms) input, which does not seems to work.
To your second reply:
Once I successfully connect to cRIO, I'm monitoring "vital" functions. So this is handled. But the problem is when I'm starting the Main Host application and searching for particular device, which might be powered off if the user forgot to have device powered on and connected prior to starting Main Host application.
08-26-2021 01:27 AM
According to specifications, initialize session can take longer than the specified timeout in some occasions.
https://zone.ni.com/reference/en-XX/help/373107N-01/nisyscfg/initialize_session/
08-26-2021 01:30 AM
Seems like this one's a duplicate
https://forums.ni.com/t5/Real-Time-Measurement-and/Search-for-online-cRIO/m-p/4174312#M22715
08-26-2021 01:49 AM
Yes, so some occasion seems to be the basic one, when the device is not connected.
Is there any other way to detect online cRIO except using Initialize Session.vi and Status System property?
The other one was already reported to moderator.
08-26-2021 01:56 AM
We can set a static IP address on cRIO and ping it to check whether it's online
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000159SmSAI&l=en-GB
08-26-2021 02:39 AM
Well, shame on me.
Thanks.
08-26-2021 02:48 AM
glad to assist you ❤️