01-05-2022 07:33 AM
Hi All,
Please check the attached vi, it's not working in false condition. please suggest the solution.
Thanks
01-05-2022 08:27 AM
You've coded it to do nothing when the switch is False; so that's how it behaves.
Also, it's badly coded: The loop spins wildly when the switch is False.
My suggestion is that you describe what you want it to do.
01-05-2022 09:58 AM
I would recommend to start with the learning resources listed at the top of the forum. Learn the basics of graphical programming and dataflow.
Some hints:
If the boolean is false, all you execute is an empty case as fast as the computer allows. The event structure can never execute and will queue up an infinite number of events, one with each change of one of the numerics.
Once the boolean is switched back to TRUE, all queued up events will fire, again as fast as the computer allows.
There is no obvious way to stop your VI. You can only abort.
Event structures should NEVER be placed inside case structures unless you can guarantee that they are reachable when needed.
Tell us exactly what the code should do as a function of user interaction. Maybe the case structure belongs inside the event case, e.g. if you want to prevent parallel updates of the numerics?
01-06-2022 06:32 AM
yes, I wanted parallel updates of the numeric control when boolean is true and independent numeric control when boolean is false.
01-06-2022 10:54 AM - edited 01-06-2022 10:54 AM
OK, so place the case structure (containing the local variables in the TRUE case and the FALSE case empty) inside the event as I already suggested. The event will fire on a value change, but only update the other control of the boolean is true.
01-06-2022 11:40 AM
Thank you, sir, Any other methods to do it.?
01-06-2022 11:43 AM - edited 01-06-2022 11:44 AM
@infent08 wrote:
Thank you, sir, Any other methods to do it.?
Yes, there are millions of other methods to do the same, but this is probably the simplest. Try to come up with at least five alternatives. A good exercise! 😄
(Why do you ask? Is there anything you don't like about the solution?)
01-06-2022 12:10 PM
sorry tried your solution but not able to do it . please suggest me other solution.
Thank you
01-06-2022 12:13 PM
@infent08 wrote:
sorry tried your solution but not able to do it . please suggest me other solution.
... then show us what you did and we'll fix it. It will work just fine!
01-06-2022 12:24 PM - edited 01-06-2022 12:36 PM
Maybe you haven't fully defined all required behaviors:
So far we have:
We don't know the rest: