NCU system software for 840D sl/840DE sl 1.3
NCU system software for 840D sl/DiE sl 1.0
NCU system software for 840D/840DE 7.4
NCU system software for 840Di/840DiE 3.3
NCU system software for 810D/810DE 7.4
11/2006
6FC5397-0BP10-2BA0
Safety Guidelines
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.
Danger
indicates that death or severe personal injury will result if proper precautions are not taken.
Warning
indicates that death or severe personal injury may result if proper precautions are not taken.
Caution
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
Caution
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
Notice
indicates that an unintended result or situation can occur if the corresponding information is not taken into
account.
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.
Qualified Personnel
The device/system may only be set up and used in conjunction with this documentation. Commissioning and
operation of a device/system may only be performed by qualified personnel. Within the context of the safety notes
in this documentation qualified persons are defined as persons who are authorized to commission, ground and
label devices, systems and circuits in accordance with established safety practices and standards.
Prescribed Usage
Note the following:
Warning
This device may only be used for the applications described in the catalog or the technical description and only in
connection with devices or components from other manufacturers which have been approved or recommended by
Siemens. Correct, reliable operation of the product requires proper transport, storage, positioning and assembly
as well as careful operation and maintenance.
Trademarks
All names identified by ® are registered trademarks of the Siemens AG. The remaining trademarks in this
publication may be trademarks whose use by third parties for their own purposes could violate the rights of the
owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Siemens AG
Automation and Drives
Postfach 48 48
90437 NÜRNBERG
GERMANY
2.5 Linking PLC CPUs to 810D, 840D...............................................................................................31
2.5.1 General ........................................................................................................................................31
2.5.2 Properties of PLC CPUs ..............................................................................................................31
2.5.3 Interface on 810D and 840D with integrated PLC .......................................................................32
2.5.4 Diagnostic buffer on PLC .............................................................................................................34
2.6.1 General ........................................................................................................................................36
2.7 Structure and functions of the basic program ..............................................................................49
2.7.1 General ........................................................................................................................................49
2.7.2 Startup and synchronization of NCK PLC....................................................................................51
2.13.2 Decoded M signals.................................................................................................................... 265
2.13.3 G Functions............................................................................................................................... 267
2.13.4 Message signals in DB 2........................................................................................................... 269
Basic logic functions: PLC Basic program powerline (P3 pl)
4Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Table of contents
2.14 Programming tips with STEP 7 ..................................................................................................272
2.14.1 General ......................................................................................................................................272
2.14.3 ANY and POINTER....................................................................................................................273
2.14.3.1 POINTER or ANY variable for transfer to FC or FB...................................................................273
2.14.3.2 General ......................................................................................................................................275
2.14.3.3 Use of POINTER and ANY in FC if POINTER or ANY is available as parameter.....................275
2.14.3.4 Use of POINTER and ANY in FB if POINTER or ANY is available as parameter.....................277
2.14.4 Multiinstance DB ........................................................................................................................278
5 Data lists................................................................................................................................................ 287
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
5
Table of contents
Basic logic functions: PLC Basic program powerline (P3 pl)
6Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Brief description
General
The PLC basic program organizes the exchange of signals and data between the PLC user
program and the NCK (Numerical Control Kernel), HMI (Human-Machine Interface) and
MCP (Machine Control Panel) areas. A distinction is made between the following groups for
signals and data:
• Cyclic signal exchange
• Eventdriven signal exchange
• Messages
Cyclic signal exchange
The cyclically-exchanged signals consist primarily of bit arrays.
• They contain commands transmitted from the PLC to the NCK (such as start or stop) and
status information from the NCK (such as program running, interrupted, etc.).
• The bit fields are organized into signals for:
– Mode groups
– channels
1
– Axes/spindles
– General NCK signals
The cyclic exchange of data is performed by the basic program at the start of the PLC cycle
(OB1). This ensures that the signals from the NCK remain constant throughout the cycle.
Event-driven signal exchange NCK → PLC
PLC functions that have to be executed as a function of the workpiece program are triggered
by auxiliary functions in the workpiece program. If the auxiliary functions are used to start
execution of a block, the type of auxiliary function determines whether the NCK has to wait
before executing the function (e.g. during a tool change) or whether the function is executed
in parallel to machining of the workpiece (e.g. for tool preparation on milling machines with
chaintype magazines).
Data transfer must be as fast and yet as reliable as possible, in order to minimize the effect
on the NC machining process. Data transfer is therefore controlled by alarms and
acknowledgments. The basic program evaluates the signals and data, acknowledges this to
the NCK and transfers the data to the application interface at the start of the cycle. If the data
do not require user acknowledgment, this does not affect NC processing.
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
7
Brief description
Event-driven signal exchange PLC → NCK
An "eventdriven signal exchange PLC → NCK" takes place whenever the PLC passes a
request to the NCK (e.g., traversal of an auxiliary axis). In this case, the data transfer is also
controlled by acknowledgment. When performed from the user program, this type of signal
exchange is triggered using a function block (FB) or function call (FC).
The associated FBs (Function Blocks) and FCs (Function Calls) are supplied together with
the basic program.
Messages
User messages are acquired and conditioned by the basic program. A defined bit field is
used to transfer the message signals to the basic program. The signals are evaluated there
and entered in the PLC diagnostics buffer on the occurrence of the message events. If a
control unit is present, the messages are displayed on the operator interface.
Note
The function of the machine is largely determined by the PLC program. Every PLC program
in the working memory can be edited with the programming device.
Basic logic functions: PLC Basic program powerline (P3 pl)
8Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Detailed description
2.1 Key PLC CPU data for 810D, 840D and 840Di
The tables below show the performance range of the PLC CPUs and the scope of the
basic PLC program relative to the various controller types.
Type of control: 810D and 840D
Key CPU data
810D / 840D 810D / 840D 810D / 840D
PLC CPU
MLFB
Memory for user and basic
program
Data block memory Like user memory Like user memory Up to 96 KB
Memory submodule no no no
Bit memories 2048 2048 2048/ 4096 with PLC
Data block memory Like user memory Like user memory Up to 96 KB
Memory submodule no no no
Bit memories 4096 4096 4096
Timers 128 128 256
Counters 64 64 256
Integrated PLC 315-2DP
master/slave
6ES7 315-2AF03-0AB0
64, 96, 128, 160, 192, 224,
256 KB
Integrated PLC 315-2DP
master/slave
6ES7 315-2AF03-0AB0
64, 96, 128, 160, 192, 224,
288 KB
Integrated PLC 314C-2DP
master/slave
6FC5 314-6CF00-0AB0
96, 160, 224, 352, 416, 480
KB
(dependent on option)
Basic logic functions: PLC Basic program powerline (P3 pl)
Because SDB 2000 and other SDBs must be stored by the PLC operating system in the
static RAM area, which the Profibus ASIC can also access, the information from SDB2000
can continue to be transferred to the NCK and the PLC basic program in conditioned form
(CPI interface).
This is necessary for controlling the drives and PROFIsafe modules on Profibus. A memory
area defined by the PLC is available for these data structures. Its size is limited by the
maximum number of slots. This means that during loading, SDBs with fewer slaves than
listed above may be rejected. A slot is usually a slave module or the slave itself. Only in a
module with both I and Q areas does one module count as 2 slots.
It is, therefore, not possible to specify the size of SDB 2000 exactly.
It is only possible to say whether the configuration is permssible after the SDB container has
been loaded into the CPU. The values specified in the tables mentioned above are therefore
only intended as guidelines.
If the configuration is impermissible, a request for a general reset is issued when the SDBs
are loaded. The cause of the configuring error can be found in the diagnostic buffer on
completion of the general reset.
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
13
Detailed description
2.1 Key PLC CPU data for 810D, 840D and 840Di
PLC versions
In SW 3.5 and higher on the 840D, version 6 (version code 35.06.03) is installed with PLC
314 and version 3 (version code 35.03.03) with PLC 315-2DP or higher.
These versions are compatible with the corresponding SIMATIC CPU300.
All modules and software packages approved by SIMATIC for these versions and CPUs are
therefore suitable. Modules that can only be installed in subrack 0 are the exception
(modules FM NC and FM 357 are also exceptions).
Version code: XX.YY.ZZ
• XX: SIMATIC CPU PLC version
• YY: Firmware transfer increment
• ZZ: Internal increment
Example
PLC 315-2DP with MLFB 6ES7 315-2AF00-0AB0: 04.02.14
PLC 315-2DP with MLFB 6ES7 315-2AF01-0AB0: 03.10.23
PLC 314: 07.02.12
HMI version display
The PLC module, the PLC operating system version and the module code appear in the last
line of the HMI version display.
Example
PLC module PLC operating system version Module code
S7 PLC_315-2DP system 03.10.23 1200
Module codes
The table below shows the relationship between the module code and the corresponding
PLC module, the suitable PLC operating system and its current software version:
Module code PLC module Suitable PLC operating systems
(corresponding SIMATIC MLFB)
0208 PLC 314 6ES7 314–1AE0–0AB0 07.02.12
1008 PLC 3152DP with ASPC 2 Step C 6ES7 315–2AF00–0AB0 04.02.14
1100 PLC 3152DP with ASPC 2 Step D 6ES7 315–2AF01–0AB0 03.10.23
1200 PLC 3152DP with ASPC 2 Step E 6ES7 315–2AF01–0AB0 03.10.23
6ES7 315–2AF03–0AB0 FW1.2 12.30.10
1400 PLC 314C2DP with IBC 16 6ES7 314–6CF00–0AB0 FW1.0.2 10.60.20
2200 PLC 317-2DP with IBC 32 6ES7 317–2AJ10–0AB0 FW2.1 20.71.15
MCI 1 (840Di) PLC 3152DP with ASPC 2 Step E 6ES7 315–2AF03–0AB0 FW1.0 04.20.36
MCI 2 (840Di)
2100
PLC 317-2DP with IBC32 6ES7 317–2AJ10–0AB0 FW2.1 20.70.17
PLC operating
system SW version
Basic logic functions: PLC Basic program powerline (P3 pl)
14Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Detailed description
2.1 Key PLC CPU data for 810D, 840D and 840Di
810 D, 840D
The tables below show the key data of the OPI interface and the PLC basic program
functionality with reference to SINUMERIK 810D, 840D and 840Di:
OPI interface
840Di 810D 840D
Number N/A N/A 1
PLC basic program functions
840Di 810D 840D
Axes/spindles
channels
Mode groups
Status/control signals
M decoders (M00-99)
G group decoders
Aux. function distributors
Interrupt-driven output of auxiliary functions
Move axes/spindles from PLC
Async. subprogram interface
Error/operating messages
MCP and handheld unit signals via NCK
Reading/writing of NC variables + + +
PI services + + +
Tool management + + +
Star/delta switchover + + +
Display control handheld unit + + +
1)
Depends on chosen system software package
1)
1)
1)
+
+
+
+
+
+
+
+
5
2
1
+
+
+
+
+
+
+
+
31
10
10
+
+
+
+
+
+
+
+
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
15
Detailed description
2.2 Reserve resources (timers, FC, FB, DB, I/O)
2.2 Reserve resources (timers, FC, FB, DB, I/O)
Reserved components
The components below are reserved for the basic program:
Component Reserved range
Timers T0 - T9
Functions (general) FC 0 - FC 29
Functions (in ShopMill/ShopTurn) FC 0 - FC 35
Function blocks FB 0 - FB 29
Data blocks (general)1) DB 1 - DB 62; DB 71 - DB 80
Data blocks (in ShopMill/ShopTurn) 1) DB 1 - DB 62; DB 71 - DB 89
1) The data blocks for channels, axes/spindles and tool management functions that are not activated may be assigned as
required by the user.
PLC 317-2DP
PLC CPU: PLC 317-2DP are reserved for further number bands for SIEMENS applications
referring to FC, FB, DB and I/O areas.
FC, FB and DB
Component Reserved range
Functions FC 1000 - FC 1023
Function blocks FB 1000 - FB 1023
Data blocks DB 1000 - DB 1099
I/O range
Component Reserved range
Address area 256 - 271 1)
Inputs/outputs 4096 upwards2)
1) Reserved for the NC module and future expansions
2) Reserved for integrated drives However, diagnostics addresses for modules can only be placed in the uppermost
address range, as suggested by STEP7.
Basic logic functions: PLC Basic program powerline (P3 pl)
16Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Detailed description
2.3 Starting up hardware configuration of PLC CPUs
2.3 Starting up hardware configuration of PLC CPUs
General procedure
STEP 7 is used to define the hardware configuration for a PLC CPU, including the
associated I/O.
The procedure to be followed is shown below:
1. Load tool box to PG/PC
2. Create a new project (File, New, Project)
3. Insert, Hardware, SIMATIC 300 station
4. Select SIMATIC 300 station1 with mouse
5. Open object by right-clicking with the mouse to start the HWConfig
6. Destination system, load to PG, the hardware equipment complement is read back from
the central system
7. Configure distributed I/Os
8. Insert PLC basic program
The addresses for the I/O modules can be changed if necessary (permissible only on certain
PLC CPUs, e.g. PLC 3152DP).
As an alternative, the entire hardware configuration can be entered manually (see also
appropriate STEP7 documentation). The notices below must be observed.
STEP7, Version 3
With STEP7 Version 3 and higher, the hardware configuration of the SINUMERIK
components must be defined via the entries in SIMATIC\RACK 300. The install or setup
program of the basic program on the tool box diskettes is required for this purpose.
STEP7 Version 5.1 SP2 and Toolbox 6.03.02
With STEP7 V5.1 SP2 and Toolbox 6.03.02 or later, the SINUMERIK components are stored
under SIMATIC 300\SINUMERIK. The current hardware expansion for STEP 7 can also be
found under eSupport.
Current path (02/13/2004): sinumerik_software > 840d/810d/fm-nc > patches & fixes > plc >
Hardware_fuer_STEP7 > Hardware upto NCU*.5/CCU3/840Di_MCI2 > V6.5.2.0
NCU
CCU1 810D CPU 6FC5 410-0AA00-0AA0 6ES7 314-1AE01-0AB0 810D/840D with PLC314
CCU2 810D CPU 6FC5 410-0AA01-0AA0 6ES7 314-1AE01-0AB0 810D/840D with PLC314
CCU1 810DE CPU 6FC5 410-0AY01-0AA0 6ES7 314-1AE01-0AB0 810D/840D with PLC314
CCU2 810D CPU 6FC5 410-0AX02-0AA0 6ES7 314-1AE01-0AB0 810D/840D with PLC314
SINUMERIK 810DE Light
CCU1 module
with system software (export)
MLFB
6FC5 410-0AY00-0AA0 6ES7 314-1AE01-0AB0 810D/840D with PLC314
Comparable
SIMATIC CPU MLFB
included
Selection from STEP7 hardware
catalog
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
17
Detailed description
2.3 Starting up hardware configuration of PLC CPUs
NCU
SINUMERIK 810D CCU2
module with system software
(standard)
SINUMERIK 840DE NCU
561.2 without system
software
SINUMERIK 840D NCU 571
(export version)
SINUMERIK 840D NCU 571
(export version) with
PROFIBUS DP
6FC5 357-0BY32-1AE0 6ES7 315-2AF01-0AB0 810D/840D with PLC3152AF01
6FC5 357-0BY33-1AE0 6ES7 315-2AF01-0AB0 810D/840D with PLC3152AF01
6FC5 357-0BY31-1AE0 6ES7 315-2AF01-0AB0 810D/840D with PLC3152AF01
6ES7 315-2AF03-0AB0 810D/810Di with PLC315-2AF03,
6FC5 357-0BB22-0AE0 with operating system
6FC5 357-0BB22-0AE0 with operating system
6FC5 357-0BB33-0AE2 6ES7 315-2AF01-0AB0 810D/840D with PLC3152AF01
6FC5 357-0BB33-0AE2 with operating system
6FC5 357-0BB23-0AE0 6ES7 314-6CF00-0AB0 810D/840D with PLC314C-2DP
6FC5 357-0BB34-0AE1 6ES7 314-6CF00-0AB0 810D/840D with PLC314C-2DP
6FC5 357-0BB11-0AE1 6ES7 315-2AF03-0AB0 810D/840D with PLC315-2AF03
6FC5356-0BB11-0AE1 6ES7 315-2AF03-0AB0 810D/840D with PLC315-2AF03
6FC5357-0BB12-0AE0 6ES7 314-6CF00-0AB0 810D/840D with PLC314C-2 DP
6FC5356-0BB12-0AE0 6ES7 314-6CF00-0AB0 810D/840D with PLC314C-2 DP
6FC5357-0BB35-0A E0 6ES7 317-2AJ00-0AB0 810D/840D with PLC317-2 DP
6FC5 222-0AA02-1AA0 6ES7 317-2AJ00-0AB0 810Di with PLC317-2 DP
Comparable
SIMATIC CPU MLFB
included
03.10.23:
6ES7 315-2AF01-0AB0
12.30.07:
6ES7 315-2AF03-0AB0
12.30.07:
6ES7 315-2AF03-0AB0
Selection from STEP7 hardware
catalog
PK bus
810D/840D with PLC3152AF01
810D/840D with PLC315-2AF03
810D/840D with PLC315-2AF03
(as of STEP7 V5.0 and Toolbox
05.03.05)
(as of STEP7 V5.0 and Toolbox
05.03.05)
(STEP7 V5.1 SP3 and higher
and Toolbox 06.03.02)
(STEP7 V5.1 SP3 and higher
and Toolbox 06.03.02)
(STEP7 V5.2 SP1 and higher
and Toolbox 06.05.02)
(STEP7 V5.2 SP1 and higher
and Toolbox 06.05.02)
Basic logic functions: PLC Basic program powerline (P3 pl)
20Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Detailed description
2.3 Starting up hardware configuration of PLC CPUs
Note
On the SINUMERIK 810D or 840D, SIMATIC subrack 0 is integrated in the NC. The
following components are plugged into this subrack:
- Slot 2: The integrated PLC (PLC 314 or PLC 315-2DP)
- Slot 3: An IM 360
- Slot 4: The FM NCU.
With PLC 314, NC software version 3.5 and higher, the FM NCU must also be defined if
further MPI (C bus) devices are included in subrack 1 to subrack 3 (e.g., FM modules with C
bus connection). The properties of the FM NCU must not be changed, as process interrupts
(e.g. auxiliary functions) of the NCU may, in this case, no longer function.
Figure 2-1 Hardware configuration of row 0 on 810D, 840D
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
21
Detailed description
2.4 Starting up the PLC program
MCP (Machine Control Panel) and HHU (HandHeld Unit)
(only for SINUMERIK 810D to SW 3.x)
If the MCP or HHU is configured (deviation from the norm), an additional SIMATIC 300
station must be inserted into the machine project for each operator component. Any type of
CPU must be inserted in location 2 on row 0 in this station by means of the hardware
configuration (HW config.). The MPI address of the operator component must be set as the
MPI address. MPI network (1) can then be marked in the SIMATIC manager. The global data
can then be activated via the "Tools" menu item.
The rest of the procedure is described in detail in the Commissioning Manual.
2.4 Starting up the PLC program
2.4.1 Installing the basic program for 810D, 840D
Before initial startup of the NC, an NC and PLC general reset must be carried out to initialize
the relevant memory areas. To do this, set switch S3 to setting 1 and switch S4 to setting 3
and switch the control off and on again (POWER ON reset).
Installation
General
With Toolbox SW 6.1 and higher, the installation is performed by a WINDOWS-compliant
setup program for the basic program, hardware selection in STEP7 (SINUMERIK
810D/840D option package) and the NC-Var Selector. To start the installation, run
"setup.exe" in the main CD directory. You can then choose which components to install.
After the installation, you can select the basic program library directly from STEP 7
(gp8x0d61, 61 is the main basic program version).
The concrete version of the basic program can be scanned for the object properties of the
library or the program folder in the comment field.
From software version 3.7 to version 4.2, installation is carried out using INSTALL.BAT
(INSTALL1.BAT, INSTALL4.BAT).
This program installs the basic program and additional files for the relevant STEP7 version.
With automatic installation in STEP 7 V3 and higher, the TYP, GSD and meta files in the
hardware catalog are also augmented and updated.
The hardware components of the SINUMERIK system are then also available for hardware
configuration under STEP 7. This eliminates the need for unzipping, mentioned below.
The basic program is supplied in zipped format as a project for STEP 7 Version 1.x or as a
library for STEP 7 Version 2.x and subsequent versions.
The OB source programs, including standard parameterization, interface symbols and DB
templates for handheld unit and M decoding functions are enclosed in the SIMATIC project
or SIMATIC library of the basic program.
STEP 7 must be installed before the basic program.
Basic logic functions: PLC Basic program powerline (P3 pl)
22Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Detailed description
2.4 Starting up the PLC program
STEP7 V1.x
The basic program is stored as a compressed file with the name GP840D.EXE (or
GP810D.EXE and GPFMNC.EXE) in the main directory on the diskette. The basic program
(GP840D.exe) must be copied to the main directory (root) of a drive (e.g., c:\) and then
called. The project structure required for the basic program is generated automatically. The
catalog name of the basic program is GP840Dxy.S7A. In this case, xy stands for the basic
program version.
STEP7 V2.x, 3.x
Note
When STEP 7 V1 is used, the GP840Dxy.S7A catalog must be copied to the root directory.
Any existing catalog with the same name GP840Dxy.S7A must be deleted beforehand.
The basic program is stored as a compressed file with the name "GP840D.EXE" in directory
S7V2.840 or S7V2.810 or S7V2 on the basic program diskette. The basic program
(GP840D.exe) must be copied to subcatalog "S7LIBS" of STEP7 V2 (step7_v2) or
subsequent versions thereof and then called. The library structure required for the basic
program is generated automatically. The catalog name of the basic program is GP840Dxy. In
this case, xy stands for the basic program version. The file "MET.EXE" must be copied to the
basic catalog of STEP 7 and called from there via the DOS window with "MET.EXE –O".
Note
The name GP840D specified above refers to the basic program of the SINUMERIK 840D.
The basic program is named GP810D on the SINUMERIK 810D and GPFMNC on the FMNC. With effect from SW 4.2, the basic program for 810D and 840D is combined. It is now
called GP8x0D.
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
23
Detailed description
2.4 Starting up the PLC program
2.4.2 Application of basic program
A new CPU program (e.g., "Turnma1") must be set up in a project by means of the STEP7
software for each installation (machine).
Comment
The catalog structures of a project and the procedure for creating projects and user
programs are described in the relevant SIMATIC documentation.
STEP7 V1
A network link to the PLC must be activated for the machine CPU program under menu
items "Edit", "Configuration". This is done in the "Services", "Parameterize" menu followed by
selection of the MPI parameters.
Default:
• "Networked"
• "MPI subnetwork number = 0"
STEP7 V2
• "CPU MPI Addr = 2"
The following must be copied into the CPU program for the machinespecific program files:
1. The basic-program blocks (FCs, FBs, DBs, OBs, SFCs, SFBs, and UDTs) ("File",
"Manage Project" menu in the Step7 program editor).
2. File GPOB840D.AWL (or GPOB810D.AWL or GPOBFMNC.AWL) and other STL (AWL)
files if appropriate must also be copied from the basic program catalog into the CPU
program. The OBs contained in this file are the basis for the user program with the
associated basic program calls. Existing user blocks must be copied as STL files to the
newly created CPU program (catalog name CPU1.S7D) and compiled.
3. We also recommend that the symbolic names are transferred with the files from the basic
program package using the symbol editor.
The basic-program blocks are copied using the SIMATIC Manager and
"File"/"Open"/"Library".
The following sections must be copied from the library:
AP off: FCs, FBs, DBs, OBs, SFC, SFB, UDT and the SDB container.
For the 810D, the SDB container includes:
• The source_files (SO):
– GPOB810D or GPOB840D
– Possibly MDECLIST, HHU_DB and others
• Symbol table (SY)
Basic logic functions: PLC Basic program powerline (P3 pl)
24Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Note
The SDB container is only included for these control variants.
Detailed description
2.4 Starting up the PLC program
Compatibility with STEP 7
No interdependencies exist between the basic program (including older program versions)
and currently valid versions of STEP 7.
2.4.3 Version codes
Basic program
The version of the basic program is displayed on the version screen of the HMI software
along with the controller type.
User Program
The user can define his/her own version code for the PLC user program in any data block in
the form of a data string containing a maximum of 54 characters. The data can contain a text
of the user's choice. Parameter assignments for this string are made via a pointer in FB 1.
Parameterization requires symbolic definition of the data block.
References::
/FB1/ Function Manual, Basic Functions; PLC – Basic Program (P3);
Chapter: Block Description
2.4.4 Machine program
The machine manufacturer creates the machine program using the library routines supplied
with the basic program. The machine program contains the logic operations and sequences
on the machine. The interface signals to the NC are also controlled in this program. More
complex communication functions with the NC (e.g., read/write NC data, tool-management
acknowledgments, etc., are activated and executed via basic-program FCs and FBs). The
machine program can be created in different creation languages (e.g., STL, LAD, CSF, S7
HIGRAPH, S7GRAPH, SCL). The complete machine program must be generated and
compiled in the correct sequence. This means that blocks that are called by other blocks
must generally be compiled before the blocks, which call them. If blocks that are called by
other blocks are subsequently modified in the interface (VAR_INPUT, VAR_OUTPUT,
VAR_IN_OUT, VAR) as the program is developed, then the call block and all blocks
associated with it must be recompiled. This general procedure applies analogously to
instance data blocks for FBs. If this sequence of operations is not observed, timestamp
conflicts occur when the data are retranslated into STEP7. In some cases, therefore, it may
not be possible to recompile blocks, creating problems, for example, with the "Block status"
function. It is moreover advisable to generate blocks in ASCIISTL by means of the STEP7
editor when they have been created in the ladder diagram or in single statements
(incremental mode).
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
25
Detailed description
2.4 Starting up the PLC program
2.4.5 Data backup
The PLC-CPU does not save any symbolic names, but instead data type descriptions of the
block parameters:
• VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT, VAR and
• the data types of the global data blocks.
Note
No sensible recompilation is possible without the related project for this machine. This
especially affects, for instance the function status of the block or the necessary changes
done in the PLC-CPU programs later. It is, therefore, necessary to keep a backup copy of
the STEP7 project located in the PLC CPU on the machine. This is a great help for the
service case and saves unnecessary consumption of time in restoring the original project.
If the STEP7 project exists and has been created according to the instructions given above,
then symbols can be processed in the PLCCPU on this machine. It may also be advisable to
store the machine source programs as AWL files in case they are required for any future
upgrade.
The source programs of all organization blocks and all instance data blocks should always
be available.
2.4.6 PLC series startup, PLC archives:
Generate series archive
Once the blocks have been loaded into the PLC CPU, a series archive can be generated via
the HMI operator interface for data backup on the machine. To ensure data consistency, this
backup must be created immediately after block loading when the PLC is in the Stop state. It
does not replace the SIMATIC project backup as the series archive saves binary data only,
and does not back up, e.g., symbolic information. In addition, no CPU DBs (SFC 22 DBs) or
SDBs generated in the CPU are saved.
In Toolbox 06.03.03 and STEP 7 V5.1 and higher, the PLC series archive can be generated
directly from the corresponding SIMATIC project.
To do this, select the "Options" → "Settings" menu item and the "Archive" tab in STEP 7. This
contains an entry "SINUMERIK (*.arc)", which must be selected to create a series startup
file. After selection of the archive, select the "File" → "Archive" menu item. The relevant
series archive will then be generated. If the project contains several programs, the program
path can be selected. A series archive is set up for the selected program path. All blocks
contained in the program path are incorporated into the archive, except for CPU-DBs (SFC
22 DBs).
The process of generating a series archive can be automated (comparable to the command
interface in STEP 7, V5.1 and higher). In generating this series archive, the command
interface is expanded.
Basic logic functions: PLC Basic program powerline (P3 pl)
26Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Detailed description
2.4 Starting up the PLC program
Functions
The following functions are available for this expansion:
The functions (shown here in VB script) are not available until server instantiations and
Magic have been called:
Functions:
Const S7BlockContainer = 1138689, S7PlanContainer = 17829889
Const S7SourceContainer = 1122308
set S7 = CreateObject("Simatic.Simatic.1")
rem Instance command interface of STEP7
Set S7Ext = CreateObject("SimaticExt.S7ContainerExt")
Call S7Ext.Magic("")
Function Magic(bstrVal As String) As Long
Call gives access to certain functions. The function must be called once after server
instantiation. The value of bstrVal can be empty. This initiates a check of the correct Step7
version and path name in Autoexec. The functions are enabled with a return parameter of 0.
Return parameter (-1) = incorrect STEP 7 version
Return parameter (-2) = no entry in Autoexec.bat
Function Magic(bstrVal As String) As Long
Function MakeSeriesStartUp(FileName As String, Option As Long, Container As
S7Container) As Long
"Option" parameter:
0: Normal series startup file with general reset
Bit 0 = 1: Series startup file without general reset. When project contains SDBs, this
option is inoperative.
A general reset is then always executed.
Bit 1 = 1: Series start-up file with PLC restart
Return parameter value:
0 = OK
-1 = Function unavailable, call Magic function beforehand
-2 = File name cannot be generated
-4 = Container parameter invalid or container block empty
-5 = Internal error (memory request rejected by Windows)
-6 = Internal error (problem in STEP 7 project)
-7 = Write error when generating series startup files (e.g., diskette full)
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
27
Detailed description
2.4 Starting up the PLC program
Use in script
If S7Ext.Magic("") < 0 Then
Wscript.Quit(1)
End If
Set Proj1 = s7.Projects("new")
set S7Prog = Nothing
Set s7prog = Proj1.Programs.Item(1) 'if there is only one program'
For i = 1 to S7Prog.Next.Count
Next
Error = S7Ext.MakeSerienIB("f:\dh\arc.dir\PLC.arc", 0, Cont)'Error analysis now'
Set Cont = S7Prog.Next.Item(i)
Check block container
If (Cont.ConcreteType = S7BlockContainer) Then
Exit For
End if
2.4.7 Software upgrades
Software upgrade
Whenever you update the PLC or NCK software, always reset the PLC to its initial state first.
This initial clear state can be achieved by means of a general PLC reset. All existing blocks
are cleared when the PLC is reset.
It is usually necessary to include the new basic program when a new NC software version is
installed. The basic programs blocks must be loaded into the user project for this purpose.
OB 1, OB 40, OB 100, FC 12 and DB 4 should not be loaded if these blocks are already
included in the user project. These blocks may have been modified by the user. The new
basic program must be linked with the user program.
To do this, proceed as follows:
1. Generate the text or source file of all user blocks before copying the basic program.
2. Then copy the new basic program blocks to this machine project (for a description, see
Subsection "Application of basic program")
3. All user programs *.awl must then be recompiled in the correct order! (See also the
"Machine program" section.)
This newly compiled machine program must then be loaded to the PLC CPU using STEP
7.
However, it is normally sufficient to recompile the organization blocks (OB) and the instance
data blocks of the machine program. This means you only need to generate sources for the
organization blocks and the instance data blocks (before upgrading).
Basic logic functions: PLC Basic program powerline (P3 pl)
28Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Detailed description
2.4 Starting up the PLC program
Overall reset
A description of how to perform a general PLC reset appears in the Installation and Startup
Guide. However, a general reset does not delete the contents of the diagnostic buffer nor the
node address on the MPI bus. Another possible general reset method is described below.
This method must be used when the normal general reset process does not work.
Proceed as follows:
No. Action Effect
1 Control system is switched off
2 PLC switch setting 3 (MRES) and switch control on
again or perform hardware reset.
3 Set PLC startup switch to position 2 (STOP) and
back to position 3 (MRES).
4 Set PLC startup switch to setting 2 or 0.
NC variables
The latest NC VAR selector can be used for each NC software version (even earlier
versions). The variables can also be selected from the latest list for earlier NC software
versions. The data content in DB 120 (default DB for variables) does not depend on the
software version, i.e., selected variables in an older software version must not be reselected
when the software is upgraded.
LED labeled PS flashes slowly.
The LED labeled PS starts to flash
faster.
2.4.8 I/O modules (FM, CP modules)
Special packages for STEP7 are generally required for more complex I/O modules. Some of
these special packages include support blocks (FC, FB) stored in a STEP7 library. The
blocks contain functions for operating the relevant module which are parameterized and
called by the user program. In many cases, the FC numbers of the CP and FM module
handling blocks are also included in the number range of the basic program for the 810D and
840D systems.
What action can be taken if such a conflict occurs?
The block numbers of the basic program must remain unchanged. The block numbers of
handling blocks can be assigned new, free numbers using STEP7. These new blocks (with
new FC numbers) are then called in the user program with the parameter assignments
required by the function.
Basic logic functions: PLC Basic program powerline (P3 pl)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0
29
Detailed description
2.4 Starting up the PLC program
2.4.9 Troubleshooting
This section describes problems which may occur, their causes and remedies and should be
read carefully before hardware is replaced.
Errors, cause/description and remedy
Serial
no.
error
informati
on
1 No connection
2 PLC cannot
3 All four LEDs
Errors Cause/description To correct or avoid errors
via MPI to
PLC.
be accessed
in spite of
PLC general
reset.
on the PLC
flash (DI
disaster)
The MPI cable is not plugged in
or is defective. Possibly, the
STEP 7 software is also not
correctly configured for the MPI
card.
A system data block SDB 0 has
been loaded with a modified MPI
address. This has caused an
MPI bus conflict due to dual
assignment of addresses.
A system error has occurred in
the PLC.
Measures: The diagnostic buffer
on the PLC must be read to
analyze the system error in
detail. To access the buffer, the
PLC must be stopped (e.g., set
"PLC" switch to position 2). A
hardware reset must then be
performed. The diagnostic buffer
can then be read out with
STEP7. Relay the information
from the diagnostic buffer to the
Hotline / Development Service. A
general reset must be carried out
if requested after the hardware
RESET. The diagnostic buffer
can then be read with the PLC in
the Stop state.
Test: Create a link with the
programmer in the STEP7 editor by
means of connection "Direct_PLC". A
number of node addresses must be
displayed here. If they do not appear,
the MPI cable is defective/not plugged
in.
Disconnect all MPI cables to other
components. Create the link
"Direct_PLC" with the programmer.
Correct the MPI address.
Once the PLC program has been
RESET or reloaded, the system may
return to normal operation. Even in this
case, the content of the diagnostic
buffer should be sent to the
Development Office.
Basic logic functions: PLC Basic program powerline (P3 pl)
30Function Manual, 11/2006, 6FC5397-0BP10-2BA0
Loading...
+ 260 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.