After the user
program is downloaded to the drive, the SG command is used to save it to the flash memory, where it
is constantly resident. When the drive is powered on, an #AUTOEXEC routine causes the program to execute automatically
in an endless loop.
Since the slave linear motor is a stand-alone device (no communication with external host), an axis control sets
the digital input according to the application requirements and gets digital output as the application progresses:
Digital input 1: Initiates the system and sets homing mode.
- Digital input 2: The axis control starts to move the master and informs the slave accordingly.
- Digital output 1: Indicates the end of the initiation process.
- Digital input 2: Indicates a motor fault.
A homing sequence is performed on the FLS (Forward Limit Switch) and then on the index located in the middle of the
linear motor. In this application, the start position is ---2000, followed by the index origin.
The AUTO routine is used to interrupt the main loop when one of the following events occur:
- AUTO_I1: Digital input 1 is set high.
- AUTO_ER: The motor has been automatically shut down due to a fault, which can be read using the MF
command. In this case, an output is set to indicate that a fault has occurred and the JZ command is used to return
to the main loop. This is done because motor faults can appear any time (for example, main power is down) and overflowing
the program counter should be avoided.