LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use treeview .net control

Solved!
Go to solution

Hi,

 

I've tried using .net ob to variant & variant to data, but getting following error:

 

Error 1 occurred at Invoke Node in .NET Object To Variant.vi->TestPanel.vi

Possible reason(s):

LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488:  Command requires GPIB Controller to be Controller-In-Charge.

Method Name: .NET:Convert Object To LabVIEW Variant

 

 

What may be the reason?

 

Thanks,

Shrini

0 Kudos
Message 11 of 15
(1,252 Views)
Can you upload your code?
0 Kudos
Message 12 of 15
(1,235 Views)

Hi,

 

Attaching my code here. I can able to display Text & Item Check status.

 

Thanks

Shrini

0 Kudos
Message 13 of 15
(1,229 Views)

Well, I never claimed to be an expert on the TreeView control, but a read of the MSDN documentation indicates that the Tag property is something different. When using the Add(string, string) method, that sets the Text and Name property of the TreeNode. The Tag property is left at its default, which is null. Thus, you can replace the Tag property with the Name property. I've attached a cleaned-up version of your code. A few things to note:

  • You should wire the error cluster through for-loops using a shift registers - otherwise you will lose errors from previous iterations.
  • You should close references at the end of your program.
  • You don't need to have to read the cound each time in the while loop, since the treeview isn't changing content.
  • Even though you have a 20msec wait in the while loop, the .NET interface will chew up processor usage in your loop. I'm assuming that code is for proof of concept. 
Message 14 of 15
(1,217 Views)

Hi,

 

Thanks a million for code modification & suggessions.

 

Regards,

Shrini

0 Kudos
Message 15 of 15
(1,206 Views)