PLC Sinumerik8 840Dsl
PLC Sinumerik8 840Dsl
Objectives ........................................................................................................................................ 3
Structure of the basic program ......................................................................................................... 4
Overview of Blocks .......................................................................................................................... 5
Interface Overview ........................................................................................................................... 6
Overview of Interface DBs ................................................................................................................ 7
Machine control panel ...................................................................................................................... 8
Interface Signals Machine Control Panel .......................................................................................... 9
Interface Signals Axis/Spindle .......................................................................................................... 10
Interface Signals Hardware .............................................................................................................. 11
New Interface Signals with 840D sl .................................................................................................. 12
Error and Operating Messages (DB2) .............................................................................................. 13
Error and operational messages ....................................................................................................... 14
Alarm Text File for HMI on PCU50 or PG ......................................................................................... 15
MBDDE.INI for Alarm Texts .............................................................................................................. 16
PLC Status with HMI on PG or PCU ................................................................................................. 17
HW Config: Int. PROFIBUS: S7 Subnet ID ....................................................................................... 18
HW Config: IP Address of CP ........................................................................................................... 19
Auxiliary functions ............................................................................................................................ 20
Overview of Auxiliary Functions and Programming ........................................................................... 21
Output to the PLC ............................................................................................................................. 22
Grouping of auxiliary functions ......................................................................................................... 23
Block change behavior ..................................................................................................................... 24
M Decoding DB75 – DB76 ............................................................................................................... 25
M Decoding List DB75 – DB76 ......................................................................................................... 26
Interface Modification Signals ........................................................................................................... 27
Restart In the course of a restart, NCK and PLC are synchronized. The system and user data
blocks are checked for integrity and the most important basic program parameters are
verified for plausibility. In the event of an error, the basic program outputs an error
identifier to the diagnostic buffer and switches the PLC to STOP. After system
initialization, the operating system runs through OB 100 and always starts cyclic
operation at the beginning of OB 1.
The PLC is synchronized with the MMC and NCK during powerup. After a correct boot
procedure and the first complete OB 1 cycle, PLC and NCK constantly exchange sign-
of-life signs. If no sign-of-life signal is received from the NC, the interface is neutralized
and the signal "NCK-CPU ready" in DB10 is set to zero.
DBs The data blocks of channels, axes/spindles and tool management functions that are
not activated may be assigned as desired by the user.
Data Interface The data interface (interface) is realized with data blocks and divided into the following
groups:
• NCK-specific signals
• Mode groupspecific signals
• Channel-specific signals
• Axis/spindle/drive-specific signals
Description Consists of FBs and FCs via which commands are transferred from PLC to
Interface NCK.
FC19/25 FC19 or FC25 are called absolutely or conditionally in OB1. It has 5 formal parameters
for transferring MCP signals from process image memory to the respective data
blocks.
BAGNo := B#16#1 //Mode group no. 1
ChanNo := B#16#1 //Channel No.1
SpindlelFNo:= B#16#4 //E.g. 4th axis is the spindle
FeedHold := M22.0 //Feed stop, modal
SpindleHold := M22.1 //Spindle stop, modal
Motor Selection and Detailed description of the special feature here is described in chapter Start-up
Parameter Set NC/PLC/SINAMICS Internally in the SINAMICS, the full 5-bit combination
switchover consisting of 2 bits motor selection and 3 bits parameter set switchover
is used to select the Drive Data Set (DDS).
• DB 30+n. DBX21.0 ... 2 Select drive data set
• DB 30+n. DBX21.3 ... 24 Select motor data set
Corresponding feedback signals are
• DB 30+n. DBX93.0 ... 2 Feedback signal from drive data set
• DB 30+n. DBX93.3 ... 24 Feedback signal from motor data set
Special Feature As described in the above mentioned chapter, there are specific set rules for
the SINAMICS parameters, e.g. the motor data set number
• MDS=p186[DDS]
or the encoder data set number
• EDS=p187[DDS]
The reason is that the drive data sets (DDS) with the same 3 less-significant
bits mean the same motor (and therefore encoder).
Therefore, the following must be identical:
• p186[0] = ... = p186[7]; p186[8]= ... =p186[15] etc.
• p187[0] = ... = p187[7]; p187[8]= ... =p187[15] etc.
Error Messages always have to be acknowledged. The error acknowledge key is determined with the
call of FC10.
Note With HMI Advanced on PG/PC you have to use the HMI installation path. By default
this path is:
C:\Siemens\Sinumerik\HMI-Advanced
Softkey: Default... Default setting for the display format (binary, hex, decimal, floating point)
Change softkey Set and reset bit memories, inputs, outputs and data bytes. The set variables are reset
by the PLC user program.
This function requires a password e.g. SUNRISE . The softkey Accept is used for
activating the modified values.
SK File Function The generated table can be saved/loaded on the hard disk. The table is saved in the
DIAGNOSTICS\PLC OPERAND SCREEN directory. The current operand table is
stored in the DIAGNOSTICS\PLC DATA\STATUS directory.
Reason This is currently the default setting in the MMC.INI with external HMI.
It is easier to adapt in the HW Config!
IP address Change the setting of the IP address there to the value to match Port X120:
Setting • 192 . 168 . 214 . 1
Reason The current default setting of the HW Config is suitable for port X127.
However, this service port is not yet active.
Furthermore, these settings are also the default values in the HMI!
Example AUXFU_GROUP_SPEC[6]=21H
The signals of auxiliary function group 7 are output in the OB1 cycle before the motion
is initiated.
AUXFU_GROUP_SPEC[9]=82H
The signals of auxiliary function group 10 are output for the duration of OB 40
execution at the end of the block.
Note:
High-speed acknowledgement can either be set by NC programming
(e.g. M=QU(10) ) or by M grouping with appropriate
configuration of MD11110 AUXFU_GROUP_SPEC.
Examples
N10 G94 G01 X50 M100 MD 22200: AUXFU_M_SYNC_TYPE = 1,
Output M100 during the motion.
MD 22200: AUXFU_M_SYNC_TYPE = 0,
N20 Y5 M100 M200 Output M200 before the motion.
M17
IP address and IP address = 192 . 168 . 214 . 250 (advisable: .250 .. 254)
Subnet mask Subnet mask = 255 . 255 . 255 . 0
Why Not Currently the HW Config of the CP 840D sl can only be loaded via Ethernet
via PROFIBUS? (see also Start-Up manual for CNC Part 1).
IP Address of NCU The IP address of the NCU on the individual ports is described in chapter 6.
There you can also see how to change the address on port X120 and how to
display the address on port X130.
Creating a project Select the menu option File -> New or click the icon in the toolbar. The "New"
dialog box is opened where you can create a new project or library.
Enter the name of your project in the "Name" box and confirm by clicking the "OK"
button.
Notes 1.The path set in the SIMATIC Manager under Options ->
Settings is displayed in the Storage Location box.
Uploading Station Select the menu option PLC -> Upload Station to PG to save the PLC program
to PG in a SIMATIC project. Blocks as well as the hardware configuration are transferred to
the project.
In the screenform "Select station address", subrack 0 and slot 0 must be selected.
Verification Check whether the displayed MAC address matches the MAC address
- MAC Address printed. In the screen above, this would be e.g.
08-00-06-73-73-F8
- IP Address You can also check the IP address.
For example, on port X120 the IP address should be 192.168.214.1
(or one of the addresses 192.168.214.2 ... 192.168.214.9.
- CPU Name The CPU name should be
CP 840D sl.
Register • Language: You can select the language you want to use for the SIMATIC
"Language" Manager, menus, dialog boxes, help, etc. Only the languages that have been
installed appear in the list.
• Mnemonics: You can select the mnemonics you want to use for programming
the S7 blocks.
"View" Tab This is where you specify what is to appear in the online display.
"Columns" Tab This is where you specify which columns are to be displayed when the Detail
view is switched-on (see "Help").
Register This is where you specify how to archive the PLC programs (e.g. path,
"Archiving". *.zip or *.arj etc.).
Module Information You will find additional information in the individual tabs:
General: Among other things, the module description, hardware and firmware versions
Diagnostic Buffer: It contains all diagnostic events in the order they occurred. All
events are listed in plain text and in the order they occurred in the display.
Memory: Size and usage of the EPROM load memory, RAM load memory and the
work memory.
Cycle Time: Displays the monitoring time selected, the shortest, the longest and the
current cycle time
Time System: Displays the real-time clock and the integrated run-time meter
Performance Data: Displays the integrated system blocks and those organization
blocks that are available as well as address areas (I,Q,M,T,C,L)
Communication: Displays the performance data of the communication interfaces and
the connection overview
Stacks: Information on the contents of the I Stack, B Stack and L Stack. For this, the
CPU must be in the STOP state or have reached a breakpoint.
Structure of the The variables you choose are entered in a variable table (VAT).
Variable Table With the exception of block-local, temporary variables, you can monitor and/or modify
all variables or addresses. The columns of the variable table that are displayed can be
selected using the menu View and have the following meanings:
• Address: absolute address of the variable.
• Symbol: symbolic name of the variable
• Symbol comment comment on the variable displayed
• Display format: a data format that you can choose per mouse click (e.g.
binary, decimal...), in which the contents of the variable is displayed
• Status value: value of the variable in the selected status format
• Control value: value that is to be assigned to the variable
Saving the An entered variable table can be saved via Table -> Save or
Variable Table Table -> Save as. You can give the variable table any name you choose and it is
inserted as the symbolic name in the symbol table.
Variable tables that are saved can be reused for monitoring and modifying, making it
unnecessary to reenter the variables to be monitored.
Note To check the input and output wiring (regardless of the user program), you can also
call the Monitor/Modify Variables tool directly from the HW Config tool.
Reference Data You can trigger the generating and displaying of reference data in the SIMATIC
...Generate Manager (when the "Blocks" folder is selected offline) or in the
...Display LAD/STL/FBD Editor via Options -> Reference data -> Display or
...Filter Filter and display. The reference data consists of various lists (see Settings) that are
displayed as filtered data (individually), (regardless of whether the item Display or
Filter and display was selected in the Options menu). When you select Display
reference data you can choose in the Settings dialog box which list is to be displayed
first. Then you can choose any of the different lists.
Saving the PLC Use the function PLC -> Upload station to PG,
Program to save the PLC program on the PG.
A dialog box titled "Select station address" is displayed.
Click button
-> Display
and confirm with
-> OK
Reference Data Use the "Reference data" function to determine in which block data bit
DB31.DBX21.7 was programmed. Which input signals are required for activating
the marker?
Check the status of the enables via the status display of the PCU 50
(Menu "Diagnostics", softkey "PLC Status").
Editing Alarm Texts Enter an alarm text file. The file should contain at least one error message and one
operational message (e.g. 700000 and 700063). One display should be in the
alarm line and one in the message box.
For editing, use the menu "Start-up", softkey “HMI" and
softkey "Editor". Position the cursor on the "USER" directory and press the INPUT
key.
Press softkey "New..." to create the alarm text file. Then enter a file name, e.g.
Then enter your texts, save the file, and close the editor.
Editing MBDDE.INI Again, select the directory "USER" in the editor and create a file MBDDE.INI. If
there is already a MBDDE.INI, open it via the INPUT key and correct the link so
that it corresponds to your alarm text file.
UserPLC=F:\USER\MYPLC_
Attention! After a change is made to an INI file, the PCU50 has to be restarted. INI files
are only read during boot.
Calling Alarms Use the free simulator inputs (e.g. IB76, 77, 80, 81) in order to display error and
operational messages. Insert a new network in OB1.
In the example, the bits for error numbers 700000 and 700063 are used.
Loading Blocks Load the changed OB to the SINUMERIK via the icon
Status/Control Use the two networks in order to familiarize yourself with the status functions of
STEP 7.
Test the block status by creating an online connection via "Accessible nodes".
Use the functions "Control variable" and "Set trigger points" in order to activate the
error text independently of simulator inputs.
Assign two AUX commands to groups 9 and 10 to output the AUX commands
to the PLC.
Group 9 H0 = 234.2 Extended address 0
Group 10 H1 = 91.2 Extended address 1
In your PLC program, decode the M commands with a decoding list (DB75/76).
M400...M415 No output to simulator
M3=20...27 QB32
M7=50...57 QB33
FB1 ListMDecGrp:=3
DB75 The file mdeclist.stl for creating DB75 can be found in the source files of the basic
PLC program.