08-07-2023 03:25 PM
Hi,
I have a very simple question. How can I know if a device is reserved or not. For instance, I see that cDAQ9189-1FB2D01 is actually reserved since "Unreserve Network Device" button is enabled.
I already know how to reserve/unreserve in my vi but I just can't find a feedback to confirm. I need this to periodically check if my cDAQ is still reserved and if not, display to the user that cDAQ is not reserved anymore.
Thanks!
08-07-2023 03:39 PM
I don't have a handy network device I can use to test this, but I'd think you can either 1- try to reserve the device programmatically and check for an error, or 2- try to start a task on the device and check for an error.
See this thread for some more ideas/info.
08-08-2023 08:14 AM
The first solution is definitely not viable since I don't want my application to steal device reservation from another PC periodically. Solution 2 might work. Is there a way to create a dummy task related to cDAQ rack, not the cards?
Thanks.
08-08-2023 09:57 AM
There's a "Force reservation?" input on that VI. If it's set to False, it won't steal it from another machine. (According to the docs)
08-08-2023 02:17 PM
Yes that's also an option. Even if a device is unreserved, I'd still have to reserve it in order to know if it's not reserved though. I guess I'll have to find the list of devices configured in NI-MAX, find cDAQ rack and its cards and try to create a task on one of them to finally know if the device is already reserved.
08-08-2023 05:27 PM
@AlexDarsigny wrote:
Yes that's also an option. Even if a device is unreserved, I'd still have to reserve it in order to know if it's not reserved though. I guess I'll have to find the list of devices configured in NI-MAX, find cDAQ rack and its cards and try to create a task on one of them to finally know if the device is already reserved.
What do you actually "need" to know? From your first post it sounded like you just needed to see if it was reserved so that it could *become* reserved. Is there something else you need to know about it?
08-09-2023 08:16 AM
I'm only looking for a status : reserved or unreserved. In my vi, I would constantly call a sub-vi to refresh this status.