LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Substract an offset from each time value of a waveform

Hi guys I have the following problem problem: During my measurement, I call the DAQmxRead-VI two times. So far, so good. Now the problem is that the second DAQmxRead starts from time values of 0. That's expectable, but how do I make the second Read-VI have the same t0 as the first one? My first aproach was separating the waveform, take the both t0 values, substract them from eachother to get the time I'd substract from each t-value of the second waveform but that's not possible because I can only extract Y, t0 and dt values from a waveform. How can I solve that? LV 8.5 DAQmx 8.0 NI PCI-6251 OpenSuse 10.2 Linux
0 Kudos
Message 1 of 14
(3,820 Views)
Hi Reboot,

take the t0 from first waveform and write it to t0 of the 2nd - so they both have the same t0...

there's only one timevalue in the waveform: t0! No need to subtract "each time value"!


Message Edited by GerdW on 04-03-2008 02:13 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(3,819 Views)
How do I write a t0 into a waveform?
0 Kudos
Message 3 of 14
(3,810 Views)
Stupid question, I found that. But it does not work. I've used the "get waveform components"-VI to extract the t0 in the first measurement frame (I use a flat sequence) and tried to write it to the waveform in the second measurement frame using the "build waveform"-VI. As inputs for that, I used the waveform from the second read-VI and the t0 which I got from the first measurement frame. The result's not changed: I still get my second measurement starting with the time "0.0000" instead of something like "2.9996" (that's where the first measurement ends).

Message Edited by ReBoot on 04-03-2008 08:21 AM
0 Kudos
Message 4 of 14
(3,806 Views)
Hi ReBoot,

and now for something completely different...

General approach:
Get t0, dt and number of samples from first waveform. Calc t=t0+number*dt and wire this to t0 of 2nd waveform...
You may have to add an additional delay when there is a gap between 1st and 2nd Read-function!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 14
(3,788 Views)
You can also use the Get Final Time Value VI:




Message Edited by smercurio_fc on 04-03-2008 09:04 AM
0 Kudos
Message 6 of 14
(3,784 Views)
I did as you said (setting t0(2)=t0(1)+dt*NoOfSamples) and I still get the same result. Maybe you could take a look at the attached file to tell me what I am doing wrong? What I also don't understand: currently, the second Read-VI already has it's t0 sometime after the first one is finished and most likely at when the second one is started. But don't I have to give the second Read-VI the same t0 as the first VI to make the time values start at 3 (first Read-VI ends at 3 seconds runtime) and not at 0?

Message Edited by ReBoot on 04-03-2008 09:10 AM
0 Kudos
Message 7 of 14
(3,782 Views)
I'm a little confused now. In your original post you said you wanted the second waveform to have the same t0 as the first waveform. Then, in a follow-up post you seemed to say that you wanted the second waveform to have its t0 to be the final time of the first waveform. Now you say that you're doing the calculations to set the t0 of the second waveform to be the end of the first, but your code shows that all you're doing is setting the t0 of the second waveform to be the t0 of the first.

Am I the only one who's confused here? Smiley Surprised
0 Kudos
Message 8 of 14
(3,771 Views)
I want my second waveform to have the same t0 as the first waveform so they can be attached into one single measurement table without any time jumps from 3 to 0.
0 Kudos
Message 9 of 14
(3,769 Views)
Hi ReBoot,

and again something completely different..

Answer:
Get the waveform data from both waveforms (Y arrays), concatenate them (BuildArray in concat mode), build new waveform using t0, dt from 1st wave and the concatenated Y values... No need to do some t0 calculations...


Message Edited by GerdW on 04-03-2008 04:23 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 14
(3,766 Views)