LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I set boolean text property on a button programatically?

Lynn queried;
 

Was this change to captions in the newer versions an improvement?!? Or was there some problem with the previous versions which required a fix?

 
To the best of my knowledge it was simply a change that resulted from a previously un-defined behaviour being defined in a way that did not anticipate our needs.
 
Search on the error code, it was mentioned somewhere.
 
Ben 
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 17
(3,138 Views)

Re: I have been unable to find a way to take a default boolean control right off the palette and create and show a caption or switch to multiple strings programatically.

 

In fact, th "Multiple Text String" property node can be enabled by installing the LabVIEW Scripting toolkit.

 

 

Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 12 of 17
(3,013 Views)

I found this thread while searching for an answer to a related problem...

Booleans such as the OK Button don't have Multiple Text String enabled by default.

If you are using Scripting to create booleans, there is an option to enable Multiple Text Strings, but it seems to throw an error.

Is this a bug with LabVIEW 2010 / Scripting or am I doing something wrong here??

0 Kudos
Message 13 of 17
(2,748 Views)

I usually create a cluster containing all my references so that their data types are preserved.  Alternately, you can use To more specific class to coerce to the appropriate class when you use the references.

0 Kudos
Message 14 of 17
(2,745 Views)

Hi DFGray - thanks for the quick reply!

The class of the reference is ok - I am using 'to more specific class', and all the other boolean specific properties are working.

The only one that's throwing an error is when I try to enable (or disable) Multiple Strings.

 

I have thought of a workaround though - instead of my script creating generic Boolean controls, I will try to create boolean controls based on a template, and ensure that Multiple Strings is enabled in that template. This might work, hopefully... 🙂

 

(I still think it's a bug in LabVIEW though)

0 Kudos
Message 15 of 17
(2,741 Views)

If I remember correctly, some boolean control styles do not support multiple strings.  Try creating the boolean with a different style.  I will admit it has been awhile since I did this, so I could be wrong.

0 Kudos
Message 16 of 17
(2,738 Views)

Here's another 'workaround' 😉

It seems that LabVIEW only throws an error once! If you try the same thing again, it works ok the second time!!

It's not exactly logical so don't ask me how I discovered it!

 

See the image attached.

At probe 18, there is no error.

Then the error occurs (code 2) after the first Property Node. I clear this error using the Clear Specific Error vi (a very handy VI located in vi.lib\addons\_NISVFA\_Shared subVIs\Common\svc_Clear Error Cluster for Specific Code.vi)

When I use the same Property Node the second time, there is no error and the Boolean is updated properly!

 

I tried this in LV 8.6 and it shows the same behavior.

Those LabVIEW guys at NI have a sense of humor alright! 🙂

0 Kudos
Message 17 of 17
(2,733 Views)