0% found this document useful (0 votes)
60 views70 pages

Simatic S7 User Guide Engl

Uploaded by

Tin Ramos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views70 pages

Simatic S7 User Guide Engl

Uploaded by

Tin Ramos
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Simatic S7 modules for COMPAX

User Guide
Simatic S7 modules for COMPAX with profibus DP
(COMPAX option F3)

As of COMPAX software version ≥ V3.0 August 2000


As of profibus software version ≥ V1.4

TIFIE
Head office Great Britain:
ER D Parker Hannifin GmbH Parker Hannifin plc
C
DIN EN ISO 9001 EMD Hauser EMD Digiplan
P. O. Box: 77607-1720 21 Balena Close
We automate motion Robert-Bosch-Str. 22 Poole, Dorset
D-77656 Offenburg, Germany BH17 7DX UK
Q

A Phone: +49 (0)781 509-0 Phone: +44 (0)1202 69 9000


U

LI TE
TY SYS
Fax: +49 (0)781 509-176 Fax: +44 (0)1202 69 5750
Reg. Nr. 36 38
[Link] [Link]

Subject to technical modification. 28.08.00 14:37 192-040032 N1


Data corresponds to state-of-the-art technology at the time of printing.
Simatic S7 modules for COMPAX with profibus DP

Contents
1. General ......................................................................................................6

2. Software modules for COMPAX with profibus DP connection ............7

3. System conditions ...................................................................................8

4. COMPAX as a profibus DP slave ............................................................9


4.1 Data exchange with COMPAX via profibus DP ................................9
4.2 COMPAX parameter settings ...........................................................10
4.2.1 Minimum parameter setting .......................................................10
4.2.2 COMPAX parameter P196: Telegram format ............................10
4.2.3 COMPAX parameter P194: Station address .............................13
4.2.4 COMPAX parameter P193: Spontaneous messages ................13
4.2.5 COMPAX parameter P191: Behavior during bus time-out ........13
4.2.6 COMPAX parameters P135 .. P142: Assignment of the
process data channel.................................................................13
4.2.7 COMPAX parameter P221 .. P224: Masking of the digital ........14
inputs and outputs ..............................................................................14
5. Simatic S7 configuration for COMPAX.................................................15

6. COMPAX code modules for Simatic S7 ...............................................17


6.1 Project management.........................................................................17
6.2 Communication structure and modular call-up .............................18
6.2.1 Reading data blocks and writing data blocks.............................18
6.2.2 Module call-up ...........................................................................20
6.2.3 Parallel nature of module call-ups .............................................22
6.3 Error monitoring when calling up modules....................................22
7. Module description ................................................................................23
7.1 FB10: Parameter setting module "ParaDn"....................................23
7.1.1 Description of function ...............................................................23
7.1.2 Setting parameters ....................................................................23
7.1.3 Status.........................................................................................26
7.1.4 Structure of the data area for ParameterWrite...........................27
7.1.5 Supplementary comments .........................................................27
7.1.6 Call-up example.........................................................................28
7.1.7 Example of a parameter DB (ParameterWrite)..........................28

2
7.2 FB11: Parameter setting module "ParaUp"....................................30
7.2.1 Description of function ...............................................................30
7.2.2 Setting parameters ....................................................................30
7.2.3 Status.........................................................................................32
7.2.4 Structure of data area for ParameterRead ................................32
7.2.5 Supplementary comments .........................................................33
7.2.6 Call-up example.........................................................................33
7.2.7 Example of a parameter DB (ParameterRead)..........................34
7.3 FB12: Programmer module "LinesDn" ...........................................35
7.3.1 Description of function ...............................................................35
7.3.2 Setting parameters ....................................................................35
7.3.3 Status.........................................................................................36
7.3.4 Structure of the data area for ProgramLines .............................37
7.3.5 Supplementary comments .........................................................37
7.3.6 Call-up example.........................................................................37
7.4 FB13: Programming module "LinesUp" .........................................38
7.4.1 Description of function ...............................................................38
7.4.2 Setting parameters ....................................................................38
7.4.3 Status.........................................................................................40
7.4.4 Structure of the data area for ProgramLines .............................40
7.4.5 Supplementary comments .........................................................40
7.4.6 Call-up example.........................................................................41
7.5 FB14: Curve module "CurveDn"......................................................42
7.5.1 Description of function ...............................................................42
7.5.2 Setting parameters ....................................................................42
7.5.3 Status.........................................................................................44
7.5.4 Structure of the data area for FixPoints .....................................44
7.5.5 Supplementary comments .........................................................45
7.5.6 Call-up example.........................................................................45
7.6 FB15: Curve model "CurveUp"........................................................47
7.6.1 Description of function ...............................................................47
7.6.2 Setting parameters ....................................................................47
7.6.3 Status.........................................................................................49
7.6.4 Structure of the data range for FixPoints ...................................49
7.6.5 Supplementary comments .........................................................50
7.6.6 Call-up example.........................................................................50
7.7 FB16: Positioning module "PosMod" .............................................52
7.7.1 Description of function ...............................................................52
7.7.2 Parameter setting ......................................................................52
7.7.3 Status.........................................................................................54
7.7.4 Structure of the data area for PosPara ......................................55
7.7.5 Supplementary comments .........................................................57
7.7.6 Call-up example.........................................................................57

3
Simatic S7 modules for COMPAX with profibus DP

7.7.7 Example of positioner DB (PosPara) .........................................58


7.8 FC10: Conversion module "FloatDSP" ...........................................60
7.8.1 Description of function ...............................................................60
7.8.2 Setting parameters ....................................................................60
7.8.3 Status.........................................................................................61
7.8.4 Structure of the data areas ........................................................61
7.8.5 Supplementary comments .........................................................62
7.8.6 Call-up example.........................................................................63
7.8.7 Example of a DSPNumber.........................................................63
7.9 FC11: Conversion module "DSPFloat" ...........................................64
7.9.1 Description of function ...............................................................64
7.9.2 Setting parameters ....................................................................64
7.9.3 Status.........................................................................................65
7.9.4 Structure of data areas ..............................................................65
7.9.5 Supplementary comments .........................................................66
7.9.6 Call-up example.........................................................................66
8. Troubleshooting .....................................................................................67
8.1 Hardware and address errors ..........................................................67
8.2 Operating and parameter setting errors .........................................68
8.3 Sending error messages to Parker .................................................70
9. Bibliography ...........................................................................................70

4
Unit assignment:
This documentation describes simatic S7 modules which
support communication between a Simatic S7 and the
following units:
• COMPAX 10XXSL with option F3
• COMPAX 25XXS with option F3
• COMPAX 45XXS with option F3
• COMPAX 85XXS with option F3
• COMPAX P1XXM with option F3
• COMPAX 02XXM with option F3
• COMPAX 05XXM with option F3
• COMPAX 15XXM with option F3
• COMPAX 35XXM with option F3
XX: any characters
F3:profibus option
Key to unit designation
e.g.: COMPAX 0260M:
COMPAX: name
02: performance class
60: variante.g. "00": standard model
M: model M: multiple axis unit
S:single-axis unit
HAUSER rating plate
The rating plate is found on the top of the unit and
contains the following information:

038106 0001 951-160101 Compax 0260M


E2

equipment
option name
name
serial number part number

5
Simatic S7 modules for COMPAX with profibus DP

1. General
Liability waiver
PARKER will not provide warranty for ensuring that these modules function
perfectly under all circumstances. Using current technology, there is not
generally any software, which functions perfectly under all circumstances and
requirements. PARKER therefore declines any liability for direct and indirect
damage of any nature caused through the use of the software modules, even
if the modules are used in accordance with the descriptions provided in this
manual.

Product monitoring obligation


Within the scope of its product monitoring obligation, PARKER attempts to
detect and describe all dangers, resulting from the use of our software
modules. We cannot however detect all dangers as a result of the complexity
of the product and our limited knowledge of the end customer systems, which
are also characterized through the use products produced by third parties.
Likewise, not all characteristics of the software module are described in this
manual. In the event that you have any further questions, please contact
PARKER.

Right of amendment
PARKER has the right to update the manual and the software modules at any
time without announcing such action beforehand. Software modules can also
be quarantined without notification if PARKER detects dangers which do not
allow for perfect operation. PARKER is not generally obliged to rectify a
detected error immediately or to prepare new functions when asked to do so
by a customer.

Copyright
This manual and the associated software modules contain information, which
is the intellectual property of PARKER. The authorized user is obliged to use
this information exclusively for the operation of the COMPAX position
controllers and their integration. Reproduction and dissemination to third
parties of the documentation or extracts of it is only permitted following
approval from PARKER. The reproduction of software modules is only
permitted in the sense of data back-up.

6
2. Software modules for COMPAX with
profibus DP connection
COMPAX position controllers have been available for several years now with
standardized field buses. Here the profibus DP, as defined in EN 50170,
proves to be a simply designed and easy to use command interface with a
high degree of efficiency. Despite this, when working with position controllers
with profibus DP engagement, the system programmer does however often
face start-up problems as a result of the high functionality of such units. If
binary controller information is still assigned actions such as positioning or
referencing, non-standardized controller instructions are usually used for the
unit parameter settings. Another obstacle may then be encountered since the
controller computers, which exchange data with the position controllers by
means of the profibus master engagement, display their data using different
internal methods and data is not therefore transformed from the position
controller to one particular controller computer type. As a result of the
restricted band width of a DP transfer channel, associated data also often has
to be transferred in blocks. The programmer is then left to handle data
transformation and division or combination into or from blocks with the
support of driver software.
PARKER will provide you with an open collection of Simatic S7 modules 1 as
handling software for some frequently repeated tasks such as the transfer of
unit parameters, command lines of the record memory and of support points
of the electronic curve disc to and from the position controller, but also for the
creation of travel orders, including all travel parameters such as acceleration
and speed. The system also supports conversion of the position controller's
internal DSP data format into the standardized IEEE floating point data format
and vice versa from IEEE floating point data format into the DSP data format
of the position controller. The collection should be continually updated and
supplemented which is why PARKER is always grateful for information from
customers.
☞ For a general understanding, it is essential that you are familiar with the
key contents of the operating instructions for the profibus option [1] and
of the COMPAX Product Manual [2] because this product is based on
knowledge of these two sources. This description is also based on a
basic understanding of Step7 programming.

1 Simatic is a registered trademark of Siemens AG


7
Simatic S7 modules for COMPAX with profibus DP

