LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to implement SIZE TO TEXT for Relay action constant and publish id constant using NI LabVIEW Scripting

Solved!
Go to solution

HI, 

Iam developing VI's using NI scripting features , In the below picture shows developed VI After scripting code ran. That constants contains morethan 10 letters but showing only 3 to 4 words.

If you click manually on the Constants you will get size to text option But by using Labview scripting that option is  not available and can't able to get this option. What I need is , If you run Scripting code for the below constants to be created, Size to text has to happen itself in the newly generated VI 

I need solution for the Size to text feature implementation Using Labview Scripting for the following VI's constants.

Simhachalam_0-1702639574976.png

 

Thank you,

Simha

 

0 Kudos
Message 1 of 5
(1,028 Views)
Solution
Accepted by topic author Simhachalam

Hi Simhachalam,

 

Unfortunately, there is no direct way to resize a constant array to its widest element.

 

Check out VI "Size Array Constants To Contents.Exec In User Context.vi" in built-in right-click plugin "Size Array Constants to Contents". It has a code that can size any constant array to its widest element:

raphschru_0-1702649700226.png

 

It proceeds by creating a temporary constant of the same type as the array element, then trying each value of the array to find the one that takes the biggest width. It then moves the constant inside the array and rewrite some cosmetic properties like the number of rows/columns and scrollbar visibility back to their initial state.

 

Regards,

Raphaël.

Message 2 of 5
(985 Views)
Spoiler
 

Hi Raphaël, 

 

Thanks for your time and for the content you shared. I will check those VI's you had shared.

If you don't mind, can you share me the downgraded version of the code (LabVIEW 2019 or 2020 fine), You sent me the latest LabVIEW version code. I tried to check it. For me the code was not opening since it is higher version than my current version. 

 

Regards

Simha

 

 

0 Kudos
Message 3 of 5
(971 Views)

You can also find it in your own installation of LabVIEW under "<LabVIEW 20xx>\resource\plugins\PopupMenus\edit time panel and diagram\Size Array Constants To Contents.llb".

Message 4 of 5
(958 Views)

Thank you very much Raphaël, I had implemented the same, it works, Good job

0 Kudos
Message 5 of 5
(934 Views)