Appendix1 Example Program - Mitsubishi Electric MELSEC-Q QnPHCPU Programming Manual

Table of Contents

Advertisement

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.
X10
0
SM402
5
X1
8
X1
10
X2
12
App
X2
14
X0
16
T0
21
M0
24
31
P1
SM400
32
App - 1
MOVP
H10
R1001
MOVP
H0
R1003
CALL
P0
SET
SM1500
RST
SM1500
SET
SM1501
RST
SM1501
K1
T0
PLS
M0
CALL
P1
RST
T0
FEND
FLT
D0
R0
S.IN
R0
R100
R200
R1000
EMOV
R100
R20
S.PHPL
R20
R120
R220
R1000
EMOV
R120
R40
S.PID R40
R140
R240
R1000
R300
EMOV
R140
R60
S.OUT1
R60
R160
R260
R1000
INT
R160
D1
Changes operation mode to AUTO.
Changes Alarm Detection (ALM) to 0.
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.
Match with the time set for the execution cycle.
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.
Converts D0 value into real number and stores it into R0.
Sets each head device of S.IN instruction.
Transfers R100 value of S.IN instruction to R20 of S.PHPL.
Sets each head device of S.PHPL instruction.
Transfers R120 value of S.PHPL instruction to R40 of S.PID.
Sets each head device of S.PID instruction.
Transfers R140 value of S.PID instruction to R60 of S.OUT1.
Sets each head device of S.OUT1 instruction.
Converts R160, R161 real number into binary.
MELSEC-Q
App - 1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-q qnprhcpu

Table of Contents