12-13-2013 02:01 PM
Hi,
My code, which is:
TaskHandle h=0;
int32 b = DAQmxCreateTask("Task1",&h);
int32 a = DAQmxCreateAIVoltageChan(h , "Dev1" , "Voltage", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, NULL);
produces an error (The value of a is -200220.). I have the simulated NI USB-6251 as Dev1 running in NIMax. The reason that I know it is running properly is that when I use DAQmxGetSystemInfoAttribute, the name "Dev1" appears as one of the detected devices names.
But I don't understand why I still get the DAQmxErrorInvalidDeviceID error.
(b is 0 though!)
I would really appreciate if anyone could help me solve the issue.
Thanks.
01-07-2014 06:15 AM
Hi NIMaxUser,
Do you have the same problem when you try to communicate with other simulated devices or just dev1?
Regards,
01-07-2014 10:19 AM
Thanks, the problem was solved by adding the ai0 to the command.