LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Connection check for the NI USB-6008

I'm using the NI USB-6008. I want put, into my software, a connection check: I want a message box in event of missing connection.
I tried the following instructions:

int variable;

variable = DAQmxLoadTask ("MyVoltageOutTask", &th_analog_write_AO0);
if (variable!=0)
    { 
         MessagePopup ("Attention!!!", "Hardware did not find");
    }

The function DAQmxLoadTask returns "0" only in event of success, but the compiler gives me error.
The compiler say:

        Device cannot be accessed

and the error is at "variable = DAQmxLoadTask ("MyVoltageOutTask", &th_analog_write_AO0);"
Can you help me please?
Thank you!!!

Stefano
0 Kudos
Message 1 of 3
(3,183 Views)

Hello Stefano,

in order to verify the correct connection for your DAQ board, I suggest you to use the following functions:

  1. DAQmxGetSystemInfoAttribute (DAQmx_Sys_DevNames): this attribute allows you to get the list of the devices currently installed on your PC;
  2. Once you get the device list, you can perform a reset of each device by using the function DAQmxResetDevice();

You can take a look on the function help for both of them in order to get more informations.

Hope this helps,

Fabio

 

 

Fabio M.
NI
Principal Engineer
0 Kudos
Message 2 of 3
(3,141 Views)
Thank you! I solved my problem with your suggestion.
Thanks!
0 Kudos
Message 3 of 3
(3,121 Views)