LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous AO AI

Dear all,
 
The attached labview program (vsweep.vi) is part of a larger program which I have been using. This program should produce a linearly increasing AO voltage on a PCI-6229 DAQ(Dev1)  and simultaneously sample four AI channels on the same device. The four channels should sampled as close to each other in time as possible (essentially I would like to have four samples at exactly the same time). The start and end values for the AO voltage are controllable parameters as well as the rate of voltage increase. The AI sampling should be performed "Points" number of times and at a rate so that the sampling takes place while the ramping is performed, i.e., first sample (close to) when the AO voltage is at the start value and the last sample when the AO voltage is at the end value. I hope my explanation is somehow clear. The other program (sweepform.vi) is used to produce the AO waveform based on the start and end voltages and the voltage ramp rate.
 
My question is this: is this program doing what it should? More specifically, do the two tasks happen simultaneously and how well are they synchronised? I am not too familiar with LabView myself and would greatly appreciate it if someone could help me here. I have of course tested the program as well as I can (e.g., by inputing the AO back in to the AI channels etc.) and it certainly seems to be doing what it is supposed to. The sychronisation requirements are not too stringent, tens (or even a hundred) of ms would be acceptable.
 
With kind regards,
 
Erik
Download All
0 Kudos
Message 1 of 4
(2,984 Views)
Your AI and AO tasks aren't really synchronized in any way. They will probably happen close to each other because they are both dependant on the data from your 'sweep parameters' cluster and nothing in between will take very long.
 
This document should tell you all you need to know about task synchronization for your device... http://zone.ni.com/devzone/cda/tut/p/id/3615.
I've attached your vi with the suggested changes, it seems to work in the simulation I did.
 
PS.
a. The DAQmx start should be before the write. (Changed in attached vi.)
b. Are you sure you want to be messing around with the AtoD conversion rate? If you are, you should do it in line (not hanging like it is) and before starting the task. (Deleted in attached vi.)

Message Edited by Troy K on 07-11-2007 01:55 AM

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Download All
0 Kudos
Message 2 of 4
(2,972 Views)

Thank you Troy! I shall edit the program as you suggested. However, what do you think about the "synchronicity" of the program as is. The real problem is that I am not very familiar with LabView and have been using the program as it is. I recently started looking at the program trying to understand exactly what it does and I couldn't understand if there is something that makes the two processes be syncronized or if it is just that this seems to happen by accident. As you say that the latter is the case I now wonder whether it might have happened that the two processes were sometimes badly out of step. If this could have happened I have to repeat some experiments I made with the program and this I would like to avoid...

Erik

0 Kudos
Message 3 of 4
(2,958 Views)
You're welcome Erik.
It is impossible to say exaclty how much out of sync they will be because it depends on a few variables such as processor load etc. I would guess that it is unlikely that your two tasks will start more than 50ms out of sync. They will probably be less than 10ms out of sync on average.
Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 4 of 4
(2,939 Views)