LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to measure a temperature over the time and displays on a graph?

Hello,
I would like to measure a variable temperature over the time and put the measurements in a graph. This must happen in realtime that means during the running programm the results have to display.
My idea was to realise this with a while loop. For example every second I get one value and put them in a "waveform graph". The graph must be out of the while loop. But it doesn't work. During the running programm there is nothing to see, only after termination the programm the graph displays with the temperature.
This is important because in my case the programm must react by special temperatures.
I attached a pdf file.

Thanx for help

Message Edited by prhf_06 on 11-29-2006 10:35 AM

0 Kudos
Message 1 of 12
(5,238 Views)

Instead of a graph, use a chart and put that inside the loop. If you need to make any decisions based on the current temperature, that code has to be inside the loop as well.

You might want to look at some of the resources available for learning LabVIEW basics at http://zone.ni.com/devzone/cda/tut/p/id/5199

0 Kudos
Message 2 of 12
(5,223 Views)
Thanky you for your reply.
In the VI out of the loop there is a case structure which will wait 60 seconds. If I put this VI and a chart into the while Loop the measurement will stop for 60 seconds.
The measurement must run independent and alone next to the other applications.

0 Kudos
Message 3 of 12
(5,206 Views)
It sounds like you might want to use the Producter/Consumer or Master/Slave design pattern for the subVI. Would need to know exactly what the subVI is supposed to do. Open the templates with File>New or check the shipping examples. You would still place the chart inside the loop if you want real time data.
0 Kudos
Message 4 of 12
(5,177 Views)
I attached a screenshot of the Sub VI called "Temp. Reg.".
the problem ist the time in this SubVI. E. g. I put this VI into the while loop in a case structure (look at the first file I attached) and the case in the loop becomes active, the while loop doesn't make anything for 10 s because it waits for the case. So my measure suspends for this time but I want a continuous measurement.

0 Kudos
Message 5 of 12
(5,168 Views)
Using a wait statement does nothing for you. It doesn't tell you what you want to know. The first time the actual temp is within 1 degree of the set point, your indicator will go true after a 10 second wait. You've done nothing to determine the stability. I did a simple example using the Elapsed Time function. Whenever the setpoint and actual are withing range, the timer is enabled. It will count up to 10 seconds and turn a front panel LED true. Anytime the setpoint and actual are outside the limit, the timer is reset. This way you really know that the actual temp is stable. This code can go inside the while loop and will not affect your ability to measure continuously.
Message 6 of 12
(5,161 Views)
I just added a chart temperature over the time.
You will see the jumps that is  why the measuremt suspends.

0 Kudos
Message 7 of 12
(5,160 Views)
I don't know what you are trying to show me. How have you modified the code now? If you added the elapsed time function like in my example and wired the Boolean output to the while loop's stop terminal, then the while loop will stop when the actual temp is within the bounds you set. If you don't want the while loop to stop, don't wire the Boolean output to the stop condition. The example was meant to show you how to actually check for a 10 second stable temperature. Modify per your needs. The temperature bouncing around is a different problem altogether and not one I can address because I have no idea of your hardware setup.
0 Kudos
Message 8 of 12
(5,147 Views)
I modified the code now and adapted the VI for my needs. This and my hardware works fine.
I tried to make two different VIs (with LV 8.20) to explain exactly my problem.

without_case.vi
the random numbers simulates the measured temperatures. With a shift register I am building an array. The simulated temperatures are refreshed every second and it is a continuous measurement.

with_case.vi
it is the same like in the VI "without_case.vi". But in the while loop there is a case structure which waits for 10 seconds. Becomes the boolean true the while loop will wait for 10 seconds and the measurement stops because the while loop is waitung for the case structure.

It is my goal that the time for checking the stability and the measurements are running parallel, This two actions have to be independent.




Download All
0 Kudos
Message 9 of 12
(5,123 Views)
I can't view the VIs but a fixed wait is a fixed wait and if it's inside the while loop, it will pause the execution of the while loop. That's the whole purpose of a wait. If it didn't pause execution, it wouldn't be a wait. why can't you use the elapsed time function? There are a lot of ways to modify it. The first time the actual is within the setpoint range, start the timer but keep it running even if the setpoint drifts, then when the time is elapsed, take another reading. It all depends on your version of stability. With your fixed wait, as I said before, the first time the actual is near the setpoint and you just wait 10 seconds for a second reading, the actual temp could be varying quite a bit in that wait time. It may not matter. If you insist o using a fixed wait, then move it to another while loop. As I also mentioned, look at the producer/consumer design patterns. There are both templates and shipping examples. With this type of architecture, you can pass data from one while loop to another.
0 Kudos
Message 10 of 12
(5,097 Views)