telsenbroich
2008-07-06 03:10:05 UTC
I am new to DAQmx (v8.6). I currently working to convert an application written using Traditional NI-DAQ (PCI-6014 and DIO-96 boards). This program uses a combination of TestStand (4.01) and DLLs written in CVI8.5. We use a combination of CVI and C/C++ adapter steps. Each step NI-DAQmx functions to perform Analog Input, Analog Output, and/or Digital Output tasks.
My question is if in one the functions I made sucessvie calls to DAQmxWriteDigitalU32 with the AutoStart parameter set to 0 then called DAQmxStartTask, would each of the Writes be performed or only the last one? In other words, are the Write commands buffered and then actually written to the port when the DAQmxStartTask is called?
Purposed code:
uInt32 data; TaskHandle taskHandle;
..
DAQmxErrChk (DAQmxCreateTask("DOB_SINGLE_OUTPUT",&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle, "Dev1/port0/line16:31", "", DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle, 1, 0, 10.0, DAQmx_Val_GroupByChannel, &data, &written, NULL));data<<1;
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle, 1, 0, 10.0, DAQmx_Val_GroupByChannel, &data, &written, NULL)); data<<1; DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle, 1, 0, 10.0, DAQmx_Val_GroupByChannel, &data, &written, NULL));
DAQmxErrChk (DAQmxStartTask(taskHandle));
if( taskHandle!=0 ) { DAQmxStopTask(taskHandle); DAQmxClearTask(taskHandle); }...
Thank you for your input.
My question is if in one the functions I made sucessvie calls to DAQmxWriteDigitalU32 with the AutoStart parameter set to 0 then called DAQmxStartTask, would each of the Writes be performed or only the last one? In other words, are the Write commands buffered and then actually written to the port when the DAQmxStartTask is called?
Purposed code:
uInt32 data; TaskHandle taskHandle;
..
DAQmxErrChk (DAQmxCreateTask("DOB_SINGLE_OUTPUT",&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle, "Dev1/port0/line16:31", "", DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle, 1, 0, 10.0, DAQmx_Val_GroupByChannel, &data, &written, NULL));data<<1;
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle, 1, 0, 10.0, DAQmx_Val_GroupByChannel, &data, &written, NULL)); data<<1; DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle, 1, 0, 10.0, DAQmx_Val_GroupByChannel, &data, &written, NULL));
DAQmxErrChk (DAQmxStartTask(taskHandle));
if( taskHandle!=0 ) { DAQmxStopTask(taskHandle); DAQmxClearTask(taskHandle); }...
Thank you for your input.