The OSR (One Shot Rising) and OSF (One Shot Falling) instructions in RSLogix 5000 are special bit instructions used to detect quick signal changes. OSR activates for one scan when a signal changes from OFF to ON, while OSF activates for one scan when a signal changes from ON to OFF. They are perfect for preventing repeated actions in PLC programs.
On this page, we’ll explore how OSR and OSF work, when to use them, and how they fit into real-world automation tasks. You’ll see ladder logic examples, practical PLC applications, and tips for combining them with other instructions like timers and counters.
By the end, you’ll clearly understand the differences between OSR and OSF, know the best situations to use each, and be able to create more precise, event-driven control logic in your RSLogix 5000 projects.
The OSR (One Shot Rising) instruction in RSLogix 5000 is a special bit instruction that turns ON its output for only one program scan when the input changes from OFF (0) to ON (1). This is useful for triggering actions a single time per event, even if the input signal stays active.
The OSR instruction uses two key elements: the Storage Bit and the Output Bit.
BOOL
tag that stores the previous state of the input (rung-condition-in) from the last scan. It becomes active when the input changes from OFF to ON, and is used internally to detect this rising edge.
BOOL
tag that turns ON for one scan when the rising edge is detected. This is the signal you can use to trigger other actions, such as counters, timers, or arithmetic operations.
In short, the OSR instruction detects the moment an input turns ON and creates a one-scan pulse on its output. This pulse can then be used to perform actions exactly once per activation, avoiding repeated triggers.
Below is an example of OSR being used to detect and count rising edge events in RSLogix 5000.
In this example, we will use the OSR (One Shot Rising) instruction to detect how many times a signal changes from FALSE to TRUE, without using the built-in counter instruction. Instead, we will manually increment a tag value each time the rising edge is detected.
Event_Count = Event_Count + 1
, incrementing only once per signal change.Each time Start_Signal turns ON from OFF, the OSR outputs a one-scan pulse to run the ADD instruction. This ensures Event_Count increases by 1 per activation, preventing multiple counts for the same signal.
The OSF (One Shot Falling) instruction in RSLogix 5000 triggers its output bit for exactly one program scan when the rung-condition-in changes from TRUE to FALSE. In simple terms, it detects the falling edge of a signal and is useful when you want an action to happen only once when something turns OFF, rather than continuously while the signal remains OFF.
Below is an example of OSF being used to detect and count falling edge events in RSLogix 5000.
The OSF (One Shot Falling) instruction in RSLogix 5000 is used to detect when a signal changes from TRUE to FALSE, and to trigger an action for just one scan. In this example, we will use OSF to count the number of falling edge events without using the built-in counter instruction.
Event_Count = Event_Count + 1
, incrementing only once per signal change.Each time Stop_Signal turns OFF from ON, the OSF outputs a one-scan pulse to run the ADD instruction. This ensures Event_Count increases by 1 per falling edge, preventing multiple counts from the same signal change.