LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Methods of Populating Listbox Values

I learned early on that it's a good practice to only send data through wires (i.e. no property nodes or local variables). I've never really had a problem adhering to this practice until I started using listboxes. The only way I know to update the listbox contents is to pass the data into an "Item Names" property node which is referenced to the listbox. Is there a cleaner way to do this?

0 Kudos
Message 1 of 3
(3,051 Views)

No, that's right. In most situations you should try to avoid using property nodes / local variables for updating indicators/controls but there are times when it is necessary and this is one of those times. Some controls/indicators are populated with property nodes and the listbox is one of them (the tree control is populated entirely with property/method nodes!) - generally you're only populating the listbox on initialisation or periodically, rather than displaying real-time data in a tight loop which is where things start to fall over.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 3
(3,044 Views)

To clarify, you should avoid using the "Value" property node to update indicators and controls because it's tied to the front panel redraw sequence, so it dramatically slows down any loop that it's in.  It's tempting because it has the error cluster right there to enforce execution order.

 

For anything else you can use property nodes when needed.  If they are mostly one-time changes you shouldn't see any problems.  If there's a lot to do at once (i.e. toggle the "visible" property on 50 different front panel controls programatically, or whatever) then you can use the "DeferPanUpdts" (Defer panel updates) property of the front panel of the VI in question to turn off the updating while you make all of the changes, then turn it back on when you're done setting all of the nodes.

0 Kudos
Message 3 of 3
(3,016 Views)