03-14-2014 02:37 PM
Tengo que sumar el numero de veces que se cumple una condicion booleana??
Ejemplo;
cuantas veces prende un led.. sumar las veces que su condicion fue TRUE
gracias
03-15-2014 01:45 PM
translated by google:
I have to add the number of times a Boolean condition is met?
example;
LED lights a few times .. add the times your condition was TRUE
thanks
Is this a real LED or a control or indicator on the front panel? What makes the LED blink? How do you detect if the LED is on (light sensor, digital input, polling, etc.). What is the maximum rate at which it can change?
Can you show us a simplified version of your program?
You probably want to count how many times it went from OFF to ON.
03-17-2014 10:23 AM
Hola Eduardo2416,
Gracias por utilizar los foros de National Instruments! Tal como Altenbach menciona, necesitamos mas información sobre lo que deseas realizar. Esta señal booleana viene de un LED fisico o es una señal de control de software (bandera)? Te hice un ejemplo muy sencillo de como podrías comenzar pero todo va depender de lo que desees realizar.
Espero que esta información te sea de utilidad!
03-17-2014 10:29 AM
03-17-2014 10:29 AM
03-17-2014 10:42 AM
Hi guys!
Oh yeah! My mistake lol. It was very very quick example that I didnt even notice that "double" verification. Eduardo you can get rid of that verification, here's a better code:
Regards!
03-17-2014 10:53 AM - edited 03-17-2014 10:57 AM
SInce we don't really know how the LED status is read by the code, "latch action" might be unrealistic.
Here's a code alternative that works for any type of mechanical action. (currently set to switch until released, like a car horn ;))
NOTE: The code would be even simpler with this idea implemented. 😄
03-17-2014 11:06 AM
Thanks Altenbach! That is definitely a better way to go.
Eduardo, hope you find these examples useful for your application or project.
Best Regards!