NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Aki_h.
Posts: 8
0 Kudos
Accepted Solution

Index Not Set Correctly

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 

Active Participant nyc
Active Participant
Posts: 1,568
0 Kudos

Re: Index Not Set Correctly

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

Knight of NI
Dennis_Knutson
Posts: 29,306
0 Kudos

Re: Index Not Set Correctly

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.

Member
Aki_h.
Posts: 8
0 Kudos

Re: Index Not Set Correctly

[ Edited ]

Hi,

 

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

 

Aki

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page