Discussion:
Multiple calls DAQmxWriteDigitalU32
(too old to reply)
telsenbroich
2008-07-06 03:10:05 UTC
Permalink
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.
 
 
 
mallorim
2008-07-07 23:10:07 UTC
Permalink
Hi Telsenbroich,
It is an interesting question you ask but unfortunately the code you suggest results in an error. When I tried setting this up with two digital writes configured before I started the task, I recieved the following error which explains about how the buffer is limited to the size of the first write and it makes suggestions about how to fix the error. Hope this helps,
<img src="Loading Image...">
Mallori M.Message Edited by mallorim on 07-07-2008 06:00 PM


mutliple digital writes before start task.PNG:
http://forums.ni.com/attachments/ni/70/9139/1/mutliple digital writes before start task.PNG
Loading...