Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronized posttriggered data acquisition

Hi,

I have problem with pci-6035e and daqmx to achieve following measurement-engine:
I will start pulse train on CTR0 - as clock for my measurement.  On the rising slope on CTR0 i will start AO (update single value from array) and on the falling slope to read for exaplme 100 values on ach0 (to calculate a mean value) and so on for all values in data for daqmxwrite. For each analog output point i will become a specified amount of samples on my ach0 - to calculate a mean value (so sample rate for reference trigger is bigger then ctr0 clock). My vi looks like: ftp://layer.uci.agh.edu.pl/pub/test-15-05.vi
But it dosn't work like i wrote above. (output of ctr0 connected with PFI7). Could somebody tell me, where is my mistake ?

Thanks in advanced
Robert Rak
0 Kudos
Message 1 of 4
(3,218 Views)
Hello Robert,

Are you receiving an error when you run this program, and if so what is that error?  Also what DAQ device are you using?  I've taken a look at your program, and tried to run it on my M-Series DAQ device, but I received several errors.  Based on what you are trying to do, I think there is an easier way to go about doing this.  It sounds like you are trying to synchronize analog input with analog output, so that a value is generated on an analog output line, then 100 or so samples are acquired from your analog input line and averaged.  Rather than trying to create your own sample clock using a counter output, and trying to trigger off of the rising and falling edges for your analog input, the easier way to implement this would be to build from the synchronized analog input/analog output shipping example, and just pad your analog output values with extra data to account for the difference in rates between your analog generation and acquisition.  Take a look at the DAQmx shipping example (Help > Find Examples) titled Multi-Function-Synch AI-AO, which can be found under Hardware Input and Output > DAQmx > Synchronization > Multi-Function.  I hope this helps.

Regards,
Travis G.
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 2 of 4
(3,198 Views)
Thanks for this example - a saw it bevore, but it doesn't work well for higher speed (e.g. update rate=100sampl/s and input rate=2000samples/s with 20points/read) -- because, in my opinion, only first AI triggers AO - remainign AI and AO are not strict synchronised. Therefor i will synchronise all AO and AI points on CTR edges. Im using NI-DAQmx-7.5.0 and Labview7.1 with PCI-6035E. The previous example i put on my ftp-server didn't work - i show only my "thinking way". This example - ftp://layer.uci.agh.edu.pl/pub/test-16-05.vi seems work (with error 200278), i.e. on rising slope of CTR0 is AO-SinglePoint, on falling slop of CTR0 will i read multiple AI Points(CTR1 is sampling clock for AI). I will do it this way (with synchronisation on counters) because it give me sureness of the measurement and i can synchronise measurement with wide range of update rate and I try after each AO make delay for some miliseconds (it doesn't work for now - is it possible to make it with only  two General Purpose Counters ??) and then acquire on AI some hundred samples to average. Measurement algorithm in theory is not difficult, but realize not ...

I would be very happy for any suggestions
Robert Rak
0 Kudos
Message 3 of 4
(3,185 Views)
Hello Robert,

Take a look at the attached example program.  It shows how to create two pulse trains using the two counters on your device, and internally route those pulse trains to be used as the sample clock for analog output and analog input tasks.  There is a fast pulse train created by counter 0, in a Counter Output > Time task.  That fast pulse train is used as the source of ticks for a second pulse train generation task, that is a Counter Output > Ticks task using counter 1.  The output terminals for these two pulse trains are explicitely programmed into the VI using the DAQmx Channel property node, and these same terminals are used as the source for analog input and analog output sample clocks.  The initial fast pulse train is set to be externally digitally triggered, so that all tasks can get configured, and wait on that one trigger to start.

An important thing to note here is that if you are performing multiple tasks on the same device, they will automatically be using the same timebase for their sample clocks, so having one start triggered off another, and having them set to the same sample clock rate will be enough to fully synchronize them.

I hope this helps and let me know if you have any questions.  I wrote and tested this on my M Series PCI-6251, but hopefully it should work on your E Series device as well.

Regards,
Travis G.
Applications Engineering
0 Kudos
Message 4 of 4
(3,169 Views)