04-17-2012 09:44 AM
Hello folks.
I have an (I think) interesting problem that I'm looking for a better solution to.
I have an array of temperature values designed to cycle a temperature chamber.:
Each element of the array has the oven temperature, the cycle duration (in mins) along with some other information. The array must be able to loop in on it's self so a "Loop to" and "Number of loops" is also include.
EG:
element 1 (20deg, for 30min) then go to
element 2 (30 deg in 30 mins) then stay at
element 3 (30 deg for 30 mins), loop to element 2 7 times then to go element 4
element 4 (45 deg for 30 mins) stay at for 30 mins then end the sequence.
Now Im trying to find the total time the temperature chamber will run for from the time in the array. In the example above the total time would be 480 mins
I have included my (rather clumsy) source code (which works but is not verry elegant)
Can anybody think of a better way?
Thanks in advance
Chuck
Solved! Go to Solution.
04-17-2012 12:31 PM
I would prefer to convert your array OvenCycle (array of instructions actually) to array of the most simple actions like pairs (value, interval) or (value, end time). If user modifies instructions, subloops - rebuild this array. Plenty of tasks I can think of will become much easier: time calculations, graph display, actual commands for the oven.
04-18-2012 05:10 AM
Thanks Alexander Your response is much appreciated.
I see what you mean but sadly the cycling and hence the vis inputs are already defined. Im hoping for a more elegant way of dealing with what we already have. Maybe a better way of breaking down the array? Or a math based approach.
04-19-2012 10:15 AM
You can use this conversion as a subVI, it is more elegant.
Here is some kind of conversion, but it works differently from the Counting2.vi. I did not understand how you make internal loops =(
The for loop after conversion counts time for all operations.
04-20-2012 06:13 AM
That is a much better way to do it, and it seems to work well. Thanks verry much