One Shot (ONS)
The ONS instruction makes the remainder of the rung true each time rung-condition-in transitions from false to true.
Available Languages
Ladder Diagram
![Ladder Diagram_One Shot (ONS)_v1](/content/dam/dita/en/factorytalk-design-studio/current/online-help/topics/graphics/ladderdiagram_oneshot(ons)_v1.png/_jcr_content/renditions/original)
Operands
IMPORTANT:
Unexpected operation may occur if:
- Output tag operands are overwritten
- Members of a structure operand are overwritten
- Except when specified, structure operands are shared by multiple instructions.
Ladder Diagram
Operand | Data Type | Format | Description |
---|---|---|---|
Storage bit | BOOL | tag | Internal storage bit. Retains the rung-condition-in from the last time the instruction was executed. There are various operand addressing modes possible for the storage bit, see Bit Addressing for examples. |
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Index through arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State | Action Taken |
---|---|
Prescan | The storage bit is set to true to prevent an invalid trigger during the first scan. |
Rung-condition-in is false | The storage bit is cleared to false, rung-condition-out is cleared to false. |
Rung-condition-in is true | See ONS Flow Chart (True). |
Postscan | N/A |
ONS Flow Chart (True)
![onsFlowChart](/content/dam/dita/en/factorytalk-design-studio/current/online-help/topics/graphics/onsflowchart.jpg/_jcr_content/renditions/cq5dam.web.1280.1280.jpeg)
Example
Ladder Diagram
![FTStudio-ONS-LD-EX-V1](/content/dam/dita/en/factorytalk-design-studio/current/online-help/topics/instructions/common-content/graphics/ftstudio-ons-ld-ex-v1.png/_jcr_content/renditions/original)
In this example, the sum increments each time limit_switch_1 goes from false to true.
Provide Feedback