3. System conditions
The COMPAX basic unit must have software version of at least 3.x and the
COMPAX profibus engagement F03 of at least 1.40. Both software versions
can be easily determined using the ServoTerminal (contained in the
COMPAX scope of supply) [2] by requesting the S31 COMPAX status values
for the basic unit and S36 for the field bus engagement. The Step7
programming package with basic or mini authorization should have a version
status of at least V3.x or greater.
 The use of the S7 function modules is associated with certain hardware
and firmware version statuses.

8
4. COMPAX as a profibus DP slave
4.1 Data exchange with COMPAX via profibus DP
Information on the profibus DP is transferred via the cyclic exchange of data
frames for request and response between the profibus DP master and
profibus DP slave. The working data of these data frames in the Simatic S7
station are blended into the address area of the CPU, the working data
passing from the DP slave is loaded into the input addresses (input byes
(EB)) of the CPU, the working data passing to the DP slave is written from the
output addresses (output bytes (AB)) of the CPU. During this process, one
byte is assigned in the I/O address area of the CPU per working data byte for
the request and response frame. As a result of the different selections of
these address areas, the DP slave station numbers and address areas are
assigned in an unambiguous manner. One address area is assigned
exclusively to one DP slave. One exception here is CPU's, which have the
option of supplying several DP slaves via what are commonly referred to as
boilerplate units from a shared address area. In this instance, the address
area assignment also takes place using the boilerplate unit number.
Furthermore, different input and output address positions can be selected for
some DP slaves. If a piece of working data, e.g. a nominal value, is
distributed over more than one byte, this piece of working data has to be
transferred in an associated manner in a profibus master I/O cycle. An
associated area is designated as a consistency area. Assurance is provided
for a consistency area to the effect that the working data leaves the DP
master and/or reaches the DP master in an associated manner.

9
Simatic S7 modules for COMPAX with profibus DP

4.2 COMPAX parameter settings


4.2.1 Minimum parameter setting

If the profibus DP is to be operated, the DP master must know the bus


structure. During booting up, the DP master checks whether the projected
configuration is also actually available on the bus. In additional to the sheer
presence of the stations, the projected length and number of consistency
areas are also checked. Each COMPAX operates as an independent DP
slave station, which has to have extra configuration. The configuration
required is described in the appropriate COMPAX documents [1]. The
configuration is undertaken in a menu-guided manner using the
parameter editor of the general COMPAX configuration tool,
ServoManager [2], provided that COMPAX option F3 (profibus) has been
previously selected. The station number and format of the data frame can
also be entered directly onto the front COMPAX screen in the sense of a
minimum configuration (capable of communication) under the C menu items
C01 (identical to parameter P194) and C03 (identical to parameter P196).
Profibus-specific COMPAX parameters are described below. A baud rate
does not have to be defined because the COMPAX engagement is set
automatically to the master baud rate. All standardized baud rates are
supported, the maximum is however 1.5 Mbaud. Only those parameter
settings required for operation with the Simatic S7 modules are described
below. The operator must note that the profibus parameters of the
COMPAX are only activated once the 24V supply (logic voltage) is
switched back on.

4.2.2 COMPAX parameter P196: Telegram format

COMPAX supports different working data lengths and consistency areas in


an application-specific manner and provides the option of configuring the
input and output area separately to ensure that different input and output
bytes can be issued by the programmable controller. You will find a tabular
list of the set-up options in [1].

10
The structure of the working data frame should be considered in more detail if
further understanding is to be possible. Different pieces of information can be
transferred depending on the working data length selected. The two main
data types which can be transferred are command data and process data.
Command data has an acyclic character and is used to read or write a unit
parameter, amongst other things. Process data has a cyclic character and is
often used to set nominal values or to record actual values. A permanent
space is assigned for both types of data in the working data frame and both
are transferred in a quasi-parallel manner in a telegram.

The following terms from [1] have been selected on the basis of the
PROFIBUS profile for speed changing drives. [1] also contains an
explanation and diagram of these terms.
The area for the command data type is designated "command identification
data" (BKD) and that for the process data type as "process data" (PZD). The
entire data frame, consisting of BKD and PZD, is designated as the
"command-process data object" (BPO). The BKD consists of three sub-areas:
"command identification" (BKE), "sub-index" (IND) and "command data"
(BDA). In the BKE of the request frame, a request code is transferred to
identify the type of command, the associated command data can be found in
the BDA. For example, the identification for writing a parameter is in BKE and
the parameter contents themselves are in BDA. In the BKE of the response
frame, you will find the response code for identification of command
acknowledgement. If the example is changed so that the COMPAX
parameter is not changed but its current value should be queried, there will
be a command code for reading a parameter in the BKE of the request frame,
the command acknowledgment can be found in the BKE of the response
frame and the parameter contents themselves are in the BDA of the response
frame. The sub-index IND is only ever required when a command cannot be
processed in an I/O cycle by the BKD. This may be the case if there is a
command or acknowledgement from several partial commands or
acknowledgments. One such command is e.g. the POSR-SPEED-ACCEL
COMPAX command for speed-profiled travel of the servo axis, which
comprises a total of three request and 3 response frames.

The PZD of the request frame always consists of one control word or byte,
that of the response frame consists of one status word or byte. Depending on
the width of the PZD, 6 bytes of cyclic information can also be exchanged in
both directions (PED or PAD). The data contents of these 6 bytes can be
configured [1].

11
Simatic S7 modules for COMPAX with profibus DP

The presence and width of the BKD and PZD depend on the working data
length selected. The working data length can be 18, 12, 8 or 1 byte. The data
frames are sub-divided into the BPO1, BPO2, BPO3 and BPO4 types in
accordance with these four working data lengths. Only the BPO1 and BPO2
types transfer both the PZD data type and the BKD data type.

A BPO of the BPO1 and BPO2 types may consist of 2 or 3 consistency


areas. As has already been described above, joint and therefore consistent
transfer is only assured by the profibus DP for data within one such
consistency area. Two or three-way division is possible for both BPO types.
When using two-way division, all data bytes of the BKD, therefore BKE, IND
and BDA are jointly transferred in both directions of travel in the first
consistency area. The same applies to data of the PZD. When using three-
way division, the consistency area BKD is divided firstly into BKE and IND
and secondly BDA to ensure that a total of three consistency areas are
created. If you remain with the selected example of the parameter writing,
only two-way division can ensure that request code (BKE) and parameter
contents (BDA) are assessed at the same time on the COMPAX
engagement. When using three-way division, the programmer would have to
previously transmit the parameter contents (BDA) e.g. using a programmable
controller cycle. Valences are assigned to the BPO type, the number of
consistency areas, the type of address areas issued (separate or combined
I/O) and the bus protocol (DP, FMS) and are stored as a total in COMPAX
parameter P196.
Function Setting Valency
BPO type BPO type 1 0
BPO type 2 1
BPO type 3 2
BPO type 4 3
Input/output configuration I/O together 0
I/O separate 4
DP configuration 3-way division: 0
(consistency areas) (BKD + IND/BDA/PZD)
2-way division: (BKD/PZD) 8
Profibus protocol FMS mode only 0
FMS mode only 32
Combined mode 64
(DP and FMS mode)
DP mode only 96

12
☞ P196 = 0 + 0 + 8 + 96 = 104 should be selected for the first tests. The
PZD channel can be fully utilized with this setting. When using the
Simatic S7 modules, only those settings printed in bold may be used
from each table line.

4.2.3 COMPAX parameter P194: Station address

Each DP slave logs onto the bus with its station number. COMPAX station
numbers are issued exclusively within a range of 1 to 126. The S7 CPU as
the DP master occupies a certain station number which must not then be
issued for a COMPAX slave.
☞ Select a setting within the range P194 = 1 .. 126.

4.2.4 COMPAX parameter P193: Spontaneous messages

When using the Simatic S7 modules, spontaneous message must not


generally be used unless express reference is made to them in the module
descriptions.
☞ Set P193 = 0.

4.2.5 COMPAX parameter P191: Behavior during bus time-out

This parameter is used to define the COMPAX position controller behavior


during a bus time-out. If P191 = 0, all nominal values are valid until a new
command arrives. When P191 = 1 or 15 this error result in an axis stop with a
subsequent powering down of the axis whenever the parking brake is
applied.
☞ This parameter does not affect the behavior of the Simatic S7 modules.
From the point of view of safety, it is however recommended that P191
= 1 or 15 is set.

4.2.6 COMPAX parameters P135 .. P142: Assignment of the


process data channel

The Simatic S7 modules can be used together with the functions of the cyclic
channel (BPO type 1). The assignment of the PED's (COMPAX to
programmable controller direction) is of no real significance to the function of
the modules.

13
Simatic S7 modules for COMPAX with profibus DP

☞ These parameters do not affect the behavior of the Simatic S7 modules.


If the PAD is assigned, ensure that no functions are triggered parallel to
the functions of the BKD.

4.2.7 COMPAX parameter P221 .. P224: Masking of the digital


inputs and outputs

Parameter P221 provides the option of operating discreet controller functions


such as manual+/- or start/stop via the profibus DP. These are functions
which are usually triggered via the digital inputs. Should these functions be
available via profibus DP and not via the digital inputs, P221 = 63 should be
set. The parameters P223 and P224 are used to assign the 16 digital outputs
of the COMPAX to the profibus DP or to the COMPAX record memory in a
bit-like manner.
☞ These parameters do not affect the behavior of the Simatic S7 modules.

14
5. Simatic S7 configuration for COMPAX
The Simatic S7 configuration for COMPAX can be undertaken using the
hardware configurator of the Step7 programming package. As of version
status V3.x of the Simatic development environment, the configuration is
usually supported by means of core unit files (GSD). Earlier version statuses
of this configurator operate with what are commonly referred to as type files.
Both types of configuration files form part of the COMPAX standard supply
package. Following installation of the ServoManager [2], the corresponding
CPX0EE95 (or [Link]) file will be in the installation directory
../SRVBOX/DATA on the hard disk. Now, for example, proceed as follows:
1. The [Link] or [Link] file must be copied into the
../STEP7/S7DATA/GSD directory on the hard disk.
2. A SUBNET PROFIBUS must be added to the working project for the
SIMATIC station. Once the change has been made to the hardware
configuration, the hardware catalogue has to be refreshed once using
UPDATE GSD FILES so that COMPAX is recorded in the catalogue.
3. Now open the hardware catalogue and configure all the assemblies used.
The selected master engagement is then connected with the subnet
PROFIBUS. Select the master address and a baud rate of no more than
1.5 MBaud.
4. You will find the "COMPAX with F03" entry in the hardware catalogue
under +PROFIBUS+OTHER FIELD UNITS+MISCELLANEOUS.
5. By pressing the left-hand mouse button, a COMPAX entry appears on the
line of dashes behind the DP profibus for each COMPAX. Now select an
entry from the configuration list proposed for COMPAX. This entry should
correspond to the settings for COMPAX parameter P196. If you have
selected P196 = 104, you should select BPO_1_BKD/PZD. A station
number (address) must also be specified in the dialogue.
6. Finally, you must assign I/O addresses to each of the two consistency
areas. Once you have double clicked on the DP slave entries, the
addresses can be edited. Use associated address areas for both
consistency areas. With some Simatic CPU types (e.g. 400 series) only
addresses which can be divided by four can be set whereby a gap of two
bytes is created.

 By assigning I/O addresses to the station numbers, stations (e.g. digital


input and output assemblies, COMPAX) are only activated from the user
program via I/O address areas.

