Siemens S7-300CPU register status word usage - Database & Sql Blog Articles

November 27, 2022

F380J106MMA original authentic, spot stock brand NICHICON
Electronic scale crystal oscillator 3.2*2.5mm 3225 16M (16.000MHZ) 12PF 10PPM 20PPM 30PPM
Probe domestic double-head probe 038-BB-5.7L The shape of the two ends of the needle is outside the pointed needle
Huaqiang Square crystal original spot stock

1. Introduction The bits of the CPU register status word give information about the status or result of the instruction and the error that occurred. We can directly integrate the status of the binary logic operation status bit signal into the program to control the flow of program execution.
2. Status Word Register First briefly introduce the status word in the CPU.
● First check bit: The 0 bit of the status word is called the first check bit. If the signal status of the /FC bit is "0", it means that a new logic string will start in the program along with the next logic instruction. The slash in front of the FC indicates that the FC is negated.
● Logical operation result: The first bit of the status word is the RLO bit (RLO = "logical operation result"), which is used as a temporary storage bit in the binary logic operation. For example, an instruction in a series of logic instructions checks the signal state of the contact and performs a logic gate operation on the result of the check (status bit) and the RLO bit according to a Boolean logic operation rule, and then the logical operation result exists in the RLO bit.
• Status bit: The status bit (bit 2) is used to hold the value of the addressed bit. The status bit always displays the status of the addressed bit to the scan instruction (A, AN, O, ...) or write instruction (=, S, R,) (for write instructions, the saved address bit status is after this write instruction is executed. The state of the addressed bit).
• OR bit: The OR bit is used when executing and logic operations before the instruction OR or logic operation. The OR bit indicates that the previously executed logical operation produces a value of "1", and thus the logical operation OR execution result has been determined to be "1".
● OV bit: Overflow indicates that an error occurred during the execution of the arithmetic or compare instruction. This bit is set according to the result of the arithmetic or logic instruction executed.
OS bit: The overflow memory bit is set with the OV bit, and it can maintain this state after updating the arithmetic instruction, that is, its state will not change as a result of the next arithmetic instruction. Thus, even in the latter part of the program, there is a chance to determine if the digital area has overflowed or if the instruction contains an invalid real number. The OS bits can only be reset by these commands: JOS (jump if OS=1), block call and block end command.
• CC1 and CC0 bits: The CC1 and CC0 (condition code) bits give information about the following results:
• Arithmetic instruction result • Comparison instruction result • Word logic instruction • In the shift function, the bit related information is shifted out.
The condition codes CC1 and CC0 can be checked with the following instructions.
After the CC1CC0 check is completed, if:
00A==0 result=0
10A>0 result>0
01A<0 result<0
• BR bit: The 8th bit of the status word is called the binary result bit. It associates a word processor with bit processing and is used to indicate whether the word logic is correct in a program that has both bit operations and word operations. When the BR bit is added to the program, the binary logic chain will not be interrupted regardless of the result of the word operation. In the block instruction of the ladder diagram, the BR bit has a corresponding relationship with the ENO bit to indicate whether the block instruction is correctly executed: if an error occurs in the execution, the BR bit is 0, and the ENO bit is also 0; if the function is correctly executed, The BR bit is 1,
The ENO bit is also 1. In the FB/FC program written by the user, the BR bit should be managed. After the function block is correctly executed, the BR bit is set to 1, otherwise it is set to 0. Use the SAVE instruction to store the RLO in the BR to manage the BR bit.
9-15 bits of the status word are not used.
3. Specific use Below we combine the pointer programming in STEP7 to specifically introduce the usage of condition code CC0/CC0.
Different instructions execute different times in the CPU. Floating point numbers take longer to execute than fixed point numbers; word logic instructions take longer than bit logic instructions; proper use of status words for programming in some programs can reduce CPU program execution time.
Example 1: For example, to compare the DBBO-DBB99 of a block in a DB, whether the positive number is negative or 0, the positive number is represented by 1; the negative number is represented by -1; 0 is represented by 0. And the corresponding result is stored in the first 100 bytes of MB200. Our usual practice might be:


Digital camera


