820SC PLC Subroutine Library
820SC PLC Subroutine Library
1. General Description
SINUMERIK 802S base line and SINUMERIK 802C base line are compact numerical
control systems designed for control of turning and milling machine tools. SINUMERIK 802S
base line equips with stepper drives and SINUMERIK 802C base line with analog servo
drives. In order that SINUMERIK802S/C can be started up easily and quickly, a PLC
subroutine library is provided, based on Programming Tool PLC 802 V3.1 or higher.
Audience:
This document is designed for engineers of Machine Tool Builders who have
general knowledge of CNC and PLC.
Related Information:
Refer to following documents for more detailed information:
• SINUMERIK 802S/C base line Start-up and installation Guide
• SINUMERIK 802S/C base line Function description
• SimoDrive 611 planning guide
1.1. Content Of The Library
PLC subroutine library is composed of 2 PLC projects files and its description document,
which is provided in the toolbox of 802S/C.
SUBR_LIBRARY_802SC.ptp Project file in which a variety of subroutines is
provided with an empty main program (OB1)
SAMPLE_802SC_bl.PTP Project file based on library, which can be used for
application of turning or milling machines
In project file SUBR_LIBRARY_802SC.ptp basic subroutines are provided for functions
such as emergency stop control, axes control, etc., as well as coolant control, lubrication
control and simple turret control, etc. All these subroutines can be used as building blocks
to build up your own PLC application program, simply by putting the required subroutines
together in MAIN (OB1) and downloading it into SINUMERIK 802S/C.
The project SAMPLE_802SC_bl.PTP, based on SUBR_LIBRARY_802SC.PTP, is a
complete application PLC program for simple turning or milling machines. The
SAMPLE_802SC_bl.PTP is preinstalled in SINUMERIK 802S/C before delivery, which can
be configured via PLC machine data for different machine tools. For those machine tools
that SAMPLE_802SC_bl.PTP can cover their functions, it doesn’t need to write any PLC
application, just specify some PLC machine data. And it is also possible to modify this
sample project file or adding the functions your machine tool needed.
Please read this description carefully before editing your own PLC program based on
SUBR_LIBRARY_802SC.ptp or modifying SAMPLE_802SC_bl.PTP.
Note:
From USR16 are predefined symbol for all interface signals of NCK, HMI, and MCP
1.2.5. Arrangement Subroutine Library
SBR Name Subroutine description
0 ~ 30 - Free for customer application
31 USR_INI Reserved for user initializing (called by SBR32 PLC_INI)
32 PLC_INI Initialization of the control
33 EMG_STOP Emergency Stop (Drive power on/off timing control )
34 X_CROSS Traverse key layout control via PLC MDs
35 SPINDLE Spindle control (contactor, analog of bi-/uni-polar)
36 MINI_HHU Siemens mini-Hand Held Unit (via PLC inputs)
38 MCP_NCK MCP & HMI signal (from V1000 /V1700 /V1900) to NCK
39 HMI_HW Handwheel selection via HMI
40 AXES_CTL Axes enables, hardware limit, motor brake release, etc.
41 GEAR_CHG 2 gear stage level change
44 COOLING Coolant control
45 LUBRICAT Lubrication control (interval and time)
46 TURRET1 Turret control 1 (simple turret with 4/6/8 position)
48 TOOL_DIR Make out the direction of tool change
49 LOCK_UNL Clamp/Unclamp control
51 Trg_key_OR User keys/LEDs feed/spindle override
62 FILTER Input/output filtering ONLY for SAMPLE
Important
! These machine data bits are specified in hexadecimal format.
Please convert bit setting into hexadecimal and then input.
2.1.4. Corresponding PLC Machine Data: MD14512[16] Bit3=1 - Spindle with override switch
SCAN_1ST PLC_INI
EN
CAUTION
! Please check whether this subroutine complies with all the relevant
safety requirements.
Terminal 63
Terminal 48
t t t t
Note: If traverse keys are not defined, traverse operation is not possible.
Note: Refer to Chapter 3.3 for MCP key layout.
2.3.5. Sample Of Subroutine Call
Network 12 Traverse keys control according PLC machine data
ONE X_CROSS
EN
M AC Motor
802C ECU
X7
4/56 Analog setpoint
±10V CMD
4/14
0V GND
1 Analog setpoint
±10V CMD
6
0V GND
Note: In case to connect 802C base line to a converter with ±10V setpoint, its
analog signal comes from cable connected to X7 labeled 4/56 and 4/14,
its enable (internal relay) labeled 4/65 and 4/9.
2.4.3. Global Memory occupied
MB115 status memory (see symbol table USR30 for details)
MB116 status memory
T12 Timer for spindle brake delay
2.4.4. Corresponding PLC Machine Data – no
2.4.5. Sample of Subroutine Call
Network 12 spindle controlling (contactor, bi-/uni-polar spindle)
ONE SPINDLE
EN
ONE MCP_NCK
EN
ONE HMI_HWL
EN
Important
! After drive optimization, MD14512[18] Bit1 must be reset “0“ .
ONE AXIS_CTL
EN
Note: NCK G level 1 on above timing diagram means either programmed spindle speed
st
is in range of 1 gear stage or M41 is programmed;
NCK G level 2 on above timing diagram means either programmed spindle speed
is in range of 2nd gear stage or M42 is programmed.
Important
Because T14 and T15 are commonly used by subroutines TURRET1
! and GEAR_CHG, so that these two subroutines can not be used
simultaneously
ONE GEAR_CHG
EN
ONE COOLING
EN
ONE LUBRICAT
EN
ONE TURRET1
EN
ONE TOOL_DIR
EN
ONE LOCK_UNL
EN
__________________________________________________________________________
Spindle
Override switch Feed Spindle
Increase key Increase key
Feed Spindle
100% key 100% key
Feed
Decrease key Spindle
2.15.5. Function description of the keys and LEDs after calling Subroutine51
If press this key and holding on more than X seconds, Current feed
override value shifts to 0% directly. The holding on time X depends on
the setting of PLC MD14510[12].
Feed Press this key and holding on more than Y seconds, Current feed
100% key override value shifts to 100% directly. The holding on time Y depends on
the setting of PLC MD14510[13].
Feed Every press, Current feed override value shifts to the next higher step.
Increase key The range of the steps is 0% to 120%, and the shift speed depends on
the setting of PLC MD14512[12] bit 4/5. .
Every press, Current spindle override value shifts to the next lower step.
Spindle
The range of the steps is 50% to 120%, and the shift speed depends on
Decrease key
the setting of PLC MD14512[12] bit 6/7
If press this key and holding on more than P seconds, Current spindle
override value shifts to 0% directly. The holding on time P depends on
the setting of PLC MD14510[12].
Spindle Press this key and holding on more than Q seconds, Current spindle
100% key override value shifts to 100% directly. The holding on time Q depends on
the setting of PLC MD14510[13].
Spindle Every press, Current spindle override value shifts to the next higher step.
Increase key The range of the steps is 50% to 120%, and the shift speed depends on
the setting of PLC MD14512[12] bit 6/7.
Spindle LED2 Indicates Current spindle override value
100% <Current spindle override value <120%: lights;
Current spindle override value =120%: flashing.(2Hz)
(1) Set MD14512[12] bit 0 = 0 (Feed and Spindle override controled by trigger user keys.)
Set MD14512[12] bit 2 = 0 (Startup feed override is always 100%)
Set MD14512[12] bit 3 = 0 (Startup spindle override is always 100%)
Set MD14512[12] bit 4/5 =00 ( Feed override standard shift speed.)
Set MD 14512[12] bit6/7 =00 (Spindle override standard shift speed.)
Set MD14510[12] = 10 ( Press and hold on feed/spindle decrease key more than 1
Second, the override shifts to 0% directly.)
Set MD14510[13] = 15 ( Press and hold on feed/spindle 100% key more than 1.5
Second, the override shifts to 100% directly.)
General Description SAMPLE.PTP is a complete PLC application program, which is built up with the
subroutines from the library. It has 2 main purposes for the SAMPLE:
(1) It is an application program that can be used directly for those turning or
milling machine tools that meet its functions, simply specifying the function
of SAMPLE by PLC machine data.
(2) It is really used as a SAMPLE application. Through this sample, you will
learn how to organize the PLC subroutine library for your own application. It
is also possible to modify this SAMPLE to meet your special requirements,
which are not included in the library.
Like the integrated PLC application in previous software version, all the inputs
and outputs of DIO module 1 (standard package) are buffered via a filter. This
filter brings flexibility for different applications. In the following chapter you will
find the explanation, telling you how the filter works and where inputs and
outputs are buffered. Of course it is possible for you to delete this filter and
address directly inputs and outputs when you would like to modify the SAMPLE.
Turret control for ; Suitable for 4 or 6 position Hall Effect Device sensor turret;
turning machine ; Turret clamping time monitoring (time can be specified by PLC MD)
; Turret sensors monitoring
; During turret activate ”read-in disable” and “Feedhold”
Coolant control ; Manual coolant on/off using user key K6 (toggle) in JOG mode
; Program control via M07, M08 and M09
; Coolant level and overload monitoring
Motor brake release ; Combined keys activated by PLC MD to release motor brake during
during drive drive optimization (only for 611U drive with SimoCom U)
optimizing Combined keys:
K22 K23 K24 The layout of the traverse keys can be defined by
Traverse keys PLC machine data from MD14510[26] ~
K25 K26 K27
MD14510[31]. The key K26 is already defined as
K28 K29 K30 rapid overlay key.
USER_DATA_HEX
MD14512
Machine data PLC Machine Data - Hexadecimal
Index Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Input signals valid (Interface X2003: Terminal 0 ~ 7)
14512[0] I0.7 I0.6 I0.5 I0.4 I0.3 I0.2 I0.1 I0.0
Machine Configuration
14512[11] Turret Ana. sp spindle Clamp Lubricat Cooling
active Gear ch. active active active active
Important
PLC machine data described in chapter 1.2.5. should also be
! specified.
I/O signal processing SAMPLE is designed to meet the different wiring on the machine tools,
i.e. any input can be connected as Normal Open, or Normal Close. All
input and output signals have been filtered by SBR62 FILTER. The I/O
filtering is carried out according to PLC MD14512[0], [1], [2], [3] and
MD14512[4], [5], [6], [7].
Principle of I/O filter with follow chart, it is easily know the correspondence of internal inputs
and outputs. Therefore in SAMPLE M100.0 is a buffered input for I0.0,
and M101.2 is for I1.2; M102.3 is for Q0.3 and M103.4 is for Q1.4, and
so on. All subroutines in LIBRARY are inputs/output independent, i.e.
there is neither hardware I/O nor buffered I/O inside any subroutines.
Any hardware I/O or buffered I/O are addressed in MAIN (OB1).
Input signal processing X2003:
I0.0Æ ÆM100.0
I0.1Æ ÆM100.1
MD14512[2]
MD14512[0]
I0.2Æ ÆM100.2
“XOR”
“AND”
I0.3Æ ÆM100.3
I0.4Æ ÆM100.4
I0.5Æ ÆM100.5
I0.6Æ ÆM100.6
I0.7Æ ÆM100.7
Input signal processing X2004:
I1.0Æ ÆM101.0
I1.1Æ ÆM101.1
MD14512[3]
MD14512[1]
I1.2Æ ÆM101.2
“XOR”
“AND”
I1.3Æ ÆM101.3
I1.4Æ ÆM101.4
I1.5Æ ÆM101.5
I1.6Æ ÆM101.6
I1.7Æ ÆM101.7
MD14512[6]
MD14512[4]
M102.2Æ ÆQ0.2
“XOR”
“AND”
M102.3Æ ÆQ0.3
M102.4Æ ÆQ0.4
M102.5Æ ÆQ0.5
M102.6Æ ÆQ0.6
M102.7Æ ÆQ0.7
Output signal processing X2006:
M103.0Æ ÆQ1.0
M103.1Æ ÆQ1.1
MD14512[7]
MD14512[5]
M103.2Æ ÆQ1.2
“XOR”
“AND”
M103.3Æ ÆQ1.3
M103.4Æ ÆQ1.4
M103.5Æ ÆQ1.5
M103.6Æ ÆQ1.6
M103.7Æ ÆQ1.7
Modifications There are 2 possibilities to modify SAMPLE application if your required
functions are not included in it.
(1). If also only one DIO module is configured, simply add any new
subroutines in range from SBR0~SBR30, and call it in MAIN (OB1), and
delete the subroutine call which you do not need from MAIN. In this
case it is very simple to use buffered I/O in MAIN as well as in your own
subroutines.
(2). If you have more DIOs in your system or you would like to address
hardware I/Os directly, simply delete the subroutine call FILTER from
MAIN. Without FILTER all buffered I/Os are no longer valid. You have to
change addressing of all buffered I/O to hardware I/O in MAIN.
Of course if you compose your own PLC application directly from
project file SUBR_LIBRARY_802SC.PTP (a project with an empty
MAIN), you can use hardware I/Os from the beginning.
Important
! All inputs of SAMPLE are defined as NO (high effective). e.g.
I0.7 is defined by SAMPLE as Emergency Stop, I0.7=“1“, is
intepreted as an effective Emergency Stop.
In case if I0.7 is wired as NC, i.e. "0“ is emergency stop, Bit 7
of MD14512[2] must be set to “1“ to inform FILTER.
Important
! In case you compose your own application using the building
blocks provided in SUBR_LIBRARY, please take care of
definition of each input of the subroutine – NO or NC.
Set following PLC machine data or load the toolbox files PLC-MD_T.ini (1) or
PLC-MD_M.ini (2) to set the with (1) or (2) marked PLC-MD):
1. Machine type defined by MD14510[16]. Lathe =0 (1) Milling =1 (2)
Important
You have to specify corresponding NC machine data before
! your machine tool working properly. Please refer to “Start-up
and installation“ guide for detail information