In my application I need to increment a variable when a certain condition is met so I have a case statement which checks whether the condition is true then increments a variable. However the variable is increment for the entire time that the condition is met. How can I restrict this to only increment one time per occasion of the condition being true. I've tried while and for loops that execute only one time and nothing seems to work.
A simple way to do this is using a boolean variable that is set to true by your condition and then set to false inside the case where the variable is incremented. Check attached vi.
I have modified Paulo's example so that you don't use local variables. This should be a more efficient approach since the local variables will make copies of the boolean.