15
Simatic S7 modules for COMPAX with profibus DP

The completed configuration must then be downloaded into the


programmable controller and/or onto the configuration carrier.

Figure 4.1 Hardware configurator S7

16
Figure 4.2 Hardware configurator S7, issuing of I/O addresses

6. COMPAX code modules for Simatic


S7
6.1 Project management
The PARKER code modules and event data modules are saved in the S7
project HAUS_xxx.S7P. All functional modules (FB) and functions (FC) are
independently programmed to ensure that only the code module required has
to be copied into the working project per function required. The event DB
associated with the FB can be automatically created when calling up the FB
through the S7 programming environment.

17
Simatic S7 modules for COMPAX with profibus DP

6.2 Communication structure and modular call-up


6.2.1 Reading data blocks and writing data blocks

The MODULE FB's operate internally with a status machine controlled by a


step string. This machine transmits certain commands to COMPAX (BKD) at
the command interface and processes status information from the command
interface (BKD). The BKD (to COMPAX) is created by the MODULE FB's and
must be "written" to the DP master by the user from the outgoing box by
means of SYSTEM_WRITE2. Vice versa, the BKD (from COMPAX) required
by the MODULE FB's must be "read" by the DP master in the incoming box
from the user program by means of SYSTEM_READ3. The COMPAX
parameter P196 is used to set parameters for the number and width of the
consistency areas of COMPAX. When the requirement for two-way division of
the entire COMPAX telegram applies, as it does when using the S7 modules,
these areas are 10 bytes and 8 and/or 2 bytes large, i.e. direct access via the
accumulator is no longer possible. Cyclical call-up of SYSTEM_READ and
SYSTEM_WRITE is required, at least while processing is in progress, to
ensure that the step string can be processed in the MODULE FB.
The system functions for SYSTEM_WRITE with an integrated master should
be called up per consistency area. If therefore e.g. there are two COMPAX
position controllers in two-way division mode on the bus, both system
functions should be called up a total of four times if fresh data is to be
continually accessed. Access via SYSTEM_WRITE/SYSTEM_READ with an
external master however occurs via all consistency areas as a whole, i.e. call-
up only occurs once per programmable controller cycle regardless of the
number of COMPAX'.

2 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used


with integrated masters (e.g. CPU315-2DP) and function, DP_SEND
(FC1), is used with explicit masters (e.g. CP342-5).
3 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used
with integrated masters (e.g. CPU315-2DP) and function, DP_RECV
(FC2), is used with explicit masters (e.g. CP342-5).
18
User program including
HAUSER S7 modules

"RESPONSE" "REQUES T"


Example: marker memory area Example: DB6 memory area
Incom ing box
Outgoing box
BPO-type 1
MB40 ADR0.0
E/A together
MB49
2-way division ADR9.0
MB50 ADR10.0
MB57 ADR17.0

SFC14 SFC15

"DPRD_DAT" "DPWR_DAT"
M1.0 EN RET_VAL MW200 M2.0 EN
W#16#0 P#M40.0 BYTE 10 W#16#0 MW204
LADDR RECORD LADDR RET_VAL
ENO P#[Link] 0.0 RECORD ENO
BYTE 10 BYTE 10
"DPRD_DAT" "DPWR_DAT"
M1.0 EN RET_VAL MW202 M2.0 EN
W#16#A LADDR RECORD P#M50.0 BYTE 8 W#16#A LADDR RET_VAL MW206
ENO P#[Link] 10.0 RECORD ENO
BYTE 10 BYTE 8

Process- I / O
Figure 5.1 Communication structure with DPRD_DAT and DPWR_DAT with
an integrated master (e.g. CPU 315-DP2)
☞ Unlike its predecessor model, the Simatic S5, the Simatic-S7 can no
longer describe the communication directly via the accumulator
commands (output bytes (AB) or periphery) or read from this (input bytes
(EB) or periphery), if the associated consistency area is bigger than the
accumulator width (32 bits). To update the COMPAX consistency areas
when using the software modules, it is essential that the system
functions for reading/writing SYSTEM_READ and SYSTEM_WRITE are
used.

19
Simatic S7 modules for COMPAX with profibus DP

6.2.2 Module call-up

The modules are FB's and/or FC's, which can be simply linked by coping and
setting parameters in the user program. FB's are always used if the module
call-up is required over several programmable controller cycles. During this
time, the FB's edit an internal step string, the status of which is saved in the
event DB. This also applies for instances where only one frame has to be
transmitted and received because the response can wait several
programmable controller cycles.
DBxx - Instanz-DB
FBxx

"FB_Name"

M1.0 EN
P#[Link] 0.0 BYTE 10 REQUEST
P#M 40.0 BYTE 10 RESPONSE
P#M 2.0 BOOL 1 START

P#[Link] 0.0 BYTE 80 USER_DATA_1


FALSE USER_DATA_2
STATUS M2.1
TRUE USER_DATA_N ENO

Figure 5.2 Example of a module call-up using real parameter settings


Parameter Address Type Direction of Meaning
space flow
REQUEST M, DB ANY Programmable Outgoing box to
indicator controller- COMPAX
>COMPAX
RESPONSE M, DB ANY COMPAX- Incoming box from
indicator >programmable COMPAX
controller
START M, DB, ANY Programmable =1 transfer is started
E indicator controller sets=0 transfer is completed
STATUS M, DB, BOOL Programmable =1 transfer is completed
A controller reads
=0 transfer underway or
is not started
USER_DAT M, DB ANY Data-dependent Use-specific source and
A indicator target data
BOOL

