Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking device state through ANSI C

Hello,
Hardware: cDAQ-9174 with three modules, NI 9263(Outputs) and 2x NI 9215(Inputs).


In NI Max I can see the 'Status' of my devices and their modules, if they're plugged in or not.
I'd like to know how to get this device's status. In particular if it is connected to the computer, so I can tell the user "Duh.. the device isn't plugged in.". I should be able to tell if a device is disconnected or not and what modules are physically installed and in which slot. I've looked at DAQmx's functions NI-DAQmx C Reference Help for one that would report a "status" like property, but I couldn't find one.
Most device properties report the same independently of the device being connected to the computer or not, simply reports what's configured in NI Max.

Thanks

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

Ok. So I've found that DAQmxSelfTestDevice() actually gives the following informative errors:

  • -88705 - "Specified device is not present", which is what NI Max says for unplugged modules.
  • -200220 - "Device identifier is invalid", when you test a chassis or module that doesn't exist (i.e. is not configured in NI Max).
  • -201250 - "Connection timeout", when called for an unconnected cDAQ-9184, which is an Ethernet module.

So, this function actually performs the desired functionality. But I still wonder, is there another better function suited for this? Something like DAQmxGetDeviceStatus().

0 Kudos
Message 2 of 2
(2,635 Views)