LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous time in array

Example:

 

This is how the program operates now:

If put in the expiration time as:

month: 1

Day: 2

Hour: 4

 

it will output these to the current and expiration arrays:

Index[0] = 4/16/09  1:29PM         5/18/09  5:29PM

 

and than I put the expiration time as:

month: 0

Day: 1

Hour: 2

 

it will output these to the current and epiration arrays:

Index[1] = 4/16/09 1:30PM        4/17/09   3:30PM

 

now what I want it to do is update all indexes of the array as needed so when it turns 4/16/09 4:00PM 

the current and epiration arrays will read:

 

Index[0] =4/16/09 4:00PM        5/18/09  8:00PM

Index[1] =4/16/09 4:00PM        4/17/09  6:00PM

 

 

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 11 of 24
(893 Views)
does the example help?
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 12 of 24
(891 Views)

1... I don't know what you mean by "I have a program for expiration".

 

2... Hardwiring paths to files on your desktop (or anywhere else) is not the best plan you could have.

 

3...I don't know what you mean by "it is not continuous".

 

4... I haven't run it, but it looks like your program is designed to:

 

a... update the DATE and TIME indicators after every 200 mSec of inactivity.

b... update a shift reg with the current DATE/TIME record  at the same time.

c... When the OK button is clicked, you convert string controls for MONTHS, DAYS, HOURS to integers (why not use integer controls?)

d... You ADD those offsets to the latest DAT/TIME record, convert it  into a TIMESTAMP, and then into a DATE STRING and TIME STRING.

e... Append those two strings to the DATE and TIME arrays, read from the DATE and TIME files.

f...  Append the DATE and TIME indicator values to the CDATE and CTIME arrays, read from the CDATE and CTIME files.

g... Stops if the STOP button is clicked.

h... Rewrites the files (using a completely different file path constant, no less).

 

You'll have to explain what it is that you expect. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 13 of 24
(884 Views)

I have to append this data to a file so that it is not forgotten when I exit the program instead it is kept in a file and when the program starts it reads it and displays it.

 

the files should be reading and writing to the same file.

 

and what this program does is:

prints to the screen the current and expiration time it does not update it in real time I need it to update it in real time so that when I say the expiration is 2 days 5 hours it should print to screen under current and expiration 4/16/09 2:05PM           4/18/09  7:05.

 

this is good but I need the time to keep going so that when time is 4/16/09  9:00PM

 

it will print to screen:

4/16/09 9:00PM       4/19/09 12:05AM 

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

I was wondering if you could put an example of this up?

 

thank you, 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 15 of 24
(865 Views)
I think your problem is that you're not storing data in the most useful form for you.  If I've understood correctly what you need is a constantly updated list of times/dates that are a certain amount of time from now.  In that case what you should do is store in your array the amount of time until expiration, and then every time you need to update, loop through your array and recalculate the new expiration time from the current time.  Similarly your file should store not the current time and target time, but just the amount of time between the two so that you can easily load it and calculate a new expiration time.
Message 16 of 24
(857 Views)

well for that program it does need to update the actual time it is not a count down to expiration.

 

thank you, 

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

I think this is what you want, but your writing makes it very hard to understand what you are trying to accomplish.

I've removed the "Current Time" array since it seems that you always want the Current Time to be the actual, current time for every item in the array.

(Also, I modified the expiration time algorithm per my suggestion in your other thread since otherwise you'll eventually have a problem with year boundaries.)

Message 18 of 24
(836 Views)

I have tried to put a get time in seconds vi in the front and Of course a timestamp is not a cluster so that did not work what I figured may work is the replace array element vi but I can not figure out how to make this work.

 

are there example of this? using time as the object?

 

Thank you,

 

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 19 of 24
(832 Views)
yes pretty much but it does have to have current date updating as well just like you have epiration date updating the current date hase to update along with it.
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 20 of 24
(829 Views)