04-29-2011 05:36 PM
I want to give some signals to the output and then gather data from the sensors after some specific amount of time, so I wont get the transient data.
So I want to give analog output out and then after like 5sec collect data from AI. I have tried "wait(ms)" and "wait until next ms multiple", but what they just add some delay and do the same thing, instead of just starting to collect data after some time.
04-29-2011 05:37 PM
To clarify:
Lets say I want to send signal from AO from 0-15sec and collect data from AI from 10-15sec. So the question is how to do that?
Thanks.
04-29-2011 08:17 PM
From the most simplistic standpoint, the wait function is the easiest to do, assumign you don't have a tight tolerance on your 5 secs delay. You didn't give an example of how you tried to use it, so I don't know what you ddn't like about it. If you dropped the code and had no data flow, you may have run your wait in parallel with your analog output.
A more complex way, but would give you more accurate timing is to use triggering to start your acquisition, but you'll need to provide more information about your setup and what you are doing with the analong input and output lines.
05-02-2011 10:25 AM
As I said I want some part of the VI start running after T seconds. But when I use the wait function, it looks like it just put the data into buffer and process them after T seconds.
For example, in the attached file, I want to collect data in [0,10] then plot them in [2, 10] and do the process in [5,10]...
The part that I have not put it yet, is to send a signal and run the motor at t=0sec and then collect data at t=2sec.
05-02-2011 11:28 AM
Or to make it more complete, how can I have some sub-VI that can calculate something based on the data I am collecting from some T1 to T2. So it should wait till T1 and just get the data till T2.
05-02-2011
11:59 AM
- last edited on
10-04-2024
03:11 PM
by
Content Cleaner
Base don your test vi, you can use Extract Portion of Signal xpress VI. It will take a subset of your signal. I don't know howvwer that this will ultimately fulfill all your needs.
The issue in your VI is all the time delays occur in parallel with the signal acquisition. Sicne you acquisition takes 10s, the waits are useless. The signal data is 10s worth of acquisition since that is how much you requested. Simply adding time delays does not make LabVIEW split the signal data.
You may wish to explicitly state what your ultimate task is, as you can get better answers that way.
05-02-2011 12:49 PM
Oh thanks. This is pretty helpful. I guess that's what I need.
I am trying to send some signals to run a motor and then after T sec (so the motor is its steady state) I want to plot some graphs and do some calculations. So the whole thing is about throwing out the transient part of the data.
Also, for some reasons, the graph has hour/min/sec as its x-axis. I tried to changed it from the graph properties/display format; but I couldn't. Do you know how can I fix it?
Thanks.
05-02-2011 06:04 PM
Hey Baran,
I'm assuming you mean the graph titled Section on your front panel. Unfortunately, that is a byproduct of the way the Dynamic Data Type is stored. However, there are two quick fixes. First, right click on the graph and select Ignore Time Stamp. That will change the format of the x-axis for you. The second solution is to change the data type to a waveform, as is this code snippet;
That will also change the formatting of the x-axis. Hope that helps!
05-02-2011 06:15 PM
Yes. The problem is the way x-scale is presented in front panel, as you can see in the attached. The second method you said works, however it shows based on samples not time. Is there anyway I can get the plot based on time?
Thanks again.
05-03-2011 05:51 PM
Hey Baran,
Try this code and see what you think. Have a great evening!