This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The
notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage
have no safety alert symbol. These notices shown below are graded according to the degree of danger.
indicates that death or severe personal injury
indicates that death or severe personal injury
indicates that minor personal injury can result if proper precautions are not taken.
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of
injury to persons with a safety alert symbol may also include a warning relating to property damage.
result if proper precautions are not taken.
result if proper precautions are not taken.
The product/system described in this documentation may be operated only by
the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their
training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems.
for the specific task in accordance with
Note the following:
Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products
and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage,
installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any
problems. The permissible ambient conditions must be complied with. The information in the relevant documentation must be observed.
This manual is applicable to the following control systems:
SINUMERIK 808D ADVANCED T (Turning) V4.6
SINUMERIK 808D ADVANCED M (Milling) V4.6
Programming and Operating Manual (Turning) Programmers and operators of turning machines
Programming and Operating Manual (Milling) Programmers and operators of milling machines
Programming and Operating Manual (ISO Turning/Milling) Programmers and operators of turning/milling machines
Programming and Operating Manual (Manual Machine Plus
Turning)
Diagnostics Manual Mechanical and electrical designers, commissioning
Commissioning Manual Installation personnel, commissioning engineers, and
Function Manual Mechanical and electrical designers, technical professionals
Parameter Manual Mechanical and electrical designers, technical professionals
PLC Subroutines Manual Mechanical and electrical designers, technical
Programmers and operators of turning machines
engineers, machine operators, and service and
maintenance personnel
service and maintenance personnel
professionals, and commissioning engineers
Under the following link you will find information to individually compile your documentation based on the Siemens content:
www.siemens.com/mdm
This manual only describes the functionality of the standard version. Extensions or changes made by the machine tool
manufacturer are documented by the machine tool manufacturer.
● Global support hotline:
+49 (0)911 895 7222
● Support hotline in China:
+86 4008104288 (china)
The EC Declaration of Conformity for the EMC Directive can be found on the Internet at
http://support.automation.siemens.com
Here, enter the number
PLC Subroutines Manual
26FC5397-0FP40-0BA0, 08/2013
● Chinese Web site:
http://www.siemens.com.cn/808D
● Global Web site:
http://support.automation.siemens.com
as the search term or contact your local Siemens office.
2.3 Data management......................................................................................................................................... 9
2.4 Program organization .................................................................................................................................... 9
2.5 Testing and monitoring your program ......................................................................................................... 10
2.6 Establishing a connection with the RS232 interface ................................................................................... 13
2.7 Establishing a direct connection with the Ethernet interface ....................................................................... 17
2.8 Establishing a network connection with the Ethernet interface ................................................................... 20
4 Use of user alarms in the PLC subroutines .............................................................................................................67
Index ....................................................................................................................................................................74
The PLC subroutines consist of three project files:
● default_turning.ptp (sample application for turning machines)
● default_milling.ptp (sample application for milling machines)
● default_ManMachPlus_T.ptp (sample application for Manual Machine Plus)
With the sample applications, you can get a good understanding about how to create or call a PLC subroutine. You can
realize most machine functions by re-organizing the PLC subroutines or modifying some must networks.
Make sure that you perform a complete machine test to all subroutines used in your main program, in order to verify that all
the subroutines called by the main program function as you desire. Failure to observe may cause personal injury or
property damage.
The system resources can be distributed into three parts:
● PLC system
– Inputs
I0.0 to I2.7 (24 inputs of the SINUMERIK 808D ADVANCED)
I3.0 to I8.7 (distributed 48 inputs)
– Outputs
Q0.0 to Q1.7 (16 outputs of the SINUMERIK 808D ADVANCED)
Q2.0 to Q5.7 (distributed 32 outputs)
– Memory
M0.0 to M255.7 (256 bytes)
– Non-volatile memory
DB1400.DBX0.0 to DB1400.DBX127.7 (128 bytes)
– PLC user alarms:
DB1600.DBX0.0 to DB1600.DBX15.7 (128 user alarms)
– Timer
T0 to T15 (100ms timer)
PLC Subroutines Manual
46FC5397-0FP40-0BA0, 08/2013
Structure of the symbol tables
Symbol table
Table name
Descriptions
Structure of the subroutines
Subroutine No.
Name
Description
T16 to T63 (10ms timer)
– Counter
C0 to C63 (64 counters)
● NCK
– PLC machine data: MD14510, MD14512, MD 14514
– MD14510 machine data INT: DB4500.DBW0 to DB4500.DBW62 (32 words)
– MD14512 machine data hex: DB4500.DBB1000 to EDB4500.DBB1031 (32 bytes)
– MD14514 machine data real: DB4500.DBD2000 to DB4500.DBD2028 (8 Dword)
● PLC Programming Tool
– Symbol table: SYM1 to SYM32 (32 symbol tables)
– Subroutine: SBR0 to SBR63 (64 subroutines)
The PLC subroutine library has been designed with symbol addressing method, which helps you easily understand the PLC
programs. All the addresses in the subroutine library use symbols for programming. All the interface signals are named with
symbols and assigned to different symbol tables.
1 IO_1 Module I/O are defined by the manufacturer
2 IO_2 Distributed I/O are defined by the manufacturer
3, 5, 7, 13 Reserved for the manufacturer
6 MANMACH JOG function
14 ASUP ASUP function
15 PLC_sel_PP PLC selects part programs
16 IS_MCP Signals from/to the MCP
17 IS_HMI Signals from/to the HMI
18 IS_AUX Auxiliary functions from the NCK
19 IS_NCK Signals from/to the NCK
20 IS_CHA Signals from/to the channel
21 IS_AX1 Signals to/from axis 1
22 IS_AX2 Signals to/from axis 2
23 IS_AX3 Signals to/from axis 3
24 IS_AX4 Signals to/from axis 4
27 MD_PLC PLC machine data
28 ALARM User alarms
29 NV_MEM Non-volatile memory
30 SPC_MEM Special memory bit
31 SBR_MEM Global memory used in the sample applications and subroutines
32 RESVD1 Reserved for the sample applications and subroutines
0 to 19 - Reserved for the manufacturer
20 AUX_MCP Auxiliary function
21 AUX_LAMP Lamp control, called in the subroutine "AUX_MCP".
22 AUX_SAFE_DOOR Safe door control, called in the subroutine "AUX_MCP" of a milling
application.
5
Subroutine No.
Name
Description
Chip remover control, called in the subroutine "AUX_MCP" of a milling
MCP interface description
Input/output
DB number
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
23 AUX_CHIP
application.
31 PLC_ini_USR_INI Reserved for the initialization by the manufacturer (this subroutine is
automatically called by subroutine 32)
32 PLC_INI PLC initialization
33 EMG_STOP Emergency Stop
37 MCP_NCK Signals from the MCP and the HMI are sent to NCK interfaces
38 MCP_Tool_Nr Display tool numbers via the LED of the MCP
39 HANDWHL Handwheel selection via HMI
40 AXIS_CTL Control of feed axis enable and spindle enable
41 MINI_HHU Handwheel hand held unit
42 SPINDLE Spindle function
43 MEAS_JOG Tool measurement in the JOG mode
44 COOLING Coolant control (Manual Machine key and M code: M07, M08, M09)
45 LUBRICATE Lubrication control (interval and time)
46 PI_SERVICE ASUP (Asynchronous Subroutine Program)
47 PLC_Select_PP PLC selects a subroutine.
48 ServPlan Service plan
49 Gear_Chg1_Auto Automatic gear change of the spindle
50 Gear_Chg2_Virtual Dummy gear change of the spindle
51 Turret1_HED_T Turret control of the turning machine (turret type: Hall element
transistor, 4/6 position)
52 Turret2_BIN_T Turret control of the turning machine (turret type: position detection
with encodings)
53 Turret3_CODE_T Hydraulic turret control of the turning machine (turret type: position
detection with encodings)
54 Turret2_3_ToolDir Evaluate tool direction and calculate tool position (called by
Turret2_BIN_T, Turret3_CODE_T)
55 Tail_stock_T Tail stock control for the turning machine
56 Lock_unlock_T Clamp or release control for the turning machine
58 MM_MAIN Manual machine
59 MM_MCP_808D Spindle signal processing for the manual machine
60 Disk_MGZ_M Disk tool magazine for a milling machine
61, 62 Reserved for the subroutine
63 TOGGLE Six key-operated switches: K1 to K6
DB1000.DBB6
DB1000.DBB7
DB1000.DBB8 Feed override value (in Gray code)
DB1000.DBB9 Spindle override value (in Gray code)
DB1000.DBB10
Output (PPU > MCP),
DB1100
1)
The decimal point of the 7 SEG LED 1.
2)
The decimal point of the 7 SEG LED 2.
DB1100.DBB0 LED 8 LED 7 LED 6 LED 5 LED 4 LED 3 LED 2 LED 1
DB1100.DBB1 LED
16
DB1100.DBB2 LED
24
DB1100.DBB3 LED 30 LED 29 LED 28 LED 27 LED 26 LED 25
DB1100.DBB4
DB1100.DBB5
DB1100.DBB6
DB1100.DBB7
DB1100.DBB8 7 SEG LED 1
DB1100.DBB9 7SEG LED 2
DB1100.DBB10
DB1100.DBB11
DB1100.DBB12 DP 2 2) DP 1 1)
LED 15 LED 14 LED 13 LED 12 LED 11 LED 10 LED 9
LED 23 LED 22 LED 21 LED 20 LED 19 LED 18 LED 17
Interfaces where nothing has been entered are reserved for the next version.
You can understand the relationship between the PLC interface addresses and the SINUMERIK 808D MCP from the
following illustration for a horizontal MCP:
You must install the 808D Toolbox on your PC/PG (PLC Programming Tool). The 808D Toolbox contains the following
software tools and information:
● Config Data 808D
– System software update
– Examples (EasyXLanguage, symbols for MCP customized keys, template for MCP strips, PLC subroutine library)
● PLC Programming Tool
The tool for creating PLC user programs
● Windows setup software for toolbox
● User documentation
● License information and conditions about Open Source Software (Readme_OSS)
● SinuComPCIN
● Access MyMachine P2P (AMM)
The toolbox installation folder is shown below:
To start the installation, double-click the
install.
Various instructions are available in the PLC Programming Tool. You can view them in the instruction branch on the
instruction tree:
file. In the setup dialog, select one or multiple options that you desire to
PLC Subroutines Manual
86FC5397-0FP40-0BA0, 08/2013
2.3
Data management
2.4
Program organization
You can right-click over an instruction or directly press the F1 key to view its help information. For example:
The data can be broken down into three areas:
● non-retentive data
● retentive data
● machine data for the PLC (this machine data is all active at POWER ON)
Most data, such as the process image, timers, and counters are non-retentive and are cleared each time the control system
is restarted.
For the retentive data, there is a data range of 1400 0000 -1400 0127. This location can be used to save all the data which is
to remain valid after POWER OFF/ON.
With the aid of the PLC-MD (see user interface), you can pre-assign your program with data or parameterize various parts of
the program.
When programming the PLC, you must structure your program into finished program parts (subroutines). The programming
language for S7-200 offers you the capability to set up your user program in a structured manner.
3. Press these two softkeys in succession to open the following communication setting window.
4. Use this softkey to select a communication baud rate. The SINUMERIK 808D ADVANCED
supports the following baud rates:
● 9.6 kbps
● 19.2 kbps
● 38.4 kbps
● 57.6 kbps
Operating sequence to configure communications in the PLC Programming Tool
5. Activate the RS232 connection with this softkey.
No modifications to the settings are possible in this state.
The active or inactive state is retained even after a power-on (except when starting with the
default data).
In the lower right corner of the screen, the
1. Start the PLC Programming Tool on your PC/PG, and click this button in the navigation bar to
open the following dialog:
icon shows that the connection to the PG/PC
PLC Subroutines Manual
146FC5397-0FP40-0BA0, 08/2013
Alternatively, you can call the above dialog by double clicking the
icon in the
project tree or choosing from the main screen menu:
2. Double-click the access point symbol.
Then the following "Set PG/PC Interface" dialog is displayed.
3. On the left side of the communication setting window, enter the IP address for the
Select the TCP/IP pointed to the Ethernet card of your PC, and then click the
button.
You can find the name of your Ethernet card under "Start" > "Settings" > "Network
connections" on your PC.
corresponding SINUMERIK 808D ADVANCED control.
● When you select "
automatically assigned.
● When you select "
previously entered on the control manually.
4. Double click this icon on the right side of the communication setting window to establish a
connection to the specified IP address.
" for the DHCP on the control, enter the IP address that is already
" for the DHCP on the control, enter the IP address that you've
● Before configuring communications in the PLC Programming Tool, make sure the connection must be already enabled
on the control.
You can save, copy or over-write a PLC project or PLC application on the control system by using the following:
● PLC Programming Tool
● USB stick
The
You can upload / download a PLC project from / to the control system with the PLC Programming Tool. Also with this tool,
you can import and export the PLC project in the "
format from / to a USB stick directly on the control system.
PLC Subroutines Manual
contains the PLC user program, including all of the important information (symbols, comments, ...).
" format. Additionally, you can read / write the PLC project in the "
"
226FC5397-0FP40-0BA0, 08/2013
Download
● Establishing a network connection with the Ethernet interface (Page 20)
You can write the transferred data into the permanent memory (load memory) of the control system with the PLC
Programming Tool or a USB stick.
To download a PLC application with the PLC Programming Tool, proceed as follows:
1. Establish the communication between the control and the PLC Programming Tool.
You can establish the connection by using the following three methods:
● Establishing a connection with the RS232 interface (Page 13)
● Establishing a direct connection with the Ethernet interface (Page 17)
→
2.
Choose these two menus from the menu bar or click the download icon to start the download,