Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

Generating arbitrary pulses with PXI-6602

$
0
0

Hi everyone!

 

I have a problem generating pulses with the PXI-6602. What I need is a sequence of pulses that appear for example at t0=0, t1=1ms, t2=5ms, t3=100ms and loop after 1000ms.

 

As far as I understood the NI-DAQmx-functions and -examples, I should be able to achieve this with the "DAQmxWriteCtrTime(...)" / "DAQmxWriteCtrFreq(...)" / "DAQmxWriteCtrTicks(...)" functions, as used in the example "DigPulseTrain-Cont-Buff-Implicit".

 

The problem is: When I try to run this example as it is on my PXIe-1075 chassis with the PXIe-8135 controller and the PXI-6602 in Slot 2, I get an error saying that I have to start the task before calling the write-function (see screenshot).

DAQmxError.PNG

 

So I copied the line with the "DAQmxWriteCtrFreq(...)"-function below the "DAQmxErrChk (DAQmxStartTask(taskHandle));"-line. Now the program is running, but on the oscilloscope I see that it just repeats the same puls over and over and does not change the ratio as it should do. Looking at the output of the write-function I can see that only one sample was written to the buffer, instead of 1000 samples which I expected.

 

When I tried to google the problem, I found these two threads, which seem at least related to my issue.

https://forums.ni.com/t5/Counter-Timer/buffered-counter-output-in-C/td-p/2791758

http://forums.ni.com/t5/Multifunction-DAQ/Auto-Start-DAQmx-task-functionality/td-p/456366

In the first discussion it is mentioned to use the write-function before starting the task, in the second it says to simply start the task before writing to the buffer.

 

I am using Labwindows/CVI 2009 on Win7 64bit. Maybe someone has an idea, what I did wrong or how to fix the problem.

 

Thank you very much in advance!

Best regards,

Christof


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>