02-04-2009 12:52 PM
Dear Friends,
I will appreciate if anyone helps me.
I am trying to convert time to no. of cycle in my program. Actually I am reading temperature from externel device. I put my program in a loop and I can see temperature chart which varies with time. how can I get a out put of time from wavechart output and calculate it to no. of cycle?
I know the frequency of my external device which sends temperature to labview.
Regards,
Mehdi
02-04-2009 11:06 PM
In general, if you know the time the first sample was taken and the time between samples, a little simple math will tell you the time each sample was taken:
time_for_sample_n = start_time + (time_between_samples * n)
Given this, you can easily calculate an array of times for each sample, that you can then use for the x-axis of a graph.
Mike...
02-05-2009 09:01 AM
Hi Mike Thank you for your answering.
My program already has time on the x-axis. By adding a loop I can see the time table in the waveform graph.
I am trying to put a time condition ( if time>50 then continue the other connections of my program).
I do not know how to wire from wave chart and get time (the x-axis) and give it to a condition block.
I will appreciate if you help me.
Regards,
mehdi
02-05-2009 04:55 PM
02-06-2009 10:15 AM
Hi,
I wired from the out put of waveform to the formula block. in the formula block I wrote the formula, but it sees the temperature data in the formula instead of time.
the variable i difined in the formula is t , I think formula block authomaticlally uses temperature as the basic out put variable.
How can i insert time in the formula?
I appreciate your help,
Regards,
mehdi
02-06-2009 03:46 PM
02-06-2009 04:56 PM
Hi,
I think I did it.
As you can see in the attached file (the black section), I wired from waveform to the "Get Waveform Time Array " and changed it to DBL and to dynamic data.
Now it works.
Thanks,
Mehdi