Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect if DAQ device is in use in another LabVIEW application

I have more than one LabVIEW executable running simultaneously that each use DAQ devices.  Because the devices may end up have different device numbers, each application cannot have its device number fixed or hard coded.  Instead the user is allow to specify which device to use.  LabVIEW can provide such a list of connected devices.  Is there a way to determine though from one application if a daq device is active (has a task assigned to it, etc) in another application so that the application can avoid trying to access it and use it ?  Try to create a new task and look for and trap an error, hopefully without corrupting the other application that is using that daq device ?

 

Steve

0 Kudos
Message 1 of 2
(2,895 Views)

Hi Steve,

 

Each DAQmx task marks the hardware resources it is using as "reserved" so that other tasks cannot interfere. Normally this happens when you call the DAQmx Start Task VI, but the DAQmx task state model allows you to explicitly control when the resources are reserved by calling the DAQmx Control Task VI. If the resources are already reserved by another task, this will result in an error, usually -50103 "The Specified Resource is Reserved".

 

If there was a VI that told you whether another application is using the device without reserving the device, using it would introduce a race condition. After your application calls the VI, another application could start using the device, and your application would be working with out-of-date information. Reserving resources prevents this race condition.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 2
(2,860 Views)