Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

usb-6289 DAQmx Start delay in program

Solved!
Go to solution

Hi! Everybody Help me with this problem.
i have a new DAQ is USB-6289.
i'm only looking for multiply AI by a decimal factor, after put this result on AO.
for example
ao0=ai0 * x
i want to do this in continuous mode and in real time, with a minimum delay. when i start the program i have a delay time that varies.
How i can measure this delay time?
someone have a example program, to do this (a simple mutiplication in real time) and check where i have my mistakes.

thanks so much.
Jonathan

i put my program and some charts from my oscilloscope (ai0 -up signal ao0-down signal)

0 Kudos
Message 1 of 4
(3,421 Views)

Hi Jonathan.

 

From what I could see, you have this sequence in your program:

 

1) Wait 100 ms, then read 1000 samples and start a timer.

2) Wait for 24 samples to be available, then read 24 samples and save them.

3) Increase a counter by 24 and do some calculations.

4)Multiply the DAQ samples and display the data

5) Calculate how much time has passed and send the data out through the AO port.

 

The variable delay has to do with the number of operations you have between your input and output (Make extra calculations and display the data) can take more or less time depending on what else is running on your system. I would recommend you to scale the data and send it out immediately after reading it. The extra operations should be done in a parallel loop.

Aldo H
Ingenieria de Aplicaciones
0 Kudos
Message 2 of 4
(3,389 Views)

Thanks Alhern.
i redising the program to see it more easy, and I removed not necessary things to increase the time.
in the new version (control 25), have the new corrections that you said me to did it.
in the new version (control 25), have a parallel process, basically it’s the same.
You know the minimum delay on this card?
Or do you have some reference to do this?

thanks so much.

0 Kudos
Message 3 of 4
(3,354 Views)
Solution
Accepted by topic author Jonathan.espinosa

Hi Jonathan.

 

The code you uploaded wasn't in parallel. The Flat Sequence structure forces the AI-AO process to wait for the panel to be updated. You can use the "Data Acquisition and Logging" template from Create...Project to get a reference on how to separate the UI update from the actual processing.

 

However, you should bear in mind that it is not possible to "just acquire a signal, multiply it and transmit it" with a DAQ device. This is because you have to do the following to get a signal and then send it through the AO:

 

1. Acquire the signal in the DAQ card.

2. Send the signal to the PC through USB.

3. Have the OS and LabVIEW process the signal to multiply it.

4. Send the signal through USB to the DAQ.

5. Output the signal.

 

This means that while you can probably reduce the delay, you will still have that delay in the order of miliseconds. If you really need a shorter delay, you have some options available:

 

1) I noticed that the signal you're reading seems to be periodic. If it's a periodic signal you can allow regeneration in the AO and drastically reduce the delay, as the DAQ will just get the periodic waveform and cycle it. However if the waveform changes you will have some glitching.

2) Use a separate multiplier circuit instead of the DAQ.

3) Use an FPGA or RIO device instead of the DAQ.

 

I hope this helps.

Aldo H
Ingenieria de Aplicaciones
0 Kudos
Message 4 of 4
(3,348 Views)