Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

using compactDAQ to output transformed input voltage

Is it possible to build a translation system using CompactDAQ that reads input voltage (-10..10V) and translates it into output voltage (say, -10..10V) following some function?

 

How can I estimate the delay between input and output?

 

For example, I want to use these two cards:

  1. NI-9201 C-series Voltage Input Module (500kS/s)
  2. NI-9264 C-series Voltage Analog Output Module (25kS/s/ch)

And function is simple output = A*(input - B)

 

Ideally I want to be able to adjust A and B in real time using GUI through labVIEW

0 Kudos
Message 1 of 2
(1,402 Views)

The delay (often termed "latency") will depend partly on how you code and partly on things outside your control (DAQmx driver, USB bus, Windows' priorities, etc.).  Let's start by aiming for ~1/20th sec latency, because it's likely gonna work without much fuss. 

 

Here's what I'd do:

1. My AO would be a software-timed on-demand task where I update the AO value about 20 times a second.

2. My AI task would read data about 20 times a second and read something like 10 to 100 samples per iteration. (I'd set the hardware sample rate accordingly.)

3. I'd reduce the AI data to a single scaled value.  For starters I'd use a simple mean, but you could consider things like an exponentially weighted average, or some type of formal digital filter.

4. Then I'd use pipelining to feed this single value forward into the next iteration.

5. On the next iteration I'd scale the input value according to A*(input - B) and write the result to the AO task.  This would happen in parallel to the AI task waiting for its new 1/20th sec worth of data.

 

See attached and snippet below.

 

 

-Kevin P

 

scale ai to ao.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(1,378 Views)