LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

updating time in an array

yes I did this modification

 

thank you very much this question has bugged me a bit, I didn't think I was too far with my first VI.

 

 

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

the delta-t has to be the same from current time to expiration time

 

so if I say the current time is 3:41 and the expiration time is 5:41  it has to be able to keep the 2 hour delta-t

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 22 of 32
(1,283 Views)
The delta T is determined by the 3 controls of months, hours, and days.  That will only change if you go in and change the values in the controls.
0 Kudos
Message 23 of 32
(1,277 Views)

so there is no way to update the delta-t because my issue is this:

 

if I hit submit:

current time:                          expiration time:

7/15/09  3:00:00               7/17/09  3:00:00

 

and than I hit submit an hour later to add another current and expiration time:

 

current time:                          expiration time:

7/15/09  4:00:00               7/17/09  5:00:00

7/15/09  4:00:00               7/16/09  6:00:00

 

 

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

You're either adding requirements or not explaining them adequately.  The key for working on everything is defining your requirements clearly before you start working.  Mod4 is based on the mish-mash of requirements you had listed to date.

 

 

If you hit submit the first time, you must have had a 2 day time for the expiration.  Now you want to change the first row's expiration time to 2 day + 1 hour but the second row to 1 day + 2 hours?  That is a different delta T while in message 22 you said "the delta-t has to be the same from current time to expiration time".  There is no logic to what you are trying to do to each element of this array.

 

All the pieces of the puzzle are there.  You just need to figure out what you want your puzzle to look like.  Sit down, think about what you are trying to do.  Write it down.  Create a flow chart of how the data changes and how to step through each element of the array to modify it the way you want.  Once you have a flowchart or some pseudocode, you should then be able to translate that to LabVIEW code.

0 Kudos
Message 25 of 32
(1,258 Views)

I have done all these things my I have already done the last MOD but my problem is it every index of the array has to update so that if I say this has a 2 hour expiration than it stays a 2 hour expiration.  so pretty much the arrays have to stay in ramge the delta-t can not change (it must be 2 hours).

 

 

so pretty much how you had MOD3 but it is not a constant array I can still add to the array.

 

 

Message Edited by Harold Timmis on 07-15-2009 05:31 PM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 26 of 32
(1,255 Views)

each array index has to change according to thier expiration day so that it keeps the expiration day within the days you specify on the numeric controls.

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

ok I think this will explain my problem best I have added a picture that explains the program and my problem and also included the program so anyone can see for themselves

 

thank you,

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Download All
0 Kudos
Message 28 of 32
(1,211 Views)

Good Afternoon Harold,

 

Would an Insert Into Array work better in this case? I attached an example of what I am thinking.

0 Kudos
Message 29 of 32
(1,201 Views)

yes but like I said in the post before the time must update the delta-t 

 

it you look at the program and submit two types or more of medicines you will notice that the delta-t for the first index (index 0) will not update to the correct delta-t instead it will grow closer and closer to being even in time (or delta-t = 0).

 

exp:

 

I type in qwerty as the fist medicine after that I type in another medicine asdfgh

 

qwerty      7/17/09 5:28     7/18/09 5:28             // so it has a one day epiration  this is the error because it is now 5:30 not 5:28 so qwerty

                                                                            //  has a 23 hour 58 mins expiration which is incorrect becuase it should be a 1 day expiration.

asdfgh      7/17/09  5:30    7/18/09  7:30            //  so it has a 1 day and 1 hour expiration.

 

 what it should say is this:

 

qwerty      7/17/09 5:30     7/18/09 5:30           // so qwerty stays at a 1 day expiration

asdfgh      7/17/09  5:30    7/18/09 7:30

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