G-Code Program Format - Mitsubishi Electric MELSEC iQ-R16MTCPU Programming Manual

Motion controller, g-code control, melsec iq-r series
Hide thumbs Also See for MELSEC iQ-R16MTCPU:
Table of Contents

Advertisement

G-code program format

The file format of a G-code program is shown below.
Item
Line feed code
Character code
File size
G-code program
A G-code program is a collection of units called "blocks" which command a single operation (sequence) of a machine. These
blocks describe the actual order in which the tool moves.
%
(Proc Prog1)
G91 G64 G00 X50. Y100. Z150.
G01 X100. Y200. Z300. F15000.
G04 P1
G09 G01 X-100. Y-200. Z-300. F15000.
G91 C500.
M02
%
No.
Name
(1)
Program start
(2)
Comment
(3)
Program block
(4)
Program end
• Write the program start and program end at the start of the block. When "%" is written at a place other than
the start of a block, it is not recognized as program start or program end.
• Write control out "(" at the start of the block. When "(" is written at a place other than the start of a block, it is
not recognized as a comment, and a minor error (error code: 1FC3H (details code: 0306H)) occurs when
the program is executed.
• When the start of the program block is not a character from "A" to "Z", a minor error (error code: 1FC0H
(details code: 0042H)) occurs. However, when the block is a line break only, that program is ignored and the
block No. is not counted.
5 G-CODE CONTROL PROGRAMS
92
5.1 G-Code Control Program Composition
Description
CRLF(0x0D, 0x0A)
ASCII code
Up to 512k bytes
(1)
(2)
(3)
(4)
Description
End of record (%) is always written on the first line of the G-code program.
The lines from end of record (%) to the end of record of program end (%) are read as one program.
When control out "(" is at the start of a block, that block is ignored and recognized as a comment. Information such as
program names and comments (ASCII code) can be written.
Also, for comments that are written on the line following end of record (%) in (1), 15 characters (excluding spaces) of that
comment are stored in "[Md.3070] Program comment being executed (D54588+128s to D54595+128s)" while the
program is being executed.
The program block is required for operation, and is made up of multiple blocks in the order of which control is performed.
A line break at the end of the program block is recognized as the end of the block.
End of record (%) is always written on the last line of the G-code program.
When end of record (%) is not written at the end of a G-code program, a minor error (error code: 1FC3H (details code:
0309H)) occurs.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec iq-r64mtcpuMelsec iq-r32mtcpu

Table of Contents