10-17-2022 01:00 PM
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.
10-17-2022 06:39 PM - edited 10-17-2022 07:17 PM
@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 ?
10-17-2022 09:31 PM
@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.
10-17-2022 11:00 PM
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:
10-18-2022 03:09 AM
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?
10-18-2022 03:12 AM - edited 10-18-2022 03:21 AM
@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.
10-18-2022 03:23 AM - edited 10-18-2022 03:42 AM
@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:
This:
Turns the strict (cluster) control reference to a strict (cluster) constant:
Both are references to a specific cluster:
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)?
10-18-2022 03:42 AM - edited 10-18-2022 03:56 AM
"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...
10-18-2022 04:03 AM
@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.
10-18-2022 04:46 AM
@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.