LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

updating time in an array

well I am trying to figure out an old project I was working on. 

 

the point is to update the system everytime you submit.

 

so say:

 

you hit submit and this line is added to the array:

 

    current Time:                  expired time:

7/14/09 10:00:00        7/15/09 10:00:00

 

and than I hit submit again a couple of days later:

 

    current time:                   expired time:

7/20/09 3:00:00          7/21/09  3:00:00

 

I hope this helps you understand

 

thank you,

       

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 11 of 32
(1,041 Views)

Your method was using initialize array to create ever growing arrays of the same value.

 

See attached.  This adds a new time to the end of each array.

Message 12 of 32
(1,034 Views)

yes that is the idea, but I need to be able to add months or hours or days right now all it adds is one day I figure I can put three controls months, days, hours and connect them to a merg so it knows how much to add to get the correct expiration time.

 

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 13 of 32
(1,026 Views)

See attached.

 

If you were just adding hours or days, you could easily do the math to add the correct amount of seconds.  But since a month has a variable number of days, then the date record will work for you, but you have to start with the current date, not a date record full of zeroes.

Message 14 of 32
(1,020 Views)

I see that, but the problem is that it needs to keep updating every index of the arrays:

 

 

exp:

 

say that this is the arrays:

 

    current Time                     expiration time:

7/15/2009 10:00:00     7/16/2009   11:00:00

7/15/2009 7:00:00       7/16/2009   8:00:00

7/15/2009 2:00:00       7/16/2009   3:00:00

7/15/2009 3:00:00       7/16/2009   4:00:00

7/15/2009 1:00:00       7/16/2009   2:00:00

7/15/2009 8:00:00       7/16/2009   9:00:00

 

when I hit the submit button say tomorrw at 7:00:00 the array will read:

 

    current Time                     expiration time:

7/16/2009 7:00:00        7/17/2009   8:00:00

7/16/2009 7:00:00        7/17/2009   8:00:00

7/16/2009 7:00:00        7/17/2009   8:00:00

7/16/2009 7:00:00        7/17/2009   8:00:00

7/16/2009 7:00:00        7/17/2009   8:00:00

7/16/2009 7:00:00        7/17/2009   8:00:00  

 

so it would update all of the array.  so it stays at 1 day, 1 hour, 0 months   

 

thank you,

 

  

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 15 of 32
(1,014 Views)
I'm confused.  You never really stated how the initial array got started to begin with.  You said you wanted to add a new value to the end of the array.  How does it even get to be different time values if you want your program to ultimately end up with the same time value?  Your original code did this and intialized the entire array to a new value and it was forever growing.  What is the logic behind that?
Message 16 of 32
(1,008 Views)

well current time comes from the current time so what ever the time may be the next set of arrays would update according to the current time arrays loke I was saying if I put in 0 months, 0 days, 1 hour the array should update both sets of arrays every time I hit the submit button like in the first vi I sent evere time you hit the submit button the first set of arrays update properly it is the second set of arrays I am having problems with it needs to update just as the first set of arrays update.

 

I hope this is a better explanation I am sorry if it is hard to understand. 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 17 of 32
(1,002 Views)
Message 18 of 32
(994 Views)

this is correct other than I do need to be able to add to it.

 

in other words the size of the array is not constant I still need to add to the array.

 

exp:

 

I hit the submit button:

 

     current time:                      expired Time:

7/15/2009  3:57:00         7/15/2009 4:57:00

 

then I hit enter again a day later:

 

     current time:                       expired Time:

7/16/2009  5:00:00         7/16/2009 4:57:00       //  this is from the previous day

7/16/2009  5:00:00         7/17/2009 7:00:00       //  this is the new item added to the array's

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 19 of 32
(992 Views)
Message 20 of 32
(990 Views)