LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with synchronous analogue input/output

Hi
 
I am wondering if anybody can solve the problem I am having with this vi that I have manipulated from one of Labviews example VI's.
 
What it is supposed to do is generate a ramp voltage via the analogue output using the for loop at the top left.  Data should then be sampled synchronously by the analogue input channel.  However I am getting a problem - the analogue input channel is not sampling the voltage ramp I programming in.  For example, if I program to sample between -5 and 5V it samples between -5.3 and 4V with a sudden jump from 5 to -5.3 V at the start of the scan. 
 
Any Ideas anybody.
 
Many thanks
 
Ashley.
 
 
 
0 Kudos
Message 1 of 5
(2,852 Views)
you can create two parallel while loops, one for AI and one for AO
then the input and output process runs ("pseudo") simultanious

regards timo
0 Kudos
Message 2 of 5
(2,844 Views)
Hi Timo
 
Thanks for your reply.
 
I have modifiued the code to the VI attached.
0 Kudos
Message 3 of 5
(2,836 Views)
Hi Timo
 
I have modified my code to the new vi attached.
 
I now have am getting the ramp function I want - but I am worried that the synchronization is a little suspect at the kind of sample rates I am going to be dealing with ca. 10kS per second. 
 
Also if the synchronism is too tight I may see transients as the analogue output from the DAQ card is driving an amplifier.  This is a problem.  What I want to be able to do is put a short, maybe 30 or 40micro seconds, delay between the analogue output switching and the analogue input sampling.  (Note that the DAQ assistant Icon simply sets a positive or negative bias output voltage in each of frames of the sequence and is not related to the problem).
 
If you have any ideas they would be most appreciated.
 
Thanks for you help so far.
 
Cheers
 
Ashley.
 
 
 
0 Kudos
Message 4 of 5
(2,836 Views)
Hi Ashley,

You can set this up fairly easily using the Start Delay Trigger property in DAQmx. If you trigger both the AO and the AI off at the same time then you can just put a 30 micro second delay on the AI so it is always going to measure 30 micro seconds after the AO has updated. I have written a simple example program that writes a sine wave out and reads it back in. You can see that changing the delay changes the phase on the graph.

Regards

Jon Bowers
Applications Engineer
NIUK
0 Kudos
Message 5 of 5
(2,814 Views)