LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Scripting - Input for style in "New VI Object" function

I am trying to create a new node programatically using "New VI Object" function and it requires ''Style'' as an input. If I create a constant for that terminal it creates a ring constant but some of the styles are missing. For example, I could not find the style for "TDMS Advanced Close" function(It is available in palette).

How to find this style ID for each node?

I tried reading the style property of the node but it is giving string as an output. Is there any way to convert this string to style in numeric(U32)? 

 

I have attached the images showing 'Style' ring constant values and "TDMS advanced close" function in palette.

 

Thanks in advance.

Download All
0 Kudos
Message 1 of 3
(3,326 Views)

I'm not sure if there's a direct way to find this, or whether something is or isn't in the list, but here are a couple of options:

 

  1. Iterate over all the values not in the list and log those which don't return errors. I would not be surprised if this will crash LV.
  2. If all else fails, create a VI with the function you want and copy it from that VI rather than attempting to drop it. This is generally a useful trick in scripting - if possible, make a copy of something rather than creating it in code, as it's almost always simpler.

___________________
Try to take over the world!
Message 2 of 3
(3,302 Views)

@tst wrote:
If all else fails, create a VI with the function you want and copy it from that VI rather than attempting to drop it. This is generally a useful trick in scripting - if possible, make a copy of something rather than creating it in code, as it's almost always simpler.

Yup this is what I was going to suggest cause I knew it would work.

0 Kudos
Message 3 of 3
(3,224 Views)