Delta DVP-PM series motion controllers support M-Code. What is M-code? How to use it?M-Code is an auxiliary function and generally placed in the subroutine of OX00~OX99 and used to be interrupt point of the program. If M-Code instruction is used in the program, when executing M-Code instruction, it is need to save the M-code into D1703 first. When M-Code is activated, the status of M1794 will be ON automatically. If M1744 is set to be ON at this time, M1794 will be OFF and it indicates that the operation of M-Code instruction is completed.
Using M-Code is able to control Y output. When high byte of D1873 is set to 1, it indicates output function is enabled. If setting low byte of D1873 to the starting number of Y output, when the status of M1794 is turned to ON, i.e. M-Code instruction is activated, the Y output which corresponds to D1873 will be ON also. When the status of M1794 is set to OFF, Y output will be OFF as well. Please refer to the following example. It is suppose that the users can display the current execution number of M-Code via Y device when M6 is activated.
(1)First set the parameter values of D1873 as follows:
Please see the picture
(2)Execute M-Code (M6), and then DVP-PM series will write the value of K6 into D1703 automatically and write the value of D1703 into K2YN. Please note that N is the starting number of Y output. For example:
MOV H6 D1703
MOV D1703 K2YN