6 Interface Between CNC And PLC
6 - 19
• Command Code for Program Selection from External Device (C120)
C120 = 1, function of program selection from external device ON
C120 = 0, function of program selection from external device OFF
R226 is the register to store the program number from external device while R255
stores the current program number. When C120 = 1, the number in R255 will be
replaced by the number in R226.
• Command for Spindle Speed Control (in %) from External I/O Device (C121)
C121 = 1, Spindle speed percentage = value in R225.
C121 = 0, Spindle speed percentage = value in R224.
Ex 1: C121 = 1, use X-axis as spindle by setting R238 = 1, R225 = 60.
V-command to spindle = 10 * R225 = 10 * 60% = 6 V
Ex 2: C121 = 0, use Y-axis as spindle by setting R238 = 2, R224 = 50.
If MCM #92 = 2000 rpm (spindle speed at 10V) and S = 1000 rpm
V-command to spindle = 10 * (1000/2000) * R224 = 10 * (1/2) * 50% = 2.5V
Spindle RPM = 1000 * 50% = 2000 * (2.5/10) = 500
• Set Work Coordinate (C123)
When C123 = 1→0 (Falling edge) and R228 = 0, select G54 as work coordinate.
When C123 = 1→0 (Falling edge) and R228 = 1, select G55 as work coordinate.
When C123 = 1→0 (Falling edge) and R228 = 2, select G56 as work coordinate.
When C123 = 1→0 (Falling edge) and R228 = 3, select G57 as work coordinate.
When C123 = 1→0 (Falling edge) and R228 = 4, select G58 as work coordinate.
When C123 = 1→0 (Falling edge) and R228 = 5, select G59 as work coordinate.
• Simultaneous Execution for M-code, S-code, T-code (C125)
When C125 =1, all M-code, S-code and T-code will be executed simultaneously.
For example: G01 X100. S2000 M18
When C125 =0, the controller will execute M18 first, then start the motor.
When C125 =1, the controller will execute M18 and start motor simultaneously.
• Axial Data Input Disabled in TEACH Mode (C128~C129)
C128 =1, X-axis data input disabled when in TEACH mode.
C129 =1, Y-axis data input disabled when in TEACH mode.
• DRO Mode Enabled (C144~C145)
C144 =1, Digital readout mode on X-axis enabled.
C145 =1, Digital readout mode on Y-axis enabled.