2 basic program structure – Yaskawa MotionSuite Series Machine Controller Programming Manual User Manual
Page 12

MotionSuite™ Series Machine Controller Programming Manual
Chapter 1: Motion Programmming Outline
1-3
1.1.2
Basic Program Structure
a. Motion programs are written in a text format motion language. Up to 256 of
these motion programs can be created separately.
b. Motion programs are of the following two types: Main programs (MPM""")
which can be called out from DWG.H, and sub-programs (MPS""") which
can be called out from the main program.
Important Point
Numbers of the MPM and MPS programs cannot be duplicated.
Calculations are Flexible and Dependable
• Integer arithmetic operations
• Real number arithmetic operations
• Logical operations
• Trigonometric operations
• Exponents
• Logarithms
• etc.
Example of Operation Commands:
MW81D=AB01H*SIN(100)+50;
MW5=BCD (1W0001);
IF CF476 <> DF897;
IF MW0001 > 7;
IF 0B0 == 1;
0B0 = (IB0 | IB2 | IB3) & 1B1;
MW6 = SQT (MW809);
Conditional Branching Commands
IF <Conditional>
•
•
Processed when conditions established
•
•
ELSE
•
•
Processed when conditions not established
•
•
IEND
Repeat Commands
WHILE <Conditional>
•
•
Processing
•
•
WEND
Control Commands
• Conditional branching commands (IF/ELSE)
• Repeat commands (WHILE)
• Timer commands (TIM)
• Subroutines (MSEE)
• Parallel execution commands (PFORK)
• Selection execution commands (SFORK)