キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

Can I add Boolean programmatically?

Can I add a new boolean by clicking a boolean ?

I'll be appreciated if you attach a sample code.

Thank you.

0 件の賞賛
メッセージ1/6
2,454件の閲覧回数

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?

0 件の賞賛
メッセージ2/6
2,418件の閲覧回数

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?

0 件の賞賛
メッセージ3/6
2,403件の閲覧回数

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.)

0 件の賞賛
メッセージ4/6
2,395件の閲覧回数

@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.

0 件の賞賛
メッセージ5/6
2,393件の閲覧回数

@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.

0 件の賞賛
メッセージ6/6
2,390件の閲覧回数