09-11-2010 11:38 PM
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?
Solved! Go to Solution.
09-12-2010 09:25 AM
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?
09-16-2010 03:40 PM - edited 09-16-2010 03:41 PM
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.
09-17-2010 10:42 PM - edited 09-17-2010 10:44 PM
Here is another attempt. I tried to make a elapsed time for each separate button. This seemed to not work either.
09-17-2010 11:22 PM - edited 09-17-2010 11:24 PM
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.
09-17-2010 11:52 PM
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.