Some readers have expressed confusion about the distinction between registers and accumulators in Siemens S7-300/400 PLCs. In today's article, we will delve into this topic.
Firstly, registers and accumulators are both integral components of the CPU module within the S7-300/400.
Registers, specifically the Register, are high-speed storage units within the CPU designed to temporarily store information such as instructions, data, and addresses needed during CPU operations. The CPU encompasses various registers, including status word registers, address registers, data block registers, etc. Today's focus is on the accumulator, which is essentially a type of register.
The Accumulator, abbreviated as ACCU, is a register used for processing bytes, words, or double words, with a length of 32 bits (4 bytes). In S7-300, there are two accumulators: ACCU1 and ACCU2. In S7-400, there are four accumulators: ACCU1 to ACCU4. Most statement table instructions require the involvement of the accumulator. The operation involves placing operands into the accumulator, performing calculations (saving intermediate results), and then transferring the result from the accumulator to a specific storage area.
At this point, two instructions must be mentioned: Load (L) and Transfer (T).
The Load (L) instruction is used to load a byte, word, or double word into Accumulator 1 (ACCU1). The original data in Accumulator 1 (ACCU1) is then saved in Accumulator 2 (ACCU2). If the Load instruction is used twice, Accumulator 2 (ACCU2) will store the operand from the first load instruction. For example, consider the following two instructions: