PLC Programming Handbooks
Siemens S7 Status Word
In Siemens PLCs the Status Word is an internal CPU register used to keep track of the state of the instructions as they are being processed.Â In order to use STL more effectively it is important to understand the Status Word and its functions.
Each bit in the Status Word has a specific function to keep track of bit logic (RLO, STA), math (OV, OS), comparison operations (CC0, CC1) and whether the logic should continue, be nested or start new (/FC, OR, BR).Â Only the first 9 of the 16 bits are used.
Each instruction may do the following to each bit in the status word.
The status word can be seen by displaying the STATUS column while monitoring in STL view.Â The RLO (bit 1) and the STA (bit 2) are also displayed in the RLO and STA column.
The Most Important Status Word Bits
/FC â€“ First Check (bit 0)
If the /FC bit is a 0 then the instruction is considered to be the first instruction being processed.Â If the /FC is a 1 then the instruction being scanned will use the logic from the previous instruction.Â Certain instructions like =, S and R will set the /FC bit to 0 thus starting new logic after it.Â Other instructions like A or O will set the /FC bit to 1 signalling to combine the logic with the next instruction.
RLO â€“ Result of Logic Operation (bit 1)
The RLO bit stores the running logic state of the currently processing instructions.Â Certain bit logic and comparison instruction will turn the RLO to a 1 when the condition is TRUE and write a 0 when the condition is FALSE.Â Other instructions read the RLO (=, S, R) to determine how they are to execute.
STA â€“ Status (bit 2)
The STA bit reflects the state of the current Boolean address.
Help with RLO, STA and /FC
If you are used to ladder logic and struggling to understand the purpose of the RLO and STA it may help to visualize a rung like below.Â The STA is used to keep track of the state of the addresses.Â The RLO is used to keep track of the state of the rung.
The equivalent STL is shown below.
It steps through the logic as follows:
The Other Status Bits
OR (bit 3)
The OR bit is used for combining AND functions before OR functions.
OS â€“ Overflow Stored (bit 4)
In the event of an overflow (OV bit 5) the OS bit will store the value even after the OV bit has been reset.Â The following commands reset the OS bit: JOS (Jump if OS=1), block call instructions, block end instructions.
OV â€“ Overflow (bit 5)
The OV bit is set by a math instruction with floating point numbers after a fault has occurred (overflow, illegal operation, comparison unordered). The OV bit is reset when the fault is eliminated.
CC0, CC1 â€“ Condition Code (bits 6 and 7)
The Condition Code bits provide results for comparison and math instructions.
Math Instructions, without Overflow
Integer Math Instructions, with Overflow
Floating Point Math Instructions, with Overflow
Shift and Rotate Instructions
Word Logic Instructions
BR â€“ Binary Result (bit 8)
The Binary Result transfers the result of the operations