LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Task error 20008 without Delay

When I run the code below I get an task error 20008 without the delay of 2 seconds.

Why do I need the delay and is there any way to reduce this ?

 

Chan_num is “Dev1/port4/line1”

 

Voltage is 25  or 0 or -25

 

 

int DAQ_set_voltage(int panelHandle,char *task_name, char *chan_num, unsigned long voltage)

{

if((status = DAQmxCreateTask("xyz",&VoutHandle)) == SUCCESS)

                                               

          if((status = DAQmxCreateDOChan (VoutHandle,chan_num , "www", DAQmx_Val_ChanForAllLines))== SUCCESS);

 

                                                                Delay(2);

                               

         if ((status = DAQmxWriteDigitalU32(VoutHandle,1,1,10.0,DAQmx_Val_GroupByChannel,&voltage,&written,NULL)) == SUCCESS)

                                                 

                 status = DAQmxStartTask(VoutHandle);      

 

0 Kudos
Message 1 of 2
(1,965 Views)

Hello,

 

Are you working from particular example? If not, it may be helpful for you to use one of the prebuilt digital generation examples to work from.

 

In addition, can you post a screenshot of that error message?

 

Thanks!

Claire C.
AppSW Staff Product Support Engineer
National Instruments
CLD|CTD
0 Kudos
Message 2 of 2
(1,934 Views)