Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

help writing pipelined continous digital output with everyNevent on PCIe6536

 
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
0 Kudos
Message 1 of 5
(3,357 Views)
Hello,

you can find the help to every DAQ-command at Start -> Programs -> National Instruments -> NI-DAQ -> NI-DAQmx C Reference Help.

The error code points out, that this property isn't supported with your card:

Why Do I Get Error 200452 When I Use Certain DAQmx Properties With My DAQ Board?
http://digital.ni.com/public.nsf/websearch/05A563FE3AA7B3C286256FF90077C303?OpenDocument

What software are you using for creating your application? There are a lot of examples that are shipped with LabWindows/CVI or NI-DAQ. With LabWindows/CVI just use the example finder, for NI-DAQ go to <Installations Folder>\National Instruments\NI-DAQ\Examples. Here are various examples for data acquisition.

National Instruments
District Sales Manager
0 Kudos
Message 2 of 5
(3,343 Views)
I'd like to develop code in C using NIDAQmx and VisualStudio2005sp1
 
The example I was talking about can be found under the link
It's programmatically close to me since it creates pipelined output using everyNsamples event in C.
 
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.
 
The problematic lines are to me: at the 212th line in the DAQmxAOUpdateDlg.cpp
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));            OK
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,channel,"",MinVal,MaxVal,DAQmx_Val_Volts,NULL));    OK
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",Freq,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));     OK
DAQmxErrChk(DAQmxCfgOutputBuffer (taskHandle, 1000));     ! Isn't it defined already by the previous line in the sampsPerChanToAcquire argument?
DAQmxErrChk(DAQmxSetAODataXferReqCond(taskHandle, channel, 10235));  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 example because I feel thet understanding that could take me closer to my solution. Thanks for the support.

 

0 Kudos
Message 3 of 5
(3,335 Views)
Hi katonag,

you can find the description of all commands in the DAQmx-C-help that I previously remarked.

Of course you are free to program your own code. And again: I would strongly advice you to start with the simple examples that are shipped with NI-DAQmx. These examples don't have as much code as your example and will help you very fast to understand the principles of DAQmx-programming.


National Instruments
District Sales Manager
0 Kudos
Message 4 of 5
(3,306 Views)

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 determine the buffer size.

That's true for the input task.

But I should set it again with the  DAQmxCfgOutputBuffer command in case of the output otherwise it stops with -200621 error.

 

0 Kudos
Message 5 of 5
(3,298 Views)