Chapter 1 Framework of an AH500 Series Motion Control Module 1.4 Structure of P Subroutines P subroutines are general subroutines. They can be called by O100 and Ox motion subroutines. If P subroutines are called by O100, the P subroutines will support basic instructions and applied instructions. If P subroutines are called by Ox0~Ox99, the P subroutines will support basic instructions, applied instructions, motion instructions, and G-codes. After O100 or an Ox motion subroutine calls a P subroutine, the P subroutine will be executed. After SRET in the P subroutine is executed, the lines under the instruction which calls the P subroutine will be executed. 1.
There are two methods of enabling a P subroutine. O100 can call P subroutines. Ox motion subroutines can call P subroutines. 1-7 Ox motion Description subroutine Executing an Ox motion subroutine 1. If users set bit 12 in SR1030 to ON when O100 runs, an Ox motion subroutine will be enabled. 2. If users use communication to set bit 12 in SR1030 to ON when O100 runs, an Ox motion subroutine will be enabled. Note: Before an Ox motion subroutine is enabled, users have to make sure that no Ox motion subroutine runs. Operation characteristic Whenever an Ox motion subroutine is enabled, it is executed once. If an Ox motion subroutine needs to be executed again, it has to be enabled again.
Instruction Basic instructions, applied instructions, motion instructions, and G-codes are supported. Note: Users have to avoid using pulse instructions. Number There are 100 Ox motion subroutines in a program. If users want to enable a motion subroutine number, they have to set SR1052, and set bit 12 in SR1030 to ON. Characteristic and function 1. Ox0~Ox99 are motion subroutines. (They can only be enabled by O100.) 2. They can control the motion of the axes of an AH500 series motion control module. Please refer to the description of G-code for more information. 3. An Ox motion subroutine can be enabled/disabled by a program or communication. 4. Ox motion subroutines can call P subroutines.
5. If Ox motion subroutines are used with O100 and P subroutines, the Ox motion subroutines, O100, and the P subroutines can be arranged in any order.