04-17-2025 02:08 PM
Trying to increment +1 after Boolean variable toggle.
It should be simple but I got stuck because I need to increment when 1 goes 0 and 0 goes to 1.
Like detects the edge of pulse.
Thanks,
Jo
04-17-2025 03:11 PM
You don't have a lot of details here but it kind of sounds like you need to add an event structure, with a "value change" event on a Boolean control, but with no other context to go on it could be something else that you need.
04-17-2025 09:48 PM
See Counter and Digital Edge Detector
There is a mistake in the falling edge loop. The constant should start with a false.
04-18-2025 01:35 AM
You can use a feedback node to compare current to previous. If the are not equal, add one to the counter.
Quick draft:
04-18-2025 05:55 AM
What is the source of the Boolean?
If it's hardware, you probably want a anti jitter strategy.
If it's a UI, you probably want to use an event structure
04-18-2025 12:40 PM
You can use the built-in Is Value Changed primitive, or any or it's variants, like the one supplied with the OpenG toolkit. There are differences, namely whether the first value received by the VI returns a True (NI's correctly does, OpenG's does not).
04-21-2025 02:58 PM
Sorry i didnt realized that more detailed explanation was needed.
I m reading Temp from the sensor. Temperature is going thru cycles, up and down.
Have a threshold that produces Boolean output.
Measuring time for True and False cycle.
Writing times for each cycle to array. Thats why I need increment.
I start looking to event structure, but I never did it before. Because examples might not work for this case.
Hope this clarifies the need.
Thanks,
Jo
04-21-2025 02:59 PM
Sorry i didnt realized that more detailed explanation was needed.
I m reading Temp from the sensor. Temperature is going thru cycles, up and down.
Have a threshold that produces Boolean output.
Measuring time for True and False cycle.
Writing times for each cycle to array. Thats why I need increment.
I start looking to event structure, but I never did it before. Because examples might not work for this case.
Hope this clarifies the need.
Thanks,
Jo
04-21-2025 03:21 PM