User`s manual
Table Of Contents
- MPC-684 family
- The feature of the MPC-684
- Program development environment
- How to connect
- Input commands
- I/O check
- How to input program
- Edit of a program
- How to program save to the PC, load from the PC
- I/O control
- Variable, Array variable, String variable, Memory I/O
- Calculation
- Pulse generation
- Multi-task
- RS-232 communication
- Debugging
- Use touch panel
- Command List

Subroutine
A subroutine is a piece of code, much like any code in a program. A subroutine has an entry point
and an exit point. At the entry of a subroutine, the system remembers where to resume execution
when the subroutine finishes. When the subroutine finishes, the system resumes execution at this
location.
If you make subroutines for each job, you can access them from the main routine, it will be easier to
read and customize a program.
100 GOSUB *HOME
110 GOSUB *CLAMP
120 GOSUB *UNCLAMP
2000 *HOME
2010 'move to origin
2020 HOME X_A -1000 IN1_ON
2030 WAIT RR(X_A)==0
2040 STPS 0 0 0 0
2050 PRSET_ACCEL X_A
2060 FEED X_A 0
2070 RETURN
3000 *CLAMP
3010 'seize
3020 ON 0
3030 OFF 1
3040 RETURN
4000 *UNCLAMP
4010 'release
4020 ON 1
4030 OFF 0
4040 RETURN
Main routine
Subroutine
14