04-08-2009 07:15 PM
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
04-09-2009 07:51 AM - edited 04-09-2009 07:51 AM
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).