LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate pulse during changing boolean value?

Solved!
Go to solution

I need to generate short pulse during changing boolean value from 0 to 1. This pulse is needed to reset counter. 

I was trying with Event Structure with Value Change but I think that I did something wrong.

Maybe sambody can give me some tips to do it in other way?

Thank you in advance.

Regards

0 Kudos
Message 1 of 10
(6,178 Views)

Where is the problem?

Is it the part of detecting a change of the boolean going from F to T?

Or is it the part of resetting the counter.

 

The Event Structure with Value Change is a good.

What is the mechancial action setting for your boolean control?

Most likely need to be one of the latched setting "Latched When Pressed"

 

Post your code.

Omar
0 Kudos
Message 2 of 10
(6,176 Views)

Try something like the attached code - a simple Functional Global.

 

 

Richard






0 Kudos
Message 3 of 10
(6,172 Views)

Resetting counter is not a problem. 

Well, problem is that I don't know how exactly Event Structure for change value works. I know how to use it in other cases but not in this one.

I attach my code.

 

My x > y value will change once. From F to T. And then I want to generate one impulse which resets counter.

 

Thank you for your responds.

0 Kudos
Message 4 of 10
(6,166 Views)
Solution
Accepted by topic author Rogal

@Rogal wrote:

I need to generate short pulse during changing boolean value from 0 to 1. This pulse is needed to reset counter. 

I was trying with Event Structure with Value Change but I think that I did something wrong.

Maybe sambody can give me some tips to do it in other way?

Thank you in advance.

Regards


We assumed you wanted a pulse when a front panel button (boolean) was clicked.

 

I am still not sure just what it is you want.

 

Do you want a single pulse when x is greater than 4?

RisingEdge.png

You don't need an event structure for that.

 

Omar
Message 5 of 10
(6,158 Views)

Yes, I want to generate short pulse when x is greater than 4. It works but I would like to use it in one while loop and use this impulse in other while loop to reset counter. And in this case it doesn't work.
I guess that impulse is too short and before signal goes to other while loop it again toggles from True to False. 

0 Kudos
Message 6 of 10
(6,134 Views)

I added to both loops 50 ms of timing and now everything works fine.

Thank you for your help and patience.

Best Regards.

0 Kudos
Message 7 of 10
(6,129 Views)

Use a queue

Omar
0 Kudos
Message 8 of 10
(6,118 Views)

Hello Broken_Arrow,

 

Many many thanks for this example, it helped my app to work. Smiley Very Happy Smiley Wink

But I still have a question about this, have you hide something in the code, because I made a same one, but it is not acting the same?

When I run mine, the value stayes on, constantly, not pulses like yours.

 

Regards

Szilard

0 Kudos
Message 9 of 10
(5,634 Views)

@SzilardB wrote:

Hello Broken_Arrow,

When I run mine, the value stayes on, constantly, not pulses like yours.


Share your code so we can help you figure out what went wrong.


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
0 Kudos
Message 10 of 10
(5,628 Views)