OSF — One-Shot Falling

Description
Section titled “Description”OSF (One-Shot Falling) is a retentive input instruction that lets an event happen exactly once when something stops. When the rung conditions to its left go from true to false, OSF passes power for one scan; on the next scan it is false again and stays false until those conditions have gone true and then false once more. Use OSF when work belongs to the release of a signal rather than its arrival: log the moment a motor stops, capture a count when a part leaves a sensor, start a cool-down when a run command drops. Do not use OSF to turn something off when a condition ends; an XIO or an OTE already does that. There is no SLC 500 equivalent; OSF is a Logix instruction.
Operands
Section titled “Operands”| Operand | Type | Format | Valid Range | Required | Description |
|---|---|---|---|---|---|
| Storage bit | BOOL or bit member | Tag name or Tag.bit |
Any writable memory BOOL or INT/DINT bit member | Yes | Scan-to-scan memory for the instruction. It holds the state of the rung conditions from the previous scan so OSF can see the edge. It is not the one-shot output and does not show whether OSF is true. Give every OSF its own storage bit and reference it nowhere else. Never use a pin. |
Scan Behavior
Section titled “Scan Behavior”Prescan
Section titled “Prescan”The storage bit starts at its power-up value (0 unless a literal was entered). OSF cannot fire on the first scan; the conditions must first be seen true.
Rung-condition-in is true
Section titled “Rung-condition-in is true”OSF is false. The storage bit is written 1 so that the next false scan is seen as a falling edge.
Rung-condition-in is false
Section titled “Rung-condition-in is false”OSF compares the rung conditions against the storage bit. If the storage bit is 1 (the conditions were true last scan), OSF is true for this scan. If the storage bit is 0 (the conditions were already false), OSF is false. In both cases the storage bit is then written 0.
Postscan
Section titled “Postscan”Nothing special. The storage bit keeps its last value into the next scan.
Timing, scan by scan:
| Scan | Conditions left of OSF | Storage bit before | OSF output | Storage bit after |
|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 |
| 2 | 1 | 0 | 0 | 1 |
| 3 | 1 | 1 | 0 | 1 |
| 4 | 0 | 1 | 1 | 0 |
| 5 | 0 | 0 | 0 | 0 |
| 6 | 1 | 0 | 0 | 1 |
| 7 | 0 | 1 | 1 | 0 |
Note that OSF is true on a scan where the conditions to its left are false. The instructions to its right receive the pulse, not the rung condition.
Example
Section titled “Example”Scenario: Every time a motor run command drops out, the number of completed cycles goes up by one. Counting on the falling edge means a cycle counts when it finishes, not when it starts.
Tags:
MotorRun— Motor run command, BOOLMotorRunOS— one-shot storage for the run command, BOOLCycles— completed cycles, INT
Rung logic:
—|XIC MotorRun|—|OSF MotorRunOS|———[ADD Cycles + 1 → Cycles]———Scan 1 — Motor stopped:
MotorRun= 0, the XIC does not conduct.MotorRunOSis 0, so there is no edge: OSF is falseCycles= 0
Scan 2 — Motor starts:
MotorRun= 1, the XIC conducts. OSF is false and setsMotorRunOS= 1Cyclesstays 0
Scan 3 — Motor running:
MotorRun= 1.MotorRunOSis already 1, OSF is falseCyclesstays 0, however long the motor runs
Scan 4 — Motor stops:
MotorRun= 0, the XIC does not conduct.MotorRunOSwas 1, so this is a falling edge: OSF is true for this scan and clearsMotorRunOSto 0- ADD runs once:
Cycles= 1
Scan 5 — Motor still stopped:
MotorRun= 0.MotorRunOSis 0, OSF is falseCyclesstays 1. The next start-and-stop adds one more
Values before and after one run: Cycles goes from 0 to 1 on the scan the motor stops, and only then.
See Also
Section titled “See Also”- ONS — One-Shot Rising (one scan when the conditions go false-to-true)
- XIC — Examine If Closed (the usual condition in front of an OSF)
- XIO — Examine If Open (a steady condition on a bit being off; not a pulse)
- TOF — Timer Off Delay (already acts on the rung’s true-to-false edge)
- Bit Logic Instructions — Category index
The pulse replaces the rung condition. This matters more for OSF than for ONS: OSF is true on the very scan its conditions are false. Power flow to the right of OSF is the pulse alone. Do not try to AND the original condition back in with another contact after the OSF, or the rung can never be true.
OSF conditions the rung; it does not read its own bit. The edge OSF detects is the true-to-false transition of everything to its left. The storage bit is only where OSF remembers last scan’s rung state. An OSF with nothing to its left sees the rung as always true and never fires.
The storage bit must be unique. Two one-shots sharing a storage bit corrupt each other’s edge memory, and any other instruction writing that bit breaks the one-shot. LadderIDE does not check this for you. Name storage bits so they cannot be mistaken for outputs, for example MotorRunOS.
Rising and falling on one signal. To act on both edges of the same condition, use an ONS and an OSF on separate rungs, each with its own storage bit. They may both watch the same contact.
Already edge-triggered instructions. TOF acts on its rung’s true-to-false edge by itself and needs no OSF. TON, TOF, RTO, TP, CTU, CTD, the sequencers, shifts, FIFO, LIFO and MSG all manage their own edges; a one-shot in front of them adds nothing.
Where OSF may sit. OSF is a condition, so it goes to the left of the rung’s output instructions. It is allowed inside a parallel branch leg, where it one-shots the conditions on that leg.
Bit members: the storage bit may be an INT or DINT bit member such as Flags.4. The base word is updated when the bit changes.
Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-09 · Screenshots verified 2026-09-09