If you use condition code to program, you can reduce the size of the program and reduce the execution time of a certain instruction. We only need to optimize the intermediate comparison program to achieve the goal.
Digital camera
Example 2: The jump function instruction JJ that jumps according to the state of the status bits C0 and CC1 does not change the state of any status bit, and the logical operation result RLO value also "follows" the jump function to the jump block. In, for the user program other logic operations (do not change / FC state).
The example two integers are subtracted and need to be judged continuously:
LMW2
LMW8
-I
JZZERO / / If the result is equal to "0", then jump to the label ZERO / / the result is not equal to "0" when the instruction executed ZERO:// the result is equal to "0", the instruction to be executed if the user is not familiar with JZ The specific meaning of the instruction and status bits C0 and CC1, the comparison result is stored in a binary bit by the comparison instruction during programming, and the execution of the program is controlled by the JC/JCN instruction according to the binary bit.
Example 3: In our actual application, we may need to use some protocol conversion gateways (such as Hilscher's NTTAP series gateway) to communicate with some serial protocol instruments, and we will encounter CRC check problems. It is necessary to judge whether the overflow bit is 1 or not to perform further calculation of the program. We take the CRC check required for MODBUS communication of EURO2408 as an example to illustrate the steps of CRC check:
1. Load 16#FFFF into a 16-bit CRC register;
2. The high 8-bit byte of the CRC register is different from the first 8-bit byte in the message, and the result is returned to the CRC register;
3. Move the CRC register data one bit to the right;
4. If the overflowed bit is equal to 1, the CRC register is differentiated from 16#A001 and the result is returned to the CRC register.
4. If the overflowed bit is equal to 0, repeat step 3;
5. Repeat steps 3 and 4 until it has been shifted 8 times;
6. The high 8-bit byte of the CRC register is different from the next 8-bit byte in the message, and the result is returned to the CRC register;
7. Repeat steps 3 through 6 until all bytes in the message are different from the CRC register and are shifted 8 times;
8. The result in the last CRC register is the CRC check code, which is added to the end of the message (data) (exchange! The lower 8 bits are in front and the upper 8 bits are in the back;)
In step 4, you need to determine if the overflow bit is 1, and how to judge has an important impact on the entire program. We can use A>0 command to judge this condition, the specific code is written. If you are interested, you can write your own CRC program according to the above steps.
4. Conclusion In general, we don't have to consider these status bits, but in some cases, using these status bits combined with certain instructions can give us more flexibility in programming and further improve ourselves. The level of programming also has a certain effect.

Elux Legend 3500 Puffs

The Elux Legend 3500 puffs Disposable Vape is among the most anticipated and favourite vapes due to all its intriguing features. Each puff provides a complete package of the charm of vaping along with the feel of nic salt and delicious flavours. The Nic Salt used in the ELUX LEGEND 3500 puffs e-liquid is pretty good in giving a splendid feel in each Disposable Electronic Cigarettes.

Elux Legend 3500 puffs that makes you feel content because you dont have to buy a new one Disposable Vape Pod for at least a week almost. With a 1500 mAh in-built battery, you get a great experience of being fearless of changing the device or battery.Elux Legend 3500 Puffs has 20 mg of nicotine strength that helps you get the right feel . The unique corlorful paint that represents each combo of different flavours is an eye-catchy factor that sets you to get more interested in elux legend 3500 puffs.


As the hottest Disposable Vape Pod product by Elux, the Elux Legend 3500 has numerous rich flavors. Unique, sweet, and fresh, there is everything in its pulls. Maybe Elux Legend doesnt catch peoples eye as quickly as the Elf Bar 1500 Puffs do, its rectangular column body provides a good grip and makes it more suitable for placement. Or rather, the understated classic design of Elux Legend 3500 just makes it more like a one-size-fits-all machine that can get along with everyone.

As Elux Legend has nearly 32 flavors available, we tried and tested each of them so you don`t have to. Learn everything about Elux Legend 3500 Puffs from our below review, and find which flavor you favor most!

The other 2% nicotine salt product you can choose like Puff Bar Puff Flex Puff XXL and Bang XXL Switch Duo 2500 puffs

elux legend 3500 puff, elux legend vape, vape kit elux legend, elux legend disposable vape

Shenzhen Essenvape Technology Co., Ltd. , https://www.essenvape.com