- 7 -
Chapter 2. MC Programming
Chapter 2. MC Programming
2.1 Types of MC program commands, variables and contacts usable
A) MC program commands can be grouped into 8 categories in large.
(1)
Program control related command: Commands for branching, ending, etc. of a program.
(2)
Conditional branching related command: Controls program branching via an input/output
condition and an IF condition comparison sentence.
(3)
Coordinate setting related command: Commands for resetting coordinate.
(4)
Velocity setting related command: Commands for velocity setting.
(5)
Movement related command: Commands for motor movement.
(6)
Input/output contact related command: Controls execution of input, output and auxiliary
contacts and programs.
(7)
Condition comparison related command: Used as a comparison operator for an IF condition
comparison sentence.
(8)
Variable manipulation related command: Used as an operator for a variable manipulation
sentence.
B) The variables usable for MC programs can be grouped into 4 categories in large.
(1)
P variable: Used to designate 2-dimensional position data.
(2)
F variable: Used to designate velocity data.
(3)
D(E) variable: Used to designate dwell data.
(4)
L variable: Used to designate 2-dimensional position, velocity, time, pulse,
manipulation and comparison data as a variable with multi-purpose functions.
C) The input, output and auxiliary contacts used in MC programs can be grouped into 3
categories in large.
(1) X contact: Used to designate an input contact.
(2) Y contact: Used to designate an output contact.
(3) M contact: Used to designate an auxiliary contact.
Table 2.1 List of MC program commands
Division
Command
Function
Type
Example of use
Program
/*
Declaration of a program comment
/* <comment>
/* TEST PROGRAM
LABL
Designation of a program branching point block
LABL <label name>
LABL LB1
GOTO
Program Branching command
GOTO <label name>
GOTO LB1
STOP
Program pause command
STOP
STOP
END
Program ending
END
END
DWL
Program pause
DWL <D variable
number(0~9)>
DWL <L variable>
DWL 0
DWL L0
Conditio
nal
branchin
g
IF
Branching of a program and proceeding of the
next command according to the result of a
comparing sentence
IF <condition comparing
sentence> <label name>
IF L0 .LE 0 LB1
IN0
Branching of a program if the designated
contact satisfies‘0’, otherwise proceeding of
the next command
IN0 <designated contact>
<label name>
IN0 X0.0 LB1
IN0 Y0.0 LB1
IN0 M0.0 LB1
IN1
Branching of a program if the designated
contact satisfies‘1’, otherwise proceeding of
the next command
IN1 <designated contact>
<label name>
IN1 X0.0 LB1
IN1 Y0.0 LB1
IN1 M0.0 LB1
Содержание MCU 2 Axis
Страница 1: ...User s Manual 2 AXES...