LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get reserved/unreserved status of device programmatically

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.

 

AlexDarsigny_0-1691439599207.png

 

Thanks!

 

0 Kudos
Message 1 of 7
(894 Views)

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.

0 Kudos
Message 2 of 7
(881 Views)

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.

0 Kudos
Message 3 of 7
(836 Views)

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)

0 Kudos
Message 4 of 7
(824 Views)

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.

0 Kudos
Message 5 of 7
(814 Views)

@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?

0 Kudos
Message 6 of 7
(788 Views)

I'm only looking for a status : reserved or unreserved. In my vi, I would constantly call a sub-vi to refresh this status.

0 Kudos
Message 7 of 7
(768 Views)