STL language status word in Siemens PLC

The meanings are: binary result bit (BR), combined status bit (CC1, CC0), overflow status hold e799bee5baa631333365646261 bit (OS), overflow bit (OV), field value bit (OR), status bit (STA), logic Operation result bit (RLO), first detection bit (FC)


A brief explanation is as follows:
First bit detection bit (FC): The CPU detects the first instruction of the logical string as the first bit detection. If the status of this bit is 0, it indicates the first instruction of a logical string; the
logical operation result bit (RLO): Store the result of a bit logic instruction or compare instruction;
status bit (STA): store the value of a bit address. When executing a bit logic instruction, the STA always agrees with the
value of the bit ; the field value bit (OR): In the logical operation of logical “AND” first, and then logical “OR”, the OR bit temporarily stores the operation result of the logical “AND” for the subsequent logical “OR” operation. The OR bit is reset by other instructions; the
overflow bit (OV): if an error occurs during arithmetic operation or floating-point comparison instruction execution (such as overflow, illegal operation, and non-standard format), the overflow bit is set to 1; the
overflow status holding bit (OS ): When the overflow bit OV is set to 1, the OS bit is also set to 1, when the OV is cleared, the OS bit remains 1, it saves the state of the OV bit; the
combined status bits (CC1, CC0): the two bits are combined It is used to indicate the relationship between the result of the arithmetic operation or logical operation generated in the accumulator 1 and 0; the
binary result bit (BR): it connects the word processing program with the bit processing, and has both bit operations and words in a section In the operation program, it is used to indicate whether the word operation result is correct.

 

 


The following is a simple example: In the FB and FC statement list programs written by the user, the BR bit must be managed. When the function block is correctly executed, the BR bit is set to 1, otherwise it is 0. Use the SAVE instruction to store RLO in BR, so as to achieve the purpose of managing BR bit. When FB or FC is executed without error, RLO is 1, and stored in BR; otherwise, 0 is stored in BR. Programming example:
A I0.0 // Read the signal state of I0.0
AI0.1 // Read the signal state of I0.1
0 I0.2 // Read the signal state of I0.2
SAVE // When I0. When the signal state of 0 and IO.1 is 1, or the signal state of I0.2 is 1 (AND operation is performed before OR operation), the logic operation result bit RLO is stored to the BR bit (binary result bit )
Generally, use the SAVE instruction before exiting the logic block to enable the output ENO (that is, the BR bit) to be set to the value of RLO, which is used to check for errors in the block. 

Published 314 original articles · Like 93 · Visit 210,000+

Guess you like

Origin blog.csdn.net/qq_18671205/article/details/105382879