11-15-2005 06:34 AM
11-15-2005 08:11 AM
11-15-2005 11:16 AM
@kurt_come wrote:
Is true that...Every time I built a subvi, in a block with Local Variable, Labview produces reference.In this procedure Labview , create mistake, in subvi---> A correct sub Vi becomes a incorrect sub VI
Yes, it is true! LabVIEW must act this way whenever you create a subVI from a code segment that contains local variables.
A local variable is just that: local to the current VI. It refers to a control or indicator on the current diagram, it cannot point to something in another subVI.
If you create a subVI containing a local variable, LabVIEW is nice enough to replace the local variable with a reference to the object of the local variable to retain your original code functionality (kudos to the LabVIEW developers!) instead of breaking the subVI. For all practical purposes, the functionality of your code is retained. The reference points to the original object on the calling VI.
LabVIEW does not create a "mistake" at all!
From your code, it looks like you haven't been programming in LabVIEW for more than a very short time because it contains many mistakes that beginners typically make, especially if they are only familiar with text based code . You need to use sequence structures and local variable only sparingly or not at all, they are rarely needed.
LabVIEW is all about data flow! Once you truly grasp that concept, you'll never go back to text based code. 😄
As with anything new, there will be an initial activation barrier that needs to be overcome. For guidance, you've come to the right place. Ask questions and listen to the answers. There is no need to bark at us. 🙂
Back to your code. It is still not clear what your program is supposed to do. Which elements of the array do you want to compare, depending on the value of the index? Should the boolean be true if (1) all comparisons are true or (2) at least one comparison is true? Do you possibly only want to compare the single array element at index (but why would you use a FOR loop then?)?
11-16-2005 09:18 AM