Bit Instructions

PLC: Instruction Set

Bit Instructions
Use the bit (relay-type) instructions to monitor and control the status of bits, such as input bits or timer-control word bits.

Available Instructions

If you want to:
Use this instruction:
Enable outputs when a bit is set
XIC
Enable outputs when a bit is cleared
XIO
set a bit
OTE
set a bit (retentive)
OTL
clear bit (retentive)
OTU
Enable outputs for one scan each time a rung goes true
ONS
set a bit for one scan each time a rung goes true
OSR
set a bit for one scan each time the rung goes false
OSF
set a bit for one scan each time the input bit is set in function block
OSRI
set a bit for one scan each time the input bit is cleared in function block
OSFI


Examine On
The XIC instruction examines the data bit to see if it is set.

 Available Languages
- Ladder Diagram

Operands
Operand
Type
Format
Description
Data bit
BOOL
tag
bit to be tested

Example 1
If BIT1 is set, this enables the next instruction (the rung-condition-out is true).



Examine Off
The XIO instruction examines the data bit to see if it is cleared.

Available Languages
- Ladder Diagram

Operands
Operand
Type
Format
Description
Data bit
BOOL
tag
bit to be tested

Example 1
If BIT1 is cleared, this enables the next instruction (the rung-condition-out is true).


Output Energize
The OTE instruction sets or clears the data bit.

Available Languages
- Ladder Diagram

Operands
Operand
Type
Format
Description
Data bit
BOOL
tag
bit to be set or cleared

Example 1


Output Latch
The OTL instruction sets (latches) the data bit. When enabled, the OTL instruction sets the data bit.  The data bit remains set until it is cleared, typically by an OTU instruction.  When disabled, the OTL instruction does not change the status of the data bit.

Available Languages
- Ladder Diagram

Operands
Operand
Type
Format
Description
Data bit
BOOL
tag
bit to be set

Example 1


Output Unlatch
The OTU instruction clears (unlatches) the data bit. When enabled, the OTU instruction clears the data bit.  When disabled, the OTU instruction does not change the status of the data bit.

Available Languages
- Ladder Diagram

Operands
Operand
Type
Format
Description
Data bit
BOOL
tag
bit to be cleared

Example 1


One Shot
The ONS instruction enables or disables the remainder of the rung, depending on the status of the storage bit. 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.

Available Languages
- Ladder Diagram

Operands
Operand
Type
Format
Description
Storage bit
BOOL
tag
Internal storage bit
Stores the rung-condition-in from the last time the instruction was executed

Example 1


One Shot Rising
The OSR instruction sets or clears the output bit, depending on the status of the storage bit. 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.

Available Languages
- Ladder Diagram
- Function Block (OSRI)
- Structured Text (OSRI)

Operands
Operand
Type
Format
Description
Storage bit
BOOL
tag
Internal storage bit
Stores the rung-condition-in from the last time the instruction was executed
Output bit
BOOL
tag
Bit to be set

Example 1


One Shot Falling
The OSF instruction sets or clears the output bit, depending on the status of the storage bit. When disabled and the storage bit is set, the OSF instruction sets the output bit.  When disabled and the storage bit is cleared, or when enabled, the OSF instruction clears the output bit.

Available Languages
- Ladder Diagram
- Function Block (OSFI)
- Structured Text (OSFI)

Operands
Operand
Type
Format
Description
Storage bit
BOOL
tag
Internal storage bit
Stores the rung-condition-in from the last time the instruction was executed
Output bit
BOOL
tag
Bit to be set

Example 1


One Shot Rising with Input
The OSRI instruction sets the output bit for one execution cycle when the input bit toggles from cleared to set.

Available Languages
- Ladder Diagram (OSR)
- Function Block
- Structured Text

Operands
Operand
Type
Format
Description
OSRI tag
FBD_ONESHOT
structure
OSRI structure

FBD_ONESHOT Structure
Input Parameter
Data Type
Description
EnableIn
BOOL
Function Block:
If cleared, the instruction does not execute and outputs are not updated.  If set, the instruction executes. Default is set.
Structured Text:
No effect.  The instruction executes.
InputBit
BOOL
Input bit.  This is equivalent to rung condition for the ladder diagram OSR instruction.
Default is cleared.


Output Parameter
Data Type
Description
EnableOut
BOOL
Enable output
OutputBit
BOOL
Output bit

Example 1 (Function Block)

Example 2 (Structured Text)
OSRI_01.InputBit := BIT1;
OSRI(OSRI_01);
OUT1 := OSRI_O1.OutputBit;


One Shot Falling with Input
The OSFI instruction sets the OutputBit for one execution cycle when the InputBit toggles from set to cleared.

Available Languages
- Ladder Diagram (OSF)
- Function Block
- Structured Text

Operands
Operand
Type
Format
Description
OSFI tag
FBD_ONESHOT
structure
OSFI structure

FBD_ONESHOT Structure
Input Parameter
Data Type
Description
EnableIn
BOOL
Function Block:
If cleared, the instruction does not execute and outputs are not updated.  If set, the instruction executes. Default is set.
Structured Text:
No effect.  The instruction executes.
InputBit
BOOL
Input bit.  This is equivalent to rung condition for the ladder diagram OSR instruction.
Default is cleared.

Output Parameter
Data Type
Description
EnableOut
BOOL
Enable output
OutputBit
BOOL
Output bit

Example 1 (Function Block)

Example 2 (Structured Text)
OSFI_01.InputBit := BIT1;
OSFI(OSFI_01);
OUT1 := OSFI_01.OutputBit;


- Download to PDF



0 comments :