I'm trying to determine the difference in functionality of the One-Shot (ONS) vs the One-Shot Rising (OSR) instruction in RSLogix5k.
When I set up both in a test program, they seems to achieve the same result, ONS taking up only one rung where OSR will require two. See attached image.
The instuctions are described as the following:
Can anyone explain? Thanks!
When I set up both in a test program, they seems to achieve the same result, ONS taking up only one rung where OSR will require two. See attached image.
The instuctions are described as the following:
ONS
Structured text does not have an OTU instruction, but you can achieve the same results using an IF…THEN construct.
IF BOOL_expression AND NOT storage_bit THEN
<statement>;
END_IF;
When enabled and the storage bit is cleared, the ONS instruction enables the remainder of the rung. When disabled or when the storage bit is set, the ONS instruction disables the remainder of the rung.
You typically precede the ONS instruction with an input instruction because you scan the ONS instruction when it is enabled and when it is disabled for it to operate correctly. Once the ONS instruction is enabled, the rung-condition-in must go clear or the storage bit must be cleared for the ONS instruction to be enabled again.
There is more but I'm sure I don't need to paste it all. I can understand the OSR pretty easily, but I find the logic on the ONS confusing, especially when it seems to function similarly to OSR.OSR
When enabled and the storage bit is cleared, the OSR instruction sets the output bit. When enabled and the storage bit is set or when disabled, the OSR instruction clears the output bit.
Can anyone explain? Thanks!