AH500 Motion Control Module Manual 2. Whenever a P subroutine is called, it is executed once. After O100 or an Ox motion subroutine calls a P subroutine, the P subroutine will be executed. After the ending instruction SRET in the P subroutine is executed, the execution of the P subroutine will stop, and the lines under the instruction which calls the P subroutine will be executed. O100 and Ox10 diverge. M1000 Calling P0 OX10 Motion subroutine O100 Main program P2 subroutine P0 subroutine Cyclic scan X0.0 Setting the motion subroutine number Ox10 b If X0.0 is ON, Ox10 will be enabled. The path a is valid. a . . . . . . Ox10 is executed once. M1000 Calling P2 Ox10 is executed once.
Ox10 is executed once. . . . P2 is executed once. ABST . . P2 is executed once. . . Subroutine section . . The subroutine P0 supports basic instructions and applied instructions. The subroutine P2 supports basic instructions, applied instructions, motion instructions, and G-codes. 3. There are three methods of disabling a P subroutine. If the STOP/RUN switch of an AH500 series motion control module is turned form the “RUN” position to the “STOP” position when the AH500 series motion control module is powered, SM072 will be OFF, O100 will stop, and Ox motion subroutines and P subroutines will not be executed.
If an AH500 series motion control module is powered, users can use communication to set SR1030 to 0, to stop the execution of Ox motion subroutines, and to stop the execution of P subroutines. If an error occurs when a P subroutine is executed, the execution of the P subroutine will stop automatically. Please refer to appendix A for more information. 4. 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.
1-8 CALL P0 MOV 16#800A SR1052 MOV 16#1000 SR1030 CALL P2 MOV P K100 SR1020 DRV X-20000 Y20000 MOV P K100 SR1021