LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ayuda

Highlighted

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

0 Kudos
Message 1 of 8
(1,059 Views)

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.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 8
(1,021 Views)
Highlighted

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.

 

Example.png

 

Espero que esta información te sea de utilidad!

Luis CT
0 Kudos
Message 3 of 8
(988 Views)
Highlighted

LuisC_AE wrote:

 

Example.png

 


What is the purpose of the "equal true" function?


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 8
(983 Views)
Highlighted

Hi Luis,

 

you made the classic Rube-Goldberg: IF "Boolean equal to true" THEN true ELSE false… 😄

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 8
(981 Views)
Highlighted

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:

 

Example.png

 

Regards!

Luis CT
0 Kudos
Message 6 of 8
(976 Views)
Highlighted

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. 😄


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Download All
0 Kudos
Message 7 of 8
(968 Views)
Highlighted

Thanks Altenbach! That is definitely a better way to go.

 

Eduardo, hope you find these examples useful for your application or project.

 

Best Regards!

Luis CT
0 Kudos
Message 8 of 8
(960 Views)