Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time derivative

Hello folks,

 

I am preparing a labview program to acquire analog input data from a position sensor. The goal is to pass this signal through a derivative (or a general transfer function) and send it to an analog output in real time. It will be done with the USB 6211 for now.

 

Now, for discrete filters/derivatives/transfer functions I need the actual signal at time t=n, but also some past signals at t=n-1, n-2... The thing is that the time-stamp of each acquired signal point should also be known in order to calculate time differences. I guess that the only way to do this is to use a shift register to save past values and the "tick count". Should I place the DAmx and tick count next to each other in a stacked time loop?

 

Thanks

Lysander



0 Kudos
Message 1 of 4
(4,543 Views)

Hello Lysandros89,

 

make a continuous acquisition and use the waveform as an output then you get the start timestamp and delta t with this you can calculate the time to every sample. If you are using more then one analog input then there also a delay between the channels, because the inputs are multiplexed. The next is with the samples to read and the sample rate you make the time of the loop as an example 1KHz sample rate 100 samples -> the loop runs with 100ms. A faster loop rate then 20ms is hard to reach, because this is an USB product on a Windows machine.

 

 tam.png

best regards
Alexander
0 Kudos
Message 2 of 4
(4,469 Views)

Thanks for the response.

Which acquisition mode is preferable for analog input? The "on-demand acquisition" with N=1 sample or the "continous acquisition". When used in a while-loop it should be the same right? As far as I know, labview runs each block once and then moves to the next...



0 Kudos
Message 3 of 4
(4,467 Views)

Hello Lysandros89,

 

i have edited my post with an examples hope it helps you

best regards
Alexander
Message 4 of 4
(4,464 Views)