LabVIEW Idea Exchange

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

Create reference in a new vi if scripting is enabled

Status: New

Often times I need to change a property of something in labview that seems to only be available through a property node. And often I don't want to do it during run time just once at development but I find it really hard to get references to some objects and I want them in another VI that I can run real quick to set the property and then be done. If you have the option enables that shows labview scripting property node options and invoke nodes, can under create there be a  Create reference in a new vi. And if you click it you get a new VI with just a ref that you can then do whatever you need with it. And please make this work for anything that has a property or method related to it. I have some tools that I wrote that can kind of do this but I am sure it is not a good way of doing it (but it is the best I have got).

15 Comments
tshurtz
Member

I think I can work with that. Thanks.

wiebe@CARYA
Knight of NI

There's the UidToObjRef function 😊.

 

Not pretty, but it works and it is there right now.

 

EDIT: didn't expect this one to cross...

tshurtz
Member

I don't suppose you have any methods for creating a Reference constant of the right type to be tied into the "to more specific class" function tshurtz_0-1586900603693.png based on a ClassName or ClassID you get out of a generic reference?

 

EDIT: I just found the method SetType for a ClassSpecifierConstant. of course I have to get the ref to that constant which isn't easy (my whole reason for doing this exercise. Maybe I just need to make it recursive Wink Wink

 

 

 

AristosQueue (NI)
NI Employee (retired)

> methods for creating a Reference constant 

 

Create one using the New VI Object node. Then set its type.

I think this should do it:

Ref.png

I haven't used it... I assume that IDString is what you would get if you call ClassName on your GObject refnum.

tst
Knight of NI Knight of NI
Knight of NI

I believe this does basically what you want - https://lavag.org/topic/20839-ad-hoc-vi-scripting-shortcut-menu-plugin-easily-manipulate-selected-it...


___________________
Try to take over the world!