LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple problem with a square wave and a boolean LED

Solved!
Go to solution

Look this is the case,

 

Im making a test for PCB, it has a emergency switch and a buzzer. the buzzer is connected to the emergency switch with a microcontroller

 

Case 1: Emergency switch isnt pushed in , buzzer makes no sound (hardware) and therefore the LED in my program stays off.

 

Case 2: Emergency switch is pushed in, buzzer automaticly makes sound (in a square wave form: 1 second high, 1 second low (3x)). But if i put this in the program the LED will blink.. because the signal is high/low. What i want is that the LED will stay on.

 

So my question is: is it possible to put a square wave output on a led and keep that led on. (it should not blink).

 

and if it is not allot of work can you please show me how to do it with a simulation.

 

(english is not my native langueage thats why i cant explain it very good)

With kind regards,

 

Asrih

0 Kudos
Message 1 of 13
(4,096 Views)

You can accomplish that several ways. For example you can check if chcange occured after 1 second - if so - keep the true state.

You can check the number of transisions from false to true (since you know the number of changes of the buzzer)

 

However it will require the knowledge of incoming singal - how long will it last, or what are time intervals or how many times it will change...

Message 2 of 13
(4,071 Views)
Is it possible to get access to the earlier value from the switch itself? That would be steady, but technically would only show the switch closure and not the buzzer being energized.

Adam's suggestion is a good one, but would result in a delay in it being turned off due to the timeout.

Personally, I would say that the best solution is to let the LED blink as it is showing the buzzer's current state exactly.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 13
(4,066 Views)

could you please show it me in a program, im new to labview

0 Kudos
Message 4 of 13
(4,058 Views)

Here is an example of using the Time Elapsed function.  As MikePorter mentioned, it does have a 1 second delay to turning off.

 

The best solution is to fix this in hardware and get the raw switch signal instead of the pulse signal.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 13
(4,048 Views)

im sorry but i dont understand what you did there, where is the LED and the square wave

0 Kudos
Message 6 of 13
(4,032 Views)

Hi Asrih,

 

You can find my suggested solution attached. On the left side of the vi, we are generating a square wave of total simulation time. On the right side (marked with a decoration frame with an arrow pointing to it) we are simulating data acquisition generation at Rate of generation constant. On the right side you can see the indicators for the LEDs. As you can see, the Held LED is now always on for the Total simulation time.

You can download the vi, test it out, change the values of the constants to see how it affects the behaviour. 

 

Hope this helps!

0 Kudos
Message 7 of 13
(3,975 Views)

Hi Asrih,

 

it is considered rude behaviour to create new threads for old/same topics

 

I also consider it as "rude" to beg for help using PMs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 13
(3,960 Views)

hi GerdW

My problem wasn't solved.

and nobody was helping no more... so i tought i'll send you a PM, but you didn't help me after that eighter... sooo... i tought i'll bring the topic back up again.

so you read my pm and didn't help me... thnx

 

0 Kudos
Message 9 of 13
(3,916 Views)

NI-Mikko,

 

First of all thanks for your reply,

second, i'm using labview 14 and you 15, i can open it.. could you please make a printscreen out of your programm?

 

with kind regards

 

N.asrih

0 Kudos
Message 10 of 13
(3,911 Views)