Chapter 6 Applied Instructions Example 1. The instruction defines X0 as the down arrow, X1 as the up arrow, X2 as the right arrow, and X3 as the left arrow. The instruction stores the setting value in D20, and the setting value must be between 0–9,999. 2. When M10 is ON, the digit in the place 10 3 is selected. If the left arrow is pressed, the places are selected in sequence (10 3 →10 0 →10 1 →10 2 →10 3 →10 0 ). 3. If you press right arrow, the places are selected in sequence (10 3 →10 2 →10 1 →10 0 →10 3 →10 2 ). The LED indicators for the corresponding places are connected to Y4–Y7. When the digits in the places are selected in sequence, the LED indicators are ON in sequence. 4.
If you press the up arrow, the digit in the place selected changes (0→1→2→…8→9→0→1). If you press the down arrow, the digit in the place selected changes (0→9→8→…1→0→9). The new digit is shown on seven-segment display. U p arrow 6_ Y 5 Y4 X1 Y7 Y6 LED indicators Left ar row R ight a r row X2 X3 Y0 Y1 Y2 Y3 X 0 D own ar row Four-digit seven-segment display The four keys are used to select the place and change the digits. Additional remarks 1. If n exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#200B. 2. If you declare the operand S 1 in ISPSoft, the data type is ARRAY [4] of BOOL. 3.
If you declare the operand D 2 in ISPSoft, the data type is ARRAY [8] of BOOLL. 6-519 103 102 101 1 2 4 8 10 103 1 2 4 8 2 4 8