LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rising edge analysis RS FlipFlop without the Reset

Hello, I am a starter with LabView and am trying to create a rising edge analysis. With the first rising edge of a Boolean Signal (an Input) a variable (and an Output) should be set and the second rising edge should reset this variable. It is like a RS Flip-flop with the second Set Signal as Reset.

 

By pressing an external pushbutton (my Input) my program should switch on/off my output to control an electrical system.

 

Maybe anyone can help me, Thank You!

Lars

0 Kudos
Message 1 of 7
(4,444 Views)
Forgotten: I am working with LabView 6.1
0 Kudos
Message 2 of 7
(4,441 Views)
If you use a state machine you can easily implement the function you want. Use a while loop with a shift register and a case structure inside. If the shift register is initialized with a false Boolean and the Boolean control is inside the loop and connected to the right terminal of the shift register, then a rising edge is detected when the control is True and the previous iteration (left terminal of the shift register) is False.

Look at the help files on shift registers and state machines.

Lynn
0 Kudos
Message 3 of 7
(4,435 Views)

Thanks for you answer, sounds very easy, but maybe I have not understand it or I am ….

In my german help file I cannot find information about state machine or about its translation and in my Test Vis the Boolean variable does not stay true when the control button (Input) is false again.

 

0 Kudos
Message 4 of 7
(4,428 Views)
Here is a simple vi that does the trick.  Substitute Boolean with your input and substitute Boolean 2 with your output.  You can also make this into a LV2 functional global by moving the Boolean and Boolean 2 out of the loop and making the loop execute only once (replace Stop and Not with False constant).   Call the functional global from your main with your input to the connector pane left side and the output comes from the connector pane right side.
- tbob

Inventor of the WORM Global
Message 5 of 7
(4,420 Views)
Lars,

Here is an example (LV 6.0). This VI implements a Toggle flipflop with Set and Reset and does so via a state machine. Note that the edge detection does not always work correctly if Input(Toggle) is True when Set or reset goes False. Adding a falling edge detector can fix that problem if necessary.

In LV 6.1 or later the event structure can be used to monitor the activity of front panel controls and might make a cleaner interface.

Lynn
Message 6 of 7
(4,414 Views)

I got it! Thanks a lot to both of you. The VI with extra Set/Reset and Error is perfect and will help me to deal with some other problems. I will try to understand booth VI and they will help me to learn LabView.

Lars

0 Kudos
Message 7 of 7
(4,400 Views)