Expanding on what GIT wrote, I think this is what you are looking for.
Code:
Green O:0/1
-------] [---------------(L)---
Red O:0/1
---+---] [---+-----------(U)---
| |
| S:1/15 |
+---] [---+
You may want to think of the First Pass bit as a virtual "button," like your Red button, but one that that is automatically "pressed by the PLC" itself during, and only for, the specific case of a "First Pass" scan.
From reading your post, I assume that your intent is that you want to Unlatch O:0:1 either
- when the Red button is pressed
- OR
- when the First Scan "button" is pressed "by the PLC."
The
parallel arrangement of the Red and S:1/15 XICs {-] [-} above is called a
logical OR in ladder, and it implements your intent.
The image at the bottom of this post gives the conditions when S:1/15 will be true for SLC 500, but I do not know what PLC your are using, so you should check the manuals for your PLC to understand when S1:15/1 will be true in your specific situation.
Furthermore, I suggest two things:
- Document with a comment what you did and why you did it with the First Past bit.
- Keep the Green and Red rungs next to each other, so all logic that drives O:0/1 can be seen and understood at once.
- In fact, I would even put it all on one rung, to ensure the logic is never separated, like this:
Code:
Green O:0/1
---+-------] [---------(L)---+---
| |
| Red O:0/1 |
+---+---] [---+-----(U)---+
| |
| S:1/15 |
+---] [---+
Alternate approach 1
Here is an alternate, but less certain, approach,
which may not work in your situation:
Code:
Green B3:0/0
------] [---------------(L)---
Red B3:0/0
-------] [---------------(U)---
B3:0/0 0:0/1
-------] [---------------( )---
This takes advantage of the fact that A-B PLCs execute a "prescan" even before the "First Pass" scan, during which many things happen, but the relevant point here is that any bit controlled by an OTE will be set false.
The problem here is if your B3:0/0 bit is ever accidentally set to 1 in your stored program in RSLogix 500, then it will be downloaded as 1 and will turn on O:0/0 on the first pass after power up. Also, if the program is ever switched to REM Program while B3:0/0 is 1, and then switched back to REM Run, then B3:0/0 will still be 1, and O:0/0 will be set to 1 on the first scan, assuming the Red button is not being held down.
In both of those cases - [Power Up] and [REM Program => REM Run], the First Pass method above will work.
Alternate approach 2
This is another was to solve the program using Prescan,
but it should not be used; it is only shown here to more fully describe the logic of a Prescan:
This will ensure that the Prescan sets O:0/1 to 0, even before the First Pass scan.
However, the trick here is to put this single run in a separate Program File by itself
that is never called (JSR) by any rung in the rest of the program.
There are at least two reasons to not do this:
- It involves a trick, so your successor, who may not understand that trick or the reason it is there, will wonder why it is there and may remove it
- The OR branch S:1/15 is much simpler,
From:
https://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1747-rm001_-en-p.pdf