M-Code Data; M-Code Examples - Omron C200H-MC221 Operation Manual

Motion control unit
Hide thumbs Also See for C200H-MC221:
Table of Contents

Advertisement

M-code Outputs

5-6-2 M-code Data

M Codes 0 to 499
M Codes 500 to 999

5-6-3 M-code Examples

Example 1
X-axis operation
Outputs from
the MC Unit
Command
from the PC
108
3. In the PC, the processes corresponding to M code 100 are performed when
the M strobe goes ON. The PC turns ON the M code reset when these pro-
cesses are completed.
4. In the MC Unit, the M code is cleared to 0 and the M strobe is turned OFF
when the PC turns ON the M code reset.
5. When the M code reset from the PC goes OFF, block N003 is executed,
moving the X-axis to 0 mm.
6. The program ends in block N004.
There are some M codes that interlock as explained on the previous page, and
others that don't interlock. These differences are explained below.
When an M code is specified in a register or position data address, the specified
value will be rounded to the nearest integer value. An error will occur if the result
isn't an acceptable M code value (0 to 999).
M codes 0 to 499 are used to interlock with external devices. Execution of the
program is paused when there isn't an M code reset input.
Use M codes 500 to 999 when it isn't necessary to interlock. These M codes are
just output and the program is executed without waiting for an M code reset
input.
These M codes are cleared when the PROGRAM END function (G79) is
executed.
M codes can be used independently or in conjunction with "G codes" such as
G00 and G01 which execute axis operations.
The following program outputs M code 496.
N000
P000
N001
G01
N002
G01
N003
G79
M strobe
M code
M code reset
X
X100
F100
M496
X200
F100
When the M code reset of the
PC is turned OFF, the next block
N002 will be executed.
Section 5-6

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents