LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use time stamp value find Y value in another waveform

Solved!
Go to solution

hello ,there, i am using labview 2013 sp1. sorry I can't use a photo to describe the problem.

Use DAQ assistant sampling 2 waveforms from 2 AI channels

Want to use rising edge of one of the waveforms as the triger to get the Y value of another waveform(just as did it with a oscilloscope)

I tried 2 method:

1. use <select signal.vi> to seperate one waveform out and use <search waveform.vi> to get the time of fits

2. also use <select signal.vi> and use <trigger and gate.vi+WDT get waveform time array DBL.vi> to get the time stamp.

is these method works?

the problem is how can i use the time value i got to fine the Y value in another waveforms?

thank you very much in advance.

0 Kudos
Message 1 of 8
(3,767 Views)

This can be done but you need to understand that your times may never actually be equal.  When sampling two AI signals that aren't simultaneous sampling, the DAQ card is actually sampling one then the other back and forth really quickly.  This means the times of sampling signal A will never be the same time that a sample on signal B was taken.  You need some kind of tolerance saying when signal A goes above 5V (or what ever) get the time.  Then find when signal B was taking a sample with 2ms of this time (or what ever)

0 Kudos
Message 2 of 8
(3,742 Views)

thank you!

could you explain which function i should use to get the Y value(amplitude) with time value?

0 Kudos
Message 3 of 8
(3,708 Views)
Use the get waveform components to pull out all Y values (as an array), dt which is time between samples, and t0 which is the start time. To get the X values for all Y values you'll need a for loop adding dt to t0
0 Kudos
Message 4 of 8
(3,679 Views)

finally, i got one picture for this vi.

tried get waveform and build waveform, but...

i can get time value of "selected signals"  either from "triger value" or from "trigger and gate"

how can i get amplitude value of "selected signals2" according to the time value i getted before?

Untitled.jpg

0 Kudos
Message 5 of 8
(3,644 Views)
Solution
Accepted by topic author muxingjun

I'm sorry you are using Express VIs, and I'm even more sorry you are using the dynamic data type.  Using these aren't your fault, it is what NI recommends for new developers, but you tend to not have as much control then you would using more strict type data, and writing the code your self.

 

Using the Split Signals you can pull out the all of your signals from the dynamic data type and process each.  Not sure why you would use the Select Signals but whatever I think they do the same thing.  Then you use the From DDT to get your data in a format that is more useful.  Select the Conversion to be to a Single Waveform.  Then the explaination I gave in my previous post is valid. 

 

Attached is a VI that I think does what you want.  You can see that once you have a waveform and its components you can do a lot more useful work.  Like finding the Min and Max of a wave by using the array functions.  It searches for the first place where AI0 went above your trigger, then gets the value that AI1 was at that same index, which will be roughly at that same time.  Remember the AI will sample one after another so no two samples will be taken at the exact same time for most DAQ cards.  Few are simultanious sampling.

0 Kudos
Message 6 of 8
(3,630 Views)

thanksHooovahh for your kindly help:

      your example vi works well, but ti runs tool fast that i can't get the value on the trigger point, so could you help me more?

i tried to add while loop for this vi and when output of trigged value is not zero ro some low value, it goes to end terminal. but even this i only can get the first value and have to waite the for loop goes to the end.

what i mean, i only want to get the value of the cross point of the 2 curve in below picture.

Untitled.jpg

0 Kudos
Message 7 of 8
(3,608 Views)

Next time open with this amount of detail.  I answered the question you asked, not the question you should have asked.

 

You will need to look for a rising edge until one is seen.  Then once you see a rising edge you will then look for a falling edge.  Do this using the is less then comparision function, instead of is greater then.  You'll then still perform the search 1D array looking for the first true.  You will need a shift register to keep track of the which edge was last seen.  As I said you'll need to start looking for a rising edge (is greater then) and once one is seen change the value in the shift register so that is will then look for a falling edge (is less then). 

 

You didn't mention it yet but your read should be done in a continuous sampling mode if it isn't already.

0 Kudos
Message 8 of 8
(3,596 Views)