Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxStartTask -200077 error for NI9237 in NI9184 in C

HI,

 

This should be simple, but I am missing sopmething...

 

The following gives a -200077 at the DAQmxStartTask step.

 


    ErrCode = DAQmxCreateTask("",&taskHandle);      // returns 0

    ErrCode = DAQmxCreateAIVoltageChanWithExcit(taskHandle,"cDAQ9184-18F6E7C-TERN-MCEMod1/ai0","",DAQmx_Val_Cfg_Default,-1,1,DAQmx_Val_Volts ,DAQmx_Val_FullBridge,DAQmx_Val_Internal,10.,1,NULL); // returns 0
   
    ErrCode = DAQmxCfgSampClkTiming(taskHandle,NULL,10.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps ,2);  // returns 0

    ErrCode = DAQmxStartTask(taskHandle); // returns -200077

    ErrCode = DAQmxReadAnalogF64(taskHandle,-1,10.0,DAQmx_Val_GroupByScanNumber,LoadCell,1,&read,NULL); returns -200077

 

 

All I want to do is occasionally (inside software loop) read a sample from the bridge. Don't want waveforms, don't need event handlers, just tell me the current ratio...

 

What am I missing???  (No LabView, just plain DAQmx and C in a console app...)

 

Thanks...

 

0 Kudos
Message 1 of 3
(5,853 Views)

Of course, the following, from the bridge example, works:

 

    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateAIVoltageChanWithExcit(taskHandle,"cDAQ9184-18F6E7C-TERN-MCEMod1/ai0","",DAQmx_Val_Cfg_Default,-0.024,0.024,DAQmx_Val_Volts ,DAQmx_Val_FullBridge,DAQmx_Val_Internal,10.0,1,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",10.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
    DAQmxErrChk (DAQmxPerformBridgeOffsetNullingCal(taskHandle,""));
    DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,1,0,EveryNCallback,NULL));
    DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
    DAQmxErrChk (DAQmxStartTask(taskHandle));

 

I am just curious why my version does not...

 

0 Kudos
Message 2 of 3
(5,847 Views)

Hello,

 

This error means that you are using a configuration value that is not supported by your hardware (probably minVal and maxVal). You can use the error handling functions in order to retrieve more information about the error. As shown in the document below you can get valuable information that will allow you to troubleshoot your application.

 

http://digital.ni.com/public.nsf/allkb/440EB533229211CD8625711C007E61B3

 

Regards,

 

MCOTO

0 Kudos
Message 3 of 3
(5,817 Views)