LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting: type specifier VI refnum

Solved!
Go to solution

I want to create some scripting tools to automatically create wrappers for existing class methods to call the method dynamically without the need to have a dependency to the class.

 

Something like this:

Example.png

 

but i'm having issues in generating the type specifier VI refnum.

If i create a dummy vi containg this code manually, and traverse the block diagram, it almost seems like the object doesn't fit in anywhere in the VI server model.

The classname is "ControlReferenceConstant" 

 

I tried numerous ways of generating said reference, but each time it tries to put an actual static VI reference to the VI, or throw some obscure error.

 

Anyone any ideas on generating this type reference?

0 Kudos
Message 1 of 5
(3,881 Views)
Solution
Accepted by Jorn_Deruyck

The only thing I can think of is to create Static VI Reference, then from it, create a constant.vi spec.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 5
(3,846 Views)

Thanks Paul!

Seems to do exactly what i want!

0 Kudos
Message 3 of 5
(3,837 Views)

I can't found that "StatVIRef" icon. Could you tell where is it?

 

Thanks a lot.

0 Kudos
Message 4 of 5
(1,314 Views)

@daniel.liu- wrote:

I can't found that "StatVIRef" icon. Could you tell where is it?


  1. Paul's attachment is a snippet, meaning you should be able to save the file and then drag it into a block diagram and you will get the original code.
  2. It's a property node linked to the StaticVIReference class. You can get it by dropping a property node, right clicking it and linking it to that class in the class hierarchy (which hides fairly deep in there, but gaining familiarity with it is a good thing for someone dealing with scripting, so I won't provide the full path).

 

The fact that you don't know that it's a property node or what a snippet is is an indication that perhaps playing with LV scripting is not for you at this point, as it requires both understanding how to write LV code and understanding how the LV code itself is built. What are you actually trying to do?


___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(1,287 Views)