LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine the maximum temperature in a consecutive of 2 minutes?

Solved!
Go to solution

I am doing the following application:

 

1) Temperature signal is read in every 1 second, define in a while loop;

2) I want to make sure that in a consecutive of 2 minutes, temperature value is always lower than a value, say 10 degree C;

3) If it can meet the criterion, returns true, otherwise continue monitoring until it is true.

 

A possible way it to define an 1D array with 120 elements, but I would like to know if there is a more elegant way? I cannot put the array in a subVI, as it is destroyed once subVI is left. LabVIEW system provides "RMS" calculation function (everything is in a sub VI) and I do not the function used in that VI.

0 Kudos
Message 1 of 9
(3,748 Views)

you could store the maximum temperature as a single point in a shift register and then each time you acquire a new temperature use the 'max&min' comparison VI to compare your current value and previous maxium and pass the larger of the two to the shift register.

 

I am not sure why you can't create a subVI - if you explain further i might be able to help.

David
www.controlsoftwaresolutions.com
0 Kudos
Message 2 of 9
(3,738 Views)
You can do point byExample_BD.png point averaging. See the example below
Tim
GHSP
0 Kudos
Message 3 of 9
(3,733 Views)

I might have read the original post wrong but I thought the objective was to track the max temp not the mean temp?

 

Like this: -

 

untitled.PNG

David
www.controlsoftwaresolutions.com
Message 4 of 9
(3,726 Views)

Hi,

 

Think he also wants to exit if any temp is above a threshold:

 

Temp readings snippet.png

 

Rgs,

 

Lucither

Message Edited by Lucither on 05-05-2010 10:07 AM
Message Edited by Lucither on 05-05-2010 10:10 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 5 of 9
(3,719 Views)
Solution
Accepted by topic author chenfangzhi

As i understand the opening post he just wants to wait until the temperature is lower than a threshold for at least 2 minutes and then exit?

Something like this should do it if thats the case.

 

 monitor1.png

Message 6 of 9
(3,683 Views)

I will the solution in the above post, as this is closest to what I want.

 

If criterion is met, count increases until 120 seconds; otherwise, count is reset to 0.

 

A further question is that how to put this as a subVI, the while loop is still in the main VI, the the counting part is grouped as subVI (most importantly, no shift register in the while loop).

 

This is not crititcal in terms of program function, but I am interested to know if it is possible in LabVIEW.

0 Kudos
Message 7 of 9
(3,650 Views)

Ah!! so thats what you meant, ok.

 

You can easily implement this as a subvi:

 

Temp readings subvi.png

 

This is what the subvi would look like. You would use a while loop that only iterates once with an un-initialised shift register. This will then store the last value in its shift register.

 

This is how it would look on your main vi:

 

Temp readings subvi demo.png

 

In this version you do not need to wire the time limit, its default value is 120. If you ever want to change this though you can wire in a new value.

 

Rgs,

 

Lucither

Message Edited by Lucither on 05-06-2010 05:04 AM
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 8 of 9
(3,625 Views)

Hi, all, with the contribution the last post, my problem has been completely resolved.

 

I learnt a new way of using un-initialized shift register. It is really very useful.

 

Initially, I worried that values stored in a shift register are destroyed once loop is exited. Actually, it is not true for un-initialized shift register. 

0 Kudos
Message 9 of 9
(3,600 Views)