LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView how to control a control using property node

Solved!
Go to solution

Hello, I'm trying to create dependency in my program, if one Boolean control is high, it sets other Boolean control to high, and that control may also need to set yet another Boolean control to high. Right now I'm using a bunch of OR gates to achieve that but wiring is becoming very messy. 

Like, in this example, I want my Boolean3 to enable Boolean2 or Boolean4 to enable the LED. I've tried using Disabled property nodes but they just enable/disable the control, not setting it to high. Besides, how would I approach this problem if I have, say, 7 controls that have Boolean2 as a dependency.  

Screenshot 2023-06-19 123719.png

0 Kudos
Message 1 of 18
(1,832 Views)

The property you are looking for is "value" or "value signaling" read the help to determine what property is appropriate for your situation.

 

Honestly if you could explain what you're trying to achieve on a higher level, we can probably come up with a better way as this screams "Rube Goldberg".

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 18
(1,810 Views)

You are following the motto of my colleague RTSLVU -- what you are engineering is definitely Ambiguous!  Before you worry about the (undescribed, untested, heavily nested, snarled) Boolean Logic, get your code working with a single Boolean and make sure it "does what you want it to do" (as opposed to doing what you tell it to do, which is often quite different ...)

 

Bob Schor

0 Kudos
Message 3 of 18
(1,781 Views)

Like I said, I want to establish a dependency. User controls Boolean buttons that enable case structures that do measurements. Some of the measurements require the use of previous measurements, so, if user only selects "Measurement 5" Boolean, I want software to enable "Measurement 1" and "Measurement 4". If user selects "Measurement 7", I want to enable "Meas1" and "Meas5". Rig ht now I implement it like this with OR gates

Screenshot 2023-06-19 172504.png

, but it's messy and I think there should be a better way.   

0 Kudos
Message 4 of 18
(1,766 Views)

@John32d wrote:

Hello, I'm trying to create dependency in my program, if one Boolean control is high, it sets other Boolean control to high, and that control may also need to set yet another Boolean control to high. Right now I'm using a bunch of OR gates to achieve that but wiring is becoming very messy. 

Like, in this example, I want my Boolean3 to enable Boolean2 or Boolean4 to enable the LED. I've tried using Disabled property nodes but they just enable/disable the control, not setting it to high. Besides, how would I approach this problem if I have, say, 7 controls that have Boolean2 as a dependency.  

Screenshot 2023-06-19 123719.png


The code image you show has no obvious connection to your description. There is only one OR gate, not a bunch. You already have a disable property, so resize that and add a "value" property wired to a TRUE constant.

 

You talk about a much more complicated scenario with seven controls but don't provide any details. Should "4" be TRUE and disabled if at least one of the seven is true? Only if all of the seven are true? Something else?

Is there still only one LED? Is "4" the only control that is dependent?

 

(And please don't do greedy loops that cannot be stopped!)

 

So go back to the drawing board and create the VI with the many controls, then describe the exact truth table you need that changes the dependent control(s). Then attach that VI here (i.e. not a picture!).

0 Kudos
Message 5 of 18
(1,765 Views)

@John32d wrote:

...but it's messy and I think there should be a better way.   


of course this is way to messy, so follow my instructions above and attach your actual VI and a description of the desired behavior. we cannot work with pictures!

0 Kudos
Message 6 of 18
(1,763 Views)

@John32d wrote:

Like I said, I want to establish a dependency. User controls Boolean buttons that enable case structures that do measurements. Some of the measurements require the use of previous measurements, so, if user only selects "Measurement 5" Boolean, I want software to enable "Measurement 1" and "Measurement 4". If user selects "Measurement 7", I want to enable "Meas1" and "Meas5". Rig ht now I implement it like this with OR gates

Screenshot 2023-06-19 172504.png

, but it's messy and I think there should be a better way.   


Yes there is. For instance if measurement 4 is dependent on measurement 1 and 2 being taken first. Then do not allow the user to select measurement 4 until measurement 1 and 2 are completed. 

 

Or if the user selects measurment 4 and measurement 1 or 2 have not been completed. Then take measurement 1 or 2 before you take measurement 4.

 

BTW: If your program architecture was a State Machine instead of One Big Loop either solution would be quite simple to implement without a bunch of convoluted logic.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 7 of 18
(1,751 Views)

Properties is just the properties.
however there is the properties name "Value" and "Value (signal)" for you as well.

The boolean set to high or low, programmer call it as value.

please set this as ANSWER or KUDO this post, if it help you.


0 Kudos
Message 8 of 18
(1,726 Views)

@RTSLVU wrote:

BTW: If your program architecture was a State Machine instead of One Big Loop either solution would be quite simple to implement without a bunch of convoluted logic.


I'm not sure you actually need a State Machine.  I think the OP can accomplish the desired effects with a simple Event Structure inside of a loop.  Initialize "4" to be disabled until 1 and 2 have been ran.  With the Event Structure, it is easy to react to each button individually and keep track of what measurements are complete in a shift register.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 18
(1,649 Views)

Have you though about using Tab Control to implement like a Wizard type of thing ? 

 

0 Kudos
Message 10 of 18
(1,634 Views)