1 Program Structure of DVP-PM 1.4 Program Design Structure of O100, OX and Pn O100 main program, OX motion subroutine and Pn subroutine are introduced in 1.1 ~ 1.3. In this section, we will further illustrate the program structure mixed with the 3 types of programs. 1.4.1 The Program Structure Assume we would like to design an O100 main program, an OX0 motion subroutine, an OX3 motion subroutine, a P1 subroutine and a P2 subroutine (5 program sections) as the following sequential control process: To explain the example in an easier way, the program design will be given in section (1) ~ (5), as shown below:
DVP-PM Application Manual 1-7 Pn subroutine Explanation Start of the program Pn, start flag of Pn subroutine (P0 ~ P255) (*It will be inserted by PMSoft when compiling to IL instructions, therefore you don’t have to add it into ladder diagram.) End of the program SRET, instruction indicating the end of Pn subroutine (*It will be inserted by PMSoft when compiling to IL instructions, therefore you don’t have to add it into ladder diagram.) Activation 1. Call Pn subroutine in O100 main program. 2. Call Pn subroutine in OX motion subroutine. Execution Execute once whenever the subroutine is enabled. Re-enable it for the re-execution. Instructions supported 1. When called in O100:
supports basic instructions and application instructions 2. When called in OX: supports basic instructions, application instructions (API), motion instructions (MON) and G-Code instructions. Note: When you need to call Pn in OX and use basic instructions and application instructions, please avoid pulse-type instructions. Quantity 256 Pn subroutines are available Features & functions 1. A general-purpose subroutine 2. Can be called in O100 main program and OX motion subroutine 3. Can be placed in front of or after O100 main program and OX subroutines.
O100 main progr . . . Call OX0 . . . . . . . Call P2 . . . M102 am OX0 motion subroutine . . . Call P1 P1 subroutine . . . . . . M2 SRET P2 subroutine . . . Call OX3 OX3 motion subr . . . . . . SRET M2