LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing minutes in an array

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?

0 Kudos
Message 1 of 7
(902 Views)

There are many ways to do it. You can just play around with Array and Comparison palettes. 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 7
(861 Views)

Maybe you should consider changing your Forum "handle".

  • Do you know that LabVIEW treats "time" as a data type, has Controls and Indicators just "made" for Time, and has an entire top-level Palette for Time functions?
  • Do you know how to do things "over and over again until I say 'Stop'"?
  • Do you know the relationship between milliseconds, seconds, and minutes?
  • Have you tried to make a little VI that would count "1, 2, 3" at the rate of 1 per second?  [This is easier to see in action].  If you got this to work, do you know how to make it run at the rate of 1 per minute?

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

0 Kudos
Message 3 of 7
(847 Views)

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

0 Kudos
Message 4 of 7
(819 Views)

@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.

 

 

0 Kudos
Message 5 of 7
(779 Views)

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.

0 Kudos
Message 6 of 7
(758 Views)

If you know the loop rate, there is absolutely no need to measure relative time, ever.

0 Kudos
Message 7 of 7
(752 Views)