05-16-2014 04:22 AM
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.
Solved! Go to Solution.
05-16-2014 08:12 AM
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)
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-18-2014 07:57 PM
thank you!
could you explain which function i should use to get the Y value(amplitude) with time value?
05-19-2014 11:26 AM
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-21-2014 01:47 AM - edited 05-21-2014 01:49 AM
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?
05-21-2014 07:48 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-22-2014 03:11 AM
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.
05-22-2014 07:18 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord