LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
falkpl

Allow vi server reference type as case selector

Status: New

reference case structure.jpg

 

 

I have pondered this and not sure it is possible but it would be nice to allow using case structures to work with vi server references.  It is very tedious to test each type with a cast to more specific and the for each type and check for error (current method or itterating through the class hierarchy).

I know that subclasses pose an issue, I would like to see for the case structure to limit each case to select the highest level (ie g object) and the distince cases are error or any direct class child of the specified parent type class.

 

The Use case I see is for handling itterating through controls from an array of controls (if the control is a boolean do something different than if the reference is to a string control).

Could be very nice for scripting.

 

 

 

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
15 Comments
raphschru
Active Participant

wiebe@CARYA
Knight of NI

AFAIK, this could be implemented in the old case structure.

 

Once a reference is connected, the user would be allowed to fill in class name(s), autocompleted like an enum (containing all appropriate class names). This would allow a case to map to several classes:

Class In Case Structure.png

This would require the user to know the class names, but that's already the case for enums.

 

It might make sense to forbit a range of values, like Control..Constant.

rolfk
Knight of NI

A range would be pretty impossible. What ordering would you use for that?

 

- alphabetical? What a mess

- LabVIEW internal numeric class ID?You gotta kidding

- user selectable ordering? Perfect way to never ever have this implemented as it would be to much work.

Rolf Kalbermatter
My Blog
drjdpowell
Trusted Enthusiast

It's a class hierarchy, so one uses parent classes rather than ranges.

wiebe@CARYA
Knight of NI

Sure, no ranges then...