GSK GSK218MC, GSK218MC-H, GSK218MC-V, GSK218MC-U1 Installation Manual

Page 1
This user manual describes all proceedings concerning the
operations of this CNC system in detail as much as possible. However, it is
impractical to give particular descriptions for all unnecessary or unallowable
system operations due to the manual text limit, product specific applications
and other causes. Therefore, the proceedings not indicated herein should
be considered impractical or unallowable.
This user manual is the property of GSK CNC Equipment Co., Ltd.
All rights are reserved. It is against the law for any organization or individual
to publish or reprint this manual without the express written permission of
GSK and the latter reserves the right to ascertain their legal liability.
This User Manual is suitable for the following CNC systems
manufactured by GSK CNC EQUIPMENT CO., LTD.
Page 2
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Series No. Product type Structure
GSK218MC Integral 10.4
GSK218MC-U1 Integral 8.4
GSK218MC
GSK218MC-H Horizontal 8.4
GSK218MC-H2 Horizontal 10.4
GSK218MC-V Vertical 10.4
LED
Remark
dimension
LED dimension is 10.4 inch by default
LED dimension is 8.4 inch by default
LED dimension is 8.4 inch by default
LED dimension is 10.4 inch by default
LED dimension is 10.4 inch by default
Wherein, GSK218MC, GSK218MC-H and GSK218MC-V have
three communication interfaces such as the RS232, USB and
network of which these interfaces are set on the front of the host.
GSK218MC-U1 owns only two communication interfaces
such as the RS232 and USB; the USB interface set on the front of
the host and the RS232 interface set on the back of the host.
II
Page 3
Preface & Precaution
PREFACE
Your Excellency,
It’s our pleasure for your patronage and purchase of this
GSK218MC Series Machining Center CNC System made by GSK CNC
Equipment Co., Ltd.
This manual is the part of the “PLC and Installation Connection
Manual” of Machining Center CNC System User Manual for
GSK218MC Series, which is introduced its programming method and
installation connection
In order to guarantee the product is operated with a safe, normal
and effective situation, it is necessary to carefully read this manual
before installing and using this product.
Chinese version of all technical documents in Chinese and
English languages is regarded as final.
III
Page 4
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
SECURITY PRECAUTION
Accident may occur by improper operation! This system
only can be operated by authorized and qualified personnel.
Especial prompt: The system power installed on (inside) the
cabinet is the special-purpose one made by GSK CNC system.
Never attempt to use for other purposes by this power. Otherwise,
tremendous hazard may occur!
IV
Page 5
Preface & Precaution
possible
STATMENT!
告、注意和注释的说明
z In this manual we have tried as much as possible to describe all
various matters. However, we cannot describe all the matters which
must not be done, or which cannot be done, because there are so
many possibilities. Therefore, matters which are not especially
described as possible in this manual should be regarded as
im
WARNING!
z Thoroughly read this manual and user manual issued by the machine
manufacturer, and strictly operate the machine based upon the
requirement of this manual before installing, programming and
operating the machine; otherwise, possibly causing damage to the
product, machine itself, as well the obsolete workpiece or injury to the
user.
V
Page 6
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
z The product functions and technical indexes (such as accuracy,
velocity) described in this manual are only directed against this
product. The CNC installed this product, the actual function
configuration and the technical capacity are determined by the
machine manufacturer; the function configurations of the CNC
machine and technical indexes are subjected on the manual issued
by the machine builder.
NOTICE!
All specifications and designs are subject to change without notice.
VI
Page 7
Preface & Precaution
SAFETY PRECAUTIONS
Transportation and Storage
z Do not pile up the carton over 6 layers.
z Do not climb, stand on the carton; do not place heavy objects on it.
z Do not drag or move the products using the cables connected with the product.
z Do not impact, scratch the panel and screen.
z Avoid from the damp, the sunshine and the rain on the product carton.
Unpacking inspection
z Check whether it is your purchased product after unpacking the carton.
z Check whether the product is damaged during transporting.
z Check whether the components are prepared or damaged comparing with the
packing list.
z It is necessary to contact our company immediately if the product type is
inconsistent with the packing list, lack of accessories or damage in
transportation.
Wiring
z The person who executes the wiring and inspection should have the
corresponding professional capacity.
z The product should be reliably grounded, and its resistance should be less than
0.1 and can not be used the neutral conductor (zero cable) to replace the
ground wire.
z The wiring should be correct and firm, otherwise, possibly causing the
malfunction in product or unexpected result.
z The surge absorb diode connected with the product should be linked based upon
the described direction, otherwise, it may damage the product.
z Before Inserting/pulling out the plug or opening the main cabinet of the product, it
VII
Page 8
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
is important to cut off the product’s power.
Inspection and maintenance
z Cut off the power before inspecting and maintaining or changing the
components.
z Check the malfunction when the short-circuit or overloading occurs. The
computer can be started after the malfunction is eliminated.
z Do not power ON/OFF frequently for the product, if you want to turn on the
power again after power off, its interval time is 1min. at least.
VIII
Page 9
Preface & Precaution
Volume Programming Description
Introduce the PLC’s specification, address, basis code and
function code of the GSK218MC series
Volume Operation Description
Introduce the PLC’s relative operation proceedings of
GSK218MC series
Volume III Function Description
Introduce the PLC’s main function of GSK218MC series
Volume Installation and Connection
Introduce the installation, connection and setting method of
the GSK218MC series CNC system
Appendix
Introduce the ladder diagram user guide about the GSK218MC
CNC system matching with the tool magazine
IX
Page 10
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
SECURITY RESPONSIBILITY
Security responsibility of the manufacturer
——Manufacturer should take responsibility for the design and structure danger of the
motor and the accessories which have been eliminated and/or controlled.
——Manufacturer should take responsibility for the security of the motor and
accessories.
——Manufacturer should take responsibility for the offered information and
suggestions for the user.
Security responsibility of the users
——User should know and understand about the contents of security operations by
learning and training the security operations of the CNC system.
——User should take responsibility for the danger because of increasing, changing or
modifying the original CNC system or accessories by themselves.
——User should take responsibility for the danger without following the operations,
maintenances, installations and storages described in the manual.
This manual is stored by the last user.
Sincerely thanks for your friendly supporting of GSK’s
products!
X
Page 11
Content
CONTENTS
VOLUME I PROGRAMMING ............................................................................................ 1
CHAPTER ONE SQUENCY PROGRAMMING COMPILATION SCHEDULE ......2
1.1 GSK218MC Series PLC Specification ................................2
1.2 Concept of the Sequence Programming .............................. 2
1.3 Distribution Interface (Step one) ..................................... 3
1.4 Ladder Diagram Compilation (Step two) .............................. 3
1.5 Sequence Programming Debugging (Step 3) .......................... 3
CHAPTER TWO SEQUENCE PROGRAMMING........................................................ 5
2.1 Performance Process of Sequence Programming ...................... 5
2.2 Cycle Performance ................................................ 6
2.3 Priority Sequence of the Execution (the 1st Level, the 2nd level) ............ 6
2.4 Sequence Program Structure ......................................... 7
2.5 Input/output Signal Treatment......................................... 9
2.5.1 Input Signal Treatment.............................................................................. 9
2.5.2 Treatment of the Output Signal ........................................................... 10
2.5.3 Distinguish of Signal State Between 1st Level and 2nd Program....... 10
2.6 Interlocking ...................................................... 11
CHAPTER THREE PLC ADDRESS .............................................................................13
3.1 Machine → PLC address (X) ...................................... 13
3.1.1 X Address on I/O Input............................................................................ 14
3.1.2 X Address on MDI Panel......................................................................... 14
3.2 PLC Address of Machine Tool Side (Y) ........................... 16
3.2.1 Y Address on I/O Output Port ................................................................. 16
3.3 PLC CNC Address (G) .......................................... 18
3.4 CNC PLC Address (F) .......................................... 19
3.5 Internal Replay Address (R) ........................................ 19
3.6 Nonvolatile Relay Address (K) ...................................... 20
3.7 Information Display Request Address (A) ............................ 20
3.8 Counter Address (C) .............................................. 21
3.9 Counter Preset Value Address (DC) ................................. 21
3.10 Timer Address (T) ...............................................21
3.11 Presetting Value Address of Timer (DT) ............................. 21
3.12 Data Table Address (D)........................................... 21
3.13 Address Mark (L) ................................................ 21
3.14 Subprogram Number (P) ......................................... 22
CHAPTER FOUR PLC BASIS CODE........................................................................... 23
4.1 RD, RD.NOT, WRT, and WRT.NOT Codes ........................... 23
4.2 AND, AND.NOT Codes ............................................ 24
4.3 OR, OR.NOT Codes .............................................. 25
XI
Page 12
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
4.4 OR. STK Code .................................................. 25
4.5 AND. STK Code ................................................. 26
CHAPTER FIVE PLC FUNCTION CODE................................................................... 27
5.1 END1 (The 1st Level Sequence Program End) ....................... 28
5.2 END2 (The 2nd Sequence Program End) ............................ 28
5.3 CALL (Call Subprogram) .......................................... 28
5.4 CALLU (Unconditionally Call Subprogram) .......................... 29
5.5 SP (Subprogram) ................................................ 30
5.6 SPE (End of Subprogram)......................................... 30
5.7 SET (Replacement/Setting) ....................................... 31
5.8 RST (Resetting) ................................................. 31
5.9 JMPB (Mark Number Skip) ........................................ 32
5.10 LBL (Mark Number) ............................................. 33
5.11 TMR (Timer).................................................... 33
5.12 TMRB (Fixed Timer)............................................. 34
5.13 TMRC (TIMER) ................................................. 35
5.14 CTR (Binary Counter) ........................................... 36
5.15 DEC (Binary Decoding) .......................................... 38
5.16 COD (Binary System Code Conversion) ........................... 39
5.17 COM (Concentric Line Control) ................................... 40
5.18 COME (Concentric Line Control End) .............................. 41
5.19 ROT (Binary Rotation Control) .................................... 41
5.20 SFT (Register Displacement/Shifting) .............................. 44
5.21 DIFU (Rising Edge Detection) .................................... 45
5.22 DIFD (Descending Edge Detection) ............................... 46
5.23 COMP (Comparison of Binary Number) ............................ 47
5.24 COIN (Consistency Comparison).................................. 48
5.25 MOVN (Data Transmission) ...................................... 48
5.26 MOVB (Transmission of 1 Byte)................................... 49
5.27 MOVW (Transmission of Two Bytes)............................... 50
5.28 XMOV (Binary Indexed Data Transmission) ........................ 51
5.29 DSCH (Binary Data Index) ....................................... 52
5.30 ADD (Binary Addition) ........................................... 53
5.31 SUB (Binary Subtraction) ........................................ 54
5.32 ANDF (Bit-by-bit AND) ........................................... 55
5.33 ORF (Bit-by-bit OR) ............................................. 56
5.34 NOT (Bit-by-bit NOT) ............................................ 57
5.35 EOR (Exclusive OR) ............................................ 58
CHAPTER SIX COMPILATION LIMIT OF LADDER DIAGRAM......................... 60
VOLUME II OPERATION EXPLANATION ................................................................... 62
CHAPTER ONE PLC INTERFACE DISPLAY ........................................................... 64
1.1 GSK218MC Series Automatic Operation in PLC ON................. 64
1.2 Program-Controlled Interface Display ............................... 64
XII
Page 13
Content
1.2.1 INFO Interface ........................................................................................ 64
1.2.2 PLCGRA Interface .................................................................................. 66
1.2.3 PLCPAR Interface................................................................................... 66
1.2.4 PLCDGN Interface .................................................................................. 67
1.2.5 PLCTRAE Interface ................................................................................ 68
CHAPTER TWO PLC PROGRAMMING OPERATION........................................... 72
2.1 Brief ............................................................ 72
2.2 Basis Code ...................................................... 73
2.3 Operation Explanation of Ladder Diagram ........................... 74
2.4 Function Code ................................................... 77
2.5 Command Table .................................................. 78
2.6 Compilation Command ............................................ 79
2.7 PLC Operation Steps.............................................. 80
CHAPTER THREE PLC ADDRESS AND PARAMETER SETTING....................... 82
3.1 Nonvolatile/Hold Relay ............................................ 82
3.2 Timer ........................................................... 84
3.3 Data List......................................................... 85
3.4 Counter ......................................................... 86
3.5 M function corresponding to F address .............................. 87
CHAPTER FOUR USER EXPLANATION OF LADDER DIAGRAM SOFTWARE
EDIT.....................................................................................................................................90
4.1 Brief ............................................................ 90
4.2 Software Introduction.............................................. 90
4.2.1 Software Start ......................................................................................... 90
4.2.2 Function Introduction .............................................................................. 91
4.3 Software Operation ............................................... 92
4.3.1 Toolbar ………………………………………………………………………92
4.3.2 Selection of Figure.................................................................................. 94
4.3.3 Editing of Figure...................................................................................... 95
4.3.4 Ladder Diagram Note.............................................................................. 96
4.3.5 Leading-out............................................................................................. 98
VOLUME III FUNCTION EXPLANATION ................................................................... 100
CHAPTER ONE CONTROLLABLE AXIS................................................................102
1.1 Output of Axis Movement ......................................... 102
1.2 Servo Signal Ready.............................................. 103
CHAPTER TWO OPERATION PREPARATION.....................................................104
2.1 ESP ........................................................... 104
2.2 CNC Overtravel Signal ........................................... 104
2.3 Alarm Signal .................................................... 105
2.4 Selection of Operation Method .................................... 106
2.5 State Signal Output .............................................. 106
XIII
Page 14
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
CHAPTER THREE MANUAL OPERATION............................................................ 108
3.1 JOG Feed/Incremental Feed ..................................... 108
CHAPTER FOUR REFERENCE POSITION RETURN........................................... 112
4.1 Manual Reference Position Return ................................ 112
4.2 Return to Reference Position Detection Signal ...................... 113
4.3 Area Detection Signal ........................................... 114
CHAPTER FIVE AUTOMATICAL OPERATION................................................... 116
5.1 Cycle Start/ Feed Dwell .......................................... 116
5.2 Resetting ...................................................... 118
5.3 Program Testing ................................................ 119
5.3.1 Machine Tool Lock .................................................................................119
5.3.2 Dry Run …………………………………………………………………….119
5.3.3 Single Block .......................................................................................... 120
5.4 Skip Optional Block ............................................. 121
5.5 Program Restart ................................................ 122
CHAPTER SIX FEEDRATE CONTROL................................................................... 124
6.1 Rapid Traverse Rate ............................................ 124
6.2 Feedrate Override............................................... 124
6.3 Override Cancellation............................................ 125
CHAPTER SEVEN MISCELLANEOUS FUNCTION.............................................. 126
7.1 M Code Miscellaneous Function .................................. 126
7.2 S Code Miscellaneous Function................................... 127
7.3 T Code Miscellaneous Function ................................... 128
7.4 Miscellaneous Function Lock ..................................... 132
CHAPTER EIGHT SPINDLE VELOCITY FUNCTION.......................................... 134
8.1 Spindle Velocity Control Method................................... 134
8.1.1 Gear Spindle ......................................................................................... 134
8.1.2 Analog Spindle ...................................................................................... 134
8.2 Rigid Tapping................................................... 136
CHAPTER NINE PROGRAMMING CODE.............................................................. 138
9.1 User Macro Program ............................................ 138
9.2 Canned Cycle .................................................. 140
CHAPTER TEN DISPLAY/SETTING........................................................................ 142
10.1 Clock Function ................................................ 142
10.2 Operation Record Display ....................................... 142
10.3 Help Function ................................................. 142
CHAPTER ELEVEN MEASURING ........................................................................... 144
11.1 Skip Function .................................................. 144
CHAPTER TWELVE PANEL LOCK SETTING ...................................................... 146
VOLUME IV INSTALLATION & CONNECTION...................................................... 157
XIV
Page 15
Content
CHAPTER ONE SYSTEM CONFIGURATION & INSTALLATION .................... 159
1.1 System Composition ............................................. 159
1.2 System Installation and Connection ................................ 159
1.3 CNC System Appearance Installation Dimension Figure .............. 161
1.4 Additional Panel Figure........................................... 167
CHAPTER TWO CONNECTION BETWEEN EQUIPMENTS............................... 169
2.1 Connection Diagram of External System ............................ 169
2.1.1 Layout of Interface Position ...................................................................169
2.1.2 Pulse Servo Connection Schematic.......................................................171
2.1.3 Bus Servo Connection Schematic .........................................................172
2.1.4 Five-Linkage Servo Connection Schematic Using Bus Technology.......173
2.2 Connection Between System and Drive Unit......................... 174
2.2.1 System Interface Figure.........................................................................174
2.2.2 Interface Signal List ...............................................................................174
2.2.3 Signal Explanation .................................................................................175
2.2.4 Cable Connection Figure .......................................................................177
2.2.5 GSK-LINK Cable Connection Figure .....................................................179
2.2.6 External Wiring Figure of GL100 Bus Extension Module .......................181
2.3 RS232 Standard Series Interfaces ................................. 182
2.4 Connection of MPG/Hand Unit..................................... 183
2.4.1 Interface Signal Figure...........................................................................183
2.4.2 Explanation of Interface Signal ..............................................................183
2.5 Connection of Spindle Unit ........................................ 186
2.5.1 Interface Signal Table ............................................................................186
2.5.2 Explanation of Interface Signal ..............................................................186
2.5.3 Cable Connection Figure .......................................................................187
2.6 System Power Interface .......................................... 189
2.7 External Power Control Interface .................................. 189
2.8 Connection of Communication Cable ............................... 189
CHAPTER THREE I/O INTERFACE OF MACHINE CONTROL......................... 191
3.1 Interface Signal Table ............................................ 191
3.2 Interface Input................................................... 191
3.2.1 Interface Circuit Input.............................................................................191
3.2.2 Interface Circuit of Hand Unit.................................................................192
3.2.3 Interface Definition of Signal Input .........................................................193
3.3 Interface Output ................................................. 196
3.3.1 Interface Circuit Output ..........................................................................196
3.3.2 Interface Definition of Signal Output ......................................................197
CHAPTER FOUR MACHINE DEBUGGING............................................................199
4.1 Debugging Preparation ........................................... 199
4.2 System Power-ON ............................................... 200
4.3 ESP and Limit ................................................... 200
4.4 Gear Ratio Adjustment ........................................... 202
XV
Page 16
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
4.5 Backlash Compensation ......................................... 204
4.6 Setting Related with Drive unit .................................... 205
4.7 Machine Tool Pitch Compensation................................. 206
4.8 Mechanical Zero Return (Machine Zero Return) ..................... 213
4.8.1 Mechanical Zero Return in Pulse Method ............................................. 214
4.8.2 Servo Zero Return Function Setting of Bus Type .................................. 217
4.9 Input/Output Signal Control of Spindle Positive/Negative ............. 223
4.10 Spindle Automatic Gear-shift Control ............................. 225
4.11 External Cycle Start & Feed Hold................................. 227
4.12 External Editing Lock and the External Operation Panel Lock ........ 228
4.13 Cooling, Lubrication and Chip-Removal Control .................... 228
4.14 Setting Related to Feedrate ..................................... 229
4.15 Setting Related with Tapping Parameter .......................... 231
4.16 Setting for the 4th Axis .......................................... 234
4.17 Setting About the Bus Servo..................................... 236
APPENDIX .......................................................................................................................... 243
APPENDIX I LADDER DIAGRAM USAGE GUIDE OF GSK218MC SERIES WITH
CONE TYPE TOOL-MAGAZINE..................................................................................... 245
I. Cautions When Using the Cone Type Tool-Magazine Ladder Diagram .. 245 II. Configuration and Definition of PLC I/O Address and Internal Software
Components …………………………………………………………………….245
III. The Usage and Maintenance of the Cone Tool Magazine.................... 270
IV. The Macro Note Matching with the Cone Tool Magazine..................... 278
APPENDIX II LADDAR DIAGRAM USE GUIDE OF GSK218MC SERIES
MATCHING WITH DISC TOOL MAGAZINE................................................................. 281
I. The application precautions of the disc tool magazine......................... 281
II. The Configuration and Definition of the PLC I/O Address and Internal Soft
Component ……………………………………………………………………281
III. The Usage and Maintenance with Manipulator Tool Magazine.............. 310
IV. Macro Note with Disk Tool Magazine ....................................................... 317
APPENDIX III FILE FORMAT OF LADDER DIAGRAM CONFIGURATION........ 319
I. F Signal and Meaning of the M Code M00---M99....................................... 319
II. That the “%” Takes One Single Line Means that the M code Information
Storage is End …………………………………………………………………….319
III. The Code and Meaning of the X Signal X0.0---X6.7 ................................ 319
IV. The Code and Meaning of the Y Signal Y0.0---Y5.7 ................................ 320
V. The Code and Meaning of the K Signal K6.0---K63.7............................... 320
VI. The Code and Meaning of the A Signal A0.0---A31.7 ........................... 320
VII. end//End Mark.....……………………………………………………………….320
XVI
Page 17
VOLUME I PROGRAMMING
Volume I
Programming
1
Page 18
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
CHAPTER ONE SQUENCY PROGRAMMING COMPILATION
1.1 GSK218MC Series PLC Specification
GSK218MC series PLC specification is shown below:
Volume I Programming
SCHEDULE
Table 1-1-1
Specification GSK218MC Series PLC
Programming language Ladder
Program level 2
The 1st level program execution cycle 8ms
Basis code average treatment time 5μs
Programming capacity 4700 steps
Code Basis code + function code
Internal relay (R)
PLC alarm detection (A)
Nonvolatile memory area
Timer (T)
Counter (C)
Data base (D)
Nonvolatile relay (K)
Counter prevalue data register (DC)
Timer prevalue data register (DT)
Subprogram (P)
Mark (L)
Input signal of NC side (F)
Signal outputs to the NC side (G)
I/O module (X)
Y
0~511 byte
0~31byte
0~127 word 0~127 word 0~255 word
0~63 byte 0~127word 0~127word
0~99
0~99
063byte
063byte
0~63 byte
0~47 byte
1.2 Concept of the Sequence Programming
The so-called sequence programming is the one that performing the logic control to the
machine tool and its relative equipments.
After the programming is converted into some kind of format, CPU can be performed its code
and calculation treatment for it, and its fruits can be memorized to RAM. CPU can be rapidly read
each code stored in the memory, which can be performed the programming according to the
calculation operation.
2
Page 19
Chapter One Squency Programming Compilation Schedule
The compilation of the sequence programming starts with the ladder diagram.
1.3 Distribution Interface (Step one)
The interface can be distributed after confirming the control object and calculating the points of
the corresponding input/output signal.
Refer to the Chapter Four Input/output interface signal table in the Volume Four Installation and
Connection when distributing the interface.
1.4 Ladder Diagram Compilation (Step two)
The required control operation can be expressed by the ladder diagram with the on-line
Volume I Programming
Volume I Programming
compilation of the Gsk218MC series ladder diagram. The functions, such as the timer and counter,
can not be expressed by relay symbols, which can be indicated by the specified function code
symbols.
The compiled ladder diagram should be stored and converted into the corresponding PLC
codes before operating, namely, the so-called instruction list.
1.5 Sequence Programming Debugging (Step 3)
The sequence programming can be debugged using the following methods:
Debugging with emulator
The machine tool can be replaced by an emulator (it composes of the lights and switches).
ON/OFF of the switch means the signal input state of the machine tool, and the ON/OFF of
the light is the signal state output.
Debugging with actual operation
Debug on the actual machine tool. It is better to prepare the precautions before debugging,
otherwise an unexpected behavior may occur.
3
Page 20
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Volume I Programming
4
Page 21
Chapter Two Sequence Programming
CHAPTER TWO SEQUENCE PROGRAMMING
The operation principle is different with the common relay circuit, because the PLC sequence
control is carried out by compiling the on-line diagram; and therefore, it is better to thoroughly
comprehend the sequence control principle when designing the PLC sequence programming.
2.1 Performance Process of Sequence Programming
In the general relay controlling circuits, each of them can be simultaneously operated. When the
relay A is operated in the following figure, the replay D and E can be operated (when the contactor A
and B are entirely closed) at the same. Each replay in the PLC sequence control is operated in turn.
The relay D is operated before relay A, and then the relay E operates (refer to the following figure).
Namely, each relay is operated based upon the sequence of the ladder diagram (compilation
sequence).
A
A
B
D
C
E
Fig. 2.1 (a) Circuit illustration
The differences between the relay circuit and PLC programming operation are shown below in
the Fig. 2.1 (b) and Fig. 2.1 (c).
Volume I Programming
A
A
C
B
C
Fig. 2.1 (b)
5
Page 22
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
A
C
(1) Relay circuit
Both Fig. 2.1 (b) and Fig. 2.1 (c) are shared a same operation. B and C are switched on after A
is turned on. B is cut off after C is ON.
Volume I Programming
(2) PLC program
A same relay is shared a same circuit, refer to the Fig. 2.1 (b); B and C are switched on after A
is turned on. B is cut off after one cycle of the PLC program is performed. In the Fig. 2.1 (c), C is ON
instead of B, after C is turned on.
2.2 Cycle Performance
A
C
B
Fig. 2.1 (c)
PLC performs from the beginning to the end of the ladder diagram. It performs again from the
beginning of the ladder diagram after this diagram is performed, which is called cycle performance.
The performance time from the beginning to the end of the ladder diagram is abbreviated as a
period of a cycle treatment. The shorter of the treatment period is, the stronger of the response
capacity of the signal is.
2.3 Priority Sequence of the Execution (the 1st Level, the 2nd level)
GSK218MC Series PLC program are composed of two parts: the 1st level program and the 2nd
level program, which are inconsistent with the performance period.
st
The 1
required for fast response.
The 2
PLC may divide the 2nd level program into N parts when the 2nd level program is executed. It is
level program performs once each 8ms, which can be treated the short pulse signal
nd
program performs once each 8*nms. N is the partition number of the 2nd level program.
performed one part for each 8ms.
6
Page 23
Chapter Two Sequence Programming
Fig. 2-3-1
PLC in the GSK218MC series is separately performed in the PLC-AVR SCM. The 1ms of each
8ms is the communication time for reading the PLC data from the CNC. The 5ms is that the PLC
gains the system control signal (F, X), and uploads the control result data (G and Y parameters)
external port I/O (X and Y). PLC is always performed the ladder diagram calculation other than the
interruption of the response exchange data.
Volume I Programming
Fig. 2-3-2
nd
When the last partition number of the 2
level program of the n is performed, the program then executes from its beginning. In this case, when the partition number is n, the performance time of one cycle is 8*n ms. The 1st level program performs once each 8ms; the 2nd level program performs once
each 8*n ms. If its steps of the 1
st
level program is increased, and therefore the steps of the 2nd level
program within 8ms should be reduced correspondingly; the partition number may be increased, and the treatment time of the overall programs will be longer. So, the compilation of the 1
st
level program
should be shorter.
2.4 Sequence Program Structure
The ladder diagram compiles in turn in the traditional PLC. However, it owns the following
advantages in the ladder diagram language allowing the structured programming:
1. The program is easy to comprehend and compile.
2. It is more convenient to find the faults during the programming.
7
Page 24
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
3. It is easy to find some reasons when the operation malfunction occurs.
There are 3-kind of structuring programming methods:
Sub-program
The subprogram is regarded as a treatment unit based on the ladder diagram.
Volume I Programming
Nesting
One subprogram can be performed the task by calling another one.
Task A
Task B
Main program
Task A
Task B
A
A
C
B
. . . .
C
Fig. 2-4-1
Subprogram 1 Subprogram 2
Task A1
Task An
Task A11
Task A12
Fig. 2-4-2
Conditional branch
The main program is performed circularly, and checks whether its conditions are suitable. If does,
perform the corresponding subprograms, vice versa.
Fig. 2-4-3
8
Page 25
Chapter Two Sequence Programming
2.5 Input/output Signal Treatment
Input signal treatment:
Volume I Programming
Output signal treatment:
CNC
8ms
CNCPLC
Shared register
Machine tool input register
IO terminal
Fig. 2-5-1
Fig. 2-5-2
PLC
The 1
level
program
nd
The 2
level
program
st
2.5.1 Input Signal Treatment
(1) NC input register
The NC input signals from the NC are memorized into the NC input register, which are
transferred to PLC each 8ms. The 1
state of these signals.
(2) Machine tool input register
st
level program performs the corresponding treatment using
9
Page 26
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
The machine tool input register is scanned and memorized its input signal from the machine
each 8ms. The 1
st
level program is also performed the corresponding treatment by using this signals
directly.
(3) The 2
nd
level program input latch
The 2nd level program input signal latch is also called the 2nd level program synchronic input
signal register. Wherein, the stored input signal is treated by the 2
in the register is synchronic with the 2
nd
level one.
nd
level program. This signal state
The signals both in the NC and machine tool input latch can be locked to the 2nd level program
input latch, as long as the 2
during the performance of the 2
nd
level program performs. The signal state in this latch keeps invariable
nd
level program.
Volume I Programming
2.5.2 Treatment of the Output Signal
(1) NC output register
The output signal transfers to the NC output register from the PLC each 8ms.
(2) Machine tool output register
The signal memorized in the machine tool output register conveys to the machine tool each
8ms.
Note: The signal states, such as the NC input register, NC output register, machine input register and machine
output register, which can be displayed by the self-diagnosis function. The diagnosis number is the address
number in the sequence programming.
2.5.3 Distinguish of Signal State Between 1st Level and 2nd Program
As for the same input signal, their states may different between the 1st and 2nd level
programming, that is the reason that different registers are used between two levels programming.
Namely, the input signal used with the 2
therefore, the signal in the 2
nd
level program is later than the 1st level one. At the worst case, one 2nd
nd
level program is the one of the 1st level who is locked. And
level program performance cycle can be lagged.
It is better to remember this point when programming the ladder diagram.
10
Page 27
Chapter Two Sequence Programming
A
A
. . . .
END1
. . . .
B
C
It belongs to the 2nd partition of the 2
nd
level program
Fig. 2-5-3-1
A=1 performs the 1st level program when the 1st 8ms is performed, then B=1. And therefore, the
nd
2
level program is performed, the A=1 is latched to the 2nd level program, and then the first partition
of the 2
therefore, the 2
nd
level program is completed.
A turns into 0 to perform the 1
nd
partition of the 2nd level program is performed; in this case, the state of the A is still
st
level program when the 2nd 8ms is performed, then B=0. And
latched as the one last time. So, C=1.
In this way, the state both B and C are different.
Volume I Programming
2.6 Interlocking
In the sequence control, the interlocking is very important from the safety issue.
It is necessary to use the interlocking in the sequence control programming. Simultaneously,
the hard interlocking is used in the relay control circuit of the strong electric cabinet of the machine
tool sides. This is the reason that the interlocking is disabled when the hardware of the performance
sequence programming malfunctions, even if the interlocking is logically used in the sequence
program (software). And therefore, the interlocking can be ensured the safety for the user, and
prevent the machine tool from damaging in the strong electric cabinet of the machine sides.
11
Page 28
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Volume I Programming
12
Page 29
Chapter Three PLC Address
CHAPTER THREE PLC ADDRESS
An address can be used for distinguishing a signal. Different address is separately
corresponding to the I/O signal at the side of the machine tool, the I/O signal at the side of the CNC,
the internal relay, the counter, the timer, the keep relay and the data list. Each address is composed
of the address number and bit number, and its number is as shown below:
Address number rules:
Address number consists of Address Type, Address Number and Bit Number.
Address type: X, Y, R, F, G, K, A, D, C and T
Address number: Decimal number means one byte.
Bit number: Octonary number system, 07 are separately indicated the bytes (07 bits) in the
front of the address number.
The address type of the GSK218MC PLC is shown below:
Add. Address explanation Length
X Machine →PLC (64 bytes) INT8U
Y PLC → machine tool (48 bytes) INT8U
F CNC → PLC (64 bytes) INT8U
G PLC → CNC (64 bytes) INT8U
R Intermediate relay (512 bytes) INT8U
D
DC The data register of the counter preset value INT16U
C
A PLC alarm detection INT8U
T
DT The data register of the timer preset value INT16U
K Keep relay (64 types) INT8U
Data register (0~255)
Counter (0~127)
Timer (0~127)
X 000 . 6
Type Address No. Bit No.
Table 3-1
INT16U
INT16U
INT16U
Volume I Programming
INT8U data type is 8-bit character type without symbol, INT16U data type is 16-bit integral type
without symbol.
3.1 Machine → PLC address (X)
The X address of the GSK218MC PLC composes of two types:
13
Page 30
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
1. The X address is assorted with the three I/O input terminals, namely, XS40, XS41 and
XS42.
2. The X address is assorted with the input button on the MDI panel of the system.
3.1.1 X Address on I/O Input
The addresses (48 addresses) are defined as INT8U from X0 to X5, which are distributed on
the three I/O input terminals, for example, XS40, XS41 and XS42.
Users can define the signal significance of the X address of the I/O ports based upon the actual
cases, which can be connected the machine tool and compiled the corresponding ladder diagram.
Volume I Programming
Refer to the appendix one (GSK218MC CNC system PLC I/O address) and the configuration and
definition of the internal software components for the initial definition of the input address.
3.1.2 X Address on MDI Panel
There are 11 types from the addresses X20 ~ X30 of which these addresses are corresponding
with the button input on the MDI panel one by one. User can not modify its signal definition. The
buttons on the MDI panel should be firstly responded by CNC, and then conveys the X signal to
PLC.
The corresponding relationships are shown below:
Table 3-1-2-1
Operation panel key
input
Edith method X20.0 Rapid switch X24.7
Auto method X20.1 F0/ 0.001 X26.0
MDI method X20.2
Zero return method X20.3
Single step method X20.4
Manual method X20.5 Manual feed axis +1st X27.0
MPG method X20.6 Manual feed axis +2nd X27.1
DNC method X20.7 Manual feed axis +3rd X27.2
Skip X21.0 Manual feed axis +Nth X27.3
Single block X21.1 N axis +(+ spindle X27.4
PLC add.
Operation panel key
input
F25%/ 0.01
(218MC-U1is the rapid
override addition)
F50%/ 0.1
(218MC-U1is the rapid
override 100%)
F100%/ 1 (218MC-U1is
the rapid override
reduction)
PLC add.
X26.1
X26.2
X26.3
14
Page 31
Chapter Three PLC Address
Operation panel key
input
PLC add.
Operation panel key
input
PLC add.
override 218MC
integration)
Dry run X21.2 Manual feed axis -1st X28.0
Miscellaneous lock X21.3 Manual feed axis -2nd X28.1
Machine lock X21.4 Manual feed axis -3rd X28.2
Optional stop X21.5 Manual feed axis -Nth X28.3
N axis- (- spindle
Program restart X21.6
override 218MC
X28.4
integration)
Working indicator X21.7 Spindle orientation X29.0
Spindle positive X22.0
Spindle stop X22.1
Tool magazine zero
return
Tool clamping/tool
releasing
X29.1
X29.2
Spindle negative X22.2 Tool magazine positive X29.3
Spindle JOG X22.6 Tool magazine negative X29.4
Channel selection
(218MC-H/-V)
X22.7
Lubrication X23.0
Tool-pivoting
(Tool-infeed)
Tool return
(Tool-retraction)
X29.5
X29.6
Cooling X23.1 Tool-change hand X29.7
Chip-removal X23.2 Overtravel releasing X30.0
- spindle override
ESP X23.5
(218MC-H/-V is the
X31.0
spindle override SOV1)
Spindle override
Cycle start X23.6
cancellation
(218MC-H/-V is the
X31.1
spindle override SOV2)
+ spindle override
Feed hold X23.7
(218MC-H/-V is the
X31.2
spindle override SOV4)
User 1
(218MC-U1 is the
blank button)
X24.0
- feed override
(218MC-H/-V is the
feedrate FOV1)
X31.3
Feedrate cancellation
User 2 X24.1
(218MC-H/-V is the
X31.4
feedrate FOV2)
+ feedrate
User 3 X24.2
(218MC-H/-V is the
X31.5
feedrate FOV4)
User 4 X24.3
Feedrate FOV8
(218MC-H/-V)
X31.6
Volume I Programming
15
Page 32
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
3.2 PLC → Address of Machine Tool Side (Y)
The Y address of the GSK218MC PLC composes of two types:
1. The Y address is assorted with the three I/O input terminals, namely, XS43, XS44 and
2. The Y address is assorted with the indicator on the MDI panel of the system.
Volume I Programming
3.2.1 Y Address on I/O Output Port
The addresses (48 addresses) are defined as INT8U from Y0 to Y5, which are distributed on
Operation panel key
input
User 5 X24.4
XS45.
PLC add.
Operation panel key
input
Feedrate FOV16
(218MC-H/-V)
PLC add.
X31.7
the three I/O input terminals, for example, XS43, XS44 and XS45.
Users can define the signal significance of the Y address of the I/O ports based upon the actual
cases, which can be connected the machine tool and compiled the corresponding ladder diagram.
Refer to the appendix one (GSK218MC CNC system PLC I/O address) and the configuration and
definition of the internal software components for the initial definition of the input address.
3.2.2 Y Address on MDI Panel
There are 8 types from the addresses Y12 ~ Y19 of which these addresses are corresponding
with the button input on the MDI panel one by one. User can not modify its signal definition. PLC
system reports to the CNC system keyboard module after calculating, and it is used for displaying
the indicator signal.
The corresponding relationships of each prompt indicator:
Table 3-2-2-1
Keyboard indicator output PLC add. Keyboard indicator output PLC add.
Edit button indicator Y12.0 Spindle orientation indicator Y15.7
Auto button indicator Y12.1 Tool magazine zero return indicator Y16.0
MDI button indicator Y12.2 + Tool magazine indicator Y16.1
Zero return button indicator Y12.3 - Tool magazine indicator Y16.2
Single-step button indicator Y12.4 Tool magazine infeed indicator Y16.3
Manual button indicator Y12.5 Tool magazine retraction indicator Y16.4
MPG button indicator Y12.6 Tool magazine releasing/clamping Y16.5
16
Page 33
Chapter Three PLC Address
Keyboard indicator output PLC add. Keyboard indicator output PLC add.
indicator
(218MC-U1 is RUN indicator)
Tool magazine tool-change hand
DNC button indicator Y12.7
indicator
Y16.6
(218MC-U1 is READY indicator)
Spindle CCW indicator Y13.0
USER3 indicator
(218MC-U1 is ALM indicator
Y16.7
Spindle CW indicator Y13.1 + the 1st axis button indicator Y17.0
Spindle stop indicator Y13.2 + the 2nd axis button indicator Y17.1
The 1st axis zero return indicator Y13.3 + the 3rd axis button indicator Y17.2
The 2nd axis zero return indicator Y13.4 + the 4th axis button indicator Y17.3
The 3rd axis zero return indicator Y13.5 USER1 button indicator Y17.4
The 4th axis zero return indicator
N axis series sequence addition
button indicator
Y17.5
The 4
(218MC);
th
and the 5th axis zero turn
Y13.6
indicator (218MC-H/-V)
The 5th axis zero return indicator
(218MC)
Y13.7
USER4 button indicator
Y17.6
USER5 button indicator (218MC-U1
Skip indicator Y14.0
is spindle override cancel (100%)
Y17.7
indicator)
Single block indicator Y14.1 - the 1st axis button indicator Y18.0
Dry run indicator Y14.2 - the 2nd axis button indicator Y18.1
Miscellaneous lock indicator Y14.3 - the 3rd axis button indicator Y18.2
Machine locking indicator Y14.4 - the 4th axis button indicator Y18.3
Machine illumination indicator Y14.5 USER2 button indicator Y18.4
Lubrication indicator
Y14.6
N axis series sequence reduction
button indicator
Y18.5
Cooling indicator Y14.7 Channel selection button indicator Y18.6
Chip-removal indicator Y15.0 JOG button indicator Y18.7
Feedrate cancel button indicator Y15.1 Overtravel end button indicator Y19.0
Rapid switch indicator Y15.2 Feed dwell button indicator Y19.1
0.001/F0 button indicator Y15.3 Cycle start button indicator Y19.2
0.01/25% button indicator Y15.4
0.1/50% indicator (218MC-U1 is
rapid override 100% indicator)
Tool magazine zero indicator
(218MC integration)
Y15.5 Optional stop indicator Y19.4
Y19.3
1/100% button indicator Y15.6 Program restart indicator Y19.5
Volume I Programming
17
Page 34
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
3.3 PLC CNC Address (G)
The addresses from G0 to G63, its definition type: INT8U, 64 bytes in total.
The operation panel key signal is shown below:
Operation panel button signal PLC add. Operation panel button signal PLC add.
Zero return method G20.3 Rapid 100% G25.3
Single step method G20.4 Incremental step length 0.001 G26.0
Volume I Programming
Miscellaneous lock G21.3 Manual feed axis +1st G27.0
Spindle CCW (Positive) G22.0 Manual feed axis -1st G28.0
Spindle CW (Negative) G22.2 Manual feed axis -3rd G28.2
Spindle override cancel
Channel selection signal G22.7 Tool magazine zero return G29.1
Table 3-3-1
Edit method G20.0 Rapid Fo G25.0
Auto method G20.1 Rapid 25% G25.1
MDI method G20.2 Rapid 50% G25.2
Manual method G20.5 Incremental step length 0.01 G26.1
MPG method G20.6 Incremental step length 0.1 G26.2
DNC method G20.7 Incremental step length 1 G26.3
SKIP G21.0 MPG one block to shift 0.001 G26.4
Single block G21.1 MPG one block to shift 0.01 G26.5
Dry run G21.2 MPG one block to shift 0.1 G26.6
Machine lock G21.4 Manual feed axis +2nd G27.1
Optional stop G21.5 Manual feed axis +3rd G27.2
Program restart G21.6 Manual feed axis +4th G27.3
Spindle stop G22.1 Manual feed axis -2nd G28.1
th
G28.3
(218MC)
G22.4 Manual feed axis –N
Spindle JOG G22.6 Spindle orientation G29.0
Lubrication G23.0 Tool clamping/releasing G29.2
Cooling G23.1 + tool magazine G29.3
Chip-removal G23.2 - tool magazine G29.4
Cycle start G23.6 Tool magazine pivoting G29.5
Feed hold G23.7 tool magazine retraction G29.6
Feedrate cancel
(218MC)
G24.1 Tool-change hand G29.7
Rapid switch G24.7 Overtravel releasing G30.0
The signal of G63 bytes are used inside the system, the G63.0, G63.1 and G63.2 are the
answer signal inside the system separately performed by M, S and T.
18
Page 35
Chapter Three PLC Address
3.4 CNC →PLC Address (F)
The addresses from F0 to F63 are defined as: INT8U, 64 bytes in total.
Refer to the Chapter Two Function for details.
3.5 Internal Replay Address (R)
The address area is reset when the system is turned on. R510 and R511 are used by the
system.
Its definition type is: INT8U, 512 bytes in total.
Volume I Programming
Address
number
R0
R511
6
7
3
45
012
Fig. 3-5-1
System program administration area
R510
The signal of R510.0 address is set to 1 when PLC starts and restarts, which is used the signal
set by the initial user. The R510.0 is reset to 0 after the ladder diagram is performed once.
R511 (System timer)
The following four signals can be used for system timer:
76 5
R511
432
1
0
Always cut off
Always power on
(104ms ON, 96ms OFF)
200ms period signal
(504ms ON, 496ms OFF)
1s period signal
Fig. 3-5-2
19
Page 36
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
3.6 Nonvolatile Relay Address (K)
This address area is used for nonvolatile replay and PLC parameter setting. This area is called
nonvolatile relay area, namely, the content inside the register will not lose even if the system is
turned off. K000~~K005 are used by the system, which is used to protect the PLC system parameter,
it is very convenient for user to control PLC in the CNC system.
Its definition type: INT8U, 64 bytes in total.
Volume I Programming
Note: When PLC address K005.2 =1, PLC enters the debugging mode. All of the external alarms are cancelled, and
the machine interlocking signals are then cancelled, the tool-change code can not be performed. The
parameter can be modified only when comprehending the parameter, so that the damage in the machine tool
or injury of the person may occur.
3.7 Information Display Request Address (A)
Address
number
K0
K1
K63
6
7
3
45
012
K relay
area
Fig. 3-6-1
This address area is cleared when the system is turned on.
Its definition type: INT8U, 32 bytes in total.
Fig. 3-7-1
20
Page 37
Chapter Three PLC Address
3.8 Counter Address (C)
This area is used for placing the current counting value of the counter. The data is cleared after
the system is turned off.
Its definition type: 128 addresses in total.
3.9 Counter Preset Value Address (DC)
This address area is used for storing the counter preset, which is a nonvolatile storage area,
that is, the memorized content may not loose even the system is power off.
Its definition type: 128 addresses in total. The setting value of the DC is only read instead of
writing.
Volume I Programming
3.10 Timer Address (T)
This address area is used for storing the current numerical value of the timer. The data initial is
presetting value after the system is power off. Current data is presetting value when it is set to 0.
Its definition type: 128 addresses in total.
3.11 Presetting Value Address of Timer (DT)
This address area is used for placing the timer preset value. This area is nonvolatile register
area, namely, the content inside the register will not lose even if the power of the system is turned
off.
Its definition type: 128 addresses. The setting value of the DT is only read instead of writing.
3.12 Data Table Address (D)
The content inside the memory will not lose even if the power of the system is turned off.
Its definition type: 256 addresses in total. Wherein, D240247 are used by the system, users
can not define by themselves.
3.13 Address Mark (L)
It is used to specify signs both skip object and the LBL code marks in the JMPB code. Its range: 0~99
21
Page 38
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
3.14 Subprogram Number (P)
It is used to specify the called object subprogram number in the CALL code and the subprogram
number in the SP code.
Its range: 0~99
Volume I Programming
22
Page 39
Chapter Four PLC Basis Code
CHAPTER FOUR PLC BASIS CODE
The design of the sequence program begins from compiling ladder diagram. The ladder
diagram consists of relay contact and function code. The logic relationship in the ladder diagram
composes of sequence program. There are two methods of the sequence program input: one uses
the mnemonic symbol language (The system is not temporarily supported the PLC command code
of the RD, AND and OR); the other one is used the relay symbol. The programming can be compiled
using ladder diagram instead of comprehending the PLC code based upon the latter.
Actually, the sequence program inside the system can be converted into corresponding PLC
code even if it is input by the relay symbol.
The basis codes are commonly used one when designing the sequence programming, which
are performed one-digit calculation.
The basis command codes of the GSK218MC series are shown below:
Table 4-1
Code name Function
RD
RD.NOT
WRT
WRT.NOT
AND
AND.NOT
OR Logic OR
OR.NOT
OR. STK Right shift 1-bit of the stacked register after ST0 and ST1 logic OR
AND.STK Right shift 1-bit of the stacked register after ST0 and ST1 logic AND
Left shift 1-bit of the register’s content, the signal state specified by address is set to
ST0
Left shift 1-bit of the register’s content, the signal state specified by address is set to
ST0 after its state is set to NOT.
Output the logic calculation result to the specified address
Output the logic calculation result after NOT to the specified address.
Logic AND
Logic AND after the specified state is set to NOT.
Logic OR after the specified state is set to NOT.
Volume I Programming
4.1 RD, RD.NOT, WRT, and WRT.NOT Codes
Mnemonic symbol and function
Table 4-1-1
Mnemonic
symbol
RD Left shift 1-bit of the register’ content, the signal state specified by address is
Function
set to ST0.
23
Page 40
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
RD.NOT Left shift 1-bit of the register’ content, the signal state specified by address is
WRT Output the logic calculation result to the specified address
WRT.NOT Output the logic calculation result after NOT to the specified address
Code explanation
z WRT and WRT.NOT codes are the coil drive code of the output relay and internal relay, but
the input relay can not be used.
z The parallel WRT command can be used multiply, but it can not output with double coil.
For example
Volume I Programming
set to ST0 after it is set to NOT.
X002.1 Y003.7
( )
F100.3 G120.0
( )
RD X002.1
WRT Y003.7
RD.NOT F100.3
WRT G120.0
Fig. 4-1-1
4.2 AND, AND.NOT Codes
Mnemonic symbol and function
Table 4-2-1
Mnemonic symbol Function
AND
AND.NOT
Logic AND after the specified state is NOT
Code explanation
z Connect 1 contact with series connection by using AND, AND.NOT code. The numbers of
series connection contacts are unconstrained, and this code can be used for dozens of
times.
Logic AND
For example:
24
X002.1 Y003.7
F100.3 X008.6
( )
Fig. 4-2-1
RD X002.1
AND.NOT F100.3 AND X008.6 WRT Y003.7
Page 41
4.3 OR, OR.NOT Codes
Mnemonic symbol and function
Chapter Four PLC Basis Code
Table 4-3-1
Mnemonic
symbol
OR Logic OR
OR.NOT Logic OR after the specified state is NOT
Code explanation
z Connect 1 contact with series connection using the OR and OR.NOT code.
z OR, OR.NOT is started from the step of this code; it can be connected with series connection
with the abovementioned RD, RD.NOT code step.
For example:
Fig. 4-3-1
Function
Volume I Programming
4.4 OR. STK Code
Mnemonic symbol and function
Table 4-4-1
Mnemonic symbol Function
OR. STK Right shift 1-bit of the stacked register after ST0 and ST1 logic OR
Code explanation
z OR.STK code is the separate code without any address.
For example:
Fig. 4-4-1
25
Page 42
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
There are three branches ①, ② and from the left bus to the node N1. The branches
and are series connection circuit block. When the series connection circuit block is performed
between bus to node or among the nodes, other than the 1
st
branch, use the RD code when the
following branch is ended. The branch is not a series connection circuit block, which can be
used by the OR code.
OR. STK and AND. STK are the codes without operation component, which are indicated the
OR , AND relationships between circuit blocks.
4.5 AND. STK Code
Volume I Programming
Mnemonic symbol and function
Mnemonic
Code explanation
z Use the AND. STK coded when the branch circuit (parallel circuit block) is connected with
series connection with the front of the circuit. The branch start is used RD, RD.NOT codes.
Use the AND. STK code connecting with series connection with the front of the circuit after
the series connection circuit block is executed.
z AND. STK code is the separate code without any address.
For example:
Table 4-5-1
symbol
Function
AND.STK Right shift 1-bit of the stacked register after ST0 and ST1 logic AND
Fig. 4-5-1
As for the abovementioned ladder diagram and command table, OR.STK indicates parallel
connection in the series connection circuit block in the block ②, ⑵AND.STK expresses the series
connection between circuit block and ②.
26
Page 43
Chapter Five PLC Function Code
CHAPTER FIVE PLC FUNCTION CODE
It is hard to compile some machine operations using the basis command codes, but the function
command codes can be simplified it.
Table 5-1 (218MC series PLC function command code)
Series
No.
1 END1 The 1st level
2 END2 The 2nd level
3 CALL Call subprogram 21 DIFU Rising edge detection
4 CALLU Unconditionally call
5 SP Subprogram 23 COMP Binary number
6 SPE End of subprogram 24 COIN Consistency
7 SET Setting 25 MOVN Data transfer
8 RST Resetting 26 MOVB Transfer of one byte
9 JMPB Sign skip 27 MOVW Transfer of two bytes
Name Function Series
No.
19 ROT Binary rotation control
sequence program
end
20 SFT Register shift
sequence program
end
22 DIFD Trailing edge
the subprogram
Name Function
detection
comparison
comparison
Volume I Programming
10 LBL Sign 28 XMOV Binary indexed data
transfer
11 TMR Timer 29 DSCH Binary data search
12 TMRB Regular timer 30 ADD Binary addition
13 TMRC Timer 31 SUB Binary subtraction
14 CTR Binary counter 32 ANDF Logic AND
15 DEC Binary decode 33 ORF Logic OR
16 COD Binary code
conversion
17 COM Control of the
concentric line
18 COME End of the concentric
line control
34 NOT Logic NOT
35 EOR Exclusive OR/ XOR
27
Page 44
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
5.1 END1 (The 1st Level Sequence Program End)
Function:
This function can be specified once in sequence program at the end of the 1
it can be performed at the beginning of the 2
execute. The first program can be compiled up to 500 steps.
Format:
Volume I Programming
5.2 END2 (The 2nd Sequence Program End)
Function:
It specifies at the end of the 2
Format:
nd
Fig. 5-1-1
nd
level program.
st
level program, or
level program when the 1st level program does not
END1
END2
Fig. 5-2-1
5.3 CALL (Call Subprogram)
Function:
Call one specified subprogram
It owns the following characters and limitations:
Subprogram can be nested and called other subprograms up to 18 layers, as for the endless
repetition caused by the closure call, the system may alarm. The system allows that the maximum
subprogram call number is 100 for controlling the performance data value. The subprogram call can
not be performed at the 1
after SPE, or before SP, the system can not be performed, and then alarms.
st
level program. The code or network wrote between END2 AND SP, or
Format:
28
Page 45
ACT
Chapter Five PLC Function Code
Subprogram
CALL
number
Control condition
ACT0, Perform next code followed with CALL.
ACT1, call subprogram of the specified subprogram number
Parameter:
indicated at 0~99.
Subprogram number: Specify the called subprogram number. The subprogram number is
Fig. 5-3-1
5.4 CALLU (Unconditionally Call Subprogram)
Function:
Unconditionally call one specified subprogram
It owns the following characters and limitations:
Subprogram can be nested and called other subprograms up to 18 layers, as for the endless
Volume I Programming
repetition caused by the closure call, the system may alarm. The system allows that the maximum
subprogram call number is 100 for controlling the performance data value. The subprogram call can
not be performed at the 1
after SPE, or before SP, the system can not be performed, and then alarms.
Format:
st
level program. The code or network wrote between END2 AND SP, or
Subprogram
CALLU
Fig. 5-4-1
Parameter:
Subprogram serial number: Specify the called subprogram number, and its range is 0~99.
number
29
Page 46
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
5.5 SP (Subprogram)
Function:
SP is used to generate a subprogram. The subprogram number is regarded as its name. The range of the subprogram is specified by the SP code and the after-mentioned SPE code together. Notice:
1. The subprogram should be compiled followed END2.
2. Another subprogram can not be set inside one subprogram.
Format:
Volume I Programming
Parameter:
Subprogram number: specify a called subprogram mark number, its range is 099.
5.6 SPE (End of Subprogram)
Function:
* Use SPE and SP together to specify the range of subprogram.
* The control will return to the main program of the called subprogram when this function
code is performed.
* The subprogram should be compiled after END2.
Figure format
SP
Subprogram
number
Fig. 5-5-1
For example
30
SPE
Fig. 5-6-1
Page 47
Chapter Five PLC Function Code
CALL P33
END2
SP P33
SPE
Fig. 5-6-2
5.7 SET (Replacement/Setting)
Function:
Set 1 in the specified address.
Format:
ACT
SET
Controllable condition:
Add.b
Fig. 5-7-1
Volume I Programming
(Address)
ACT=0, the state of the add.b remains invariable.
ACT=1, the add.b is set to 1.
Parameter:
Add.b: setting component address bit can be treated as the output coil, Add = Y, G, R, K and A.
5.8 RST (Resetting)
Function:
Set 0 on the specifying place.
Format:
31
Page 48
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Fig. 5-8-1
Controllable condition:
ACT=0, the state of the add.b remains invariable.
ACT1, add.b is set to 0.
Parameter:
Add.b: resetting component address can be treated as output coil, Add = Y, G, R, K and A.
Volume I Programming
5.9 JMPB (Mark Number Skip)
Function:
JMPB immediately transfers the control to program following with mark number in the ladder
diagram programming.
The characters and limitations are shown below:
Format:
* Multiple skip codes can be shared with the same mark number.
* The skip can not be performed each other between the 1
* The skip can not be performed among the subprograms.
* Rebound is allowable, but users should hold the endless cycle which may be caused by
it.
* The skip can not be performed between main program and subprogram.
st
and the 2nd level programs.
Controllable condition:
ACT0, Do not skip, perform the next code followed JMPB.
ACT1, Perform the next code after the mark number when the skip jumps to the specified
mark number.
Parameter
32
Lx: Specify a skip object mark number. Any value (from 0 to 99) can be specified.
ACT
JMPB
Destination
mark number
Fig. 5-9-1
Page 49
Chapter Five PLC Function Code
5.10 LBL (Mark Number)
Function:
Specify one mark number in the ladder diagram, namely, it is a specified skip destination for
JMPB.
It is very important to notice that one mark number with xx only can be specified once using LBL.
It may alarm if it uses repeatedly.
Format:
Parameter:
For example:
LBL
xx: Specify a skip object mark number, its range is 0~99.
JMPB 33
LBL 33
JMPB 33
Mark number
Fig. 5-10-1
Volume I Programming
5.11 TMR (Timer)
Function:
Delay conducting timer.
Format:
ACT
TMR
Fig. 5-10-2
TIMER (Timer
number)
Fig. 5-11-1
W
33
Page 50
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Controllable condition:
ACT0, close the timer.
ACT
1, start the timer.
The concrete operation is as follows:
ACT
W
Volume I Programming
Parameter:
TIMER : The timer number indicates by xxx (it expresses by numbers from 0 to 127).
Output:
W : Output coil. W=1 when it reaches to the resetting value, W=0 means it does not reach
Note: TIMER performs once each 8ms, its setting unit is ms, and 8ms is the performance radix, complete 8ms if it is
insufficient. For example: the setting is 54ms, 54=6*8+6, complete 2ms, the actual performance is 56ms. The
time of the timer is set in the [TMR] of the [PLCPAR] under the program-controlled interface. The sequence
number of the timer may be detected its range by the system directly. The alarm may occur when the
sequence number repeats or exceeds its range.
5.12 TMRB (Fixed Timer)
to it.
TIMER= Setting time
Fig. 5-11-2
Function:
Delay conducting timer
Format:
ACT
TMRB
Controllable condition:
ACT0, Close the timer
ACT
1, Start the timer
The concrete operation is as follows:
34
Timer
accuracy
Fig. 5-12-1
Timer
number
Presetting
time
W
Page 51
Chapter Five PLC Function Code
ACT
W
TIMER = Setting time
Fig. 5-12-2
Parameter:
TIMER: Fix the timer number, it is indicates by xxx, xxx is numbers from 0 to 127.
Table 5-12-1 (Timer accuracy)
Timer
Setting No. Timer range setting Error range
accuracy
8ms 0 From 8ms to 524.280s
48ms 1 From 48ms to
Scan period from 0 to the 1st level program
Scan period from 0 to the 1st level program
31.456min
1s 2 From 1s to 546 min
10s 3 From 10s to 182 h
1min 4 From 1min to 65535min
1ms 5 From 1ms to 65.4s
Scan period from 0 to the 1st level program
Scan period from 0 to the 1st level program
From 0 to 1s
Scan period from 0 to the 1st level program
Presetting time
The time setting of the fixed timer, its numerical range is: 0~65535.
Output
W : Coil output. W=1, it reaches to the presetting. W=0, it does not reach.
Note: As for the sequence of the timer, the system may check its range automatically, if the repeated sequence or
out of the range, the system may alarm. The presetting time in timer is solidified in the ROM along with the
ladder diagram, so, the time of the timer only can be changed by modifying the ladder diagram file.
Volume I Programming
5.13 TMRC (TIMER)
Function
Delay conducting timer
Format
ACT
Controllable condition
ACT0, Close the timer
TMRC
Timer
accuracy
Fig. 5-13-1
Timer
number
W
35
Page 52
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
ACT1, Start the timer
The concrete operation is as follows:
ACT
W
Parameter
TIMER: The timer number indicates by xxx (xxx expresses by numbers from 0 to 127).
Volume I Programming
Timer
precision
8ms 0 From 8ms to 524.280s
48ms 1 From 48ms to 31.456
1s 2 From 1s to 546 min
10s 3 From 10s to 182 h
1min 4 From 1min to 65535min
1ms 5 From 1ms to 65.4s
Output:
Setting
No.
TIM ER=S etting tim e
Fig. 5-13-2
Table 5-12-1 (Timer accuracy)
Setting time range Error range
Scan period from 0 to the 1st level program
Scan period from 0 to the 1st level program
min
Scan period from 0 to the 1st level program
Scan period from 0 to the 1st level program
From 0 to 1s
Scan period from 0 to the 1st level program
W : Output coil. W=1, it reaches to the presetting, W=0, it does not reach to it.
Note: The time of the timer is set in the [TMR] in the [PLCPAR] controlling by the program control surface. TMRC and
TMR timers are shared with a same address, so, the TMRC and TMR timers can not be repeatedly used. The
system may automatically check the range of the timer sequence. It may alarm when the sequence number is
repeated or exceeded its range.
5.14 CTR (Binary Counter)
Function:
The data in the counter are binary system, which have the following functions based upon the
applications.
1) Presetting counter
2) Ring-counter
If the count reaches to the output signal of presetting value, preset the numerical value.
36
Page 53
Chapter Five PLC Function Code
When the counter reaches to the presetting value, it inputs the count signal and resets the initial
value and performs the count again.
3) Addition and subtraction counter
This is treated as the forward-backward counter, which can be used both addition and
subtraction.
4) The selection of the initial value
The initial value can be regarded as 0 or 1.
Format:
Volume I Programming
Controllable condition:
Specify initial value (CN0):
CN0=0, counter begins with 0.
CN0=1, counter begins with 1.
Specify rising or descending counter (UPDOWN):
UPDONW=1, subtraction counter
UPDOWN=0, addition counter
Reset (RST):
RST=0, Remove the reset
RST=1, reset: W resets to 0, and the counter value reset to initial value. The RST is set
to 1, as long as the reset is required.
Counting signal (ACT):
ACT=1: Count performs when ACT is at the rising edge.
ACT0: Counter does not operate, W holds unchangeable.
Fig. 5-14-1
Parameter:
COUNTER: Specify the number of the counter, which is indicated by xxx (xxx is No. 0 to
No.127).
Output:
W : Coil output, W=1, it reaches to the presetting value.
Note 1: The system may automatically check the sequence number range of the timer, it may alarm if the sequence
37
Page 54
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
is repeated or exceeded its range.
Note 2: The current value of the timer may automatically clear, after the ladder diagram is converted and
downloaded.
Reset the counter by the pulse signal before counting for ensuring the reliable of the counter.
5.15 DEC (Binary Decoding)
Function:
DEC can be decoded for the binary system code data, one of the consecutive data of the
specified 8-bit (1 type) or 16-bit (2 types) is same as the code data. The corresponding output data
Volume I Programming
bit is 1; the output data is 0 without any same number.
This code is used for the data decode of M or T function.
Format:
Controllable condition:
ACT0: Reset all of the output bits.
ACT
1: Perform the data decode; the treated result is set at the output data address.
Parameter:
Length: Set the dimension of the code data at the 1
0001: The code data is binary system code data of one byte.
0002: The code data is binary system code data of two bytes.
S1: Code data address. Specify an address of the storage code data.
S2: Decoding specifying No. Specify the 1
decoded (1 byte) or 16-bit (two bytes).
S3: Decode result address. Specify an address output the decoding result. The register area
must be output with one byte or two bytes areas.
For example:
Fig. 5-15-1
st
bit data of the parameter.
st
bit with the consecutive number of the 8-bit to be
38
ACT
DEC
1 F10 8 R4
Fig. 5-15-2
Page 55
Chapter Five PLC Function Code
When ACT1, F108, R40000,0001;
When ACT
1, F109, R40000,0010;
………………………….
When ACT
1F1015, R41000,0000;
5.16 COD (Binary System Code Conversion)
Function:
COD code may automatically produce a corresponding table under its function block when it
inputs the data capacity, which is used for inputting the conversion table data for the user. 10 grids of
each row in this table, it calculates based upon the quotient +1 if it can not be exactly divided, but the
capacity data does not change, and then the address of the table number may not display.
Format:
Volume I Programming
S1 S2 S1 S2
Controllable condition:
Reset (RST):
RST=0, Do not reset.
RST=1, It will output W resetting incorrectly
Working code (ACT):
ACT
0: Do not perform the COD.
1: Perform the COD. The value of the “conversion input data address (S1)” is
ACT
regarded as the table number of the conversion table, the corresponding
conversion data of the table number is taken out from conversion table to
Fig. 5-16-1
Table 5-16-2
012 9
XXX YYY AAA
10 11 12 N-1
……… ………
……… ……………… ……… ………
………
UUU
output the “output address to the conversion data (S2)”.
39
Page 56
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Fig. 5-16-2
Volume I Programming
Parameter:
Output:
If the abnormal occurs during the COD code performs. W=1, it indicates that the error issues.
Note: The capacity of the conversion data table is up to 100 bytes (bits), this table is compiled between the
Length1: Specify the byte number of the binary system data of the conversion data in the
conversion table.
1: Binary system of 1 byte.
2: Binary system of 2 bytes.
Up to 512 bytes.
Length2: The capacity of the conversion table data. Each conversion table capacity can
not more than 100, it is 100 bytes when 1 type format is specified; it is 100 bits
when 2 bytes format are specified. The total capacity of the entire COD codes
conversion table should be less than 512 bytes.
S1: The data in the conversion table can be taken out by the specifying table number,
and the address of the specifying table number is regarded as the input address of
the conversion data. This address should be supplied a register with one byte.
S2: The output address of the conversion data. Specify the byte numbers of the register
in the form specification beginning with the address.
parameter conversion data output address and error output (W).
5.17 COM (Concentric Line Control)
Function
COM specifies the control until the coil working within the public end code COME range. The
system may alarm if the public end code does not specified.
Format:
40
Page 57
Controllable condition:
Chapter Five PLC Function Code
Fig. 5-17-1
When ACT=0, the coil within the specified range is cut off without any condition (W=0).
When ACT=1, it is same as the end of COM code.
Note 1: Do not specify another COM code within the range of one COM code.
Note 2: When the ACT = 0 of the COM, the coil within the specified range WRT NOT is set to 1 at any time (WRT
NOT = 1).
Note 3: The function codes, such as JMPB, END1, END2, CALL, CALLU, LBL, SP, SPE, COM and COME, can not
be used between COM and COME, otherwise the system may alarm.
5.18 COME (Concentric Line Control End)
Function:
This code is specified the controllable range of the concentric control line code (COM), which
can not be used separately; it must be used with COM together.
Format
COME
Volume I Programming
Fig. 5-18-1
5.19 ROT (Binary Rotation Control)
Function:
It is used for the revolving control, such as the tool post and rotation worktable. The code is
with some functions, refer to the following:
1. Select the revolving direction with the short path.
41
Page 58
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
2. Count the steps from the current position to the objective one; or count the steps from the
previous position of the current one to the previous position of the objective one.
3. Count the position number at the objective previous position or the steps at the objective
previous position.
Format:
Volume I Programming
Controllable condition:
Parameter:
CNO
DIR
ROT
position address
Current position
Objective position
Rotary table
address
S1
S2
address
S3
Calculation result
output address
W
S4
POS
INC
ACT
Fig. 5-19-1
Specify the initial number of the rotary table (CN0):
CNO=0, counter begins with 0. CNO=1, counter begins with 1.
Check whether the short path can be selected the rotation direction (DIR):
DIR=0, Do not select; the selection direction is only positive. DIR=1, Selection; the selection direction can be divided into positive or negative.
Specify the operation condition (POS):
POS=0, counting objective position POS=1 the previous position of the counting object
Specify the position numbers and steps (INC):
INC=0, counting position number. Specify INC=0 and POS=1 if the previous position of
the objective one is to be calculated.
INC=1, counting steps. Perform the code (ACT) when the code INC=1 and POS=0, if
the distance between the current position and the objective one is to be calculated.
Performance code (ACT):
ACT= 0, do not perform the ROT code. W is without change. ACT
1, perform the ROT code. Generally, set the ACT=0, if the operation result is to
be required, and then set the ACT=1.
S1 : Provide the rotary position number. S2 : Provide the address storing the current position. S3 : Specify the address (or code value) storing the objective position. For example,
store the address of the T code outputting from the CNC.
S4 : The calculation outputs to address, compute the steps to be rotated of the rotary,
42
Page 59
Chapter Five PLC Function Code
which reaches to the objective position or the previous position. Always check whether the ACT is 1 when using the calculation result.
Output:
W : Rotation direction output. It outputs to the W by the short-circuit rotation direction,
its direction is positive (FOR) when W=0; it is the negative direction (REV) when
W=1. The definitions of the FOR and REV are shown below, the increase direction
of the position number of the revolving table is positive (FOR); it is the negative
direction in the decrease state. The address of W can be selected freely, however,
if the W results should be used, always check the condition of the ACT=1.
For example: One revolving table is shown below:
Volume I Programming
Fig. 5-19-2
Fig. 5-19-3
Perform the short path rotation, and calculate the position No. of the previous one for the
objection position.
Current position No. S2=1, revolving index position No. S1
12, CNO=1, DIR=1, POS=1 and
INC=0
Wherein:
S3=10, S4
S3=8, S4
11, W1, when the objective position is A in the ACT = 1.
9, W1, when the objective position is B in the ACT = 1.
43
Page 60
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
S3=5, S44 and W0, when the objective position is C in ACT = 1.
S3=3, S4
5.20 SFT (Register Displacement/Shifting)
Function:
This code can be shifted 1 byte (8-bit) based upon the digits specifying by the code parameter
each time. The “1” that overflows from cycle shifting will be added from the negative direction, for
example, the top bit “1” is overflown when shifting to left, the lowest bit supplies “1”, vice versa.
Format:
Volume I Programming
2 and W0 when the objective position is D in the ACT = 1.
Controllable condition:
Specify the shifting direction (DIR)
DIR=0, left shift
DIR=1, right shift
State specifying (CONT)
CONT=0, Do not perform the cycle shifting
CONT=1, perform the cycle shifting
Reset (RST)
Reset shifting output data (W=1) is (W=0)
RST=0, W does not reset
RST=1, W resets (W=0)
Execution condition (ACT)
ACT=0, Do not perform the SFT code.
Fig. 5-20-1
44
ACT=1, Perform the shifting, set ACT to 0 after the code is performed, if only 1 bit is
moved.
Page 61
Chapter Five PLC Function Code
Parameter:
S1 : Set the shifting data address, it composes of one storage area by 1 byte.
Length: it is a 4-digit, which is shown in the following figure:
Fig. 5-20-2
L: its range is 0~8
A: It is treated as bit-parameter, it is always shifted when ACT =1 during A =0, and it moves
once each period.
ACT is regarded as the pulse signal when A = 1, and when the value turns into 1 from 0, it
Volume I Programming
moves once.
Output:
W : “1” state does not move out when the W = 0 shifting operation is performed.
“1” state moves out when the W = 1 shifting operation is performed.
5.21 DIFU (Rising Edge Detection)
Function:
This code is set the output signal to 1 during the scan period of the input signal rising edge.
Format
ACT
DIFU
L Rising edge
number
Fig. 5-21-1
W
Controllable condition:
Input signal: The output signal is set to 1 at the rising edge (0
Output signal: The output signal keeps to 1 during one scan period of the ladder diagram when
the function code is performed.
Parameter:
L : The range of the rising number is 0~255. The system alarm may occur when another
DIFU code or DIFD code is used the same number in the ladder diagram.
Operation:
1) of the input signal.
45
Page 62
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Fig. 5-21-2
The system may automatically check the range of the series number of the rising edge, as for
the repeated series number or the exceeding range, the system alarm may occur.
Volume I Programming
5.22 DIFD (Descending Edge Detection)
Function:
This code outputs 1 signal of one scan period when inputting the signal descending edge.
Format:
Controllable condition:
Input signal: The output signal is set to 1 at the descending edge (10) of the input signal.
Output signal: The state in the output signal keeps one scan period of the ladder diagram when
ACT
DIFD
L Descending
edge number
Fig. 5-22-1
W
this function code is performed.
Parameter:
L : The range of the descending edge number is 0~255. The system alarm may occur when
another DIFU code or DIFD code is used the same number in the ladder diagram.
Operation:
46
Page 63
Chapter Five PLC Function Code
Fig. 5-22-2
The system may automatically check the range of the series number of the descending edge,
as for the repeated series number or the exceeding range, the system alarm may occur.
5.23 COMP (Comparison of Binary Number)
Function:
Compare the dimensions of two binary number data. Specify the enough bytes to store the input
data and comparison data in the memory block.
Format:
Volume I Programming
Fig. 5-23-1
Controlled condition:
ACT0, Do not perform the COMP code. W value is invariable.
ACT
1, Perform the COMP code
Parameter:
Length: Input the specified format (constant or address) and the specified data length (1 byte
or 2 bytes) of the data.
Fig. 5-23-2
S1, S2: The contents both the comparison 1 and comparison 2 can be regarded as constant
and address number.
Address No.: Type R, X, Y, F, G, K, A, D and C
Output:
W =0: Data input
W = 1: Data input Data comparison
Data comparison
47
Page 64
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
5.24 COIN (Consistency Comparison)
Function:
This code can be detected whether the input value and comparison value are consistent.
Format:
Controllable condition:
Volume I Programming
ACT0, Do not perform the COIN code. W value is invariable.
ACT
Parameter:
Length: Input the specified format (constant or address) and the specified data length (1 byte
or 2 bytes) of the data.
ACT
COIN
Length
format
specifying
1, Perform the COIN code.
S1
Input value
Fig. 5-24-1
S2
Comparison
value address
W
Fig. 5-24-2
S1 : The input data can be specified both the constant and storage address.
S2 : Compare the storage address of the data.
Output:
W : W = 0: input value ≠ comparison value
W = 1: input value = comparison value
5.25 MOVN (Data Transmission)
Function:
The data of the source address or the specified binary data is transferred to the destination
address.
Format:
48
Page 65
Chapter Five PLC Function Code
Fig. 5-25-1
Controllable condition:
ACT0, No data to be transferred
1, The byte specified by the quantity is transferred.
ACT
Parameter:
Length: The byte numbers or data number to be transferred.
S1 : Resource start address or constant.
Select the transfer form based upon the S1:
1. If the S2 is single byte address, S1 is the constant, the resolution of the S1 based
upon the byte is copied to the address where it is corresponding Length type at the
beginning with S2; the S1 should be evaluated based upon the bit, if S2 is the bit
address; the bit address corresponding Length begins with the S2 address.
2. The address type both S1 and S2 will not be considered whether it is matched, which
is transferred the data by the byte address.
S2 : Destination start address.
For example:
Fig. 5-25-2
1. When S1 is regarded as constant 5, and the S2 is treated as R60, then
R60=00000101
Volume I Programming
2. When S1 is regarded as constant 5, and the S2 is treated as D60, then D60=5.
3. When S1 is address D50, and S2 is treated as D60, then D60=D50.
W=1, the specified quantity bytes are transferred.
W=0 No data transfer
The quantity range that exceeds the parameter type is detected when transferring, the system
alarm may occur.
5.26 MOVB (Transmission of 1 Byte)
Function:
49
Page 66
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
The MOVB code transfers the 1 byte data to a specified destination address from a specified
resource address.
Format:
Fig. 5-26-1
Controllable condition:
ACT0, No data transfers.
ACT
1, 1 byte is transferred.
Volume I Programming
Parameter:
S1 : Resource address or constant
S2 : Destination address
5.27 MOVW (Transmission of Two Bytes)
Function:
MOVW code transfers the 2 bytes data to a specified destination address from a specified
resource address.
Format:
If the S2 is single byte address, the S1 should be copied to the S2 address based
upon the byte value; if S2 is bit address, the S1 should be copied to the S2 lower
byte address based upon the byte value.
Controllable condition:
ACT0, No data transfers.
ACT
1, 1 byte is transferred.
Parameter:
S1 : Resource address or constant
S2 : Destination address
50
Fig. 5-27-1
Page 67
Chapter Five PLC Function Code
5.28 XMOV (Binary Indexed Data Transmission)
Function:
This function code is used to read or write the data from the data table. The data number
(table-capacity) in this table can be specified by address; the data table can be operated by PLC
based upon the user’s setting during operating.
Format:
Volume I Programming
Fig. 5-28-1
Controllable condition:
Specify the operation (read or write) (RW)
RW=0: Read the data from the data table.
RW=1: Write the data to the data table.
Reset (RST)
RST=0: Release the reset
RST=1: Reset W=0.
Execution code (ACT)
ACT0: Do not execute the XMOV code, W keeps invariable.
1: Execute the XMOV code.
ACT
Parameter:
Length: The format specifies the length of the transmission data.
1: 1 byte length.
2: 2 bytes length.
S1 : The data capacity storage address of the data table is used to store the data capacity
of the data table; the occupied byte number should be suitable for the specified length
of the Length. The valid range of the data is determined by the specified byte length of
the Length 1 format.
1 byte length: From 1 to 512.
2 byte length: From 1 to 256, that is, 256×2
of the PLC data table.
S2 : Set the address of the data table head. The storage area of the data table = byte length
× data number of its table. The address of the table head should be the value in which
is set inside the data table.
512 bytes, which is the capacity
51
Page 68
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
S3 : Input/output address. Set and place the address from the reading when the data is read.
S4 : Storage address of the table number. It is used to store the table number to be read or
Output:
When the value in the table number exceeds the S1, W=1, the read or write of the data table
does not perform.
W=0, Without error
Volume I Programming
W=1, Error
Set and place the address from writing when the data is write. Its byte numbers should
be suitable from the setting of the Length format. This address is defined as D register.
write. It occupied bytes should be suitable for the specifying in the Length. If the setting
of the table number is more than the data registered in the S1, it outputs W=1 in a
wrong way.
5.29 DSCH (Binary Data Index)
Function:
This function code can be use for indexing the binary data in the data table. The data number
(table capacity) in the data table can be specified by address. In this case, the table capacity still can
be changed even if the program is written into ROM.
Format:
Fig. 5-29-1
Controllable condition:
Detection repetition (REP)
REP=0: Perform DSCH code, start to search it from the first address of the data table, it
will not consider the destination data may generate repeatedly; it may stop the
search outputting its address when detecting the destination data at the first
time. W=1, if the indexed data does not find.
REP=1: Perform DSCH code. If the indexed data does not find or it has two or above
data, W=1.
Reset (RST)
52
Page 69
Chapter Five PLC Function Code
RST=0, Release the reset.
RST=0: Reset W=0.
Performance code (ACT)
ACT0: Do not perform DSCH code, W keeps invariable.
ACT
1: Perform DSCH code. Output its table number if the indexed data is found; if it is
not found or it has two more above data, W=1.
Parameter:
Length : Format specifies the length of the index data.
1: 1 byte long
2: 2 bytes long
S1 : Data number storage address of the data table. The byte length specified by this
address is distributed the storage area for the requirement of the byte. The data number
of the data table is n+1 (table head is 0, the end of the table is n).
S2 : Set the data table head address.
Volume I Programming
S3 : Set the input address of the index address.
S4 : The address output of the index result. Actual address = head address + table number,
table number is 0
indexing: output its number from the list if the index data is found. The table number is
outputted to the index result output address of which the required storage byte number
should be suitable for the specified format.
Output:
W=0, Find the indexed data.
W=1, Do not find the indexed data.
(S1-1), the actual address can not exceed the data table. After
5.30 ADD (Binary Addition)
Function:
This function code is used for the add operation of the 1 byte or 2 bytes binary data. The
addend data and the add operation output the data should be set the storage address with the
corresponding byte length.
Format:
Fig. 5-30-1
53
Page 70
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Controllable condition:
Reset (RST):
Execution code (ACT)
Parameter:
Length : Specify the data length (1 byte or 2 bytes) and the specifying method of the
Volume I Programming
RST=0 : Release the reset.
RST=1 : Reset W=0.
ACT
0: Do not execute ADD code, W keeps invariable.
1: Execute the ADD code.
ACT
addend (constant or address).
Fig. 5-30-2
S1 : Specify the storage addend address.
S2 : The specifying method of the addend is determined by the specification of the Length.
S3 : Specify the output operation address.
Output:
W=1: Operation is abnormal.
W=0: Operation is normal.
When the add operation result exceeds the specified data length, W=1.
5.31 SUB (Binary Subtraction)
Function:
This code is used for the subtraction of the 1 byte or 2 bytes binary data. The minuend and the
subtraction output data should be set the storage address with the corresponding byte length.
Format:
54
Fig. 5-31-1
Page 71
Chapter Five PLC Function Code
Controllable condition:
Reset (RST):
RST=0: Release the resetting.
RST=1: Reset W=0.
Execution code (ACT):
ACT
0: Do not execute the SUB code, W keeps invariable. 1: Execute the SUB code.
ACT
Parameter:
Length: Data length specified (1 or 2 bytes) and the addend specifying method (constant or
address).
Volume I Programming
Fig. 5-31-2
S1 : Specify and store the minuend address.
S2 : The specifying method of the subtractor is determined by Length.
S3 : Specify and output the address of the operation result.
Output:
W=0: Normal operation.
W=1: Abnormal operation.
The subtraction result exceeds the specified data length, W=1.
5.32 ANDF (Bit-by-bit AND)
Function
This code is performed the AND with a constant (or the content from the address B) from the
content of the address A (or the one from the address B), and its result is stored to address C.
Format:
Fig. 5-32-1
55
Page 72
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Controllable condition:
ACT0: Do not execute ANDF code.
1: Execute the ANDF code.
ACT
Parameter:
Length : Specify the data length (1 byte or 2 bytes), input the data format (constant or
address).
Volume I Programming
S1: Specify the input data that will to be performed by AND. The address is then begins and the
data length is consistent with the Length.
S2: The input data is performed with the one of the AND. When the format specifying is
S3: It is used for storing the address of ANDF operational result. The result from the ANDF is
For example: When the address A and B have the following data, which are shown below:
Address A
Address B
The operational result of the ANDF is shown below:
Address C
Fig. 5-32-2
selected the address, the address is then started, and the data length is consistent with the
length.
stored from this address, and the data length is consistent with the one of the Length.
1 1 1 0 0 0 1 1
0 1 0 1 0 1 0 1
0 1 0 0 0 0 0 1
5.33 ORF (Bit-by-bit OR)
Function:
This code is performed the OR with a constant (or the content from the address B) from the
content of the address A, and its result is stored to address C.
Format:
56
Page 73
Controllable condition:
ACT0: Do not execute the ORF code.
1: Execute the ORF code.
ACT
Parameter:
Chapter Five PLC Function Code
Fig. 5-33-1
Volume I Programming
Fig. 5-33-2
Length : Specify the data length (1 byte or 2 bytes), input the data format (constant or
address).
S1 : Specify the input data that will to be performed by NOT. The address is then begins
and the data length is consistent with the length.
S2 : The input data is performed with the one of the OR. When the format specifying is the
address specification, and therefore, the address starts, and the data length is
consistent with the specified Length..
S3 : It is used for storing the address of ORF operational result. The result from the ORF is
stored from this address, and the data length is consistent with the one of the length.
For example: When the address A and B have the following data, which are shown below:
Address A
Address B
The operational result of the ORF is shown below:
Address C
1 1 1 0 0 0 1 1
0 1 0 1 0 1 0 1
1 1 1 1 0 1 1 1
5.34 NOT (Bit-by-bit NOT)
Function: This code is reversed to each content in address A, and store the result to the address B.
Format:
57
Page 74
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Controllable condition:
ACT0, Do not execute the NOT code.
ACT
Parameter:
Length: Specify the data length (1 byte or 2 bytes)
Volume I Programming
Fig. 5-34-1
1, Execute the NOT code.
Fig. 5-34-2
S1 : The input data is reversed bit-by-bit. The address is started and the data length is
consistent with the length.
S2 : It is used for outputting NOT operational result. The result of the NOT operation starts
to store from this address, and the length of the data is consistent with the one of the
length.
For example:
When the address A and B have the following data, which are shown below:
Address A
The operation result of the NOT is shown below:
Address B
1 1 1 0 0 0 1 1
0 0 0 1 1 1 0 0
5.35 EOR (Exclusive OR)
Function:
This code is performed the Exclusive OR with a constant (or the content from the address B)
from the content of the address A, and its result is stored to address C
58
Page 75
Chapter Five PLC Function Code
Format:
Fig. 5-35-1
Controllable condition:
ACT0 : Do not execute the EOR code.
ACT
1: Execute the EOR code.
Parameter:
Length : Specify the data length (1 byte or 2 bytes), input the data format (constant or
address).
Volume I Programming
Fig. 5-35-2
S1 : Specify the input data that will to be performed by Exclusive OR. The address is then
begins and the data length is consistent with the length.
S2 : The input data is performed with the one of the Exclusive OR. When the format
specifying is selected the address, the address is then started, and the data length is
consistent with the length.
S3 : It is used for storing the address of EOR operational result. The result from the EOR
is stored from this address, and the data length is consistent with the one of the
length
For example: When the address A and B have the following data, which are shown below:
Address A
1 1 1 0 0 0 1 1
Address B
0 1 0 1 0 1 0 1
The operational result of the EOR is shown below
Address C
1 0 1 1 0 1 1 0
59
Page 76
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
CHAPTER SIX COMPILATION LIMIT OF LADDER DIAGRAM
1. The program should with the codes END1 and END2, which are regarded as the end symbol
st
of the 1
2. It is only support the parallel output instead of the multi-level output.
3. The result output address in the overall basis codes, output function codes can not be set as
the following addresses:
1) Counter presetting address DC, timer presetting address DT.
2) The addresses from K0 to K5 are occupied by system, user can not define it.
3) The addresses G63, R510 and R511 are occupied by system, and therefore the user can
level and 2nd level program, and the END1 should be placed before END2.
Volume I Programming
4) X address and F address on the I/O input port.
4. The vertical hovering, the node point does not connect to the following node and the parallel
conducting line is performed the parallel connection to the node network of which the
above-mentioned circumstances will generate the node or network which can not be
performed; and therefore, the system alarm occurs.
5. The start network, that is, it does not connect directly between different vertical lines in the
same row; one of row does not consecutively connect to the vertical line. As for this case, the
system can not be treated, and therefore the alarm occurs.
6. The upper embossment can not be accepted inside the network, that is, the parallel network
generates on several nodes on one certain row, and any row of it can not be connected to this
parallel network. The system alarm may issue.
The following cases are regarded as syntax error, the system alarm may occur.
not define it.
W
W
60
W
W
W
W
W
Fig. 6.1
Page 77
Chapter Six Compilation Limit 0f Ladder Diagram
Volume I Programming
61
Page 78
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
VOLUME II OPERATION EXPLANATION
Volume II Operation
62
Page 79
63
Page 80
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
CHAPTER ONE PLC INTERFACE DISPLAY
1.1 GSK218MC Series Automatic Operation in PLC ON
PLC operates when the system is turned on: the 1st period may use the R510.0 to conduct a
period of its network cables, the value of the R510.0 is then reset to “0”; the user can not output this
value. The value of the nonvolatile relay is the one of the last output before PLC stops.
Note: The keys inside the < > in the following explanations are panel buttons; the keys inside the is the soft
【 】is the interface corresponding with the current soft key; means that it includes
Volume II Operation
button under the screen;
submenu; all of the PLC operations are performed in the MDI mode, other methods only can be viewed and
searched.
1.2 Program-Controlled Interface Display
1.2.1 INFO Interface
1. Enter the page by pressing the <program-controlled> key; enter the INFO interface
pressing the
key to shift the screen in the PLC interface by defining the bit parameter
the
INFO interface. This interface offers some relative information of this system, such as the
version number, modification data etc.
[INFO] soft key, refer to the Fig. 1-2-1-1. Also, it can be set the <program-controlled>
No: 26#6=1, and then enter
Fig. 1-2-1-1
(1) The ladder diagram name in current operation is supplied on the interface. The ladder diagram
64
Page 81
Chapter One PLC Interface Display
divides into three types: the only one ladder diagram in operating, the rest of 15 ladder diagrams
other than the operation of the ladder diagram 0—15 and the other ladder diagrams for compiling
and reference (Any two numbers can be identified or named other than 0-15).
(2) The value of the system is set by bit parameter 53#0~#3 when the power is turned on
initialization, which is the composed parameter of binary system; the No. 0 ladder diagram is
used when this value is set to 0; when this value is set to 1~15, the No. 1~15 ladder diagrams
are then used. The ladder diagram file for loading some one number is called operation file (this
operation may cause hazard; it is enabled after restarting when the power is turned off). This
file may be deleted to rebuild if the format is incorrect. So, the user should carefully specify the
file name of the ladder diagram. The overall file names of the ladder diagram must be
“ladderXX.grp” (XX is number), otherwise, the files may not be identified by the system. The file
format is described by the system, the user can not modify it without the system; otherwise, it
may be deleted or can not be identified.
(3) M6 is separately called the macro program from O91000 to O91015 when the 0~15 ladder
Volume II Operation
diagrams are used.
(4) The selection of the ladder diagram. The file name can be specified by moving the cursor or
inputting the “LX”/“LXX” (X/XX is number). The system may detect whether the X”/“XX is the
known file name by pressing the “input” key. If it does not detect, the ladder diagram file should
be set up based upon the file name “ladder0X.grp” or “ladderXX.grp”. The system may
automatically generate two function blocks “END1” and “END2” when the new file is set up, so
that the user can consecutively operate this ladder diagram file (The command table remains
null if it is converted after opening the file). User can copy or cut the ladder diagram from the
normal file (it can not exceeds 100 rows, otherwise, only the previous 100 rows can be
performed) pasting to other file, then copy the function (without modification), and then set up a
new file. For safety’s sake, after the ladder diagram is compiled, the current file may
automatically stored when another file is opened; the ladder diagram syntactic may be detected
before storing of which it may give up if the incorrect syntax is found.
(5) The file header includes the basis information of the file such as the line number and step
number, wherein, the step information occurs as long as it is converted, otherwise, it always
keeps the opening information. User can delete the unopened and unoperated ladder diagram
file; this operation is the irreversible operation, so user should be careful. The system may stop
the renewal of the ladder diagram network after the user open the unoperated ladder diagram,
in order to avoid the misguidance. The operating ladder diagram can only be stored and copied,
so that user can copy this information to others ladder diagram files. It is better to stop the
operation before compiling the current ladder diagram. When the cursor stops at the
background compiling file, user can open the Info information to modify the compiling file
background (including the ladder diagram version number, suitable machine and ladder
65
Page 82
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
diagram maintainer) by the “modification” key.
1.2.2 PLCGRA Interface
Enter PLCGRA interface pressing the [ PLCGRA] soft key, it also can be set the
<
Program-controlled> key to shift the screen in the PLC interface by defining the bit parameter N0:
Volume II Operation
26#6=1,
and then enter the PLCGRA interface. Refer to the Fig. 1-2-2-1:
Fig. 1-2-2-1
The content and operation of the
PLCGRA [ladder01]: Operate the current ladder diagram name.
PLCGRA interface:
1/972: It means that the cursor specified line is at the place of the ladder diagram.
Run: Ladder diagram operation state. The operation state of the ladder diagram includes RUN,
STOP and DEBUG.
Figure area: Ladder diagram program
Input: Display the input data. The input data can be enquired pressing the on the panel.
MEA: The note of cursor positioning node
MDI: Current working method (The ladder diagram can be modified only in the MDI mode).
The searching and positioning can be performed by the page-up, page-down and other
direction keys, the components then can be viewed and modified.
1.2.3 PLCPAR Interface
Enter PLCGRA interface pressing the [ PLCGRA] soft key, it also can be set the
66
Page 83
Chapter One PLC Interface Display
<program-controlled> key to shift the screen in the PLC interface be defining the bit parameter N0:
26#6=1
, and then enter the PLCGRA interface. Refer to the Fig. 1-2-3-1:
The content and operation of the
RUN: The operation state of the ladder diagram
PLCPAR interface:
Volume II Operation
Fig. 1-2-3-1
ADDR: Nonvolatile/keep relay address
Bit0~Bit7: Bit number state of the nonvolatile relay address
1: It means that this address remains the original state (before the power off);
0: It means that the address is rest to default state after the power is turned off.
Input: Display the input data.
MDI: Current working method. (Note: The relative parameters of the PLCPAR can be modified
only in the MID mode.)
The searching and positioning can be performed by the page-up, page-down and other
direction keys, the corresponding address then can be viewed and modified.
1.2.4 PLCDGN Interface
Enter the PLCDGN interface by [PLCDGN] soft-key, it also can be set the
<
Program-controlled> key to shift the screen in the PLC interface by defining the bit parameter N0:
26#6=1
, and then enter the PLCDGN interface. Refer to the Fig. 1-2-4-1.
67
Page 84
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Volume II Operation
The content and operation of the
RUN: Operation state of the ladder diagram
ADDR: Address of diagnosis number
Bit0~Bit7: The bit number state of the diagnosis address. 1: with signal breakover; 0: without the
signal breakover.
Input: Display the input data.
MDI: Current working method
The searching and positioning can be performed by the page-up, page-down and other
direction keys, the corresponding diagnosis number then can be viewed and modified.
Generally, only the searching operation can be performed in the interface, the I/O terminal of
the PLC enters signal debugging mode, after only the user gain the limit setting that K0.1 is set to 1,
in this case, user can modify the X and Y signals.
1-2-4-1
Fig.
PLCDGN interface:
1.2.5 PLCTRAE Interface
PLCTRA interface composes of two sub-interface “Setting” and “Trace”. Enter the PLCTRAE
“Setting” interface by pressing the [
Refer to the
68
Fig. 1-2-5-1 for PLCTRACE “Setting” interface:
PLCTRAE] soft key under the screen.
Page 85
Chapter One PLC Interface Display
Fig. 1-2-5-1
The content and operation of the PLCTRAE “Setting” interface
(1) Mode:
- - Circular cycle: periodic sampling for each time.
- - Signal change: sampling when signal changes.
(2) Resolution:
Input the sampling resolution, the default value is the least resolution (8ms), its range is
(8ms --1000ms).
The input value uses the multiple of the 8ms.
(3) Time limit:
When the sampling mode is set to “periodic cycle”, this parameter then displays. Input the
performance time of the trace. The numerical range of the “periodic cycle” is determined by the value
of the “resolution” or the specified signal address quantity, and its range is displayed at the right side.
(4) Frame limit:
Volume II Operation
When the sample mode is set to “signal change”, then display this parameter. Input the sampling
quantity, and its range is displayed at the right side.
(5) Stop condition:
- - without: Do not stop tracing.
- - Buffer area full: It stops tracing when the buffer area is full.
- - Signal trigger: It stops tracing by the signal trigger.
Trigger setting: This parameter is enabled when the “stop condition” is selected to the
“signal trigger”.
Address: The input signal address is regarded as trigger stopping. (R address can not be
used for trigger stopping)
69
Page 86
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Mode; It determines that what kind trigger mode is used to stop tracing.
Rising edge: The tracing is automatically stopped by the rising edge of the trigger signal.
Falling edge: The tracing is automatically stopped by the falling edge of the trigger signal.
Any change: The tracing is automatically stopped by the rising or falling edge of the trigger
signal.
(6) Sampling condition: This parameter is enabled when the sampling mode is set to “signal
change”, which is determined the sampling condition.
- - Signal trigger: The specified mode changes when the signal specified by the trigger
address which is set by the sampling condition, collect the signal.
- - Any change: Any change occurs when the signal specified by the trigger address which is
set by the sampling condition.
Volume II Operation
Enter the
1-2-5-2:
Trigger setting: When the sampling mode is set to “signal change”, and then the sampling
condition is set to “signal trigger”, this parameter is enabled.
Address: The input signal address is treated as the sampling of the trigger signal. (The
R address can not regarded as the sampling trigger)
Mode: The trigger mode inputs the specified trigger signal.
Rising edge: The rising edge sampling of the trigger signal specifies the signal state.
Falling edge: The falling edge sampling of the trigger signal specifies the signal state.
Any change: Specify the signal state by the rising or falling edge sampling of the trigger
signal.
Switch on: Sample the specified signal state when the trigger signal is switched on.
Switch off: Sample the specified signal state when the trigger signal is switched off.
PLCTRACE “trace” interface by pressing the [trace] soft key. Refer to the Fig.
70
Fig. 1-2-5-2
Page 87
Chapter One PLC Interface Display
The content and operation of the PLCTRACE “trace” interface
(1) Sampling mode: Display the current sampling mode of the system.
(2) Period: Display the current sampling period of the system, that is, resolution.
(3) Time: This parameter displays when the “sampling mode” selects the “periodic cycle”.
- - Format display when tracing: the current timing is at the left side, and the max.
allowance timing is at the right side.
- - Format display when stopping: the most right side timing is placed at the right side; the
timing of trace stopping is placed at the middle side, and the max. allowance timing is
placed at the right side.
(4) Setting address: Move the cursor by the
be traced is inputted inside the
, it can be traced 15 signals at the same time.
Any address can be inputted. As for the R address, the previous 3 positions can be inputted
the address before 256; the 4
th
and 5gh position can be inputted 2 addresses after 255.
(5) (S) start: The signal trace can be performed pressing
is set correctly.
(T) Stop: Stop the signal trace after controlling the
Clear: Clear the value under the cursor pressing the
and , the signal address that will
Volume II Operation
key after the trace parameter
key.
key.
71
Page 88
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
CHAPTER TWO PLC PROGRAMMING OPERATION
2.1 Brief
The PLC operations of the GSK218MC serial are completed corresponding interface in the
system. The overall modification of the ladder diagrams should be performed after gaining the
limitation higher than the debugging.
GSK218MC series operations can be performed within two interfaces.
Volume II Operation
1. Enter PLCGRA classification interface pressing
The
PLCGRA interface consists of basis code, function code, command table and edit
command.
Fig. 2-1-1
[PLCGRA] twice, refer to the Fig. 2-1-1:
2.
PLCPAR interface includes KPAR, TMR, DATA, CTR and MDEC.
Enter PLCRAR interface pressing the
PLCPAR classification operation interface by controlling
The parameter modification, PLC operation state control and entering the I/O debugging mode
should be performed after the limitation above the debugging is gained. Refer to the Chapter Three
for details.
72
[PLCPAR] soft key, refer to Fig. 1-2-3-1. Enter the
[PLCRAR] again, refer to the Fig. 2-1-2.
Page 89
Chapter Two PLC Programming Operation
Fig. 2-1-2
2.2 Basis Code
Enter the basis command operation interface pressing the [Basis command] soft key in the
Fig. 2-1-1. Refer to the Fig. 2-2-1.
Volume II Operation
Fig. 2-2-1
Display other basis codes pressing theXkey. Refer to Fig. 2-2-2.
73
Page 90
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
Volume II Operation
Fig. 2-2-2
The basis codes are separated into7 kinds figures as follows:
[ ]: Normally opened contact
[ ]: Normally closed contact
[—( ) ]: Output coil
[—{( ) ]: Output coil reverse [—— ]: Horizontal breakover cable
[ ]: Vertical breakover cable
[ ]: Delete the vertical breakover cable
Miscellaneous soft keys:
[ X ]:
[W ]: Page-up
[Return]: Return to the last menu
Page-down
2.3 Operation Explanation of Ladder Diagram
z Add component: positioning the cursor to the place where the component is needed to be
added, input the component name in according to the corresponding menu, the display is
then appeared after the data; the corresponding components can be added pressing the
key on the panel. If the component has been positioned at the current place, the
new one may replace the old one.
74
Page 91
Chapter Two PLC Programming Operation
z Insertion component: Positioning the cursor to the place where is required to insert the
component; a vacancy is inserted in this place pressing the
new component pressing the steps of the add component. The cursor can be inserted in
turn.
z Component Deletion: Delete the current component pressing the key on the
panel.
z Add the vertical breakover cable: Add a vertical breakover cable at the lower right corner of
the current cursor by pressing the
z Delete the vertical breakover cable: The vertical breakover at the lower right corner of the
current cursor can be deleted by pressing the
z Add a horizontal breakover cable: a horizontal breakover cable can be inserted at the
current cursor place by pressing the [
replace the component which has been performed at the current position.
[ ] soft key.
[ ] soft key.
——] soft key; the horizontal breakover cable may
key, and then add the
Volume II Operation
z Row insertion: The cursor is positioned at any destination row, firstly press the on
the panel, then press the
specified row of the cursor. The followings rows are moved down in turn.
z Row deletion: The cursor is positioned at the destination row, firstly press the on
the panel, then press the
are moved up in return.
z Block deletion: The cursor is positioned as the start position where to be deleted, then input
the address of the output coil of the desired deletion block, and then press the
key on the panel.
key, and therefore a new row is inserted above the
key, the current row is then deleted, the following rows
z Search: Directly input the component name what you want to reach, it will display at the
75
Page 92
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
data column on screen, upward or downward search by pressing the or
after inputting.
z Save: The modified ladder diagram is saved by pressing the key.
Illustrations of the ladder diagram programming:
1. The cursor is positioned as the start place of the programming position, a normally opened
Volume II Operation
contact symbol occurs at the cursor’s positioning by
component name X1.4, affirm it by pressing the key, the component X001.4
appears on the current cursor position.
2. Rightward one place of the cursor, press the
contact occurs at the cursor positioning, directly input component name X2.1, affirm it by
pressing the
3. The cursor is positioned at the next start position, press the
normally opened contact occurs at the cursor positioning, direct input the component name
X2.4, affirm it by pressing the
position
key, and then the X002.1 appears at the current cursor position.
[ ] soft key, a symbol of the normally closed
, the component then appears at the current cursor
[ ] soft key, directly input the
[ ] soft key, a symbol of the
4. Rightward one place of the cursor, press the
at the current cursor position;
5. Upward one place of the cursor, press the
the lower right corner of the cursor.
6. Press the
breakover line), and then the output coil is produced at the right side of the ladder diagram.
Directly input the component name G1.0, affirm it by pressing thef
G001.0 occurs at the current cursor position.
The compiled ladder diagram is shown in the
76
[—( )] soft key, the output coil is automatically generated (the required horizontal
[——] soft key, draw a horizontal breakover line
[ ] soft key, draw a vertical breakover line at
, the component
Fig. 2-3-1:
Page 93
Chapter Two PLC Programming Operation
X001.4 G001.0
X002.1
( )
X002.4
Fig. 2-3-1 Ladder diagram illustration
Explanation: The green component indicates connection state in the ladder diagram regardless
of the normally opened, normally closed or output coil, and the white one means
disconnected state. (The dark color is disconnection state, the light color is
connected state due to the printing)
2.4 Function Code
Press the [Function command] soft key in the Fig. 2-1-1, then enter the function code
operation interface, refer to the Fig. 2-4-1.
Volume II Operation
Fig. 2-4-1
There are 35 PLC function codes are listed in the function code. Refer to the Chapter Two
Programming for function code format and usage, the compilation of the function code is consistent
with the ladder diagram operation in the Section 2.3.
77
Page 94
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
2.5 Command Table
In the PLCGRA interface, as the Fig. 2-1-1. Press the [Command table] soft key again, and
then enter the command table classification operation interface, refer to the
Volume II Operation
Fig. 2-5-1
Fig. 2-5-1.
The content and operation of the command list:
1/3070: Offer the steps and total steps information of in the current operation of the ladder
diagram.
RUN: the operation state of the ladder diagram
Input: Display the input data.
MDI mode: current working method.
[Conversion]: Ladder diagram converts to the command list.
[Download]: Download the command list to the CNC, automatically operate the PLC ladder
diagram.
[Stop]: Stop the operation of the ladder diagram.
[Return]: Return to the previous menu.
The positioning can be performed by the page-up, page-down and four direction keys, and then
check the command list.
78
Page 95
Chapter Two PLC Programming Operation
2.6 Compilation Command
Volume II Operation
Fig. 2-6-1
The content and operation of the command list interface:
1/972: Display the current position of the cursor and the total line number of the ladder diagram.
RUN: The operation state of the ladder diagram.
Input: Display the input data.
MDI mode: Current working mode.
[Copy]: Press this key after entering G12.1, the ladder diagram between cursor and G12.1 can
be duplicated.
[Paste]: Paste the copied diagram to the ladder diagram.
[Deletion]: Press this key after entering the G12.1, the ladder diagram between the cursor and
G12.1 can be deleted.
[Replacement]: Input the replaced the signal address, then press this key, the system may
prompt whether it is replaced or replaced completely.
Y: Replaced; N: Do not replace; A: Replaced completely
[Return]: Return to the previous menu.
The search positioning can be performed by the page-up, page-down and four direction keys on
the panel, then check the command list.
79
Page 96
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
2.7 PLC Operation Steps
PLC operation steps:
1. Press <Set> key, input the password higher level than the machine tool builder in the
[Password] interface.
2. Press the <Program-controlled> key, in [PLCPAR] interface, enter the check and setting
interfaces of the hold/nonvolatile relay by pressing the [KPAR] soft key. The PLC can be
operated modifying the relative bit of the K000 and K001. (For example, K000.7 is set to
1, then memories). Refer to the K code list of the Appendix in the Chapter Four
Installation Connection for the definition of the relative bit.
Volume II Operation
3. Press the [Command list] soft key in the [PLCGRA] interface, then press the [Stop]
soft key in the interface, the ladder diagram of current operation is stopped. (This step
can be ignored if the current ladder diagram does not modify).
4. The modification of the PLC program compilation is completed by the
command]
interface. Press the <Save> key, the data column prompts: “Ladder diagram saves
successfully!” means that the save is performed. When some incorrect compilation
occurs in the PLC, the corresponding alarm may display during storing, check the PLC
program.
5. The data column may display: “the ladder diagram is converting…” by pressing the
[Command list] soft key in the [PLCGRA] interface, then control the [Conversion] soft
key. ”Successfully convert”! displays after converting.
6. The data column may display: “the command list is downloading” by pressing the
[Command list] soft key in the [PLCGRA] interface, then press the [Download] soft key.
, [Function command] and [compilation command] in the [PLCGRA]
[Basis
80
“Successfully download!” displays after the downloading is performed. The ladder
diagram is converted into the command list downloading to the CNC and then it
operates automatically.
Page 97
Chapter Two PLC Programming Operation
Volume II Operation
81
Page 98
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
CHAPTER THREE PLC ADDRESS AND PARAMETER SETTING
The addresses and parameters, such as the counter, timer, data list and nonvolatile relay may
be used in the PLC; the viewing and setting of these addresses and parameters should be
performed in the corresponding interface. Press the
interface, then enter the PLC address and parameter setting interfaces, refer to the
includes the nonvolatile relay, timer, data list, counter, F address corresponding with the M function.
It is used for checking and setting these addresses, parameters and data list. (User can set it after
the debugging password is input and gained an authority)
[PLCPAR] soft key again in the PLCPAR
Fig. 3-1, which
Volume II Operation
Fig. 3-1
3.1 Nonvolatile/Hold Relay
Press the [KPAR] soft key in the Fig. 3-1, then enter the checking and setting interfaces of the
nonvolatile replay, refer to the
Fig. 3-1-1.
82
Page 99
Chapter Three PLC Address And Parameter Setting
Fig. 3-1-1
Volume II Operation
The content and operation of the nonvolatile replay interface:
RUN : Ladder diagram operation state.
ADDR : Nonvolatile relay address.
Bit0~Bit7 : Bit number state of the nonvolatile replay address.
1: This address remains the state before power off after the power is turned off;
0: This address resets on default state after the power is turned off.
Input : Input data display.
MDI mode : Current working mode.
[Return] : Return to the previous menu.
[X] : Enter next page.
The set value can be downloaded to the CNC operation pressing the <
Save> key after
modifying. “KPAR downloading successful” displays after the save is performed; the system displays:
“downloading fail” when the save is incorrect; the “illegal downloading parameter” displays without
downloading conditions.
(
Note: It can be saved and operated by pressing the <Save> after modifying. K000~~K005 are
used by the system. Refer to the Appendix One and Three for details)
The search and positioning can be performed by the page-up, page-down and four direction
keys on the panel; checking and modifying of the nonvolatile relay address can be performed.
83
Page 100
GSK218MC Series Machining Center CNC System PLC & Installation Connection Manual
3.2 Timer
Press the [TMR] soft key in the Fig. 3-1, then enter the checking and setting interfaces of the
timer, refer to the
Volume II Operation
Fig. 3-2-1.
Fig. 3-2-1
The content and operation of the timer:
RUN : Operation state of ladder diagram.
N0. : Timer serial number; Do no change it.
ADDR. : Timer address; Do not change it.
CURT : Current value of the timer; Do not change it.
modifying. “TMR downloading successful” displays after the save is performed; the system displays:
“downloading fail” when the save is incorrect; the “illegal downloading parameter” displays without
downloading conditions.
SET : Presetting value of the timer; it can be changed after the K000.0 (PLC parameter
allows to be modified) is set 1 in the MDI mode.
Input : Input data display
MDI mode : Current working mode
[Return] : Return to the previous menu
[X] : Enter to the next page.
The set value can be downloaded to the CNC operation pressing the <
Save> key after
The search and positioning can be performed by the page-up, page-down and four direction
keys on the panel; checking and modifying of the timer address can be performed.
84
Loading...