LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
cy...

Not CCTV (class, cluster, typedef, variant)

Status: New

I need "something" that is flexible and not necessarily defined during development... can be expanded or superseded over versions without breaking VIs.

 

currently using map, with main VI setting the keys and values and called VIs/subVIs processes only the keys specified (with default values) within the called VI itself. additional checks are required to prevent illogical or erroneous conversions during execution

 

something simpler/more elegant would be nice... the current ones are too "predefined" or "required to be defined'

 

any ideas?

CY (expired CLAD)
6 Comments
wiebe@CARYA
Knight of NI

You'd need to establish more rules.

 

Technically, you can have things that don't need to be defined or checked. It's just that you can't do anything with those objects 🙄.

 

Things will always need to be either defined or undefined, implying additional checks are required to prevent illogical or erroneous conversions during execution.

 

Sounds like interfaces might help. Put a LabVIEW class type in the map. This will accept any class, incl. future ones. At run time, cast to the desired interface, and if the class implements the interface, it will work. The classes don't need to be in the same hierarchy.

 

IMHO, Interfaces cover:


@cy... wrote:
  • flexible and not necessarily defined during development...
  • can be expanded or superseded over versions without breaking VIs.
  • something simpler/more elegant

cy...
Active Participant

@wiebe thanks for the feedback, do you mean the class as the value in the map? I am unfamiliar with interfaces, is there any links that I can refer to (too clutter-y if search interface as term)

 

reason I used maps with string is due to configuration files, as a workaround to configure the predefined cluster within the called VI to offer some flexibility to impose some caller configurations over the called VI's default configurations

 

*perhaps NI can offer some booster courses to past trainees to keep them up to date... 😁 complimentarily 

CY (expired CLAD)
wiebe@CARYA
Knight of NI

Searching for "class interface" gives slightly less cluttered results.

 

This is the must read on interfaces: LabVIEW Interfaces: The Decisions Behind the Design - NI Community.

 

Yes, a map with keys vs LabVIEW class objects was what I meant. But there's little to go on. It could be totally off.

 

I usually pass (my own) config file class to classes coming out of class factories. Each module can do with the config file as it pleases, or it can be more restrictive (e.g. only read). In fact, my config file library can read\write classes from \to a config file, like a double, string or int. Provided it's formatted correctly, of course.

AristosQueue (NI)
NI Employee (retired)

CY: I have no understanding of what you're asking for. Can you post a picture of use case?

cy...
Active Participant

@wiebe thanks for the advise, after going through the YT recorded session by AQ, interface seemed like the thing I am looking for. I would have just missed it by 1 version for my 2019 project, I didn't use OO for that project because it lacked flexibility in terms of development and future expansion of the application and its plugins. 

 

@AQ seemed like interface can offer all that I asked for, if only I knew of it earlier 😅 thank you for the great presentation on interface 👍

CY (expired CLAD)
AristosQueue (NI)
NI Employee (retired)

Glad I could help.