LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array cycle counting

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 5
(2,811 Views)

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. 

0 Kudos
Message 2 of 5
(2,796 Views)

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.

0 Kudos
Message 3 of 5
(2,767 Views)
Solution
Accepted by topic author Nickleback

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.

0 Kudos
Message 4 of 5
(2,740 Views)

That is a much better way to do it, and it seems to work well. Thanks verry much

0 Kudos
Message 5 of 5
(2,715 Views)