Chapter 6 Applied Instructions Symbol S : Matrix source n : Length of the array D : Pointer Explanation 1. This instruction checks the state of SM613. If SM613 is ON, the instruction clears the value of the pointer D to 0. 6_ The instruction writes the state of SM615 into the bit specified by the value of the pointer D and then checks the state of SM612. If SM612 is ON, the instruction increments the value in the pointer D by one. 2. When the instruction writes the state of SM615 into the last bit, sets SM608 is ON, and records the bit number in the pointer D . If value of the pointer D exceeds the range, SM611 is ON. 3. The operand n must be between 1–256. 4.
You specify the value of the pointer. The values are between 0–16 n − 1, and correspond to the range between b0–b16 n − 1. If the value of the pointer exceeds the range, SM611 is set to one, and the instruction is not executed. Example 1. Suppose SM613 is OFF and SM612 is ON when M0 switches from OFF to ON. 2. Suppose the current value in D20 is 45. When M0 switches from OFF to ON one time, the instruction gives the execution result shown below. When the value in D20 is 45, SM615 is OFF, and SM608 is OFF.
6-373 API Instruction code Operand Function 1213 MBWR P S, n, D Writing a matrix bit Device X Y M S T C HC D FR SM SR E K 16# “$” F S n D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S n D Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 -