LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Check for Dev1

Hello all,

 

Here's my dilemma:

 

All the NI examples define an error pointer in their examples as:

 

#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else

 

Is there any CVI-specific function to just check and see if Dev1 or any other device is present? Thanks!

 

-Bryan

CVI 8.5

0 Kudos
Message 1 of 2
(3,495 Views)

Do you want to check that a particular well known device is installed and configured  in the system? Simply issue a DAQmx command like DAQmxResetDevice and check the error code: when trying to address a device which is not present in the system you will get error -200220 (Device identifier is invalid).

 

If on the the other hand you want to detect all deveices in the system and check each of them, DAQmx supplies some useful: with DAQmxGetSystemInfoAttribute (DAQmx_Sys_DevNames, msg, 1024); you receive in the string the list of all devices. The string needs then to be scanned and for each device listed you can get with DAQmxGetDeviceAttribute the appropriate attribute (as an example, wether the device is simulated or not and all its characteristics: see in the help for the function for a list of attributes that can be retrieved).

(The correct way it to first use these functions with a NULL buffer and obtain the minimum lenght of the buffer to be passed in a second call to store all the informations in it).

 

Message Edited by Roberto Bozzolo on 04-09-2009 02:51 PM


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,473 Views)