LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Index Not Set Correctly

Solved!
Go to solution

Hi everyone,

 

I am an EE intern using LabVIEW to create a program to control and retrieve data from a testing pedestal for antennas.  I am using LabVIEW 2011 Version 11.0.1.

 

I am currently having trouble with the index portion of the LabVIEW program I am currently creating.  Right now, on the bottom left of the VI, I have a case structure that begins counting whenever the "Start/Stop" button on the front panel is un-pressed(when the VI stops acquiring data) so that the button is now on "stop"(sorry if my description is confusing).  However, the number stored in Index always seems to start at 2 and not at 0, where I want it to start.  Consequently, the data stored in the array Data Stored always begins storing data from index 2.

 

My question is, what is the problem with the way I am counting for the Index, and how can I fix this so that the array Data Stored will always begin storing data from its 0 index?

Thank you,

 

Aki 

0 Kudos
Message 1 of 4
(2,226 Views)

For future reference, you might find http://www.ni.com/academic/students/learnlabview/  useful

0 Kudos
Message 2 of 4
(2,225 Views)
Solution
Accepted by topic author Aki_h.

Your code is overly complex. In your true case, simply have a build array function where one input is wired to the shift register and the other input is wired to the new value. The false case would simply have the shift register wired through. Right click in the shift register and select 'Create>Constant' so that you start with an empty array. Get rid of everything else (Insert Into Array, the case statement with the index count, and each and every local variable.

0 Kudos
Message 3 of 4
(2,215 Views)

Hi,

 

I will try what you just told me. Thank you!

 

Aki

0 Kudos
Message 4 of 4
(2,214 Views)