User`s manual
App - 1 App - 1
MELSEC-Q
APPENDIX
APPENDIX
Appendix 1 EXAMPLE PROGRAM
In the following program, the operation mode switches to the manual mode at power-on. Turning
X10 ON selects AUTO (automatic mode), starting PID control.
R1001H10MOVP
Changes operation mode to AUTO.
Changes Alarm Detection (ALM) to 0.
P0
CALL
Jumps to P0 label when SM402 is ON.
Sets last value hold processing.
Resets last value hold processing.
Sets output value hold processing.
Resets output value hold processing.
T0
Match with the time set for the execution cycle.
M0PLS
Jumps to P1 label when M0 is ON.
Changes T0 data to 0 when M0 turns ON.
Indicates the end of sequence program where SM402 is OFF.
R0D0
FLT
Converts D0 value into real number and stores it into R0.
R1000R200R100R0S.IN
Sets each head device of S.IN instruction.
R20R100EMOV
Transfers R100 value of S.IN instruction to R20 of S.PHPL.
R1000R220R120R20S.PHPL
Sets each head device of S.PHPL instruction.
R40R120EMOV
Transfers R120 value of S.PHPL instruction to R40 of S.PID.
R300R1000R240R140S.PID R40
Sets each head device of S.PID instruction.
R60R140EMOV
Transfers R140 value of S.PID instruction to R60 of S.OUT1.
0
X10
SM402
X1
X1
X2
X2
31
24
21
16
14
5
8
10
12
32
P1
R1003H0MOVP
SM1500
SET
SM1500RST
SM1501
SET
SM1501RST
K1X0
P1
CALL
T0RST
FEND
T0
M0
SM400
R1000R260R160R60S.OUT1
Sets each head device of S.OUT1 instruction.
Converts R160, R161 real number into binary.
D1R160INT
App










