From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
Hi I'm learning about the use of parallel whiles for my program. Just can someone explain me why in the attached example, the delayed leds do not behave as they should. For example, if LED 1 has 500ms delay and LED 2 1000ms delay, LED 2 turns off first. But if LED 1 delay is higher than LED 2 delay, it works properly.
You have a race condition, because the upper loop will run a second time most of the time (after turning off the LED for a nanosecond) because the lower loop takes twice as long before resetting the switch. If you increase the upper delay to e.g. 600ms, your VI will work more reliably.