LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Error 1077 when asking for 8th row of Tree Control with 17 rows

Solved!
Go to solution

Attached is a screen shot of a portion of my App where I have asked a Tree control for the NumRows and feed that into a For Loop and set the ActiveItemRowNumber of the same Tree Control equal to i. You can see from the Probe that the Tree Control says it has 17 Rows, but gave me an Error 1077 when I asked for the 8th row. 

 

I am trying to iterate through all of the Rows in the Tree, looking in one column (column 9) for a String match so that I can change the value in another column (7) in the same row.

 

Why do I get an Error 1077 when I set ActiveItemRowNumber to 8 in a Tree Control where NumRows=17 ?

 

How do I iterate down a column of a Tree Control looking in one column for a String match?

 

 

0 Kudos
Message 1 of 9
(4,445 Views)

Why can't I change the ActiveItemRowNumber property of a Tree Control equal to any visible Row within NumberRows range?

 

How can I tell what the valid range is for ActiveItemRowNumber of a Tree Control?

0 Kudos
Message 2 of 9
(4,438 Views)

Is this a BUG, in that there appears to be no way to know what is an acceptable Uppper Limit for the value of ActiveItemRowNumber  in a Tree Control; or am I missing something ?

 

 

0 Kudos
Message 3 of 9
(4,411 Views)

I am unable to reproduce this behavior. You should copy the for loop over to a new VI to isolate the code. If it does the same thing, post the code so others can try to reproduce the behavior.

 

Side comments:

  • Why are you using a control reference in one case, and then property nodes in another? That is inconsistent. 
  • You do not need to have separate property nodes to set two properties. Expand the one property node to select a new property. Properties are executed in vertical order, top to bottom. This is documented in the LabVIEW Help. 
  • You should wire your error clusters rather than relying on the automatic error handling of LabVIEW. This automatic error handling can be turned off in the options, so if you rely on it to catch errors you will not be able to do so if you run the code on another computer that has it turned off (such as mine).
0 Kudos
Message 4 of 9
(4,398 Views)

What do you mean by " You should copy the for loop over to a new VI to isolate the code." ?

 

Can you provide an example of this?

 

 

0 Kudos
Message 5 of 9
(4,393 Views)

Like this. No error is generated. Don't know why you would be using a reference for a control on the front panel. If using a reference to a control on a calling VI, then the error is understandable.

0 Kudos
Message 6 of 9
(4,382 Views)

@Dennis Knutson wrote:

Like this. No error is generated. Don't know why you would be using a reference for a control on the front panel. If using a reference to a control on a calling VI, then the error is understandable.


 

See, even your Tree_Set_Row.vi program that you attached gets the same Error 1077 if I delete all of the Items in the tree and then insert only 3 rows of data items into the tree before running your program. As soon as the ActiveItemRowNumber is set greater than 3, then an Error 1077 is generated.

 

It is not always the case that a Tree will have rows of data greater than or equal to the number of Rows visible (NumRows) in the Tree. Some rows may be blank without data.

 

It order to be able to iterate through the Tree down the rows of data, either of two things need to be true:

  1. ActiveItemRowNumber should not return an error if it is set larger than the number of rows of data present, OR
  2. there needs to be some property of the Tree Control that provides the number of rows with data in the Tree. I haven't found such a property of the Tree Control that would give this number.

So, my questions still stand:

  1. How do I iterate down the rows of data in a Tree Control using a For Loop and ActiveItemRowNumber that does not generate an error even when the rows of data is less than the number of rows visible in the Tree?
  2. How do I know how many rows of data are availabe in the Tree Control, so that I can iterate through them? What property provide this information?
  3. Does the Tree Control provide enough information (properties) so that you can iterate through the data, regardless of how much or how little data is loaded into the Tree Control?
  4. Is there some other property of the Tree Control other than ActiveItemRowNumber that can be used to iterate down the rows of data in a Tree Control?

Thanks for your assistance.

 

0 Kudos
Message 7 of 9
(4,371 Views)
Solution
Accepted by topic author dbaechtel

Now I understand what you want. Use the all tags property and the array size function on that.

Message 8 of 9
(4,357 Views)

@Dennis Knutson wrote:

Now I understand what you want. Use the all tags property and the array size function on that.


That seems to work well.

0 Kudos
Message 9 of 9
(4,347 Views)