10-27-2020 10:43 PM
Can I add a new boolean by clicking a boolean ?
I'll be appreciated if you attach a sample code.
Thank you.
10-28-2020 12:22 AM
You can change the visibility of an existing booleans or add new elements to a booleans array.
You can add booleans using scripting, but that's editing.
Can you explain what you are trying to do?
10-28-2020 02:44 AM
I'll pick a point of screen with mouse and then a new booleans will appear at the point.
The point is that I need to add more than 100 booleans.
How can I do that?
10-28-2020 03:27 AM - edited 10-28-2020 03:37 AM
Can you explain the purpose? A boolean is just a logic value. Do you want to add a boolean control or indicator?
Adding a boolean to the front pane is pretty useless unless that boolean has a function and is wired to the rest of the code. You cannot change code while running.
Maybe all you need is a 2D picture indicator where you would draw things as a function of mouse click.
Or you could have a 2D array of booleans (Array container transparent, FALSE state transparent, TRUE state looking like the boolean you want.)
10-28-2020 03:30 AM
@RingRoller wrote:
How can I do that?
Check out the example browser for VI-Scripting. You should find scripts like these:
https://forums.ni.com/t5/LabVIEW/Create-Control-From-Reference/td-p/1539816?profile.language=en
http://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/scripting_adding_objects/
However, as @altenbach wrote, these can only be used for editing. Most of them cannot be used on running VIs. For example, check this function: http://zone.ni.com/reference/en-XX/help/371361R-01/lvscript/vi_create_from_data_type/
In the "Remarks" section, look for "Settable when the VI is running" and "Available in Run-Time Engine".
If You could expand on why, when and where You want to create these 100 booleans, You may get advice for other solutions.
10-28-2020 03:37 AM
@altenbach wrote:
Or you could have a 2D array of booleans (Array container transparent, FALSE state transparent, TRUE state looking like the boolean you want.)
Here's an invisible 2D array where clicking while the VI is running can make the boolean element appear and disappear.