LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strictly Type Constant Refnum

I'm going to say that NI hadn't thought through all the consequences of enabling strictly typed constants and doesn't show "Include Data Type" for constant references of any type.  I don't know if strictly typed constants are officially supported, so I don't know whether this should be considered a bug or not.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 23
(1,549 Views)

@billko wrote:

It might not be possible, since having a strictly typed constant is only enabled by a special flag


Which flag are you talking about ?

The closest I know is "EnableStrictTypedefConstantConfiguration", but this is about typedef'd constants on the diagram, which is different from strictly-typed constant refnums.

 

Out of curiosity, I have tried to merge the type code of a strictly-typed control refnum with the type code of a generic constant refnum, then using "Flattened String To Variant" and "VI.Create from Data Type" to create a chimaera data type that would hypothetically be a strictly-typed constant refnum, but without success. The additional type info added to the constant refnum is simply ignored =(

 

So sadly I think it is not possible

 

I guess you want to set the class of the Affected Items of your plugin to a specific strictly-typed constant to avoid further filtering on the data type ? Is it a matter of performance for the plugin ?

0 Kudos
Message 12 of 23
(1,513 Views)

@raphschru wrote:

@billko wrote:

It might not be possible, since having a strictly typed constant is only enabled by a special flag


Which flag are you talking about ?

The closest I know is "EnableStrictTypedefConstantConfiguration", but this is about typedef'd constants on the diagram, which is different from strictly-typed constant refnums.

 

Out of curiosity, I have tried to merge the type code of a strictly-typed control refnum with the type code of a generic constant refnum, then using "Flattened String To Variant" and "VI.Create from Data Type" to create a chimaera data type that would hypothetically be a strictly-typed constant refnum, but without success. The additional type info added to the constant refnum is simply ignored =(

 

So sadly I think it is not possible

 

I guess you want to set the class of the Affected Items of your plugin to a specific strictly-typed constant to avoid further filtering on the data type ? Is it a matter of performance for the plugin ?


I have to admit I was pretty confused about what we were talking about.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 13 of 23
(1,496 Views)

You have a lot more options under "GObject" than I do in my LabVIEW installation. Are you using an LabVIEW ini key?


@paul_cardinale wrote:

paul_cardinale_0-1666027447038.png

 


 

Message 14 of 23
(1,482 Views)

I'm assuming you're using the SuperSecretStuff-key or something, since i don't have constants as a reference option.

However, it seems you can drop a .ctl in a static VI ref and type cast a GObject ref that way. Would that work?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 23
(1,460 Views)

@pauldavey wrote:

You have a lot more options under "GObject" than I do in my LabVIEW installation. Are you using an LabVIEW ini key?


What I see is:

 - VI Scripting ON to access scripting classes (light blue nodes) like Constants and other diagram objects + additional scripting methods and properties on "normal" classes.

 - INI Key "SuperSecretPrivateSpecialStuff=True" to access private classes (brown nodes) like Provider, LVTarget, CopyExpert, ... but these are hardly useful even for advanced scripting. If you add this INI key you will have cluttered menus for additional functions that might be useful only 0,0001% of the time.

0 Kudos
Message 16 of 23
(1,456 Views)

@paul_cardinale wrote:

It's easy enough to create a Refnum control for a strictly typed cluster control.

I want to create one for a strictly typed cluster constant.

Is that even possible?


I'm also not entirely sure what you want or how to test if it works.

 

Anyway, if creating a control is easy, creating a constant from it might work:

wiebeCARYA_0-1666080802753.png

This:

wiebeCARYA_1-1666080932606.png

 

Turns the strict (cluster) control reference to a strict (cluster) constant:

wiebeCARYA_2-1666080985297.png

 

Both are references to a specific cluster:

wiebeCARYA_0-1666082562247.png

 

 

If that isn't what you're looking for, I'd need some code for illustration...

 

Is this something you can create manually (as an example)?

 

 

Message 17 of 23
(1,445 Views)

"Creating a strictly-typed control refnum constant" is different from "Creating a strictly-typed constant refnum control".

 

In the first case the data type is a refnum of the Control class, in the second case the data type is a refnum of the Constant class.

Then you can effectively make a control or a constant out of these 2 data types, but this is not what it's about.

 

We are talking about an hypothetic strictly-typed constant refnum data type, which mimics the strictly-typed control refnum data type.

You cannot create this manually because it surely does not exist at all...

0 Kudos
Message 18 of 23
(1,427 Views)

@raphschru wrote:

"Creating a strictly-typed control refnum constant" is different from "Creating a strictly-typed constant refnum control".

 

In the first case the data type is a refnum of the Control class, in the second case the data type is a refnum of the Constant class.

Then you can effectively make a control or a constant out of these 2 data types, but this is not what it's about.

 

We are talking about an hypothetic strictly-typed constant refnum data type, which mimics the strictly-typed control refnum data type.

You cannot create this manually because it surely does not exist at all...


That actually helped.

 

Would have been a good first reply...

 

I hope you all see that this isn't that obvious.

Message 19 of 23
(1,417 Views)

@raphschru wrote:

You cannot create this manually because it surely does not exist at all...


I agree.

 

It's Sisyphean, at least in current LV versions.

0 Kudos
Message 20 of 23
(1,390 Views)