05-30-2023 02:07 PM - edited 05-30-2023 02:20 PM
I am logging data from sensors and a balance every one minute. I need an array column which displays the Elapsed Time in minutes as below.The time starts at 0 min and increments 1 for every minute
Time
0
1
2
3
4
5
6
7
8
9
10
How can I implement this?
05-30-2023 03:03 PM
There are many ways to do it. You can just play around with Array and Comparison palettes.
05-30-2023 03:46 PM
Maybe you should consider changing your Forum "handle".
If you want to learn how to program, you almost have to try to write programs. Best to start with really simple things like creating a VI that "does something once a minute"...
Bob Schor
05-30-2023 09:11 PM
Yes...I can make it log data once every minute...but I am not sure how to log the elapsed time in minutes in an array
05-31-2023 10:00 AM - edited 05-31-2023 10:03 AM
@Labwizard wrote:
Yes...I can make it log data once every minute...but I am not sure how to log the elapsed time in minutes in an array
If the loop runs once per minute, you can calculate the time from the iteration terminal, no need to measure it.
(A loop time of 1 minute is a bad idea, because the controls will also only get read once per minute, so use a simple state machine instead where you conditionally append when the time is up.).
All you need is start with an empty array in a shift register and use build array to append the new element. If this is not clear, maybe start with a few basic LabVIEW tutorials.
In your case, the "time" is identical to the index of the logged value. Assuming you log every value to a file, all you need is also log the index. no need to built arrays in memory with redundant information.
05-31-2023 12:47 PM - edited 05-31-2023 12:49 PM
I just used an elapsed timer and divided the seconds by 60 and stored the values everytime another elapsed timer resetted at 60 seconds using a condition =0 & >=60 to a case structure.
05-31-2023 01:19 PM
If you know the loop rate, there is absolutely no need to measure relative time, ever.