LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing time to the number of cycle

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

Download All
0 Kudos
Message 1 of 7
(3,113 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(3,091 Views)

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

0 Kudos
Message 3 of 7
(3,073 Views)
The x-axis is calculated similarly to what was mentioned above. Since you are building the waveform, I would suggest calculating the number of samples that means time=50, then monitor the array size until it reaches that value. Use a case structure at that point to begin your next step.
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 4 of 7
(3,054 Views)

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

0 Kudos
Message 5 of 7
(3,037 Views)
Which formula block are you talking about, specifically? And what exactly do you mean by inserting time into the formula? Do you mean the time values that correspond to each y value in the graph?
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 6 of 7
(3,015 Views)

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

0 Kudos
Message 7 of 7
(3,009 Views)