04-30-2021 12:09 PM
Greetings 🙂
I‘m doing a measurement using multiple instruments. I’m stuck in one implementation where I need to keep multiple controls enabled while some controls remain disabled. When I press the start button (turned ON), then enable and disable process will occur. After the start button is released (turned OFF), all controls should go back to the default state (enable).
For easy understanding, have a look at snippet, and the things that I’m trying to do are:
Firstly, when the start button is switched on (true case), all enabling and disabling will take place.
Secondly, input C will be disabled, and input A and B will remain enabled.
Thirdly, when the start button is switched off (false case), all controls will be again enabled.
Please need help on this,
Thanks. J
Solved! Go to Solution.
04-30-2021 12:19 PM
Use Disable Property nodes to enable/disable buttons.
04-30-2021 12:20 PM
Enabling/disabling controls is done via property nodes.
Sorry, I cannot see your entire code (posting by phone). Where is the top level loop?
04-30-2021 12:53 PM - edited 04-30-2021 12:54 PM
@ Yamaeda,
I know about the property node, but when I use that, my goal is not being fulfilled those three steps altogether (that I wrote before), e.g., when I disable buttons, it remains disabled even though I exit the application.
I guess I am messing up something where I need some help.
04-30-2021 01:03 PM - edited 04-30-2021 01:05 PM
@REDUANUL wrote:
I know about the property node, but when I use that, my goal is not being fulfilled those three steps altogether (that I wrote before), e.g., when I disable buttons, it remains disabled even though I exit the application.
I guess I am messing up something where I need some help.
All you have attached is a useless code fragment which runs once and completes (I really hope you are not using continuous run mode!). Where are the "multiple buttons" you mention in the subject? There is only one! Once you exit the application, "disabled" is no longer relevant. Enable the correct terminal states first thing when the VI starts instead, independent of their state in edit mode.
Where is your attempt of using property nodes? How do you "exit the application"? Where are the three steps? Are you sure your Boolean has a useful mechanical action? Why are the terminals inside the case structure? Where is the toplevel loop?
04-30-2021 01:12 PM
@ altenbach,
In this updated snippet I used property node but is there any good way to disable all controls (input B and C) except one button (input A)?
Actually, in my measurement project, I have more than 10 buttons where I need to use property nodes one by one which is pretty much a manual process.
04-30-2021 01:20 PM - edited 04-30-2021 01:20 PM
Input A is not a button. They are all numeric controls.
You can build an array of references, and wire those references to a For Loop and put the property node inside that.
04-30-2021 01:22 PM
@REDUANUL wrote:
Firstly, when the start button is switched on (true case), all enabling and disabling will take place.
Secondly, input C will be disabled, and input A and B will remain enabled.
Thirdly, when the start button is switched off (false case), all controls will be again enabled.
So, in simpler words, A and B are always enabled and C should depend on the boolean. Here's a simple code fragment to do just that:
Note that properties only need to be written when they change not with every iteration of the toplevel loop.