03-30-2014 12:11 PM
I have attached a picture of a section of my code
2 buttons on the left (Status 1 and Status 2)
Other sections control the Numeric part, when set to 3 I want the LED (Alarm 1/2) to blink every 250ms, when set to 2 I want it to blink every 1000ms
I believe this is the appropriate way of doing this, (if there is a better method, please let me know too)
However the problem.......
When Numeric 1 is set to 3, the LED (Alarm 1) is blinking every 250ms. (As I want it to)
HOWEVER, when Numeric 2 is set to '2', the LED (Alarm 2) is blinking every 1000ms, AND Alarm 1 is ALSO blinking at 1000ms.
I don't understand why. I've changed a lot of sections to test if any of the other parts of the vi is affecting it but I don't believe so.
Thanks in advance
Solved! Go to Solution.
03-30-2014 12:19 PM - edited 03-30-2014 12:44 PM
@Jbiem wrote:
I have attached a picture of a section of my code
Please attach the actual VI instead. We cannot debug pictures. We cannot see the other cases, we can't even see most terminals.
In any case, the code looks completely "inside-out". Why is there no outer loop? Why do you need all these local variables? You are also doing equal comparisons on floating point values, whcih is generally not a good idea. Why all the coercion dots? How do the inner loops ever complete? Why all the duplicate code? The only thing different between the mutually exclusive cases is a single diagram constant, so why duplicate all the rest of the inner code?
All you need is a single outer while loop running at 250ms, then do a little logic to blink the LEDs as needed.