06-14-2019 08:49 AM
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);
06-17-2019 11:29 AM
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!