LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Time Resets

Solved!
Go to solution

This picture shows the possibility of resetting the elapsed time with a button. I tried using a for loop to have multiple buttons but the time does not work. Is the problem with the Timing Subvi? Would it be best to subtract Get Date/Time in Seconds Subvi?

CLD Certified 2014
0 Kudos
Message 1 of 6
(3,251 Views)

Please post your VI along with a little better description what you are trying to do.  What buttons/multiple buttons do you have?  What is their meaning?  What is it you are trying to accomplish with your code?

0 Kudos
Message 2 of 6
(3,221 Views)

I created this vi to demonstrate what I would like to have happen. The first button works what I would like but when I tried to use a for loop of 8 iterations, only the first button works.

CLD Certified 2014
Download All
0 Kudos
Message 3 of 6
(3,181 Views)

Here is another attempt. I tried to make a elapsed time for each separate button. This seemed to not work either.

CLD Certified 2014
0 Kudos
Message 4 of 6
(3,163 Views)
Solution
Accepted by topic author ADrexelDragon

How is it not working?

 

Your 3 state button confuses me.  The buttons say On, Off, Reset.  But your button states are On, Off, Idle.  Then that translates to code where you only compare the Button state to On.  But also have another array of Constants where it is an 8 element 1-D array of 0's and 1's.  (What do those mean?)  But when you make any changes  where any item in the array is =0, then you change the whole array to 1.  And if any button state = "On", then you change that entire array to 0's.  I would think you'd be working on those individually for each button.

 

Why are you taking a 3 state button and turning it into two different comparisons "On" or not, and a 0 or 1?

 

Also, since you initialize your cluster with a 0 time constant, your later subtractions just give you the current time, rather than an elaspsed time since a particular point in time.

 

I'd recommend taking a step back and flowcharting how you want the logic of your code to go.

0 Kudos
Message 5 of 6
(3,156 Views)

All I am trying to do is make buttons control elapsed time. I am trying to create this without having to use 8 different time SubVis. 

CLD Certified 2014
0 Kudos
Message 6 of 6
(3,150 Views)