LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error code 97 while using active x tree

Hi
I have attached a Vi, when i run this vi i get the error code 97. Whichinfact is happenning in the property node of the tree in the subvi present in the while loop.
0 Kudos
Message 1 of 2
(2,605 Views)
The problem is that you're asking for the selected item in the tree before the user has selected anything. As a result, the "Selected Item" property is generating a null reference, which won't give you any valid properties or methods.

I figured out was wrong by right-clicking on the error cluster and choosing "Explain Error" to get more info about code 97; the explanation mentioned a null reference.

What you need to do is filter out any 97 errors at the "Get Selected Tree Item" level. Then your loop executes without error when nothing is selected and returns the desired result when an item is selected. Attached is an example of such a modification.

Hope it helps,
John Lum
National Instruments
0 Kudos
Message 2 of 2
(2,605 Views)