Why doesn't my logic work?

Levi G

Member
Join Date
Sep 2015
Location
Alberta
Posts
148
I am trying to make a output go on and stay on by pressing a momentary button on my hmi (Panelview 800) Then when I press again I want the output to go off. I can see the bit change state when I press the button but the output does not go on at all. What am I doing wrong? The bits and the outputs are used nowhere else in the program and the routine is being called.
 
Momentary button? Maybe your button should be a toggle? Or have some sort of latching feature?

Sounds like a similar issue I had where buttons are auto unlatching bits so fast you could not do anything.
 
You are trying to do too many things on the same rung. Separate the different steps with more rungs. Establish the "on" state 1st , then and only then allow the "off" state to work.
 
Looks like when you are holding your push button in, DRV_2_START is an XIO, so it is good at first, but then the DRV_2_START OTE comes on, which would cause your DRV_2_START XIO to immediately go off?

So there is no latching mechanism to keep the DRV_2_START OTE running. You would need an XIC latch around your manual button with a way to stop the latch DRV_2_START OTE.
 
If you search the forum for flip-flop logic you will find many examples of different styles of logic to do exactly what you want.

My personal favourite is using a counter but there are lots of seal-in options that work also.
 
Do This

EDIT: added a .pdf for readability. You can set the debaounce timer to whatever value you see fit.

Flip-Flop Logic.jpg
 

Attachments

  • Flip-Flop Logic.pdf
    30.3 KB · Views: 27
Last edited:
Thanks for the help guys I will give this stuff a shot as soon as I get a chance. SERGIE yes this code is being executed
 
Could you use a counter to toggle it off when it reaches 2? And add a bit of a time delay to hold that input active for a second or so? I've had similar problems with momentary switches, where the program ignored it, unless I added a small TOF to it.
 
You are trying to do too many things on the same rung. Separate the different steps with more rungs. Establish the "on" state 1st , then and only then allow the "off" state to work.

The rung is pretty simple, the tricky part is understanding how the PLC is scanning the elements of this rung. The OTU branch is throwing me at the moment, but it's clear to me it's an execution issue with the logic as written.theredview is seeing what I am seeing.

If you search the forum for flip-flop logic you will find many examples of different styles of logic to do exactly what you want.

Have to agree with this, I like using one-shots to handle it, makes the rung really clean, I have to believe I've posted it in one of the flip-flop threads at some point.
 

Similar Topics

Hello I have In touch 10.1 I tried to enter the WindowMaker to make some adjustments I am using a dongol for the license . I can access the...
Replies
1
Views
83
Hello guys, I'm trying to use the Lenze GDC 4-14 with the system bus adapter 2177, but it doesn't appear in the communication window. It's like I...
Replies
0
Views
222
I am noticing a problem where i am using MOV instruction and writing literal text into source and String datatype in destination. It works fines...
Replies
6
Views
486
Hello Folks! I have an issue and its very often but in this case i applied all the tricks and tips that i always do in similiar issues but in this...
Replies
2
Views
774
Hello all, I have a Panelview 550 Cat 2711-K5A5 that has one Serial port ( RS-232). Which I can talk to via my cable via DF1. Which is weird...
Replies
13
Views
2,423
Back
Top Bottom