4.22 AL T(ALTERNATIVE OUTPUT) .......................................................................... Ⅳ-18
GSK980TD Turning Machine CNC System
Ⅳ-11
II
Chapter 1 Sequential Program
g
g
Chapter 1 SEQUENTIAL PROGRAM
1.1 PLC SPECIFICATION
For different CNC PLC, there are different program capacity, processing speed, function instructions and
nonvolatile memory addresses. Specifications of GSK980TD PLC are as follows:
Specification
Programming language
Programming software
Programming grades
Executive cycle of grade one program
Average processing time of basic instruction
Max. step of program
Programming instruction
Sequential program is defined to logically control the machine and relative devices according to sequence of
ladder. The sequence of ladder is compiled in a traditional PLC but GSK980TD CNC PLC is integrated by
traditional one and advanced structured programming, employed with subprogram, embedded subprogram and
conditional branch,and with apparent advantages compared to the traditional.
1.2.1 Subprogram
In GSK980TD CNC PLC program, a special subprogram can be called according to requirements of
programming. For example, subprogram P0001 can be called when contactor X0000.0 is closed as follows:
Ⅰ-1
GSK980TD Turning Machine CNC System
g
g
Book 1 Pro
Call subprogram P0001
rammin
Subprogram P0001
1.2.2 Subprogram Embedding
GSK980TD CNC PLC can realize 20 grades subprogram embedding as the following figure. Subprogram
P0001 can be called when contractor X0000.0 is closed in main program; subprogram P0002 can be called
when contractor X0002.0 is closed in the subprogram P0001.
Subprogram P0001
Subprogram P0001
Call subprogram P0002
Ⅰ-2
Chapter 1 Sequential Program
g
g
Subprogram P0002
Book 1 Pro
1.2.3 Conditional Branch
The system can judge whether the setting conditions to execute a corresponding subprogram are satisfactory
when a main program is executed circularly, otherwise the system executes subprograms in order as the
above-mentioned figure.
1.3 EXECUTING SEQUENTIAL PROGRAM
The edited sequential programs(ladder program)are downloaded to 980TD by serial, CNC reads the ladder and
converts into some format identified by it after it is switched on again, and then CPU decodes and operation
processes them to store into RAM, and last reads every instruction in memory to execute it by arithmetical
operation.
1.3.1 Execution Process of Sequential Program
rammin
PLC sequence control is executed by software and there is different from general relay circuit, and so its method
is understandingly considered in editing PLC sequential programs.
Every relay can output simultaneously for general relay control circuit as the following figure. Y0002.3 and
Y0002.5 output simultaneously when contactor X0000.0, X0002.0 and X0002.2 are closed; in PLC sequence
control, every relay outputs in order. For example, Y0002.3 outputs and then Y0002.5 does when X0000.0,
X0002.0 and X0002.2 are closed, namely, outputs are executed in order as ladder.
Ⅰ-3
1.3.2 Cycle Execution of Sequential Program 1.3.2 Cycle Execution of Sequential Program
g
g
p
p
GSK980TD Turning Machine CNC System
Book 1 Pro
rammin
Cycle execution of sequential program is defined that PLC executes ladder from its home to end, and again
Cycle execution of sequential program is defined that PLC executes ladder from its home to end, and again
from its home to end after the run is completed.
from its home to end after the run is completed.
Processing cycle is defined to runtime of ladder from home to end. The shorter the processing cycle is, the
Processing cycle is defined to runtime of ladder from home to end. The shorter the processing cycle is, the
stronger the response of signal is.
stronger the response of signal is.
1.3
.3 Priority Order of Executing Sequential Program 1.3.3 Priority Order of Executing Sequential Program
GSK980TD PLC programs are divided into grade one and grade two programs which processing cycles are
GSK980TD PLC programs are divided into grade one and grade two programs which processing cycles are
different. The first one is executed per 8ms to do with short pulse signal with quick reaction, and the second one
different. The first one is executed per 8ms to do with short pulse signal with quick reaction, and the second one
is executed per 8n(ms),in which n is fraction times. PLC divides the grade two program into n blocks according
is executed per 8n(ms),in which n is fraction times. PLC divides the grade two program into n blocks according
to runtime, and executes one block per each 8(ms).
to runtime, and executes one block per each 8(ms).
End of grade one
rogram
Fraction 1:
0004~0006
Fraction 1:
0007~0011
End of grade one
rogram
Fraction of the grade two program is to execute the first and execution process is as the following figure when
the fraction number is n; T11, T12, T1n are runtime to execute the first. T21, T22, T2n separately corresponds
to runtime of No. n block in executing the second when No. n cycle is execute. Tc1, Tc2, Tcn separately
corresponds to hold time by CNC when No. n cycle is executed.
The program returns to its beginning to continue execution when the last fraction block of the second is
executed completely. The first is executed every 8ms, No. n block of the second is done every 8n, and runtime
Ⅰ-4
Chapter 1 Sequential Program
g
g
of one cycle is 8n(ms). The more the fraction number of the second is, the longer the runtime of one cycle is. of one cycle is 8n(ms). The more the fraction number of the second is, the longer the runtime of one cycle is.
1ms
Block 1
T21
8ms
1ms
Block 2
T22
8ms
T1nT12 T11
1ms
Block n
T2n
8ms
Block 1
Tcn Tc2Tc1
1.4 PROCESSING INPUT/OUTPUT SIGNAL 1.4 PROCESSING INPUT/OUTPUT SIGNAL
Processing of input/output signal is as the following figure. X signal of machine I/O interface and F signal of
Processing of input/output signal is as the following figure. X signal of machine I/O interface and F signal of
NC are separately input to input memories at machine side and NC side, and directly used by the first grade
NC are separately input to input memories at machine side and NC side, and directly used by the first grade
program; they separately input to synchronous input memories are used by the second. Output signals of the
program; they separately input to synchronous input memories are used by the second. Output signals of the
first and the second are separately output to output memories at NC side and machine side,and then separately
first and the second are separately output to output memories at NC side and machine side,and then separately
output to NC and I/O interface of machine
output to NC and I/O interface of machine
Signal states of the above-mentioned memories are displayed by diag no st i c inte rfa ce, an d th e diagn o s tic nu mber
Signal states of the above-mentioned memories are displayed by diag no st i c inte rfa ce, an d th e diagn o s tic nu mber
corresponds to address number of program.
corresponds to address number of program.
Book 1 Pro
rammin
PLC
NC
侧同步输入存储器
Syn. input memory at CN side
Syn. input memory at machine side
机床侧同步输入存储器
Grade one program
第一级程序
F
NC
侧输入存储器
Input memory at CN side
N C
Machine
机
床
G
X
Y
NC
侧输出存储器
Output memory at CN side
机床侧输入存储器
Input memory at machine side
Output memory at machine side
机床侧输出存储器
Grade two program
第二级程序
1.4.1 Processing Input Signal 1.4.1 Processing Input Signal
A:Input signal of grade one program: A:Input signal of grade one program:
Input memory at NC side is scanned every 8ms and stores F signal from NC, and the system directly use its state
Input memory at NC side is scanned every 8ms and stores F signal from NC, and the system directly use its state
when the first is executed.
when the first is executed.
B:Input signal of grade two program: B:Input signal of grade two program:
Input signal of the second is the one stored by the first. The first directly use F and X signal and so the input Input signal of the second is the one stored by the first. The first directly use F and X signal and so the input
Ⅰ-5
signal of the second lags the first one and its max. lag time is runtime of one grade two program. signal of the second lags the first one and its max. lag time is runtime of one grade two program.
g
g
p
p
C:Difference of input signal states of the first and the second: C:Difference of input signal states of the first and the second:
Book 1 Pro
For the same input signal, its states are different in the first and the second when PLC reads input signals,
For the same input signal, its states are different in the first and the second when PLC reads input signals,
because the first reads input memories at NC side and machine side but the second reads the synchronous input
because the first reads input memories at NC side and machine side but the second reads the synchronous input
memory at NC side and ones at machine side. The input signal of the second lags behind that of the first and its
memory at NC side and ones at machine side. The input signal of the second lags behind that of the first and its
lag time is 8nms which should be noted.
lag time is 8nms which should be noted.
rammin
Example: Example:
GSK980TD Turning Machine CNC System
End of grade one
rogram
Fraction1:
0003~0005
Fraction1:
0006~0007
End of grade two
rogram
When the lag time is the first 8ms, X0001.0=1 and the system executes the first Y0001.0=1. When the system
starts to execute the second, X0001.0=1 inputs to the synchronous input memory and starts to execute the first
block of the fractional second.
When the lag time is the second 8ms, X0001.0=0 and the system executes the first one Y0001.0=1. And then the
system executes the second block of the fractional second but X0001.0 =1 which state is still the previous
synchronous input memory and Y0002.3=1 after execution.
1.4.2 Processing Input Signal
A:Signal to NC
PLC transmits output signal to the output memory at NC side every 8ms, and then directly outputs to NC.
B:Signal to machine
PLC transmits output signal to the output memory at machine side, and then directly outputs to memory every
2ms.
Ⅰ-6
Chapter 1 Sequential Program
g
g
p
1.4.3 Synchronous Procession of Short Pulse Signal1.4.3 Synchronous Procession of Short Pulse Signal
The first is used for processing the short pulse signal. When it is less than 8ms, namely when the system
The first is used for processing the short pulse signal. When it is less than 8ms, namely when the system
executes the first, the input signal state may be changed, which may execute programs by mistake.
executes the first, the input signal state may be changed, which may execute programs by mistake.
End of grade one
rogram
As above, X0001.3=0 is changed to X0001.3=1 after Y0002.3=1 is executed, and if the system executes the
next line of ladder and Y0003.3=1, at the moment Y0002.3=1 and Y0003.3=1. To avoid the above, process
synchronously the short pulse signal as follows:
Book 1 Pro
rammin
End of the first
grade program
After the program is executed synchronously and when X0001.3=1,Y0003.3=1,Y0002.3=0, X0001.3=0,
Y0002.3=1,and Y0003.3=0,but Y0003.3=1 or Y0002.3=1.
1.4.4 Interlock Signal
For safety, the signals must be employed with soft interlock in sequence control, and with hard interlock to relay
control circuit of power electric box at machine side at the same time. Because the hardware is failure, the
interlock is invalid in executing sequential program even if it is employed logically with soft interlock, which
can ensure the operator is not injured and the machine is prevented from damage.
1.5 EDITING SEQUENTIAL PROGRAM
Edit the sequential program from ladder which is composed of relay contacts, symbols and function instructions.
Logic relationship in ladder consists of sequential program which is edited by two methods: one is employed
with input to use program instructions and the other is with relay symbols by their corresponding contactor,
symbol and function instruction. Edit the sequential program employed with the ladder format instead of
mnemonic code language when the system is employed with the relay symbol.
In actual editing sequential program, use programming instruction or ladder to edit it according to PLC. In the
User Manual, the system is employed with ladder as follows:
Ⅰ-7
1.5.1 Distributing Interface (Step 1)
g
g
GSK980TD Turning Machine CNC System
Book 1 Pr
The interfaces can be distributed after control target is defined and the corresponding input/output signal points
are counted. Refer to input/output interface signal list
o
1.5.2 Editing Ladder (Step 2)
rammin
Edit the software GSKCC.EXE by 980TD ladder to represent the required control operations of machine.
Counter, timer which are not done by relay symbol is represented by the specified function instructions. The
edited ladder is downloaded to CNC by serial.
1.5.3 Debugging Ladder (Step 3)
After the ladder is downloaded to 980TD, the ladder is debugged as follows:
A: emulator
Use one emulator instead of machine to debug it. Machine signal state is represented with switch ON/OFF,
and output signal state is done with indicat or ON/OFF. Observe if every indicator on the emulator is correct
when executing CNC.
B: CNC diagnosis
Observe if the diagnostic state of every signal is consistent with the function requirement when executing
CNC. Check the ladder by checking each function in order.
C: actual run
There may be an unexpected result in the actual debugging machine and so do preventive measures before
debugging.
1.5.4 Program Editing Limit
In program, END1 and END2 are needed, which are taken separately as ending character of the first and the
second, and END1 must be before END2. The system only supports parallel output instead of multi grades
output and there are syntactic errors as follows:
Ⅰ-8
Chapter 1 Sequential Program
p
g
g
End of grade one
rogram
Syntactic error:
0002~0003
Book 1 Pro
Syntactic error:
0004
Syntactic error:
0005~0006
Syntactic error:
0007~0009
Syntactic error:
0010~0011
rammin
Ⅰ-9
Chapter 2 Address
g
g
Chapter 2 ADDRESS
Addresses are used for distinguishing signals. Different addresses separately correspond to input/output signal
at machine side and CNC side, internal relay, counter, timer, holding relay and data list. An address number is
consisted of address type, address number and bit number as follows:
X 0001.6
Bit number
位号
地址号
Address number
地址类型
Address type
Address type: X, Y, R, F, G, K, A, T, DT, DC, C, D, L, P
Address number: decimal number to express one byte
Bit number: octal number, 0~7 separately expressing byte 0~7 bit of front address number
980TD PLC addresses are divided into fixed addresses and definable addresses. Signal definitions of the fixed
addresses cannot be changed and are defined by CNC; the definable addresses can be defined again by user
according to the actual requirements. Address types are as follows:
Address Explanation Range
X Machine→PLC X0000~X0029
Y PLC→machine Y0000~Y0019
F NC→PLC F0000~F0255
G PLC→NC G0000~G0255
R Intermediate relay R0000~R0999
D Data register D0000~D0999
C Counter C0000~C0099
T Timer T0000~T0099
DC Counter preset value register DC0000~DC0099
DT Timer preset value register DT0000~DT0099
A Information displaying request signalA0000~A0024
K Hold relay K0000~K0039
L Jump label L0000~L9999
P Subprogram label P0000~P9999
Note: address R900~R999, K30~39 are used for reserved area of CNC program instead of output relay.
Book 1 Pro
rammin
2.1 MACHINE→PLC ADDRESS(X)
980TD PLC X addresses are divided into two types,the first one is X0000.0~X0003.7,which are mainly
distributed to CNC XS40 and XS41 I/O interfaces, including fixed addresses and definable addresses,and the
second one is X0020.0~X0026.7,which are fixed addresses and mainly be distributed to input keys on operator
panel. Other addresses are reserved ones. The value range is 0 or 1.
z Address range: X0000.0~X0003.7 are separately distributed to CNC XS40 and XS41 I/O interface.
z Fixed address: X0000.3, X0000.5, X0001.3 separately corresponds to XDEC, ESP, ZDEC signal
Example: ESP signal is can be connected to X0000.5, CNC directly distinguishes signals on it and judge if there
Namely: CNC alarms to emergently stop when X0000.5 is 0;
CNC alarms to emergently stop when G8.4 is 0 by PLC control.
Emergent stop signal ESP X0000.5
Deceleration signal of machine reference point return in X direction XDEC X0000.3
Deceleration signal of machine reference point return in Z direction ZDEC X0001.3
zDefinable address: their functions can be defined by user according to requirement and used for connecting
with external electric circuit and ladder. Distribution graph of X address in I/O interface is as follows:
which can be directly distinguished by CNC in CNC run.
is ESP signal; CNC alarms to emergently stop when G8.4 signal is valid by PLC control.
Address range: X0020.0~X0026.0 are fixed addresses which correspond to press keys on operator panel and
which signal definitions cannot be changed by user.
Ⅱ-2
Chapter 2 Address
g
g
Relationship between addresses and press keys is as follows:
X0020 7 6 5 4 3 2 1 0
SKIP
Key
SINGLE
JOG
MPG
AUTO
MDI
Book 1 Pro
EDIT
X0021 7 6 5 4 3 2 1 0
MSTMST
Key
DRY
X0022 7 6 5 4 3 2 1 0
Key
X0023 7 6 5 4 3 2 1 0
Key
CCW
JOG
LUR.
STOP
COOLANT
CW
X0024 7 6 5 4 3 2 1 0
Key
PAUSE
X0025 7 6 5 4 3 2 1 0
Key
rammin
TOOL
RUN
X0026 7 6 5 4 3 2 1 0
Key
2.2 PLC→MACHINE ADDRESS(Y)
980TD-PLC Y address are divided into tw o: Y0 00 0.0~Y0003.7 are mainly distributed to CNC XS42 and XS39
I/O interfaces, including fixed address and definable address; Y0004.0~X0009.7 which are mainly distributed
to indicators on the operator panel. Other addresses are reserved ones. Their values are 0 or 1.
2.2.1 Y Address in I/O Interface
Address range: Y0000.0~Y0003.7 are separately distributed to CNC XS42 and XS39 I/O interfaces and their
signal definitions can be defined by user according to requirements to connect to external
Ⅱ-3
g
g
Distribution graph of 980TD output interfaces address is as follows:
Address range: Y0004.0~Y0009.0 are fixed addresses which correspond to indicators on the operator panel,
and which signal definitions cannot be changed by user. Relationship corresponding to each state indicator is
referred to Appendix2: Output signal(Y).
2.3 PLC→NC ADDRESS(G)
Address range: G0000.0~G0255.7, value range: 0 or 1. Refer to Appendix3: G, F signals about definitions of
address signals.
2.4 NC→PLC ADDRESS(F)
Address range: F0000.0~F0255.7, value range: 0 or 1. Refer to Appendix3: G, F signal about definitions of
address signals.
2.5 INTERNAL RELAY ADDRESS
Address range: R0000.0~R0999.7, value range: 0 or 1. They are zero after CNC is switched on.
Ⅱ-4
Chapter 2 Address
g
g
Address
number
R0000
R0001
R0899
R0900
R0999
7 6 5 43210
Definable
addresses
NC
2.6 INFORMATION DISPLAYING REQUEST ADDRESS(A)
Address range: A0000.0~A00024.7 and they are zero after CNC is switched on.
Address
number
A0000
A0001
A0024
7 6 543210
Book 1 Pro
rammin
2.7 HOLD RELAY ADDRESS(K)
The address area is used for hold relay and setting PLC parameters and data are saved after the system is
switched off. Address range: K0000.0~K0039.7, value range: 0 or 1.
Address
number
K0000
K0001
K0029
K0030
K0039
7 6 5 43210
Definable
addresses
NC
Ⅱ-5
GSK980TD Turning Machine CNC System
g
g
2.8 COUNTER ADDRESS(C)
Book 1 Pro
The address area is used for storing current counting value of counter and data are saved after the system is
switched off. Address range: C0000~C0099, value range: 0~21,4748,3647.
rammin
Address
number
C0000
C0001
C0099
31 30 2928
2.9 COUNTER PRESET VALUE ADDRESS(DC)
32 1 0
The address area is used for storing preset value of counter and data are saved after the system is switched off.
Address range: DC0000~DC0099, value range: 0~21,4748,3647.
Address
number
DC0000
DC0001
DC0099
31 30 2928
32 1 0
2.10 TIMER ADDRESS(T)
The address area is used for storing current value of timer and T0000~T0079 are zero after the system is
switched on.T0080~T0099 are saved after it is switched off. Value range: 0~21,4748,3647.
Address
number
T0000
T0001
T0099
31 30 2928
32 1 0
Ⅱ-6
Chapter 2 Address
g
g
2.1 1 TIMER PRESET VALUE ADDRESS(DT)
The address area is used for storing preset value of timer and data are saved after the system is switched off.
Address range: DT0000~DT0099 and value range: 0~21,4748,3647.
Address
number
DT0000
DT0099
31 30 2928
32 1 0
2.12 DATA LIST ADDRESS(D)
D0000~D0299 are zero when CNC is switched on. D0300~D0999 are saved after it is switched off. Value
range: 0~255.
Address
number
D0000
D0001
D0299
D0300
D0999
7 6 5 43210
Book 1 Pro
rammin
2.13 LABEL ADDRESS(L)
It is used for specifying jump target label in JMPB and LBL label.
Range: L0~L9999
2.14 SUBPROGRAM NUMBER(P)
It is used for specifying the target subprogram number to call in CALL and subprogram number in SP.
Range: P0000~P9999
Ⅱ-7
Chapter 3 PLC Basic Instructions
g
g
Chapter 3 PLC BASIC INSTRUCTIONS
Basic instructions are used for editing sequential programs and executing 1-bit operation. There are basic instructions
for GSK980TD PLC as follows:
Instruction
name
LD Read normally-open contact X, Y, F, G, R, K, A
LDI Read normally-closed contact X, Y, F, G, R, K, A
OUT Output coil Y, G, R, K, A
AND Normally-open contact in series X, Y, F, G, R, K, A
ANI Normally-closed contact in series X, Y, F, G, R, K, A
OR Parallel normally-open contact X, Y, F, G, R, K, A
ORI Parallel normally-closed contact X, Y, F, G, R, K, A
ORB Parallel series circuit block
ANB Parallel circuit block in series
3.1 LD,LDI,OUT INSTRUCTION
Function Component
Book 1 Pro
rammin
● Mnemonic code and function
Mnemonic code Function Ladder symbol
LD Read normally-open contact
LDI Read normally-closed contact
OUT Output coil
● Instruction explanation
A: LD, LDI are used for connecting contact to bus bar. Each one can combine with instruction ANB and can be
used at starting point of branch.
B: OUT is used for driving output relay, internal relay coil instead of input relay.
C: Parallel instruction OUT can be continuously used.
● Programming example
Program explanation:
When X0002.1 is 1, the system outputs Y0003.7
When F0100.3 is 0, the system outputs G0120.0
Ⅲ-1
3.2 AND, ANI INSTRUCTION
g
g
Bo
● Mnemonic code and function
ok 1 Pro
Mnemonic code Function Ladder symbol
GSK980TD Turning Machine CNC System
rami
m
n
● Instruction explanation
AND, ANI can connect one contact in serial. There can be many contacts in serial and the instructions can be
used many times.
● Programming example
Program explanation:
Use X0002.1,
Use F0100.3 and X0002.1 in series
Use X0008.6, and F0100.3 and X0002.1 in series
If X0002.1=1, X0008.6=1 and F0100.3 is 0, the system outputs Y0003.7.
AND Normally-open contact in series
ANI Normally-closed contact in series
3.3 OR, ORI INSTRUCTION
● Mnemonic code and function
Mnemonic code Function Ladder symbol
OR Parallel normally-open contact
ORI Parallel normally-closed contact
● Instruction explanation
A: OR, ORI can be connected to one contact in parallel. When more than two contacts are connected in series
and the serial loop is connected with other loop in parallel, the system should use ORB.
B: The system executes OR, ORI from its current step with LD, LDI in parallel.
● Programming example
Ⅲ-2
Chapter 3 PLC Basic Instructions
g
g
N
Program explanation: Program explanation:
Use X0002.1 Use X0002.1
Use F0100.3 and X0002.1 in series Use F0100.3 and X0002.1 in series
If X0002.1=1, and F0100.3 is 0, the system outputs Y0003.7. If X0002.1=1, and F0100.3 is 0, the system outputs Y0003.7.
Book 1 Pro
3.4 ORB INSTRUCTION 3.4 ORB INSTRUCTION
●Mnemonic code and function ●Mnemonic code and function
Mnemonic code Mnemonic code Function Function Ladder symbol Ladder symbol
ORB Parallel series circuit block
● Instruction explanation
A: Serial loop block is defined to its loop combined by more than contacts in series. When the serial loop is
connected in parallel, starting point of branch uses LD and its end point uses ORB.
B: ORB is sole instruction without address.
● Programming example
ode
rammin
Program explanation:
As above figure, there are three branches(0002,0003,0004) from left bus line to node, and 0002 and 0003 are
serial circuit blocks. There is parallel serial circuit block between bus line and node or among nodes, the
following ending of branch use ORB except for the first one. Use OR instruction if the branch 0004 is not serial
circuit block.
ORB and ANB are instructions without operation function, representing or, and relationship among circuit
blocks.
3.5 ANB INSTRUCTION
●Mnemonic code and function
Mnemonic code Function Ladder symbol
ANB Parallel circuit block in series
● Instruction explanation
A: Use ANB when the branch loop is serially connected with the previous loop. Use LD, LDI at the starting
Ⅲ-3
point of branch, and use ANB to serially connect with the previous loop. point of branch, and use ANB to serially connect with the previous loop.
g
g
B: ANB is sole instruction without address. B: ANB is sole instruction without address.
Book 1 Pro
● Programming example ● Programming example
rammin
GSK980TD Turning Machine CNC System
Block 1
Program explanation:
As above ladder, ORB represents the parallel serial circuit block in block 2 and ANB represents block 1 and 2 in
series.
Block 2
Ⅲ-4
Loading...
+ 136 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.