From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace cluster with class?

My application my application has grown to the complexity that it would make sense to start using object-oriented features. In particular, there is one cluster that appears throughout the program that carries my output file reference and some related information.

I created a class. I tried to global-replace the cluster with the class – knowing that I would have to replace a lot of accesses with accessors. But the global replace just shows a blank if I select my class as the replacing object – and instead of replacing all, it only replaces the first one.

If I have to do this all by hand it will be prohibitive. Is there any way to replace those cluster controls and indicators in my subVIs with class things, throughout?

0 Kudos
Message 1 of 2
(1,940 Views)

Of course, we can't "see" your project (because you didn't post any code), but I'm guessing that one or more of the following "Good LabVIEW Practices" was not followed:

  • All of the LabVIEW code for a particular "project" should be "contained in" (which means "referenced by") a LabVIEW Project (.lvproj) File.
  • All User-Defined Clusters should be converted to a TypeDef, and the TypeDef used throughout the Project.

With these two steps, it should be a very simple process to create a Class that incorporates the TypeDef and turn the VIs that currently process the Cluster into Methods of the Class.

 

Bob Schor

0 Kudos
Message 2 of 2
(1,912 Views)