EDH0162En1040 – 06/99 6.18
MM4005 Feature Descriptions Tutorial
Executing Sub-Routines in a Program: EX Command
The MM4005 is capable of executing complex programs containing sub-rou-
tines.
The sub-routines are blocks of commands that do not contain the EX com-
mand. They are called by the main program.
Example
| ********* Program 1 (Main Program) *********
1EP
| Enter program 1.
1PA10, 2PA10 | Two-axis movement.
2EX | Execute program 2.
3EX | Execute program 3.
4EX | Execute program 4.
OR | Origin search on all axes.
QP | Quit main program.
| **************** Program 2 ****************
2EP
| Enter program 2.
SB | Set bits.
1AS"This " | Define string # 1.
2AS"is " | Define string # 2.
1CS$S2 | Concatenate string # 1 and string # 2.
DS$S1"a string" | Display on screen.
WT3000 | Wait for 3 seconds.
QP | Quit program 2.
| **************** Program 3 ****************
3EP
| Enter program 3.
3AS"a value: " | Define string # 3.
101YS99.99 | Define value # 101.
3CS$Y101 | Concatenate string # 3 and value # 101.
DS$S1$S3 " !" | Display on screen.
WT3000 | Wait for 3 seconds.
QP | Quit program 3.
| **************** Program 4 ****************
4EP
| Enter program 4.
1PR-20,WS | Axis 1 movement.
2PR-20,WS | Axis 2 movement.
CB | Clear bits.
WT1000 | Wait for 1 second.
QP | Quit program 4.
THIS IS A STRING | Display on controller screen.
THIS IS A VALUE: 99.99 ! | Display on controller screen.
6.17
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com