Appendix 2 Example Programs; Appendix 2.1 Reading M-Code - Mitsubishi Electric MELSEC Q Series Programming Manual

Motion controller, real mode
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

APPENDICES

APPENDIX 2 Example Programs

APPENDIX 2.1 Reading M-code

[Program Example]
System configuration
Motion SFC program
[G10]
[F10]
The program example for reading M-code at the completion of positioning start or
positioning is shown below.
The judgement of the positioning start completion and positioning completion is made
with the following signals.
• Positioning start completion .........M2400+20n (positioning start complete signal)
• Positioning completion ...............M2401+20n (positioning complete signal)
(1) A program that outputs the M-code from PY000 to PY00F to external destination
after conversion into BCD code at the positioning start completion is shown below.
Q61P
Q03UD
Q172D
QY40P
QY40P
CPU
CPU
PY000
PY010
to
to
PY00F
PY01F
Reading M-code
M2401
#0=BCD(D13)
DOUT PY0, #0
END
Q172D
LX
Positioning start complete flag for axis 1 ON ?
Read M-code for axis 1, and store to #0 after BCD conversion.
Output the data of "#0" to "PY000 to PY00F".
APP - 68

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents