Skip to main content

Example - Instruction List

ADD


The ADD instruction adds a WORD value, S1, to a WORD value, S2, and saves the sum in an assigned WORD data register, D.

Instruction List Example

StepInstructionOperand 1Operand 2Operand 3Operand 4Operand 5Current State
0LDM100
1MOV50D00
4MOV10D01
8ADDD00D01D02
12END
13PEND

When the contact, M10.0, is powered ON, 50 is moved into the WORD data register, D0, and 10 is moved into the WORD data register, D1.


When the contact, M0.0, is powered ON, the WORD data register, D0, is added to the WORD data register, D1, and the sum saved in the WORD data register, D2.

Memory Monitor

ADDP


The ADDP one-shot instruction adds a WORD value, S1, to a WORD value, S2, and saves the sum in an assigned WORD data register, D.
Every time this instruction executes, it energizes the output only once.

Instruction List Example

StepInstructionOperand 1Operand 2Operand 3Operand 4Operand 5Current State
0LDM100
1MOV50D00
4MOV10D01
8ADDPD00D01D02
12END
13PEND

When the contact, M10.0, is powered ON, 50 is moved into the WORD data register, D0, and 10 is moved into the WORD data register, D1.


When the contact, M0.0, is powered ON, the WORD data register, D0, is added to the WORD data register, D1, and the sum saved in the WORD data register, D2.

Memory Monitor