LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LVOOP: display class as a cluster

Is there a simple way to display a class as the cluster on a front panel. To do member access is straight forward but that only gets you one member. What if I want to display the whole class as a cluster?

 

Thanks,

 

Norm

0 Kudos
Message 1 of 5
(2,578 Views)

Why would you want to do that using LVOOP?

 

If you use a Library and a cluster you can do what you want to do.

 

The benefits of LVOOP over a Library is dynamic dispatching which mean you (and LV) doe not know what is actually in the class wire/control until run time.

 

Otherwise use an accessor method and resize for all elements and write those to a "Bundle" that drives a cluster on the FP.

 

Ben

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 5
(2,568 Views)

Why are the accessor elements in alphabet order and the bundle in cluster order? Yes I know I can clean it up. I was hoping there was an easier way.

Display class as a cluster.png

0 Kudos
Message 3 of 5
(2,538 Views)

@Viper wrote:

Why are the accessor elements in alphabet order and the bundle in cluster order? Yes I know I can clean it up. I was hoping there was an easier way.

Display class as a cluster.png


It appears you copied out the class definition to create the type you are using for the Bundle by Name.

 

Quick tip that may be helpful

 

Drop a "Bundle" (not a bundle by name) and just wire from the accessors to the bundle and let the bundle adapt.

 

Right-click the top middle of the Bundle and do a "Create constant". THe new constant will get it definition from what you had wired.

 

Make the contant a type def ( you know how to do that)

 

Replace the instance on the diagram with the type def version.

 

Right-click the "Bundle and select "Replace" then navigate the "Bundle By Name".

 

I hope that helps somebody,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 5
(2,532 Views)

It would be possible to create an XNode that takes any object as an input, and outputs a cluster of its properties.  But it would be a lot of work, and I really don't see the point.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 5
(2,486 Views)