From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a Counter on a stacked sequence

I am using a stacked sequence and am trying to insert a counter so that when I run the program continuously, the spreadsheet that the file is written to automatically indexs the data correctly. The way I currently have it is that I initialize an array at element 0 and run the program once.

 

But when I try to run the program on the continuous mode, the data always writes to element 0. Is there any way to put in a variable and have it count how many time the program has repeated in continuous mode so that the data is written to the various elements and does not overwrite previously recorded data.

 

Any help would be appreciated.

 

 

0 Kudos
Message 1 of 3
(2,408 Views)
You have two problems. One is the used of a stacked sequence structure. Many of us here consider it very bad style. Second is the use of run continuous mode. This should NEVER be used as the normal run operation. It should only be used for special debug cases. The correct way to do things is to place a while loop around your code. Then the problem of getting the iteration count is trivial.
Message 2 of 3
(2,406 Views)

I would recommend you take a couple of tutorials before you start programming in LabVIEW. What you need is a while loop whose iterative count you can use to index an array. Never use the Run Continuously button when you are running your application with LabVIEW unless you are debugging your application.

 

Go through the following document:

Getting Started with LabVIEW

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 3
(2,402 Views)