Discussion:
help writing pipelined continous digital output with everyNevent on PCIe6536
(too old to reply)
katonag
2007-05-23 09:40:11 UTC
Permalink
 
I'd like to program a high speed digital output, where data is generated by my PCIe6536 'on the fly'.
This means I'd like to program pipelined, buffered, burst digital OUTPUT with the buffer filled by using the every N samples event.
(I already managed to program such operation for the input direction, and I'd like to use the card in both direction [16bit in/16bit out] simultaneously in the future)
 
I only found the example DAQmx AO Every N Samples on the developer zone but simply exchanging AO to DO does not worked.
I don't undestand the meaning of the line
DAQmxSetAODataXferReqCond(taskHandle, channel, 10235) and on the other hand it generated error -200452 on my card.
 
Can somebody explain me how to write this DO task / do somebody has an example?
thx
katonag
2007-05-25 10:40:08 UTC
Permalink
I'd like to develop code in C using NIDAQmx and VisualStudio2005sp1
 
The example I was talking about can be found under the link
<a href="http://zone.ni.com/devzone/cda/epd/p/id/4800" target="_blank">http://zone.ni.com/devzone/cda/epd/p/id/4800</a>
It's programmatically close to me since it creates pipelined output using everyNsamples event&nbsp;in C.
&nbsp;
Of course,it's not the same hardware, since I have a digital card. That's why I tried to siply translate and exchange AO functions to DO. But there are commands I do not understand, which access the soul of the hardware, and that's why I did not managed to modify that code.
&nbsp;
The problematic lines are to me: at the 212th line in the DAQmxAOUpdateDlg.cpp
DAQmxErrChk (DAQmxCreateTask("",&amp;taskHandle));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OK
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,channel,"",MinVal,MaxVal,DAQmx_Val_Volts,NULL));&nbsp;&nbsp;&nbsp; OK
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",Freq,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));&nbsp;&nbsp;&nbsp;&nbsp; OK
DAQmxErrChk(DAQmxCfgOutputBuffer (taskHandle, 1000));&nbsp;&nbsp;&nbsp;&nbsp; ! Isn't it defined already&nbsp;by the previous line in the sampsPerChanToAcquire argument?
DAQmxErrChk(DAQmxSetAODataXferReqCond(taskHandle, channel, 10235));&nbsp; This means DAQmx_Val_OnBrdMemEmpty which makes no sense to me to request data transfer at the edge of the underflow condition...

On the other hand, it was not trivial to me, to which amount should I set the output buffer. Especially in the case of my PCIe card, which has little onboard memory.
Ideal solution to me would be if you could rewrite that sample to PCIe6536/7 comment and upload it. I'm just talking about this AO&nbsp;example&nbsp;because I feel thet understanding that could take me closer to my solution. Thanks for the support.
&nbsp;
katonag
2007-05-30 17:40:16 UTC
Permalink
That was whatI did before to com to these problem.
Anyway, with more experiencing I managed to do the job, and it seems working with 25MHz In and Out :-)
For example which is non trivial:
DAQmxCfgPipelinedSampClkTiming sets the buffer size according to the help: If sampleMode is DAQmx_Val_ContSamps, NI-DAQmx uses this value to <a>determine the buffer size</a>.
That's true for the input task.
But I should set it again with the&nbsp; DAQmxCfgOutputBuffer command in case of the output otherwise it stops with -200621 error.
&nbsp;

Loading...