Showing results for 
Search instead for 
Did you mean: 

change Boolean state when switching between cases

I have a case structure with a true and false case.  In the false case I have two boolean I can turn on and off by clicking on them.  When changing to the true case I disabled the two booleans using a property node.  However when switching to the true case the booleans are disabled and remain in their last state, i.e. if they were true (on) in the false case, they remain true (on) in the grayed out disabled false case.   How do I change the state of the boolean in addition to disableing it.  i.e. if in the false case the boolean is in the true state (on) and I switch to another case the booleans are disabled using the property node and return to the false (off) state?  I have attached a example vi.

Thank you for your help.

0 Kudos
Message 1 of 4

You have to do two things:
1 - insert a time delay so that the CPU can take a break
2 - in the "true case" insert 2 variables (for both the controls) when a "false" constant.

See the attached file.
Software developer

Message 2 of 4
Jorge,  Thank you for your help. 


0 Kudos
Message 3 of 4

Jorge already gave you some useful advice, but I would really recommend that you rethink your approach.

Here are some points:

  • I am not sure why you place the booleans inside the case structure.
  • You song and dance is just an "invert" (see picture). Even better leave it all out and swap the contents of the two cases!
  • There is no reason to constantly spin the loop writing the same properties over and over. It is sufficient to recalculate when one of the controls change. Use an event structure!
  • You can eliminate the second switch by placing the diagram constants in the two cases.

Attached is a quick draft using events to duplicate your existing functionality. See if it gives you some ideas. 🙂

Message Edited by altenbach on 02-03-2008 02:23 PM
Download All
0 Kudos
Message 4 of 4