20
REQUEST and RESPONSE (FB's)
From the user's point of view, the setting of COMPAX addresses only occurs
via the incoming and outgoing box, an explicit station address is therefore not
required at the FB level. The system modules for receiving and transmitting
the programmable controller firmware create a relationship between the
incoming and/or outgoing box and the input and/or output addresses of the
programmable controller. The relationship between the programmable
controller input and/or output addresses and the station number required for
setting COMPAX addresses is determined within the programmable controller
with the aid of the hardware configuration. The MODULE FC's do not use an
incoming and outgoing box because direct communication with the COMPAX
is not usually required via the FC's.
☞ The setting of COMPAX addresses occurs via the assigned incoming
and outgoing box. Station numbers are not therefore required.

START and STATUS (FB's and FC's)


When there is an increasing flank (FALSE following TRUE) at the START
input, the MODULE FB starts to actively write in the outgoing box. START
must be in place until the STATUS output of the FB's indicate that the
transfer has been completed (TRUE). When there is a decreasing flank
(TRUE following FALSE) at the START input, the BKD is filled with zeros
once (and only once) and the programmable controller program writes to
COMPAX by means of SYSTEM_WRITE and sets the STATUS output to
FALSE. When using a FC's, START and STATUS are only used to start and
indicate the ready message. START can be statistically set to TRUE when
using the FC's.
☞ The START input with the FB's should only be in place until the STATUS
reports TRUE to keep system load on COMPAX as low as possible.
USER_DATA
USER_DATEN is the working data which is exchanged with the COMPAX.
The structure and number of pieces of user data depends on the FB or FC
currently being used.

21
Simatic S7 modules for COMPAX with profibus DP

6.2.3 Parallel nature of module call-ups

With reference to one single COMPAX, at any one time only one MODULE
FB may be called up using active START in order to transfer data. The
parallel call-up of FB's, with reference to one COMPAX, is only possible if
only one FB has an active START input. Note that when the flank of the
START input decreases, zero bytes are transferred once into the BKD. FB's
with an inactive START only implement initializations of their temporary
variables and are then completed without writing to the outgoing box.

On the other hand, MODULE FB's may transfer data in parallel, if they are
determined for different COMPAX. If the same FB is to be used in parallel, it
should be called up each time with a different event DB. Since according to
the profibus DP principle, all stations are usually involved in the exchange of
information, even without a current FB call-up, there is no additional
expenditure (in terms of time) for the transfer of data. The programmable
controller cycle time is simply increased by the FB call-up.

☞ Parallel data transfer is not possible for one COMPAX using different
FB's. The same or different FB's can be called up in parallel for different
COMPAX but exclusive usage of the event DB's should be noted. All
MODULE FB's are capable of multiple events.

6.3 Error monitoring when calling up modules


Even though the module software currently automatically monitors the
arguments handed to it, step string blocking of a FB's may come about as a
result of an operating error because there is a result different to that expected
in the incoming box of the COMPAX. For example, this applies to the
description of a protected COMPAX parameter if the associated MODULE FB
is not informed that the parameter is to be transferred with a password.

☞ If a command cannot be undertaken by COMPAX via the BKD channel


(writing), e.g. a positioning error during an active positioning process or
the setting of parameters without the password approval required, the
response ID AK=7 is used to announce that the command cannot be
undertaken via the BKD channel (reading). The application programmer
should monitor the FB's for AK=7.

22
7. Module description
7.1 FB10: Parameter setting module "ParaDn"

7.1.1 Description of function

This FB is used to transfer a parameter block (group of parameters) from the


programmable controller to the COMPAX. In addition to the transfer of
parameters, the following incoming or outgoing commands can also be
transferred and these should be selected explicitly:
• number of COMPAX parameters,
• deactivate password (is activated again once parameter transfer is
complete),
• validate VP, VP parameter and
• validate VC, VC parameter.
During these processes, all parameters are read from a special data block
and always have DSP format (3 bytes before the decimal point, 3 bytes after
the decimal point).

7.1.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
Parameter- Data type: ANY Indicates the area (D, M) in
Write Address areas: which parameter numbers and
Data module area parameter values are saved.
Marker area
Call-up example:
P#[Link] 0.0 BYTE 16

23
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
Number Data type: BYTE Number of parameters to be
Address areas: transferred
Constants
Data module area
Marker area
I/O area
Call-up example:
B#16#10
VP Data type: BOOL Initiate VP command following
Address areas: parameter transfer
Constants
Data module area
Marker area
I/O area
Call-up example:
M 150.0
E70.0
[Link] 10.0
VC Data type: BOOL Initiate VC command following
Address areas: parameter transfer
Constants
Data module area
Marker area
I/O area
Call-up example:
M 150.1
E70.1
[Link] 10.1

24
Variable Data type Meaning
Address area
Call-up example
PASS- Data type: BOOL Temporarily cancel password
WORD Address areas: protection
Constants
Data module area
Marker area
I/O area
Call-up example:
M 150.2
E70.2
[Link] 10.2
Response Data type: ANY Indicates the area (DB or M) in
Address areas: which the response from
Data module area COMPAX can be found. The
Marker area response from COMPAX is
Call-up example: read via the profibus with the
P#M 100.0 BYTE 10 help of a system module
P#[Link] 0.0 BYTE 10 (SYSTEM_READ4).
Request Data type: ANY Indicates the area (DB or M) in
Address areas: which the request to COMPAX
Data module area can be found. The request to
Marker area COMPAX is written via the
Call-up example: profibus with the help of a
P#M 110.0 BYTE 10 system module
P#[Link] 0.0 BYTE 10 (SYSTEM_WRITE5).

4 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used with


integrated masters (e.g. CPU315-2DP) and the function, DP_RECV (FC2),
is used with explicit masters (e.g. CP342-5).
5 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used

with integrated masters (e.g. CPU315-2DP) and the function, DP_SEND


(FC1), is used with explicit masters (e.g. CP342-5).
25
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the transfer of
Data module area parameters.
Marker area
E area
Call-up example:
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1
Status Data type: BOOL Bit (DB, M, A) announces that
Address areas: all parameters, including the
Data module area incoming commands
Marker area (password) and outgoing
I/O area commands (VP, VC), have
Call-up example: been transferred if selected.
M 150.2
70.2A
[Link] 10.2

7.1.3 Status

The status indicates that all transfers have been successfully completed. We
would recommend that the status bit is monitored. The status bit is not set,
e.g.
• if the input and output variables does not have the format expected,
• if start has been deactivated before the end of the transfer,
• if password-protected parameters have been transferred without the
password also having been transferred,
• if VC has been selected and the axis is in motion.

26
7.1.4 Structure of the data area for ParameterWrite

The data area, in which all parameter numbers and values are stored, is n*8
bytes large, whereby n is the number of parameters to be transferred. The
order in which the parameters are to be transferred is irrelevant to the
transfer. The 8 bytes (one slot) for each parameter are made up as follows.
The slots (for several parameters) must be evenly connected.
Parameter Address Data type Meaning
Parameter 0.0 BYTE (UINT) Parameter number (1..250)
Value 1 2.0 BYTE (UINT) Digit after the decimal point 3
(LSB) NK3
Value 2 3.0 BYTE (UINT) Digit after the decimal point 2
NK2
Value 3 4.0 BYTE (UINT) Digit after the decimal point 1
(MSB) NK1
Value 4 5.0 BYTE (UINT) Digit before the decimal point 1
(LSB) VK1
Value 5 6.0 BYTE (UINT) Digit before the decimal point 2
VK2
Value 6 7.0 BYTE (UINT) Digit before the decimal point 3
(MSB) VK3

7.1.5 Supplementary comments

• The parameter values are transferred in 6 byte DSP format regardless of


the internal back-up in COMPAX. FC10 can be used to change from
floating comma format into DSP format and FC11 can be used for the
opposite direction.
• The conversion of numerical formats is described in the COMPAX Product
Manual.
• Note that the password protection is always reactivated when it has been
temporarily canceled for the transfer of parameters (PASSWORD :=
TRUE).
• The COMPAX commands VP and VC are subject to certain application
conditions, which can be taken from the COMPAX Product Manual (2).

27
Simatic S7 modules for COMPAX with profibus DP

• FB10 interacts closely with FB11 ("ParaUp") because the


ParameterWrite/ParameterRead data areas used are compatible with one
another.
In the simplest scenario, the parameter record is created using
ServoManager and then downloaded once into the programmable
controller using FB11 (ParameterRead). If COMPAX has to be changed,
then FB10 can directly download the parameter record (from
ParameterWrite) into COMPAX.

7.1.6 Call-up example

In this example, the parameters P11=100 and P40=-10.5 are to be set. P40 is
transferred immediately without the password protection having been
deactivated, P11 requests the password protection to be canceled and a
subsequent VP.
CALL FB 10 , DB10
ParameterWrite :=P#[Link] 0.0 BYTE 16
Response :=P#[Link] 0.0 BYTE 10
Start :=P#M 2.0 BOOL 1
Number :=B#16#2
Password :=TRUE
VP :=TRUE
VC :=FALSE
Status :=M2.1
Request :=P#[Link] 0.0 BYTE 10

7.1.7 Example of a parameter DB (ParameterWrite)

Parameter Address Date Meaning


Parameter 0.0 B#16#0B Transfer parameter 11
1.0 B#16#00 Not used
NK3 2.0 B#16#00 Digit after the decimal point
NK2 3.0 B#16#00 Digit after the decimal point
NK1 4.0 B#16#00 Digit after the decimal point
VK1 5.0 B#16#64 Digit before the decimal point
VK2 6.0 B#16#00 Digit before the decimal point
VK3 7.0 B#16#00 Digit before the decimal point

28
Parameter Address Date Meaning
Parameter 8.0 B#16#28 Transfer parameter 40
9.0 B#16#00 Not used
NK3 10.0 B#16#00 Digit after the decimal point
NK2 11.0 B#16#00 Digit after the decimal point
NK1 12.0 B#16#80 Digit after the decimal point
VK1 13.0 B#16#F5 Digit before the decimal point
VK2 14.0 B#16#FF Digit before the decimal point
VK3 15.0 B#16#FF Digit before the decimal point

29
Simatic S7 modules for COMPAX with profibus DP

7.2 FB11: Parameter setting module "ParaUp"


7.2.1 Description of function

This FB is used to transfer a parameter block (group of parameters) from


COMPAX to the programmable controller. All parameters between
• the COMPAX parameter first specified and
• the COMPAX parameter last specified
are transferred to the programmable controller.
During this, all parameters are saved by the FB in a special data block and
always have DSP format (3 bytes before the decimal point, 3 bytes after the
decimal point).

7.2.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
Parameter Data type: ANY Indicates the area (D, M) in which
-Read Address areas: the parameters numbers and
Data module area parameter values should be saved.
Marker area
Call-up example:
P#[Link] 0.0 BYTE 16
Parameter Data type: BYTE COMPAX parameter to be
-From Address areas: transferred first
Constants
Data module area
Marker area
I/O area
Call-up example: B#16#10

30
Variable Data type Meaning
Address area
Call-up example
Parameter Data type: BYTE COMPAX parameter to be
-To Address areas: transferred last
Constants
Data module area
Marker area
I/O area
Call-up example: B#16#12
Response Data type: ANY Indicates the area (DB or M) in
Address areas: which the response from COMPAX
Data module area can be found. The response from
Marker area COMPAX is read via the profibus
Call-up example: with the help of a system module
P#M 100.0 BYTE 10 (SYSTEM_READ6).
P#[Link] 0.0 BYTE 10
Request Data type: ANY Indicates the area (DB or M) in
Address areas: which the request to COMPAX can
Data module area be found. The request to COMPAX
Marker area is written via the profibus with the
Call-up example: help of a system module
P#M 110.0 BYTE 10 (SYSTEM_WRITE7).
P#[Link] 0.0 BYTE 10

6 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used with


integrated masters (e.g. CPU315-2DP) and the function, DP_RECV (FC2),
is used with explicit masters (e.g. CP342-5).
7 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used

with integrated masters (e.g. CPU315-2DP) and the function, DP_SEND


(FC1), is used with explicit masters (e.g. CP342-5).
31
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the transfer of parameters.
Data module area
Marker area
E area
Call-up example:
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1
Status Data type: BOOL Bit (DB, M, A) indicates that all
Address areas: parameters, including the incoming
Data module area commands (password) and
Marker area outgoing commands (VP, VC), have
I/O area been transferred if selected.
Call-up example:
M 150.2
70.2A
[Link] 10.2

7.2.3 Status

The status indicates that all transfers have been successfully completed. We
would recommend that the status bit is monitored. The status bit is not set,
e.g.
• if the input and output variables do not have the format expected.

7.2.4 Structure of data area for ParameterRead

The data area in which all parameter numbers and values are saved is n*8
bytes in size, whereby n is the number of read parameters. The slots (for
several parameters) are evenly connected.

32
Parameter Address Data type Meaning
Parameter 0.0 BYTE (UINT) Parameter number (1..250)
Value 1 2.0 BYTE (UINT) Digit after the decimal point 3
(LSB) NK3
Value 2 3.0 BYTE (UINT) Digit after the decimal point 2
NK2
Value 3 4.0 BYTE (UINT) Digit after the decimal point 1
(MSB) NK1
Value 4 5.0 BYTE (UINT) Digit before the decimal point 1
(LSB) VK1
Value 5 6.0 BYTE (UINT) Digit before the decimal point 2
VK2
Value 6 7.0 BYTE (UINT) Digit before the decimal point 3
(MSB) VK3

7.2.5 Supplementary comments

• The parameter values are saved in 6 byte DSP format regardless of the
internal back-up in COMPAX. FC11 can be used to change from DSP into
floating comma format and FC10 can be used in the opposite direction.
• The conversion of numerical formats is described in the COMPAX Product
Manual.
• FB11 interacts closely with FB10 ("ParaDn") because the
ParameterRead/ParameterWrite data areas used are compatible with one
another.
In the simplest scenario, the parameter record is created using
ServoManager and then downloaded once into the programmable
controller using FB11 (ParameterRead. If COMPAX has to be changed,
then FB10 can directly download the parameter record (from
ParameterWrite) into COMPAX.

7.2.6 Call-up example

In the example, all 250 COMPAX parameters are to be stored in one 2000
byte (250 x 8 byte) DB. In the example, P1=100 and P250=1.

33
Simatic S7 modules for COMPAX with profibus DP

CALL FB 11 , DB11
Response :=P#[Link] 0.0 BYTE 10
Start :=P#[Link] 13.7 BOOL 1
ParameterFrom :=B#16#1
ParameterTo :=B#16#FA
Status :=M11.0
Request :=P#[Link] 0.0 BYTE 10
ParameterRead :=P#[Link] 0.0 BYTE 2000

7.2.7 Example of a parameter DB (ParameterRead)

Parameter Address Date Meaning


Parameter 0.0 B#16#01 Parameter 1 read
1.0 B#16#00 Not used
NK3 2.0 B#16#00 Digit after the decimal point
NK2 3.0 B#16#00 Digit after the decimal point
NK1 4.0 B#16#00 Digit after the decimal point
VK1 5.0 B#16#64 Digit before the decimal point
VK2 6.0 B#16#00 Digit before the decimal point
VK3 7.0 B#16#00 Digit before the decimal point
... ... ... Parameters 2 .. 249
Parameter 1992.0 B#16#FA Parameter 250 read
1993.0 B#16#00 Not used
NK3 1994.0 B#16#00 Digit after the decimal point
NK2 1995.0 B#16#00 Digit after the decimal point
NK1 1996.0 B#16#00 Digit after the decimal point
VK1 1997.0 B#16#01 Digit before the decimal point
VK2 1998.0 B#16#00 Digit before the decimal point
VK3 1999.0 B#16#00 Digit before the decimal point

34
7.3 FB12: Programmer module "LinesDn"
7.3.1 Description of function

This FB is used to transfer a program block (group of program lines) from the
programmable controller to COMPAX. During this transfer, all program lines
are read directly by the FB from a memory area in the programmable
controller and written into the record memory of the COMPAX.

7.3.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
Program- Data type: ANY Indicates the area (D, M) in which
Lines Address areas: the program lines are saved.
Data module area
Marker area
Call-up example:
P#[Link] 0.0 BYTE 1500
Number Data type: BYTE Number of parameters to be
Address areas: transferred
Constants
Data module area
Marker area
I/O area
Call-up example: B#16#0A
Respons Data type: ANY Indicates the area (DB or M) in
e Address areas: which the response from
Data module area COMPAX can be found. The
Marker area response from COMPAX is read
Call-up example: via the profibus with the help of a
P#M 100.0 BYTE 10 system module
P#[Link] 0.0 BYTE 10 (SYSTEM_READ8).

8 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used


with integrated masters (e.g. CPU315-2DP) and the function, DP_RECV
(FC2), is used with explicit masters (e.g. CP342-5).
35
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
Request Data type: ANY Indicates the area (DB or M) in
Address areas: which the request to COMPAX
Data module area can be found. The request to
Marker area COMPAX is written via the
Call-up example: profibus with the help of a system
P#M 110.0 BYTE 10 module (SYSTEM_WRITE9).
P#[Link] 0.0 BYTE 10
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the transfer of program
Data module area lines.
Marker area
E area
Call-up example:
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1
Status Data type: BOOL Bit (DB, M, A) announces that all
Address areas: program lines have been
Data module area transferred.
Marker area
I/O area
Call-up example:
M 150.2
70.2A
[Link] 10.2

7.3.3 Status

The status indicates that all transfers have been successfully completed. We
would recommend that the status bit is monitored. The status bit is not set,
e.g.
• if the input and output variables do not have the format expected.

9 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used


with integrated masters (e.g. CPU315-2DP) and the function, DP_SEND
(FC1), is used with explicit masters (e.g. CP342-5).
36
7.3.4 Structure of the data area for ProgramLines

The special identifications for record memory commands form part of the
profibus documentation (1). As a rule, two or three blocks are transferred per
record line, each using 10 bytes. The FB decides from record line to record
line whether two or three blocks of 10 bytes should be transferred to
COMPAX. The line number is encoded in COMPAX within the 10 bytes.

7.3.5 Supplementary comments

• FB12 interacts closely with FB13 ("LinesUp") because the ProgramLines


data areas used are compatible with one another.
In the simplest scenario, the program is created using the ServoManager
and is then downloaded once into the programmable controller
(ProgramLines) using FB13. If COMPAX has to be changed, the FB12 can
then download the program data record (STOP ProgramLines) directly into
the COMPAX. You do not need to know the identification coding, but if
requried, please refer to the profibus operating instructions (1).
• The standard COMPAX can save a maximum of 250 program lines.

7.3.6 Call-up example

In the example, 100 COMPAX program lines are to be written from one 3000
byte (100 x 3 x 10 bytes) DB in to the COMPAX.

CALL FB 12 , DB12
ProgLines:=P#[Link] 0.0 BYTE 3000
Response :=P#[Link] 0.0 BYTE 10
Start :=P#M 1.3 BOOL 1
Number :=B#16#64
Status :=M2.3
Request :=P#[Link] 0.0 BYTE 10

37
Simatic S7 modules for COMPAX with profibus DP

7.4 FB13: Programming module "LinesUp"


7.4.1 Description of function

This FB is used to transfer a program block (group of program lines) from


COMPAX to the programmable controller. During this transfer, all program
lines are read by FB directly from COMPAX's record memory and written into
a memory area on the programmable controller.

7.4.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
Program- Data type: ANY Indicates the area (D, M) in which
Lines Address areas: the program lines are to be saved.
Data module area
Marker area
Call-up example:
P#[Link] 0.0 BYTE
1500
LineFrom Data type: BYTE COMPAX program line to be
Address areas: transferred first
Constants
Data module area
Marker area
I/O area
Call-up example: B#16#1
LineTo Data type: BYTE COMPAX program line to be
Address areas: transferred last
Constants
Data module area
Marker area
I/O area
Call-up example: B#16#32

38
Variable Data type Meaning
Address area
Call-up example
Response Data type: ANY Indicates the area (DB or M) in
Address areas: which the response from
Data module area COMPAX can be found. The
Marker area response from COMPAX is read
Call-up example: via the profibus with the help of a
P#M 100.0 BYTE 10 system module
P#[Link] 0.0 BYTE 10 (SYSTEM_READ10).
Request Data type: ANY Indicates the area (DB or M) in
Address areas: which the request to COMPAX
Data module area can be found. The request to
Marker area COMPAX is written via the
Call-up example: profibus with the help of a system
P#M 110.0 BYTE 10 module (SYSTEM_WRITE11).
P#[Link] 0.0 BYTE 10
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the transfer of program
Data module area lines.
Marker area
E area
Call-up example:
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1

10 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used with


integrated masters (e.g. CPU315-2DP) and the function, DP_RECV (FC2),
is used with explicit masters (e.g. CP342-5).
11 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used

with integrated masters (e.g. CPU315-2DP) and the function, DP_SEND


(FC1), is used with explicit masters (e.g. CP342-5).
39
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
Status Data type: BOOL Bit (DB, M, A) announces that all
Address areas: program lines have been
Data module area transferred.
Marker area
I/O area
Call-up example:
M 150.2
70.2A
[Link] 10.2

7.4.3 Status

The status indicates that all transfers have been successfully completed. We
would recommend that the status bit is monitored. The status bit is not set, e.g.
• if the input and output variables do not have the format expected.

7.4.4 Structure of the data area for ProgramLines

The special identifications for record memory commands form part of the
profibus documentation (1). As a rule, two or three blocks are transferred per
record line, each using 10 bytes. The FB decides from record line to record
line whether two or three blocks of 10 bytes are to be written into the memory
area (D, M). If e.g. 10 data records are to be safely transferred, the memory
area to be reserved should be at least 300 bytes.

7.4.5 Supplementary comments

• FB13 interacts closely with FB12 ("LinesDown") because the ProgramLines


data areas used are compatible with one another.
In the simplest scenario, the program is created using the ServoManager
and then downloaded once into the programmable controller
(ProgramLines) using FB13. If COMPAX has to be changed, the FB12 can
then download the program data record (from ProgramLines) directly into
the COMPAX. You do not need to know the identification coding, but if
requried, please refer to the profibus operating instructions (1).
• The standard COMPAX can save a maximum of 250 program lines.

40
7.4.6 Call-up example

In the example, 100 COMPAX program lines are to be saved in a 3000 byte
(100 x 3 x 10 bytes) DB.

CALL FB 13 , DB13
Response :=P#[Link] 0.0 BYTE 10
Start :=P#M 1.2 BOOL 1
LineFrom :=B#16#1
LineTo :=B#16#64
Status :=M2.2
Request :=P#[Link] 0.0 BYTE 10
ProgramLines :=P#[Link] 0.0 BYTE 3000

41
Simatic S7 modules for COMPAX with profibus DP

7.5 FB14: Curve module "CurveDn"


7.5.1 Description of function

This FB is used to transfer an individual curve (group of support points with a


maximum of 1000 support points, including auxiliary function values) from the
programmable controller to COMPAX. During this transfer, all support points,
auxiliary function vales and the curve head are read by the FB from memory
area in the controller and written directly in COMPAX's curve memory. This
function can only be used in a COMPAX with curve disc functionality
(COMPAXxx70).

7.5.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
FixPoints Data type: ANY Indicates the area (D, M) in which
Address areas: the curve head, support points
Data module area and the auxiliary functions are
Marker area saved.
Call-up example:
P#[Link] 0.0 BYTE 4000
VF Data type: BOOL Initiate VF command after curve
Address areas: transfer
Constants
Data module area
Marker area
I/O area
Call-up example:
M 150.0
E70.0
[Link] 10.0

42
Variable Data type Meaning
Address area
Call-up example
Response Data type: ANY Indicates the area (DB or M) in
Address areas: which the response from
Data module area COMPAX can be found. The
Marker area response from COMPAX is read
Call-up example: via the profibus with the help of a
P#M 100.0 BYTE 10 system module
P#[Link] 0.0 BYTE 10 (SYSTEM_READ12).
Request Data type: ANY Indicates the area (DB or M) in
Address areas: which the request to COMPAX
Data module area can be found. The request to
Marker area COMPAX is written via the
Call-up example: profibus with the help of a system
P#M 110.0 BYTE 10 module (SYSTEM_WRITE13).
P#[Link] 0.0 BYTE 10
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the curve transfer.
Data module area
Marker area
E area
Call-up example:
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1

12 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used with


integrated masters (e.g. CPU315-2DP) and the function, DP_RECV (FC2),
is used with explicit masters (e.g. CP342-5).
13 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used

with integrated masters (e.g. CPU315-2DP) and the function, DP_SEND


(FC1), is used with explicit masters (e.g. CP342-5)..
43
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
Status Data type: BOOL Bit (DB, M, A) announces that the
Address areas: curve has been transferred.
Data module area
Marker area
I/O area
Call-up example:
M 150.2
70.2A
[Link] 10.2

7.5.3 Status

The status indicates that all transfers have been successfully completed. We
would recommend that the status bit is monitored. The status bit is not set,
e.g.
• if the input and output variables do not have the format expected.

7.5.4 Structure of the data area for FixPoints

When a curve is downloaded into the COMPAX, sufficient memory space


should be prepared for FixPoints. The minimum amount of memory should be
prepared in accordance with the following guideline:
• 3 byte curve number in COMPAX,
• 3 bytes for the present curve number,
• 60 bytes for 20 curve head entries and
• 6 bytes per support point including auxiliary function values (digital outputs
and 2 analogue values), maximum 1000 support points.

44
7.5.5 Supplementary comments

• FB14 interacts closely with FB15 ("CurveUp") because the FixPoints data
areas used are compatible with one another.
In the simplest scenario, curves are created using ServoManager and then
downloaded one after another into the programmable controller (exclusive
FixPoints memory areas are required for each curve) using the FB15. If
COMPAX has to be changed, the FB14 can then individually download
each curve (from the different FixPoints memory areas) into the COMPAX.
You do not need to know the exact position of the support points in
FixPoints, but if required, please refer to the curve disc operating
instructions (3).
• The curve memory may contain several curves. Following a download with
the CAM editor of the ServoManager, the curves can be found one after
another in the COMPAX memory, whereby the start and end point of the
memory area of a curve depend on the curve number and the number of
support points. It is inevitable that memory area overlaps occur when
curves are indiviudually downloaded in the curve memory from several
COMPAX projects (ServoManager) and an upload is then processed via
FB15. A subsequent download of curves then certainly results in
uncontrolled COMPAX behavior.
• The number of support points required to calculate the minimum size of the
FixPoints curve memory can be taken from the CAM editor of the
ServoManager.
• Explicit parameters do not need to be set for the curve number because
they are already contained in FixPoints.
• VF applies to all the curves downloaded to COMPAX using FB14. If more
curves are to be downloaded, VF TRUE must only subsequently be set for
the last curve to be downloaded.

7.5.6 Call-up example

A curve is to be downloaded into COMPAX, the first master support point of


which is 0 mm and the last master support point of which is 200 mm. The
distance between support points is 10 mm. The curve number is two (is
however in FixPoints).

The minimum size of the FixPoints memory area required is calculated from:

45
Simatic S7 modules for COMPAX with profibus DP

3 bytes curve number in COMPAX


+ 3 bytes present curve number
+ 60 bytes curve head
+ 21 x 6 bytes support points
≡=============
192 byte memory space required for FixPoints

CALL FB 14 , DB14
FixPoints :=P#[Link] 0.0 BYTE 192
Response :=P#[Link] 0.0 BYTE 10
Start :=P#M 1.6 BOOL 1
VF :=TRUE
Status :=M2.6
Request :=P#[Link] 0.0 BYTE 10

46
7.6 FB15: Curve model "CurveUp"
7.6.1 Description of function

This FB is used to transfer an individual curve (group of support points with a


maximum of 1000 support points, including auxiliary function values) from
COMPAX to the programmable controller. During this transfer, all support
points, auxiliary function values and the curve head are read by FB directly
from the curve memory of COMPAX and written into a memory area in the
programmable controller. This function can only be used in a COMPAX with
curve disc functionality (COMPAXxx70).

7.6.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
FixPoints Data type: ANY Indicates the area (D, M) in which
Address areas: the curve head, the support points
Data module area and the auxiliary functions are to
Marker area be saved.
Call-up example:
P#[Link] 0.0 BYTE 4000
Curve- Data type: BYTE Curve (number) which is to be
Number Address areas: downloaded from the COMPAX
Constants into S7.
Data module area
Marker area
I/O area
Call-up example:
B#16#32

47
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
Response Data type: ANY Indicates the area (DB or M) in
Address areas: which the response from
Data module area COMPAX can be found. The
Marker area response from COMPAX is read
Call-up example: via the profibus with the help of a
P#M 100.0 BYTE 10 system module
P#[Link] 0.0 BYTE 10 (SYSTEM_READ14).
Request Data type: ANY Indicates the area (DB or M) in
Address areas: which the request to COMPAX
Data module area can be found. The request to
Marker area COMPAX is written via the
Call-up example: profibus with the help of a system
P#M 110.0 BYTE 10 module (SYSTEM_WRITE15).
P#[Link] 0.0 BYTE 10
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the curve transfer.
Data module area
Marker area
E area
Call-up example:
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1

14 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used with


integrated masters (e.g. CPU315-2DP) and the function, DP_RECV (FC2),
is used with explicit masters (e.g. CP342-5).
15 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used

with integrated masters (e.g. CPU315-2DP) and the function, DP_SEND


(FC1), is used with explicit masters (e.g. CP342-5)..
48
Variable Data type Meaning
Address area
Call-up example
Status Data type: BOOL Bit (DB, M, A) announces that the
Address areas: curve has been transferred.
Data module area
Marker area
I/O area
Call-up example:
M 150.2
70.2A
[Link] 10.2
CurveNot- Data type: BOOL Bit (DB, M, A) announces that the
Present Address areas: curve selected is not available in
Data module area the COMPAX.
Marker area
I/O area
Call-up example:
M 150.3
70.3A
[Link] 10.3

7.6.3 Status

The status indicates that all transfers have been successfully completed. We
would recommend that the status bit is monitored. The status bit is not set,
e.g.
• if the input and output variables do not have the format expected,
• the curve is not available in the COMPAX. In this instance, the
CurveNotPresent bit is also set.

7.6.4 Structure of the data range for FixPoints

When uploading a curve from the COMPAX, sufficient memory space should
be provided for FixPoints. The minimum amount of memory should be
prepared in accordance with the following guideline:
• 3 bytes curve number in COMPAX,
• 3 bytes for the present curve number,

49
Simatic S7 modules for COMPAX with profibus DP

• 60 bytes for 20 curve head entries and


• 6 byte per support point, including auxiliary function values (digital outputs
and 2 analogue values), maximum 1000 support points.

7.6.5 Supplementary comments

• FB15 interacts closely with FB14 ("CurveDn") because the FixPoints data
areas used are compatible with one another.
In the simplest scenario, curves are created using ServoManager and then
downloaded into the programmable controller (exclusive FixPoints memory
areas are required for each curve) using the FB15. If COMPAX has to be
changed, the FB14 can then individually download each curve (from the
different FixPoints memory area) directly into COMPAX. You do not need
to know the exact position of FixPoints support points but if requried,
please refer to the curve disc operating instructions (3).
• The curve memory may contain several curves. Following a download with
the CAM editor of the ServoManager, the curves can be found one after
another in the COMPAX memory, whereby the start and end point of the
memory area of a curve depend on the curve number and the number of
support points. It is inevitable that memory area overlaps occur when
curves are indiviudually downloaded in the curve memory from several
COMPAX projects (ServoManager) and an upload is then processed via
FB15.
• The number of support points required to calculate the minimum size of the
FixPoints curve memory can be taken from the CAM editor of the
ServoManager.
• Curve number 0 is not permitted.

7.6.6 Call-up example

A curve is to be downloaded into the programmable controller, the first


master support point of which is 0 mm and the last master support point of
which is 200 mm. The distance between support points is 1 mm. The curve
number is one.

The minimum size of the FixPoints memory area required is calculated from:

50
3 bytes curve number in COMPAX
+ 3 bytes present curve number
+ 60 bytes curve head
+ 201 x 6 bytes support points
≡=============
1272 bytes memory space required for FixPoints

CALL FB 15 , DB15
Response :=P#[Link] 0.0 BYTE 10
Start :=P#M 1.4 BOOL 1
CurveNumber :=MB5
Status :=M2.4
CurveNotPresent :=M3.4
Request :=P#[Link] 0.0 BYTE 10
FixPoints :=P#[Link] 0.0 BYTE 1272

51
Simatic S7 modules for COMPAX with profibus DP

7.7 FB16: Positioning module "PosMod"


7.7.1 Description of function

This FB is used to initiate a curve memory travel motion. Complete


parameters can be set for the travel motion. There are switches/parameters
• to select the relative or absolute feed,
• to select the acceleration profile via parameters, including setting the
password,
• to set the speed,
• to set the acceleration and decceleration ramp times,
• to set the feed value,
• to select and set the type of the 8 possible switching cams for outputs and
speed profiles.
A special CONTROL word can be used to define which travel parameter
should be transferred. E.g. if the speed value SPEED only has to be
transferred if the speed is to be changed. A transfer with optimum times is
therefore ensured. All travel parameters are saved here in a special data
block and depending on their significance have either floating comma or
integer format.

7.7.2 Parameter setting

Variable Data type Meaning


Address area
Call-up example
PosPara Data type: ANY Indicates the area (D) in which the
Address areas: values for the position target, the
Data module area speeds, ramp times, acceleration
Call-up example: profile as well as switching steps
P#[Link] 0.0 BYTE 152 for outputs and speed are saved.

52
Variable Data type Meaning
Address area
Call-up example
Response Data type: ANY Indicates the area (DB or M) in
Address areas: which the response from COMPAX
Data module area can be found. The response from
Marker area COMPAX is read via the profibus
Call-up example: with the help of a system module
P#M 100.0 BYTE 10 (SYSTEM_READ16).
P#[Link] 0.0 BYTE 10
Request Data type: ANY Indicates the area (DB or M) in
Address areas: which the request to COMPAX can
Data module area be found. The request to COMPAX
Marker area is written via the profibus with the
Call-up example: help of a system module
P#M 110.0 BYTE 10 (SYSTEM_WRITE17).
P#[Link] 0.0 BYTE 10
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the travel parameter transfer.
Data module area When start is set, all prepared
Marker area commands, such as speeds, ramp
E area times, switching steps etc. are
Call-up example: transferred to COMPAX.
P#M 150.0 BOOL 1
P#E 70.0 BOOL 1
P#[Link] 10.0 BOOL 1

16 SYSTEM_READ: The Siemens function, DPRD_DAT (SFC14), is used with


integrated masters (e.g. CPU315-2DP) and the function, DP_RECV (FC2),
is used with explicit masters (e.g. CP342-5).
17 SYSTEM_WRITE: The Siemens function, DPWR_DAT (SFC15), is used

with integrated masters (e.g. CPU315-2DP) and the function, DP_SEND


(FC1), is used with explicit masters (e.g. CP342-5)..
53
Simatic S7 modules for COMPAX with profibus DP

Variable Data type Meaning


Address area
Call-up example
StartPos Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the transfer of the actual
Data module area positioner command (POSR,
Marker area POSA). StartPos is used to
E area synchronize several axes or for
Call-up example: applications with critical time limits
P#M 150.1 BOOL 1 since all travel parameters, with
P#E 70.1 BOOL 1 the exception of POSR/POSA, are
P#[Link] 10.1 BOOL 1 pre-transferred.

Status Data type: BOOL Bit (DB, M, A) announces that all


Address areas: travel parameters have been
Data module area transferred followed by the
Marker area POSR/POSA command. It does
I/O area NOT indicate the end of the
Call-up example: positioning process.
M 150.2
70.2A
[Link] 10.2

7.7.3 Status

The status indicates that all transfers have been successfully completed. We
would recommend that the status bit is monitored. The status bit is not set,
• if the input and output variables do not have the format expected,
• if StartPos has not yet been activated,
• if start was deactivated before the transfer was complete,
• if the numerical range for the floating point numeral of between -8 388 608
and +8 388 607 has been exceeded (the maximum numbers for COMPAX
may only fall in the range +/- 4 000 000),
• if the acceleration profile is also transferred without the password being
transferred at least once.

54
7.7.4 Structure of the data area for PosPara

The data module, in which all values are saved for the positioning and/or
switching / speed steps, is 152 bytes in size. If no shift points are transferred,
the module size falls to 24 bytes. By encoding a control word, you can select
which values should be transmitted to COMPAX and which should not.
Parameter Address Data type Meaning
CONTROL 0.0 WORD CONTROL sets the software switch
(low) (BINARY) for a selective transfer of travel
parameters:

0.0 absolute=0 / relative=1


0.1 transfer acceleration profile
yes/no = 1/0
0.2 transfer speed yes/no = 1/0
0.3 transfer accel+ yes/no = 1/0
0.4 transfer accel- yes/no = 1/0
0.5 transfer password yes/no = 1/0
0.6 reserved
0.7 reserved
1.0 transfer switching step 1 yes/no =
1/0
...
1.7 transfer switching step 8 yes/no =
1/0
CONTROL 2.0 WORD reserved
(high) (BINARY)
ACCELE- 4.0 BYTE Total speed for ramp profile
RATION (UINT) 1 = linear
PROFILE 2 = smooth
3 = quadratic
SPEED 8.0 DWORD Start speed floating point value [%]
(FLOATIN 0.0 .. 100.0 for synchronous motors
G POINT) 0.0 .. 300.0 for asynchronous motors
ACCEL+ 12.0 DWORD Floating point value for acceleration
(FLOATIN ramp [ms]
G POINT) 10 .. 65 000

55
Simatic S7 modules for COMPAX with profibus DP

Parameter Address Data type Meaning


ACCEL- 16.0 DWORD Floating point value for deceleration
(FLOATIN ramp [ms]
G POINT) 10 .. 65 000
POSITION 20.0 DWORD Floating point value for
(FLOATIN position/distance [P90]
G POINT) -4 000 000 .. +4 000 000
TYPE 24.0 BOOL Software switch for selecting the type
Shift point n + (n-1)*16 (BINARY) of shift point n
where Type of switching cam n
n = 1 .. 8 0 = speed step
1 = set / reset output
POSR 28.0 DWORD Floating point value for distance
Shift point n + (n-1)*16 (FLOATIN [P90] to the starting point for shift
where G POINT) point n
n = 1 .. 8 -4 000 000 .. +4 000 000
SPEED 32.0 Speed: Speed floating point value [%] for
Shift point n + (n-1)*16 DWORD shift point n
where (FLOATIN 0.0 .. 100.0 for synchronous motors
or n = 1 .. 8 G POINT) 0.0 .. 300.0 for asynchronous motors

OUTPUTNO. Output no.: Integer for output number for shift


Shift point n BYTE point n
(UINT) 1 .. 16
ACCEL 36.0 Accel: Ramp floating point value [ms] for
Shift point n + (n-1)*16 DWORD shift point n
where (FLOATIN 0 .. 65 000
or n = 1 .. 8 G POINT)

OUTPUT Output
value value: Integer for output value for shift point
Shift point n BYTE n
(UINT) 30 hex = reset output
31 hex = set output

56
7.7.5 Supplementary comments

• FB is not designed for speed control mode (P93=4), speed steps cannot be
specified without positioning. Positioning processes require normal mode
(P93=1), continuous mode (P93=2) or reset mode (P93=3).
• Positioning can also be undertaken using mark references. The mark
reference is not then activated by FB, but must be explicitly approved via
the COMPAX parameter P35 and the input E14.
• Reference journeys cannot be triggered via the module.
• Absolute travel commands may only be used in normal and reset mode.
• The postion reached message must be queried using the STATUS WORD,
the FB only "initiates" the axis movement.
• The axis movement can be stopped via the CONTROL WORD using stop
or break.
• If switching steps are used, all values must be entered, therefore e.g. the
ACCEL value must not be missing for any speed stage.
• If not all shift points are required, you may shorten the positioner DB by the
corresponding slots.
• If password protection has been canceled by CONTROL, it is not reset by
the FB.
• If the transfer of travel parameters is interrupted (e.g. START activated too
early), any cams of the travel profile already set will remain set. One of the
following actions must be undertaken to deactivate the cams transferred by
this point:

- approach machine-zero,
- or approach real zero,
- or teach-in real zero using P211=1 or 3,
- or teach-in data record using P211=2 or 3,
- or undertake POSR0.

7.7.6 Call-up example

CALL FB 16, DB 16
PosPara :=P#[Link] 0.0 BYTE 152
Response :=P#[Link] 0.0 BYTE 10
Start :=P#[Link] 13.7 BOOL 1
StartPos :=P#[Link] 13.6 BOOL 1
Status :=[Link] 4.4
Request :=P#[Link] 0.0 BYTE 10

57
Simatic S7 modules for COMPAX with profibus DP

7.7.7 Example of positioner DB (PosPara)

In the example, an acceleration profile already defined is to be initiated using


newly determined values for speed (100%), accel+ (1000 ms) and accel-
(500 ms) a relative feed movement (1000 user units [P90]). During the feed
movement (after 500 user units [P90]), the speed should be reduced [50 %]
and one output (A9) should also be set after 200 user units [P90] and another
output (A10) reset after 900 user units [P90]. The accel value for the speed
stage must be entered, even if it doesn't change with regard to ACCEL+ or
ACCEL-. A maximum of 8 slots may be assigned for shift points, whereby all
combinations of speed stages outputs are possible.
Parameter Address Date Meaning
CONTROL 0.0 w#16#071D 0.0 = 1 POSR
(low) 0.1 = 0 do not transfer
acceleration profile
0.2 = 1 transfer speed
0.3 = 1 transfer accel+
0.4 = 1 transfer accel-
0.5 = 0 do not transfer password
0.6 = 0 reserved
0.7 = 0 reserved
1.0 = 1 transfer switching step 1
1.1 = 1 transfer switching step 2
1.2 = 1 transfer switching step 3
1.3 = 0 do not transfer switching
step 4
1.4 = 0 do not transfer switching
step 5
1.5 = 0 do not transfer switching
step 6
1.6 = 0 do not transfer switching
step 7
1.7 = 0 do not transfer switching
step 8
CONTROL 2.0 w#16#0000 Reserved
(high)
ACCELERATI 4.0 b#16#00 Acceleration profile is not
ON PROFILE transferred!

58
Parameter Address Date Meaning
SPEED 8.0 1.000000e+002 Start speed floating point value
100.0 %
ACCEL+ 12.0 1.000000e+003 Floating point value for
acceleration ramp 1000 ms
ACCEL- 16.0 5.000000e+002 Floating point value for
deceleration ramp 500 ms
POSITION 20.0 1.000000e+003 Floating point value for distance
1000.0 [P90]
TYPE 24.0 2#0 0 = speed step
Shift point 1
POSR 28.0 5.000000e+002 Following 500 [P90], measured
Shift point 1 from starting point, accelerate or
brake to new speed
SPEED 32.0 5.000000e+001 New speed 50 %
Shift point 1
ACCEL 36.0 5.000000e+002 Used, pre-defined deceleration
Shift point 1 ramp of 500 ms
TYPE 40.0 2#1 1 = set / reset output
Shift point 2
POSR 44.0 2.000000e+002 Following 200 [P90], measured
Shift point 2 from starting point, set / reset
output
OUTPUTNO. 48.0 b#16#09 Set / reset output 9
Shift point 2
OUTPUT value 52.0 b#16#31 Set output
Shift point 2
TYPE 56.0 2#1 1 = set / reset output
Shift point 3
POSR 60.0 9.000000e+002 Following 900 [P90], measured
Shift point 3 from starting point, set / reset
output
OUTPUTNO. 64.0 b#16#0A Set / reset output 10
Shift point 3
OUTPUT value 68.0 b#16#30 Reset output
Shift point 3

59
Simatic S7 modules for COMPAX with profibus DP

7.8 FC10: Conversion module "FloatDSP"


7.8.1 Description of function

This FC is used to convert an IEEE 32 bit floating point numeral into a


Motorola 48 bit DSP number. Conversion is finitely precise but with larger
figures, substantial rounding errors can occur. The FC operates locally on the
programmable controller, bus communication is not required.

7.8.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
FloatNum Data type: ANY Indicates the area (D, M) in which
ber Address areas: the IEEE 32 bit floating point
Data module area numeral is saved.
Marker area
Call-up example:
P#[Link] 0.0 BYTE 4
DSPNumb Data type: ANY Indicates the area (D, M) in which
er Address areas: the Motorola 48 bit DSP number
Data module area should be saved.
Marker area
Call-up example:
P#[Link] 0.0 BYTE 6
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts conversion of the numerical
Data module area format. The numerical conversion
Marker area is not flank triggered, i.e.
E area conversion occurs for as long as
Call-up example: start is activated.
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1

60
Variable Data type Meaning
Address area
Call-up example
Status Data type: BOOL Bit (DB, M, A) announces that the
Address areas: number has been converted.
Data module area Remains TRUE as soon as the
Marker area first conversion has been
I/O area successfully carried out.
Call-up example:
M 150.2
70.2A
[Link] 10.2

7.8.3 Status

The status indicates that the first conversion following the start has been
successfully carried out. If start remains active and if only the call-up
argument FloatNumber is changed, the status is not changed during status, if
the conversion is successful.

7.8.4 Structure of the data areas

The floating point numeral should be saved as an IEEE 32 bit floating point
numeral and consists of the prefix (1 bit), exponent (8 bits) and mantissa (23
bits). The maximum/minimum floating point numeral to be converted is +/- 8
388 607.0. The result, the Motorola 48 bit DSP number, is saved in the
memory in the following form, the digit before the decimal point is saved in
complementary format and when numbers are negative, these are filled
accordingly with 1 bits.

61
Simatic S7 modules for COMPAX with profibus DP

Parameter Address Data type Meaning


DSPNumber 0.0 BYTE (UINT) Byte NK3 after the decimal point,
minimum value byte (LSB)
1.0 BYTE (UINT) Byte NK2 after the decimal point,
average value byte
2.0 BYTE (UINT) Byte NK1 after the decimal point,
maximum value byte (MSB)
3.0 BYTE (UINT) Byte VK1 before the decimal point,
minimum value byte (LSB)
4.0 BYTE (UINT) Byte VK2 before the decimal point,
average value byte
5.0 BYTE (UINT) Byte VK3 before the decimal point,
maximum value byte (MSB)

7.8.5 Supplementary comments

• The FC10 works totally locally and produces the results in one cycle.
• The FC10 is only designed to create numerical values, these are e.g.
arguments for the SPEED, ACCEL, POSR or POSA COMPAX commands.
Values for parameters with a numerical character (e.g. feed constants,
parameters P40 to P49) and values for variables (V00 to V39) can be
created. Exercise caution with values for binary parameters (e.g. P93),
which must not have a digit after the decimal point.
• The maximum/minimum value, the variables and some parameters (3 and
6 byte parameters) that COMPAX can accept are +/-8 388 607.0. The
floating point argument must never be greater than this. You should note
that certain COMPAX parameters and commands have additional limit
values (accel +/- 65 000, maximum travel range +/- 4 000 000.0). The
parameter limit values should be taken from the COMPAX Product Manual.
Rounding errors occur.
• Attention! Once the start is deactivated, one DSP value 0.0 is written to the
6 byte DSP number.

62
7.8.6 Call-up example

In the example, the floating point numeral –125 9876 is to be converted into a
DSP number.
CALL FC 10
FoatNumber :=P#M 10.0 BYTE 4
Start :=P#M 1.0 BOOL 1
Status :=M2.0
DSPNumber :=P#M 20.0 BYTE 6

7.8.7 Example of a DSPNumber

Parameter Address Date Meaning


DSPNumber MB20 B#16#80 NK3 after the decimal point
MB21 B#16#2A NK2 after the decimal point
MB22 B#16#03 NK1 after the decimal point
MB23 B#16#82 VK1 before the decimal point
MB24 B#16#FF VK2 before the decimal point
MB25 B#16#FF VK3 before the decimal point

63
Simatic S7 modules for COMPAX with profibus DP

7.9 FC11: Conversion module "DSPFloat"


7.9.1 Description of function

This FC is used to convert a Motorola 48 bit DSP number into an IEEE 32 bit
floating point numeral. Die Conversion is finitely precise but with larger
figures, substantial rounding errors can occur. The FC works locally on the
programmable controller, bus communication is not required.

7.9.2 Setting parameters

Variable Data type Meaning


Address area
Call-up example
DSPNumb Data type: ANY Indicates the area (D, M) in which
er Address areas: the Motorola 48 bit DSP number
Data module area is saved.
Marker area
Call-up example:
P#[Link] 0.0 BYTE 6
FloatNum Data type: ANY Indicates the area (D, M) in which
ber Address areas: the IEEE 32 bit floating point
Data module area numeral should be saved.
Marker area
Call-up example:
P#[Link] 0.0 BYTE 4
START Data type: ANY Indicates a bit (DB, M, E) which
Address areas: starts the conversion of numerical
Data module area formats. The numerical
Marker area conversion is not flank triggered,
E area i.e. conversion occurs for as long
Call-up example: as start is activated.
P#M 150.4 BOOL 1
P#E 70.4 BOOL 1
P#[Link] 10.4 BOOL 1

64
Variable Data type Meaning
Address area
Call-up example
Status Data type: BOOL Bit (DB, M, A) announces that the
Address areas: number has been converted.
Data module area Remains TRUE as soon as the
Marker area first conversion has been
I/O area successfully carried out.
Call-up example:
M 150.2
70.2A
[Link] 10.2

7.9.3 Status

The status indicates that the first conversion following the start has been
successfully carried out. If start remains active and if only the DSPNumber
call-up argument is changed, the status is not changed during status, if the
conversion is successful.

7.9.4 Structure of data areas

The floating point numeral is saved as an IEEE 32 bit floating point numeral
and consists of prefix (1 bit), exponent (8 bits) and mantissa (23 bits). The
maximum/minimum DSP number to be converted is +/- 8 388 607.0. The
argument, the Motorola 48 bit DSP number, must be saved in the memory in
the following form, the digit before the decimal point should be saved in
complementary format and when numbers are negative, these are filled
accordingly with 1 bits.

65
Simatic S7 modules for COMPAX with profibus DP

Para- Address Data type Meaning


meter
DSPNum 0.0 BYTE (UINT) Byte NK3 after the decimal point, minimum
ber value byte (LSB)
1.0 BYTE (UINT) Byte NK2 after the decimal point, average
value byte
2.0 BYTE (UINT) Byte NK1 after the decimal point,
maximum value byte (MSB)
3.0 BYTE (UINT) Byte VK1 before the decimal point,
minimum value byte (LSB)
4.0 BYTE (UINT) Byte VK2 before the decimal point,
average value byte
5.0 BYTE (UINT) Byte VK3 before the decimal point,
maximum value byte (MSB)

7.9.5 Supplementary comments

• The FC11 works totally locally and produces the result in one cycle.
• The maximum/minimum value, the variables and some parameters (3 and
6 byte parameters) which COMPAX may accept is +/-8 388 607.0. The
floating point numeral cannot be greater following successful conversion.
Rounding errors occur!
• Attention! Once start is deactivated, one floating point value 0.0 is written
to the 4 byte floating point numeral.

7.9.6 Call-up example

A DSP hex number "80 2A 03 82 FF FF" is to be converted into a floating


point numeral.
CALL FC 11
DSPNumber :=P#M 20.0 BYTE 6
Start :=P#M 1.1 BOOL 1
Status :=M2.1
FloatNumber :=P#M 10.0 BYTE 4
The resultant floating point number is –125.9876.

66
8. Troubleshooting
8.1 Hardware and address errors
An unobtainable COMPAX can be detected via the ONLINE hardware
configuration of the Step7 package. Possible causes for this error may be as
follows:
Description of error Cause of error Error rectification
Activation not Cabling error Check cable assignment
possible
Line B on X5/6 pin 2
line A on X5/6 pin 7 incoming,
line B on X7 pin 2
line A on X7 pin 7 outgoing,
standard Siemens connectors (line
B pin 3, line A pin 8) cannot be
used, see operating instructions for
profibus option [1]
Activation not Cabling error Check output resistances
possible
If COMPAX is the last unit on the
bus line, a BUS3/01 output
resistance package must be
installed, standard Siemens
connectors with engagable output
resistances cannot be used, see
operating instructions for profibus
option [1]
Activation not Address error, Check address setting
possible parameter error
Compare C01 or P194 setting for
the station address with S7
configuration, the station address is
only transferred by COMPAX
following logic voltage off/on

67
Simatic S7 modules for COMPAX with profibus DP

Description of error Cause of error Error rectification


Activation not Protocol error, Check protocol settings
possible parameter error
Compare C03 or - P196 setting for
the protocol (length, consistency
division, I/O setting) with the S7
configuration, all possible settings
can be found in the GSD file also
supplied,
the protocol setting is only
transferred by COMPAX following
logic voltage off/on
Activation not COMPAX Check COMPAX hardware
possible and/or
Change or repair, use
engagement
ServoTerminal to query S36 via
assembly F03
RS232
defective

8.2 Operating and parameter setting errors


The MODULE FB's and FC's do not necessarily have to be used. The
COMPAX programmer interface described in the operating instructions for
the profibus option [1] also exclusively uses these modules. The modules do
however relieve you of the work of generating the message frame and the
amount of user projection expenditure can therefore be reduced
considerably. The input/output characteristics of the modules can be easily
monitored via variable observation of the S7 package.
☞ All modules are translated using the KNOW_HOW_PROTECT switch to
ensure that the source code cannot be viewed.

68
Description of error Cause of error Error rectification
FB does not complete Reading and Check system module call-up
transfer writing modules
Call up these modules at least
(SYSTEM_WRITE
during module processing. We
and/or
would recommend that the
SYSTEM_READ)
modules are called up in cycles
not called up
during the complete
correctly
programmable controller program
processing, if run-time problems
will not be caused by such action.
FB does not complete Incorrect Check user date
transfer USER_DATA
Step string in the FB, cause e.g.
password not provided when
setting parameters
FB does not complete Several START Check FB's call-up
transfer inputs active on
Only activate one FB via START
FB's, which
per COMPAX
address a
COMPAX
Function not carried START input not Check START input setting
out activated or
Activate START input and leave
deactivated too
activated until STATUS
soon
announces that the transfer was
successful. A falling flank on the
START input describes the BKD
outgoing box (writing) once) with
a zero telegram
Programmable Incorrect Check module length
controller program programming
Check that DB modules are
interrupt
present and are of the minimum
size, generally check values

69
Simatic S7 modules for COMPAX with profibus DP

8.3 Sending error messages to Parker


We are only too pleased to receive detected errors and suggestions for
improvement from you. If we are to be able to respond quickly to an error, the
error detected should be accompanied by as accurate an error description as
possible which should contain the following information:
• your company's name, contact, telephone and fax numbers, e-mail address
is available,
• the COMPAX unit variants and the software version (take status S31 from
ServoTerminal or S31 and S38 from COMPAX front panel),
• the F03 (profibus) software version (take status S36 from ServoTerminal)
• the system configuration (COMPAX-S, COMPAX-M)
• the addresses set (C01 or P194) and the protocol selected (C03 or P196)
or the complete COMPAX configuration
• the modules used (FB, FC) and their edition status (object characteristics)
• programmable controller structure used, edition status of S7 programmer
package
• description of error, observations and comments

9. Bibliography
(1) Operating instructions. Option: profibus (F3)
(2) COMPAX Product Manual. Compact servo-control
(3) Operating instructions for electronical curve control

70

You might also like