LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating 1D array of different timers

Solved!
Go to solution

Hello all,

 

How could I create an array of timers which I can deal with every timer inside this array individually? For EX. (I need just to reset the timer in the second element of the array and keep the other elements running) I hope my idea is clear and am looking for help.

 

Thanks in advance 
 

0 Kudos
Message 1 of 8
(1,052 Views)
Solution
Accepted by topic author Mina55

Hi Mina, I think many people create some re-usable timer code because it is needed so often. I've made a Timer class (attached). You can simply create as many instances as you need.

 

You could build them into an array, but you will have to document the code very well so that everyone knows what the second element of the timer array actually corresponds to. Depending on your application, a cluster may be better so that each timer can have a name specified.

Message 2 of 8
(1,037 Views)

@Mina55 wrote:

How could I create an array of timers which I can deal with every timer inside this array individually? For EX. (I need just to reset the timer in the second element of the array and keep the other elements running) I hope my idea is clear and am looking for help.

 


No, it is not clear at all.

 

Where is "this array" and what does it represent? What are the various operations on each timer besides "reset" (e.g. start, stop, pause). How does the front panel look like? What is the purpose of the timers?

0 Kudos
Message 3 of 8
(998 Views)
Solution
Accepted by topic author Mina55

See if this can give you some ideas.

 

altenbach_0-1705348881229.png

 

Message 4 of 8
(990 Views)

Thanks it helped 

0 Kudos
Message 5 of 8
(965 Views)

My question was too simple I just wanted to have an array of timers that I could reset (Just reset) any one of them individually depending on a certain action if it got triggered or not (true or false) not with a push button and this is a part of a big code 

0 Kudos
Message 6 of 8
(963 Views)

@Mina55 wrote:

My question was too simple I just wanted to have an array of timers that I could reset (Just reset) any one of them individually depending on a certain action if it got triggered or not (true or false) not with a push button and this is a part of a big code 


Fortunately, LabVIEW logic does not care at all where a boolean comes from (front panel control, result of some operations, digital input, etc.). As long as the "dataflow" is right, things will work the same.

0 Kudos
Message 7 of 8
(951 Views)

Yes it gave me some insight into what should I do further some minimal things that I could do on top of your work that I will make the timer value as an input and once the elapsed time gets equal to the timer value it should auto-reset

Thanks a lot for giving me the main idea👌

0 Kudos
Message 8 of 8
(934 Views)