Sie sind auf Seite 1von 59

Description

www.festo.de
Library for motor controller
with FHPP
FestoMotionFHPP TIA Portal (Siemens TIA portal)

21.11.2016
Version 14.0.1
Table of contents
1 Important information ................................................................................................................................... 5
1.1 Intended use ....................................................................................................................................... 5
1.2 Safety instructions .............................................................................................................................. 5
1.3 Danger categories ............................................................................................................................... 6
1.4 Marking special information ............................................................................................................... 6

2 Introduction ................................................................................................................................................... 7
2.1 Basic principles ................................................................................................................................... 7
2.2 General information on Festo motor controllers .................................................................................. 7

3 Festo handling and positioning profile (FHPP) ............................................................................................. 9


3.1 FHPP operating modes ...................................................................................................................... 10
3.2 Function blocks for Festo motor controllers ...................................................................................... 10

4 Usage of the library ..................................................................................................................................... 11


4.1 Linking the library ............................................................................................................................. 11
4.2 Folder structure within the library ..................................................................................................... 12
4.3 FHPP data transfer ............................................................................................................................ 12
4.4 CPU and fieldbus-specific features .................................................................................................... 13
4.4.1 Profibus/Profinet.................................................................................................................. 13
4.4.2 IO-Link.................................................................................................................................. 13
4.4.3 Modbus TCP ......................................................................................................................... 14
4.4.4 Figure 4-7: CPU and fieldbus-specific features for data transfer (Modbus TCP) .................... 14
4.5 Addressing the data elements........................................................................................................... 15
4.5.1 FHPP_DPRD_DAT/ FHPP_DPWR_DAT (incl. FHPPplus) .......................................................... 15
4.5.2 FHPP_GETIO_PART/ FHPP_SETIO_PART ............................................................................... 16
4.5.3 FHPP_DATA_PEEK/ FHPP_DATA_POKE ................................................................................. 17

5 Device setup in the TIA portal ..................................................................................................................... 19


5.1 Installing the GSD/GSDML files in the TIA portal ............................................................................... 19
5.2 Adding a PROFIBUS drive under Devices & Networks ....................................................................... 19
5.3 Adding a PROFINET drive under Devices & Networks ........................................................................ 20
5.4 Adding an IO-Link drive under Devices & Networks........................................................................... 21
5.4.1 Installing the IODD files in the TIA portal (Device Tool) ......................................................... 21
5.4.2 Installing the IODD files on a non-Siemens IO-Link master ................................................... 22
5.5 Configuring Modbus TCP ................................................................................................................... 22

6 Elements in the library ................................................................................................................................ 23


6.1 FHPP_DATA elements for data exchange ........................................................................................... 23
6.1.1 FHPP_DPRD_DAT (Profibus/ Profinet)................................................................................... 23
6.1.2 FHPP_DPWR_DAT (Profibus/Profinet) ................................................................................... 24
6.1.3 FHPP_DATA_PEEK (IO-Link) .................................................................................................. 25
6.1.4 FHPP_DATA_POKE (IO-Link) .................................................................................................. 26
6.1.5 FHPP_GETIO_PART (IO-LINK) ................................................................................................ 27
6.1.6 FHPP_SETIO_PART (IO-LINK) ................................................................................................ 28
6.1.7 FHPP_MB_CLIENT (Modbus TCP) .......................................................................................... 29
6.2 FHPP_CONTROL function blocks for controlling ................................................................................. 30
6.2.1 FHPP_CTRL ........................................................................................................................... 30
6.2.2 FHPP_PLUS .......................................................................................................................... 35
6.3 FHPP_PARAMETER elements for parameterisation ........................................................................... 36
6.3.1 Overview of parameter FBs (function blocks) ....................................................................... 36
6.3.2 FPC_DIAG - Read current error .............................................................................................. 36
6.3.3 FPC_DIAG_BUFFER - Reading diagnostic memory ................................................................ 37
6.3.4 FPC_DIRMP - Dynamic FHPP parameters .............................................................................. 38
6.3.5 FPC_FILE - Transfer parameter records ................................................................................. 39

ii
Table of contents

6.3.6 FPC_MULTI Transfer of a list of device parameters ............................................................. 41


6.3.7 FPC_DATA_OBJECT - Transfer of internal objects (expert) ..................................................... 43
6.3.8 FPC_PNU - Transfer of individual FHPP parameters .............................................................. 44

7 STATUS (reporting system element) ........................................................................................................... 45


7.1 DT_FML_STATUS ............................................................................................................................... 45
7.2 Category ........................................................................................................................................... 45
7.2.1 Category 1 - Function block error .......................................................................................... 45
7.2.2 Category 2 reserved ........................................................................................................... 45
7.2.3 Category 3 FPC error numbers ........................................................................................... 46
7.2.4 Category 4 Siemens error numbers.................................................................................... 47

iii
1 Important information
1.1 Intended use
The function blocks (FB) described are used to control and parameterise motor controllers by Festo via the FHPP
protocol.
By means of the function blocks, the various functions of these controllers can be comfortably incorporated into
the PLC program. The function blocks are called cyclically, using a separate instance, for each motor controller
(each axis) that is integrated into the user program. Simultaneous use of other function blocks for controlling the
same device is not permitted.
Observe the "Safety instructions" and instructions on the designated use of the respective devices, components
and modules. When connected with commercially available components, such as sensors and actuators, the
specified limits for pressures, temperatures, electrical data, torques etc. must be observed.

Target group
This manual is intended exclusively for technicians trained in control and automation technology, who have
experience in installing, commissioning, programming and diagnosing positioning systems and the relevant
fieldbuses.

Service
If you have any technical problems, please consult your local Festo service, or contact the central service at the
following e-mail address:
service_international@festo.com

1.2 Safety instructions


When commissioning and programming positioning systems, you must observe the safety regulations in the
manuals and operating instructions for the components used. The user must ensure that nobody has access to
the sphere of influence of the connected actuators. Access to the potential danger area must be prevented by
suitable measures such as barriers and warning signs.

Warning
Electrical axes can move with high force and at high speed. Collisions can lead to serious injury to
people and damage to components.
You must make sure that nobody can place their hand in the positioning range of the axes or other
connected actuators and that there are no objects in the positioning path while the system is
connected to energy sources.

Warning
Parameterisation errors can cause injury to people and damage to property.
Only enable the controller if the axis system has been professionally installed and parameterised.

5
FHPP library for Siemens TIA Portal

1.3 Danger categories


This document contains information on possible dangers that can occur if the product is not used as designated.
These danger warnings are marked with a signal word (warning, caution, etc.), placed on a grey background and
additionally marked with a pictogram. A distinction is made between the following danger warnings:

Warning
... means that non-observance can result in serious personal injury or damage to property.

Caution
... means that any failure to comply can result in personal injury or material damage.

Note
... means that failure to observe this instruction can result in damage to equipment.

1.4 Marking special information


Information on how danger warnings are represented can be found under "Important user information".

Pictograms
The following pictograms mark passages in the text which contain special information.

Information: Recommendations, tips and references to other sources of information.

Text markings
1. Numbers denote activities that must be carried out in the order specified.
Bullet points denote activities that can be carried out in any order.
o Circular dots denote general listings.

Further conventions
FB Sometimes, the abbreviation "FB" (or "FBs") is used for "function block(s)":
Names of windows, dialogues and buttons such as "Message Window," "Extract Project," "OK" as
"OK"
well as designations are shown in inverted commas.
Names of keys on the PC keyboard are represented in the text with uppercase letters (e.g. ENTER
CTRL
KEY, CTRL, C, F1 etc.).
For some functions you need to press two keys simultaneously.
CTRL+C
Example: The CTRL key together with the "C" key produces the CTRL+C character.
If "click" or "double-click" is mentioned, this always applies to the left-hand mouse button. If the
right-hand mouse button is to be used, this will be explicitly mentioned.

6
2 Introduction
2.1 Basic principles
"FestoMotionFHPP" is a library for use under Siemens TIA portal. With this library,
o the CMMD-AS motor controllers
o the CMMO-ST-C5-1-LKP motor controllers
o the CMMP-AS motor controllers
o the CMMS-AS and CMMS-ST motor controllers
o the integrated motor unit EMCA-EC
can be controlled and parameterised via their respective fieldbus interface.
A motor controller is controlled by means of the Festo Handling and Positioning Profile (FHPP).
The library contains function blocks for controlling and parameterising the drives.
Refer to the User Documentation of the motor controller for additional information on operating and setting up.

Architecture
Each motor controller is integrated into the project via the Devices & Networks menu.
o All function blocks that access I/O data directly to control a motor controller require the addresses of
the input and output data. See Chapter 3.5 Addressing the data elements
o All function blocks that access I/O data directly to parameterise a motor controller require the
addresses of the input and output data of the Festo Parameter Channel (FPC).

For each motor controller, a separate instance of a function block needs to be created for control or
parameterisation.

2.2 General information on Festo motor controllers


The following sections contain information on the function blocks for Festo motor controllers. The following
additional manuals are required for a complete understanding:

Documentation on Festo motor controllers


Documentation Table of contents
Brief description and descriptions (see Brief description: Important commissioning instructions and
Support Portal or Catalogue) preliminary information.
Descriptions: contents as described below.
Manuals P.BE-... (from the Support Portal) Installation, commissioning and diagnostics of electric axes with
the relevant Festo motor controller.
Help system for the Festo Configuration Functional descriptions for the Festo Configuration Tool
Tool (contained in FCT software) configuration software.
Help system for the "FestoMotionFHPP" Use of the function blocks for Festo motor controllers described
library (this Help) here.

Note
Always observe the information and safety instructions in the documentation.

7
3 Festo handling and positioning profile (FHPP)
Tailored to the target applications for handling and positioning tasks, Festo has developed an optimised device
profile, the Festo Handling and Positioning Profile (FHPP).
The FHPP device profile allows uniform programming for the control of Festo motor controllers via various
fieldbus systems.
In the FHPP, the user can create a uniform definition for
o Operating modes
o I/O data structure
o Parameter objects
o Sequence control.

Figure 3-1: The FHPP principle

Control and status bytes


Control of the motor controllers via the fieldbus is achieved via 8 bytes of I/O data. Usually, control functions are
triggered and status messages for the function block are evaluated by means of single-bit operations.

Parameter channel
The control system has read and write access to all controller parameter values via the parameter channel. A
further 8 bytes of I/O data are used for this purpose.

9
FHPP library for Siemens TIA Portal

3.1 FHPP operating modes


Record selection
In the "Record selection" mode, the records that are saved in a record list within the motor controller can be
executed. The record list is parameterised or taught during commissioning with the Festo Configuration Tool.

Direct mode
In "Direct mode", the most important positioning data is transferred directly to the motor controller via the FHPP
control data.
o Target positions and speeds can be ascertained and specified by the controller at execution time.
o There are no limitations regarding the number of saved records.
In direct mode, values can be taught/parameterised via the PLC control system.
The following direct operating modes can be selected:
o Direct mode with position control
o Direct mode with torque control
o Direct mode with speed adjustment

3.2 Function blocks for Festo motor controllers


The library contains the following function blocks (FBs):
o A control function block "FHPP_CTRL" for controlling the motor controller
o One "FHPPplus" function block for transfer of the FHPP+ data (controller-dependent)
o Various parameter function blocks for exchanging individual parameters or groups of parameters with
the motor controller
o Transfer function blocks for providing data from the motor controller for the control function block and
the parameter function blocks
o Transfer function blocks for transferring output data from the control function block and the parameter
function blocks

The transfer function blocks are dependent on the fieldbus, via which an FHPP device is connected to
the control system.

3.3 Releases for TIA Portal


Several libraries are available for the different TIA portal versions. There can be functional differences in the
several versions. The versions can be assigned by the folder name or the ending oft he file name.
o FestoMotionFHPP_V13_SP1.al13 -> TIA Portal V13
o FestoMotionFHPP.al14 -> TIA Portal V14

10
4 Usage of the library
4.1 Linking the library
The library is added to the project via the menu Extras, Global libraries, Open library.

Figure 4-1: Integrating the library

The library is now available in the Global Libraries window. The elements and data types required are copied
directly into the project by drag & drop.

Figure 4-2: Using the library

Notes on using the library can be found in the general help under the topic "Using elements from
libraries".

11
FHPP library for Siemens TIA Portal

4.2 Folder structure within the library


For a clear overview, the elements in the library are grouped into subfolders.

Figure 4-3: Structure of the folders

All elements and data types required from the library for the project must be copied to the project.

4.3 FHPP data transfer


The FHPP input data is read into the control system via one of the read elements. A data reference (FML_REF)
connects all elements of a drive. Finally, the FHPP output data is sent to the drive via one of the write elements.
The read/write function block required depends on how the FHPP device is connected to the control system.

read data from device (pre)


FHPP DATA

FHPP_CTRL

FHPP CONTROL

FHPPplus FML_REF

FPC_PNU/ FPC_DIAG/ ... FHPP PARAMETER

write data to device (post)


FHPP DATA

Figure 4-4: Sequence of the elements

Note
The function block required for reading or writing data depends on the connection of the device and
the CPU required.

12
Usage of the library

4.4 CPU and fieldbus-specific features


4.4.1 Profibus/Profinet
S71500/ S71200/ S7300/ S7400

FHPP_DPRD_DAT

Profibus/ Profinet
FHPP library blocks

FHPP-Device

FHPP_DPWR_DAT

Figure 4-5: CPU and fieldbus-specific features for data transfer (Profibus/ Profinet)

4.4.2 IO-Link
S71500/ S7300/ S7400

FHPP_GETIO_PART

FHPP-Device
FHPP library blocks
IO-LINK

FHPP_SETIO_PART
Profibus/ Profinet

IO-Link Master
S71500/ S71200

FHPP_DATA_PEEK

FHPP library blocks

FHPP_DATA_POKE

Figure 4-6: CPU and fieldbus-specific features for data transfer (IO-Link)

13
FHPP library for Siemens TIA Portal

4.4.3 Modbus TCP


S71500/ S71200

FHPP_MB_CLIENT

FHPP-Device Modbus TCP

FHPP library blocks

Figure 4-7: CPU and fieldbus-specific features for data transfer (Modbus TCP)

14
Usage of the library

4.5 Addressing the data elements


If a drive is integrated under Devices & Networks, the hardware addresses can be viewed in the system
constants under PLC Variables.
The I/O data of a device is generally accessed via the HW addresses. As FHPP drives are modular devices, the
individual I/O modules must be addressed.

Note
Unconfigured modules have zero as their address on the element.

4.5.1 FHPP_DPRD_DAT/ FHPP_DPWR_DAT (incl. FHPPplus)

Figure 4-8: FHPP_DPRD/DPWR_DAT

Note
"Message from PLC" in the FCT is viewed from the device perspective. The PLC sends the data to the
device.

15
FHPP library for Siemens TIA Portal

4.5.2 FHPP_GETIO_PART/ FHPP_SETIO_PART


If a device is connected to a CPU via a fieldbus coupler (e.g., IO-Link master), the I/O data can no longer be
reached simply via the module address. This requires partial access to the I/O data, which is addressed as
follows.
The address is the same as the start of the IO-Link master sub-module (see 1), and the offset (see 2) corresponds
to the data shift within the IO-Link master in bytes. For example, if the addressed FHPP device is in the first slot
of the IO-Link master, the offset is zero.

2
2

Figure 4-9: FHPP_GETIO/SETIO_PART

16
Usage of the library

4.5.3 FHPP_DATA_PEEK/ FHPP_DATA_POKE


In contrast to the addressing of the GETIO_PART and SETIO_PART element, the addressing of PEEK and POKE
originates from the I/O address of the corresponding I/O data range, and not from the HW sub-module address.

Figure 4-10: FHPP_DATA_PEEK/POKE

17
5 Device setup in the TIA portal
5.1 Installing the GSD/GSDML files in the TIA portal
Before the library can be used, the GSD/GSDML files for the respective drive must be installed. The installation
process is the same for the GSD and GSDML file.
To install the GSD/GSDML files, switch to project view in the TIA portal.
1. Select "Extras" > "Install device description file (GSD)"
2. Click the "Search" button to the right of the source path, and select the folder in which the
GSD/GSDML files were saved.
3. Select the desired GSD/GSDML file(s).
4. Click "Install" to start the installation process for the selected files.

5.2 Adding a PROFIBUS drive under Devices & Networks


Under project navigation, in project view, open the Devices & Networks view.
1. All installed drives are displayed in the hardware catalogue under "PROFIBUS-DP" > "Additional FIELD
DEVICES" > "Drives" > "Festo".
2. You can attach the required drive to the PROFIBUS master via drag & drop.
3. Drag with the mouse to establish the network connection. Select the Profibus interface of the CPU, and
drag the connection to the interface of the Festo drive.

Figure 5-1: Adding a Profibus device to the network

Next, you have to select the required EA modules.


5. Open device view to open the list of available protocols.
6. Drag the required modules into the list. It is indicated where the placement is possible.
Addressing is automatic, but can be changed manually.

Figure 5-2: Selecting the EA modules (Profibus)

19
FHPP library for Siemens TIA Portal

5.3 Adding a PROFINET drive under Devices & Networks


Under project navigation, in project view, open the Devices & Networks view.
1. All installed drives are displayed in the hardware catalogue under "PROFIBUS IO" > "Additional FIELD
DEVICES" > "Drives" > "Festo".
2. You can attach the required drive to the PROFIBUS master via drag & drop.
3. Drag with the mouse to establish the network connection. Select the Profinet interface of the CPU, and
drag the connection to the interface of the Festo drive.

Figure 5-3: Adding a Profinet device to the network

Next, you have to select the required EA modules.


5. Open the Drives subfolder to open the list of available protocols.
6. Drag the required modules into the list. It is indicated where the placement is possible. Addressing is
automatic, but can be changed manually.

Figure 5-4: Selecting the EA modules (Profinet)

20
Device setup in the TIA portal

5.4 Adding an IO-Link drive under Devices & Networks


IO-Link devices always have a point-to-point connection to an IO-Link master. From a control system perspective,
an IO-Link master is a PROFINET or PROFIBUS slave device, and can be from Siemens or a third-party
manufacturer.

Note
The individual I/O modules on an IO-Link master are grouped into a module in the control system. As
a result, partial access to the I/O data of the IO-Link master is required for an IO-Link device.

5.4.1 Installing the IODD files in the TIA portal (Device Tool)
The device description file for IO-Link devices is installed in the "Device Tool".
An IO-Link master needs to be configured in the Devices & Networks dialogue. Start the Device Tool by right-click
on the IO-Link master.

Figure 5-5: Start the Device Tool with a Simatic ET200SP

You can then import the IODD in the Device Tool.

There are two IODD variants for FHPP devices:


- FHPP standard only (8 byte)
- FHPP standard + FPC (16 byte)

The FPC protocol allows access to the internal objects.

21
FHPP library for Siemens TIA Portal

Figure 5-6: Import the IODD

5.4.2 Installing the IODD files on a non-Siemens IO-Link master


See the Help for the respective product for the procedure for commissioning an IO-Link device on a
non-Siemens master.
Ensure that the master is implemented per IO-Link specification V1.1.

5.5 Configuring Modbus TCP


In contrast to Profinet, Profibus and IO-Link devices, a Modbus TCP connection can only be established via the
PLC program.
In order to control an FHPP device via Modbus TCP, the function block"FHPP_MB_CLIENT" is required.

Note
The function block FHPP_MB_CLIENT only supports Modbus TCP connections with S71200 and
S71500 CPUs.

Note
Not all FHPP devices support Modbus TCP

Note
The function block FHPP_MB_CLIENT only supports the Siemens MB_Client version 4.0 or higher.

Figure 5-7: MB_CLIENT version Siemens

22
6 Elements in the library
6.1 FHPP_DATA elements for data exchange
The elements use functions from Siemens to read and write data to the device. The names of the blocks contain
the Siemens function used in each case.

Detect and rectify commissioning errors in a simple way:


- Always observe the Error Bool in FML_REF. The transfer is only error-free if its value is FALSE.
- Activate the HW_IO_Addresses one after the other in order to detect incorrect inputs more
quickly.
- Analyse errors easily and rapidly by means of the return value.

6.1.1 FHPP_DPRD_DAT (Profibus/ Profinet)


The function block FHPP_DPRD_DAT calls the Siemens function DPRD_DAT, processes the raw data from the
motor controller, and makes it available in standardised form to the control block and the parameter blocks in a
data structure at the in-out parameter FML_REF.

Figure 6-1: Function block FHPP_DPRD_DAT

Inputs and outputs

Signal name Variable Data type Description


type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control
and parameterise a motor controller.
HW_IO_FHPP VAR_INPUT WORD/ Hardware address of the FHPP standard data (0=inactive)
HW_IO(V14)
HW_IO_FPC VAR_INPUT WORD/ Hardware address of the FPC standard data (0=inactive)
HW_IO(V14)
HW_IO_FHPPplus VAR_INPUT WORD/ Hardware address of the FHPP+ data (0=inactive)
HW_IO(V14)
DeviceType VAR_INPUT STRING[16] Specification of device type. Admissible characters:
CMMO_ST, EMCA_EC, CMMP_AS, CMMS_AS, CMMS_ST,
CMMD_AS
cfgFHPPplusIn VAR_INPUT DINT FHPP+ data composition (FCT)
Error VAR_OUTPUT BOOL Error occurred
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

Note
With S7300/400 CPUs you have to asign the logical input address oft the specific module.

23
FHPP library for Siemens TIA Portal

6.1.2 FHPP_DPWR_DAT (Profibus/Profinet)


The function block FHPP_DPWR_DAT calls the Siemens function DPWR_DAT and makes the PLC output data
available to the drive.

Figure 6-2: Function block FHPP_DPWR_DAT

Signal name Variable type Data type Description


FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control
and parameterise a motor controller.
HW_IO_FHPP VAR_INPUT WORD/ Hardware address of the FHPP standard data
HW_IO(V14) (0=inactive)
HW_IO_FPC VAR_INPUT WORD/ Hardware address of the FPC standard data (0=inactive)
HW_IO(V14)
HW_IO_FHPPplus VAR_INPUT WORD/ Hardware address of the FHPP+ data (0=inactive)
HW_IO(V14)
cfgFHPPplusOut VAR_INPUT DINT Activate FHPP+ data mapping. (Value from FCT)
Error VAR_OUTPUT BOOL Error occurred
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

Note
With S7300/400 CPUs you have to asign the logical output address oft the specific module.

24
Elements in the library

6.1.3 FHPP_DATA_PEEK (IO-Link)


The function block FHPP_DATA_PEEK calls the Siemens function PEEK, processes the raw data from the motor
controller, and makes it available in standardised form to the control function block and the parameter function
blocks in a data structure at the in-out parameter FML_REF.

Figure 6-3: Function block FHPP_DATA_PEEK

Note
only S71200/1500 CPUs

Inputs and outputs

Signal name Variable type Data type Description


FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to
control and parameterise a motor controller.
IAddress_FHPP VAR_INPUT INT Start address of the FHPP input data
IAddress_FPC VAR_INPUT INT Start address of the FPC input data (0=inactive)
IAddress_FHPPplus VAR_INPUT INT Start address of the FHPP+ input data (0=inactive)
DeviceType VAR_INPUT STRING[16] Specification of device type. Admissible characters:
CMMO_ST, EMCA_EC, CMMP_AS, CMMS_AS,
CMMS_ST, CMMD_AS
cfgFHPPplusIn VAR_INPUT DINT Activate FHPP+ data mapping. (Value from FCT)
Error VAR_OUTPUT BOOL Error occurred
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

25
FHPP library for Siemens TIA Portal

6.1.4 FHPP_DATA_POKE (IO-Link)


The function block FHPP_DATA_POKE calls the Siemens function POKE and makes the PLC output data available
to the drive.

Figure 6-4: Function block FHPP_DATA_POKE

Note
only S71200/1500 CPUs

Inputs and outputs

Signal name Variable type Data type Description


FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to
control and parameterise a motor controller.
OAddress_FHPP VAR_INPUT INT Start address of the FHPP output data
OAddress_FPC VAR_INPUT INT Start address of the FPC output data (0=inactive)
OAddress_FHPPplus VAR_INPUT INT Start address of the FHPP+ output data (0=inactive)
cfgFHPPplus VAR_INPUT INT Activate FPC data mapping
Error VAR_OUTPUT BOOL Error occurred
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

26
Elements in the library

6.1.5 FHPP_GETIO_PART (IO-LINK)


The function block FHPP_GETIO_PART calls the Siemens function GETIO_PART, processes the raw data from the
motor controller, and makes it available in standardised form to the control function block and the parameter
function blocks in a data structure at the in-out parameter FML_REF.

Figure 6-5: Function block FHPP_GETIO_PART

Note
only S7300/400/1500 CPUs

Inputs and outputs

Signal name Variable type Data type Description


FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control and
parameterise a motor controller.
ID VAR_INPUT WORD/ Hardware identifier of the EA module
HW_SUBMODULE
Offset VAR_INPUT INT Number of the first byte to be read in the process image of
the component (smallest possible value: 0)
DeviceType VAR_INPUT INT Specification of device type. Admissible characters:
CMMO_ST, EMCA_EC, CMMP_AS, CMMS_AS, CMMS_ST,
CMMD_AS
cfgFPC VAR_INPUT BOOL Activate FPC data mapping
cfgFHPPplusIn VAR_INPUT INT Activate FHPP+ data mapping. (Value from FCT)
Error VAR_OUTPUT BOOL Error occurred
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

27
FHPP library for Siemens TIA Portal

6.1.6 FHPP_SETIO_PART (IO-LINK)


The function block FHPP_SETIO_PART calls the Siemens function SETIO_PART and makes the PLC output data
available to the drive.

Figure 6-6: FHPP_SETIO_PART

Note
only S7300/400/1500 CPUs

Inputs and outputs

Signal name Variable type Data type Description


FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to
control and parameterise a motor controller.
ID VAR_INPUT WORD/ Hardware identifier of the EA module
HW_SUBMODULE
Offset VAR_INPUT INT Number of the first byte to be described in the
process image of the component (smallest possible
value: 0)
cfgFPC VAR_INPUT BOOL FPC data transmission
cfgFHPPplusOut VAR_INPUT INT FHPP+ data composition (FCT)
Error VAR_OUTPUT BOOL Error occurred
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

28
Elements in the library

6.1.7 FHPP_MB_CLIENT (Modbus TCP)


The function block FHPP_MB_CLIENT calls the Siemens function MB_CLIENT, through which a Modbus TCP
connection is established to the drive, and the cyclical data exchange takes place.

Figure 6-7: Function block FHPP_MB_CLIENT

Note
only S71200/1500 CPUs

Inputs and outputs

Signal name Variable Data type Description


type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control
and parameterise a motor controller.
Modbus_DATA_PTR VAR_IN_OUT VARIANT Pointer to the FHPP Modbus data register
EnableConnection VAR_INPUT BOOL initialises and ends the Modbus connection
DeviceType VAR_INPUT STRING[16] Specification of device type. Admissible characters:
CMMO_ST, EMCA_EC, CMMP_AS, CMMS_AS,
CMMS_ST, CMMD_AS
EnableFPC VAR_INPUT BOOL Activates transfer of the FPC data
EnableFHPPplusIn VAR_INPUT DINT Data composition of FHPP+ input data (FCT)
EnableFHPPplusOut VAR_INPUT DINT Data composition of FHPP+ output data (FCT)
IP_ADDR_BYTE1..4 VAR_INPUT BYTE IP address for the Modbus TCP slave, in bytes
ConnectionID VAR_INPUT INT Unique connection ID (1-4095)
TIMEOUT VAR_INPUT TIME Timeout period for connection monitoring
Default = 500 ms
COM_ENABLED VAR_OUTPUT BOOL Connection established
Error VAR_OUTPUT BOOL Error occurred
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

Modbus_DATA_PTR:
For the exchange of data via Modbus, the MB_CLIENT requires a global memory area as a data buffer.
For each Modbus TCP connection to an FHPP drive, an FHPP Modbus data register must be created and
transferred to the element.

Note
Create the FHPP data register as an ARRAY[1..32] of bytes in a global DB.
The maximum length of an FHPP telegram is 32 bytes.

The FHPP_MB_CLIENT is preset internally with all Festo specific configuration settings.

29
FHPP library for Siemens TIA Portal

6.2 FHPP_CONTROL function blocks for controlling


6.2.1 FHPP_CTRL
The control function block "FHPP_CTRL" is used for controlling a Festo motor controller. The available input and
output data are managed in the DT_FML_REF structure.

Note
The supply and disposal of the FHPP data must be ensured by means of the function blocks from the
FHPP_DATA library folder.

Figure 6-8: Function block FHPP_CTRL

The following tables describe all inputs and outputs provided by the "FHPP_CTRL" function block for controlling
a motor controller.
In-out variable - VAR_INOUT

Signal Data type Description


name
FML_REF DT_FML_REF This data structure contains all data required to control and parameterise a motor
controller.

30
Elements in the library

Input variables - VAR_INPUT

Signal name Data type Description


EnableDrive BOOL Enable drive
= TRUE: Enable drive
= FALSE: Disable drive
Stop BOOL Stop
= TRUE: Enable operation.
= FALSE: Stop active (cancel emergency ramp + positioning
task). The drive stops with maximum braking ramp, the
positioning job is reset.
Brake BOOL Release brake
= TRUE: Release brake
= FALSE: Brake is active
Note: It is only possible to release the brake if the controller
is disabled. As soon as the controller is enabled, it has
priority over the brake control system.
ResetFault BOOL Acknowledge the malfunction
A malfunction is acknowledged with a rising edge and the
malfunction value is deleted.
HMIAccessLocked BOOL Software access blocked
Control of access to the local (integrated) diagnostic
interface of the controller.
= TRUE: The "FCT" software may only monitor the
controller; the software cannot assume control of the device
(FCT control).
= FALSE: The FCT software can assume control of the device
(to change parameters or to control inputs).
OPM INT FHPP operating mode + control mode
= 0: Record selection
= 1: Direct mode with position control
= 5: Direct mode with force/torque operation
= 9: Direct mode with speed adjustment
Halt BOOL Halt
= TRUE: Halt is not active
= FALSE: Halt is active (do not cancel braking ramp +
positioning task). The axis stops with a defined braking
ramp, the positioning task remains active (the remaining
path can be deleted with ClearRemainingPosition).
StartTask BOOL Start positioning job
A rising edge transfers the current nominal data and starts an
action (also, e.g., Record 0 = homing).
StartHoming BOOL Start homing
A rising edge starts homing with the preset parameters.
JoggingPos BOOL Jog positive
The drive moves at the specified speed or rotational speed in
the direction of larger actual values, as long as the bit is set.
The movement begins with the rising edge and ends with the
falling edge.

31
FHPP library for Siemens TIA Portal

JoggingNeg BOOL Jog negative


The drive moves at the specified speed or rotational speed in
the direction of smaller actual values, see JoggingPos.
TeachActualValue BOOL Teach value
With a falling edge, the current actual value is transferred to
the nominal value register of the currently addressed teach
target. Actual values might include position or torque.
ClearRemainingPosition BOOL Delete remaining path
In the "Halt" state, a rising edge causes the positioning task
to be deleted and a transition to the "Ready" state.
Relative BOOL Absolute/relative (only direct mode with position control)
= FALSE: Setpoint value is absolute
= TRUE: Setpoint value is relative to last setpoint value.
DeactivateStrokeLimit BOOL Deactivate monitoring of a stroke limit
= FALSE: Stroke limit monitoring is active
= TRUE: Stroke limit monitoring is not active
ExecuteFunction BOOL Activation oft the FUNC-BIT (only for CMMP-AS)
=TRUE: Activate Func
=FALSE: Deactivate Func
RecordNo INT Record number (record selection only)
SetFunctionNumer INT Set the function number (only for CMMP-AS)
Described in CMMP-AS FHPP manual
SetFunctionGroup INT Set the function group (only for CMMP-AS)
Described in CMMP-AS FHPP manual
SetValueVelocity BYTE Speed in % of the base value (limited to 100%)
(only direct application with positioning mode)
Direct application positioninig mode: target
velocity
Direct application force/torque mode for CMMO-
ST and EMCA-EC: velocity limit
SetValuePosition DINT Position in the position unit
(only direct application with positioning mode)
SetValueForceRamp BYTE Force ramp in % of the base value (limited to 100%)
(only direct application with force/torque mode)
SetValueForce DINT Torque in % of the base value
(only direct application with force/torque mode)
SetValueRotRamp BYTE Speed ramp in % of the base value (limited to 100%)
(only direct application with speed mode)
SetValueRotSpeed DINT Speed in speed unit
(only direct application with speed mode)

32
Elements in the library

Output variables - VAR_OUTPUT

Signal name Data type Description


DriveEnabled BOOL Controller enabled
= FALSE: Drive blocked, controller not active
= TRUE: Drive (controller) enabled
Ready BOOL Operation enabled
= FALSE: Stop activated
= TRUE: Operation enabled, positioning possible
Warning BOOL Warning
= FALSE: No warning active
= TRUE: Warning is active
Fault BOOL Malfunction
= FALSE: No malfunction
= TRUE: Malfunction active. Error code in the diagnostic
memory.
SupplyVoltagePresent BOOL Load voltage is applied
= FALSE: No load voltage
= TRUE: Load voltage is applied
ControlFCT_HMI BOOL Software device control
= FALSE: Device control enabled (e.g. PLC/fieldbus)
= TRUE: Software device control (PLC control is locked)
StateOPM INT Feedback on FHPP operating mode + control mode
= 0: Record selection
= 1: Direct mode with position control
= 5: Direct mode with torque control
= 9: Direct mode with speed adjustment
HaltActive BOOL Halt
= FALSE: Halt is active
= TRUE: Halt is not active, axis can be moved
AckStart BOOL Acknowledge Start
= FALSE: Ready for start (reference, jog)
= TRUE: Start carried out (reference, jog)
MC BOOL Motion complete
= FALSE: Positioning task active
= TRUE: Positioning task complete, possibly with error
Note: MC is set only after device is switched on (status
"Drive blocked").
AckTeach BOOL Acknowledge teach
= FALSE: Ready for teaching
= TRUE: Teaching carried out, actual value was transferred
DriveIsMoving BOOL Axis is moving
= FALSE: Speed of the axis < Limit
= TRUE: Speed of the axis >= Limit
DragError BOOL Following error
= FALSE: No following error
= TRUE: Following error active
StandstillControl BOOL Standstill monitoring
= FALSE: Axis stays in the tolerance window after MC
= TRUE: Axis has left the tolerance window after MC
HomingValid BOOL Drive has a valid reference position
= FALSE: Homing must be carried out
= TRUE: Reference position available, homing does not
have to be carried out
VelocityLimitReached BOOL Speed limit value reached (with torque control only)
= FALSE: Speed limit not reached
= TRUE: Speed limit reached

33
FHPP library for Siemens TIA Portal

StrokeLimitReached BOOL Stroke limit value reached/exceeded


= FALSE: Normal condition; stroke limit is not reached
= TRUE: Stroke limit was reached/exceeded
FunctionIsActive BOOL Feedback of the FUNC-Bit (only for CMMP-AS)
=TRUE: FUNC-Bit is activ
=FALSE: FUNC-Bit is not activ
ActualFunctionNumber INT Feedbackof the function number (only for CMMP-AS)
ActualFunctionGroup INT Feedbackof the function group (only for CMMP-AS)
RC1 BOOL 1. Record sequencing carried out
= FALSE: No step enabling condition was configured or
reached
= TRUE: The first step enabling condition was reached
RCC BOOL Record sequencing complete - valid as soon as MC is
present.
= FALSE: Record sequencing cancelled. At least one step
enabling condition has not been achieved.
= TRUE: Record sequence was processed to the end.
ActualRecordNo INT Record number (record selection only)
ActualPosition DINT Position in the position unit
(only direct application with positioning mode/ record
selection)
ActualVelocity DINT Speed in % of the base value
(only direct application with positioning mode/ record
selection)
ActualForce DINT Torque in % of the base value
(only direct application with force/torque mode)
ActualRotRamp DINT Speed ramp in % of the base value
(only direct application with speed mode)
ActualRotSpeed DINT Speed in speed unit
(only direct application with speed mode)

For the function block FHPP_CTRL, the monitoring and watch table of the same name is available. It
permits simple initial start-up.

34
Elements in the library

6.2.2 FHPP_PLUS
The module FHPP_PLUS permits data exchange of freely defined additional objects. The selection of these
objects is parameterised in the FCT, and transferred as a configuration entry to the transfer function block used.

Note
The data is transferred to the fieldbus in the parameter sizes 1 byte, 2 byte, 4 byte. Within the PLC, all
FHPP+ data is converted to the DINT data type.
Please note the positive/negative signs and value limits.

The availability of the FHPP+ data channel is device-dependent. See the device description for
further information.

Figure 6-9: Function block FHPP_PLUS

Inputs and outputs

Signal name Variable Data type Description


type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control and
parameterise a motor controller.
O_FHPPplus1..9 VAR_INPUT DINT FHPP+ output variables 1..9
I_FHPPplus1..9 VAR_OUTPUT DINT FHPP+ input variables 1..9

35
FHPP library for Siemens TIA Portal

6.3 FHPP_PARAMETER elements for parameterisation


6.3.1 Overview of parameter FBs (function blocks)
The table shows the existing parameter function blocks with the motor controllers that support them.

Parameter FB CMMO-ST EMCA-EC CMMP-AS CMMS-xx


FPC_DIAG X X X X
FPC_DIAG_BUFFER X X X X
FPC_DIPMP X X X X
FPC_FILE X X - -
FPC_DATA_OBJECT - - X X
FPC_MULTI X X X X
FPC_PNU X X X X

X = The motor controller supports the function block.


- = The function block cannot be used.

Note
The supply and disposal of the FPC data must be ensured by means of the function blocks from the
FHPP_DATA library folder.

For every function block FPC_xxx, a monitoring and force table is available.

6.3.2 FPC_DIAG - Read current error


The function block FPC_DIAG reads out the latest error registered in the motor controller.

Figure 6-10: Function block FPC_DIAG

Inputs and outputs

Signal name Variable Data type Description


type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to
control and parameterise a motor controller.
Execute VAR_INPUT BOOL Start transfer
FALSE -> TRUE: The current error is read via a rising
edge.
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Transfer is active (or has not been started)
= TRUE: Transfer is complete
Error VAR_OUTPUT BOOL Error
= FALSE: No error during transfer
= TRUE: Error during
MessageNumber VAR_OUTPUT INT Error number read; 0 if no error is active.
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

36
Elements in the library

6.3.3 FPC_DIAG_BUFFER - Reading diagnostic memory


The function block FPC_DIAG_BUFFER reads the diagnostic memory of the respective motor controller.

The parameters are stored in an "ARRAY[1..200]OF FHPP_PRM_DIAGMESSAGE".

Figure 6-11: Function block FPC_DIAG_BUFFER

The motor controllers have different diagnostic memory sizes:


CMMO-ST and EMCA-EC: 200 entries
CMMP-AS: 32 entries
CMMS-xx: 4 entries

Inputs and outputs

Signal name Variable type Data type Description


FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data
required to control and parameterise a
motor controller.
Execute VAR_INPUT BOOL Starts the function All messages are read
and transferred to the DiagBuff array
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Transfer is active (or has not
been started)
= TRUE: Transfer is complete
ValidEntries VAR_OUTPUT INT Display of the number of entries in the
diagnostic memory of the motor
controller
ParamNr VAR_OUTPUT INT Number of the parameter which is
currently being transferred
Error VAR_OUTPUT BOOL Error
= FALSE: No error during transfer
= TRUE: Error during
Status VAR_OUTPUT DT_FML_STATUS Feedback of error
DiagBuff VAR_OUTPUT ARRAY [1..200] OF Diagnostic buffer
DT_FML_PRM_DIAGMESSAGE The messages read are stored in the
diagnostic buffer (array).

Design of the field structure of the diagnostic buffer


DiagBuff ARRAY [1..200] OF FHPP_PRM_DIAGMESSAGE;
TYPE FHPP_PRM_DIAGMESSAGE :
STRUCT
DiagEvent : DINT; // Diagnostic event PNU 200
DiagMsgNumber : DINT; // Fault number PNU201
DiagTimeStamp: : DWORD; // Time stamp of diagnostic message
END_STRUCT
END_TYPE

37
FHPP library for Siemens TIA Portal

6.3.4 FPC_DIRMP - Dynamic FHPP parameters


The function block FPC_DIRMP writes or reads dynamic values for direct mode (position control).

Figure 6-12: Function block FPC_DIRMP

The function block transfers 3 parameters (sorted by PNU):

PNU Parameter
540.1 Basic velocity
541.1 Acceleration
542.1 Deceleration

Inputs and outputs

Signal name Variable Data type Description


type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control and
parameterise a motor controller.
Execute VAR_INPUT BOOL Start transfer
FALSE -> TRUE: With a rising edge, transfer of a parameter
is started
Write VAR_INPUT BOOL Read/write
= FALSE: Read parameter
= TRUE: Write parameter
Velocity VAR_INPUT DINT PNU 540.1: Basic velocity
Acceleration VAR_INPUT DINT PNU 541.1: Acceleration
Deceleration VAR_INPUT DINT PNU 542.1: Deceleration
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Transfer is active (or has not been started)
= TRUE: Transfer is complete
Error VAR_OUTPUT BOOL Error
= FALSE: No error during transfer of a parameter
= TRUE: Error during transfer of a parameter
ActVelocity VAR_OUTPUT DINT PNU 540.1: Current basic velocity
ActAcceleration VAR_OUTPUT DINT PNU 541.1: Current acceleration in direct mode
ActDeceleration VAR_OUTPUT DINT PNU 542.1: Current deceleration in direct mode
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

38
Elements in the library

6.3.5 FPC_FILE - Transfer parameter records


This function block can be used to save complete parameter records on the controller in a GlobalDB, and
accessed again from there.

For example, the function block can transfer all parameters to the new device if a device is replaced.

The function block FPC_FILE


o transfers a complete set of parameters from the motor controller to a GlobalDB on the controller via
"Upload",
o transfers a complete set of parameters to the motor controller from a GlobalDB on the controller via
"Download".

Note
The function block FPC_FILE is only supported by controller types CMMO-ST and EMCA-EC.

Functional description
o The function must be selected by setting one of the variables "Upload" or "Download" to "TRUE".
o The parameter records are stored in a pre-defined byte array in a GlobalDB on the controller.
o The byte array must be >= the size of the data expected.
o Every error interrupts the current transfer.
o Upload: If there is an error, the data already written is deleted again.
o Every message is monitored by timeout on transfer.
o The duration of the transfer depends on the bus cycle time and might take some time.

Figure 6-13: Function block FPC_FILE

Inputs and outputs

Signal Variable Data type Description


name type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to
control and parameterise a motor controller.
FILE_ARRAY VAR_IN_OUT ARRAY[1..n] of Byte array for storage of the data in a Global DB.
Byte The size of the array depends on the number of
device parameters.
Execute VAR_INPUT BOOL Start transfer
FALSE -> TRUE: The parameter transfer is started
by a rising edge
Upload (*) VAR_INPUT BOOL Parameter transfer from the motor controller to
the file.
A new file is created or overwritten.
Download (*) VAR_INPUT BOOL Parameter transfer from the file to the motor
controller.
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Parameter transfer is still active (or not
started).
= TRUE: Parameter transfer completed without
errors.
CountByte VAR_OUTPUT DINT Dynamic byte counter during parameter transfer

39
FHPP library for Siemens TIA Portal

FileSize VAR_OUTPUT DINT Size of the parameter file to be transferred.


Error VAR_OUTPUT BOOL Error
= FALSE: No error.
= TRUE: Error on transfer; see ErrHandle for
details.
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

Note (*): The "Upload" and "Download" signals must not be set simultaneously.

40
Elements in the library

6.3.6 FPC_MULTI Transfer of a list of device parameters


The function block FPC_MULTI transfers a list of parameters to the respective motor controller.

The parameters are transferred in an ARRAY[1..n] OF DT_FML_PRM_DESCRIPTION.

Figure 6-14: Function block FPC_MULTI

Inputs and outputs

Signal name Variable type Data type Description


FML_REF VAR_IN_OUT DT_FML_REF This data structure contains
all data required to control
and parameterise a motor
controller.
FML_PRM_DESCRIPTION_ARRAY VAR_IN_OUT VARIANT Array of the parameters to
be transferred.

Execute VAR_INPUT BOOL Start transfer


FALSE -> TRUE: With a rising
edge, transfer of a
parameter is started
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Transfer is active
(or has not been started)
= TRUE: Transfer is
complete
The result of the reading is
displayed as the Value in the
parameter field (array).
ParamNr VAR_OUTPUT INT Number of the parameter
which is currently being
transferred
Error VAR_OUTPUT BOOL Error
= FALSE: No error during
transfer of a parameter
= TRUE: Error during
transfer of a parameter
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

41
FHPP library for Siemens TIA Portal

Structure DT_FML_PRM_DESCRIPTION

Signal name Data type Description


PNU WORD Parameter number
SUBINDEX BYTE Sub-index
ACCESS BYTE Read access:
0 = PNU
Write access:
1 = PNU

VALUE DINT Parameter value

42
Elements in the library

6.3.7 FPC_DATA_OBJECT - Transfer of internal objects (expert)


The function block FPC_Data_Object allows access to internal objects of the motor controller.

Figure 6-15: Function block FPC_DATA_OBJECT

Inputs and outputs

Signal Variable Data type Description


name type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control and
parameterise a motor controller.
Execute VAR_INPUT BOOL Start transfer
FALSE->TRUE: With a rising edge, transfer of a parameter is
started
Write VAR_INPUT BOOL Read/write
= FALSE: Read parameter
= TRUE: Write parameter
Object (1) VAR_INPUT INT Number of the corresponding parameter
Value VAR_INPUT DINT Parameter value when writing a parameter
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Transfer is active (or has not been started)
= TRUE: Transfer is complete
Error VAR_OUTPUT BOOL Error
= FALSE: No error during transfer of a parameter
= TRUE: Error during transfer of a parameter
ActObject VAR_OUTPUT INT Current number of the corresponding parameter
ActSubindex VAR_OUTPUT BYTE Current subindex of the corresponding parameter
ActValue VAR_OUTPUT DINT Parameter value when reading a parameter
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

Table: FPC_DATA_OBJECT, inputs and outputs

Note (1):
The object parameters are not public. If necessary, please contact the Festo Service.

43
FHPP library for Siemens TIA Portal

6.3.8 FPC_PNU - Transfer of individual FHPP parameters


The function block FPC_PNU transfers an individual parameter to/from the motor controller.

Figure 6-16: Function block FPC_PNU

Inputs and outputs

Signal Variable Data type Description


name type
FML_REF VAR_IN_OUT DT_FML_REF This data structure contains all data required to control and
parameterise a motor controller.
Execute VAR_INPUT BOOL Start transfer
FALSE->TRUE: With a rising edge, transfer of a parameter is
started
Write VAR_INPUT BOOL Read/write
= FALSE: Read parameter
= TRUE: Write parameter
PNU VAR_INPUT INT Number of the corresponding parameter
Subindex VAR_INPUT INT Subindex of the corresponding parameter
Value VAR_INPUT DINT Parameter value when writing a parameter
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Transfer is active (or has not been started)
= TRUE: Transfer is complete
Error VAR_OUTPUT BOOL Error
= FALSE: No error during transfer of a parameter
= TRUE: Error during transfer of a parameter
ActPNU VAR_OUTPUT INT Current number of the corresponding parameter
ActSubindex VAR_OUTPUT INT Current subindex of the corresponding parameter
ActValue VAR_OUTPUT DINT Parameter value when reading a parameter
Status VAR_OUTPUT DT_FML_STATUS Feedback of error

Table: FPC_PNU, inputs and outputs

44
7 STATUS (reporting system element)
7.1 DT_FML_STATUS

Category Source
Variables Data type Description
Err Bool Error bit
Cat INT Category
ID DINT Number

7.2 Category

Category Source
1 Function block
2 Reserved
3 Parameter transfer (FPC)
4 Siemens

7.2.1 Category 1 - Function block error


Return code Level Description
16#0000_0000 Info No error
16#0000_0001 Info init active
16#0000_0002 Info function block busy
16#0000_000A Info other FPC function block is active
16#8000_0001 Error FHPP+ Data configuration is not valid
16#8000_0014 Error Timeout
16#8000_001E Error device type not valid
16#8000_001F Error data type variant not valid
16#8000_0028 Error wrong value for access (FPC_MULTI)
16#8000_0029 Error Byte array within DB file to small (FPC_FILE)

7.2.2 Category 2 reserved


Reserved for extensions

45
FHPP library for Siemens TIA Portal

7.2.3 Category 3 FPC error numbers


The ErrID indicates the error which occurred when transferring a device parameter. The number group of the
error is specified in the FHPP protocol under FPC (Festo Parameter Channel).

Error code Description

0 0x00 Invalid PNU


1 0x01 Parameter value cannot be altered
2 0x02 Lower or upper value limit exceeded
3 0x03 Faulty subindex
4 0x04 No array
5 0x05 Incorrect data type
6 0x06 Setting not permitted (can only be reset)
7 0x07 Description element cannot be modified
8 0x08 PPO-Write requested in IR does not exist
9 0x09 Description data do not exist
10 0x0A Access group incorrect
11 0x0B No supervising access
12 0x0C Incorrect password
13 0x0D Text not legible in cyclic exchange
14 0x0E Name not legible in cyclic exchange
15 0x0F Text array does not exist
16 0x10 PPO-Write missing
17 0x11 Task cannot be carried out due to operating status
18 0x12 Other errors
19 0x13 Data not legible in cyclic exchange
22 0x16 Unacceptable: attributes, number of elements, PNU or IND
24 0x18 Write Request: number of values not permitted
...100 ...0x64 reserved PROFIBUS
101 65 Festo: ReqID is not supported
102 66 Festo: Parameter is write-only (for passwords)
255 0xFF Reserved Festo

46
STATUS (reporting system element)

Extended error number group FPC_FILE


Error code Description

1001 0x3E9 Wrong sequence number


1002 0x3EA Timeout between two packets
1003 0x3EB Wrong packet format
1004 0x3EC False instruction
1005 0x3ED Read error
1006 0x3EE Write error
1007 0x3EF Data volume is not correct
1008 0x3F0 Parameter file error
1009 0x3F1 -- reserved
1010 0x3F2 Timeout
1011..1018 0x3F30x3FA -- reserved
1019 0x3FB No or double direction selected
1020 0x3FC -- reserved
1021 0x3FD Size of parameter file too short/long
1022 0x3FE Parameter file is not complete

7.2.4 Category 4 Siemens error numbers


In the event of processing problems, elements that use Siemens functions internally will also transfer their return
value to the library error structure. For a description of the errors, see the Siemens Help for the elements used.

ID Description
16#xxxx_8xxx Siemens return code of internal used function block
16#40xx_xx00 Siemens return code of internal used function block

47
8 Application examples
8.1 Controlling a Festo motor controller
In the example, the motor controller CMMP-AS is used with the function block FHPP_CTRL.

Figure 8-1: Function block FHPP_CTRL with partial connection

This function block allows control of a motor controller in the following four combinations of operating mode and
control mode:
o (0) Record selection
o (1) Direct mode with position control
o (5) Direct mode with force/torque control
o (9) Direct mode with speed adjustment

49
FHPP library for Siemens TIA Portal

The preset operating and control mode is only adopted when a movement is initiated, i.e. a rising
edge at the StartTask input.

8.1.1 Fundamental program structure


For correct program execution, the following sequence must be observed for the function block calls:

1. Read the fieldbus data, e.g. with FHPP_DPRD_DAT. The input data from the motor controller is
prepared in the FML_REF structure.
2. Calls the instance of the function block FHPP_CTRL. That controls the allocated motor controller.
3. Writes the fieldbus data, e.g. with FHPP_DPWR_DAT. The output data for the motor controller from
FML_REF are correctly assigned there.

8.1.2 Requirements for ready status


As a function of the motor controller used, additional input signals may be required there, e.g. a digital input.
Detailed information can be found in the description for the motor controller used.
o Motor controller is switched on
o Load voltage is present
o PLC has master control

Achieving ready status


Signals at the function block Feedback
-- SupplyVoltagePresent = TRUE
EnableDrive = TRUE DriveEnabled = TRUE
MC = TRUE
Stop = TRUE Ready = TRUE
Halt = TRUE HaltActive = TRUE

8.1.3 Carrying out homing


HomingValid = FALSE: Homing travel must be carried out.

Signals at the function block Feedback


StartHoming =TRUE AckStart = TRUE
(Edge FALSE -> TRUE) MC = FALSE
DriveIsMoving =TRUE
StartHoming = FALSE AckStart = FALSE
DriveIsMoving = FALSE
(homing complete) MC = TRUE
HomingValid = TRUE

50
Application examples

8.1.4 Setting and "Record selection" mode


Signals at the function block Feedback
OPM = 0 OPMString = 'Record mode selected'
StateOPMString = 'Record mode active'
StateOPM = 0
Specify record number --
RecordNo = n
StartTask = TRUE AckStart = TRUE
(Edge FALSE -> TRUE) MC = FALSE
DriveIsMoving = TRUE
ActualRecordNo = n
ActualPosition = ... (current position is displayed)
StartTask = FALSE AckStart = FALSE
-- DriveIsMoving = FALSE
(positioning complete) MC = TRUE

51
FHPP library for Siemens TIA Portal

8.1.5 Setting and operation of "Direct mode with position control"


Signals at the function block Feedback
OPM = 1 OPMString = 'Direct mode position control selected'
StateOPMString = 'Direct mode position control active'
StateOPM = 1
Specify speed 0..100%
SetValueVelocity = ...
Specify target position --
SetValuePosition = ... Note: Make sure to observe end positions.
StartTask = TRUE AckStart = TRUE
(Edge FALSE -> TRUE) MC = FALSE
DriveIsMoving = TRUE
ActualVelocity = ...
ActualPosition = ...
StartTask = FALSE AckStart = FALSE
-- DriveIsMoving = FALSE
(positioning complete) MC = TRUE

8.1.6 Setting and operating "Direct mode with force/torque control"


Signals at the function block Feedback
OPM = 5 OPMString = 'Direct mode force control selected'
StateOPMString = Text of the previous operating and control mode
StateOPM = Previous operating and control mode
SetValueForce = ... 0..100%
StartTask = TRUE StateOPMString = 'Direct mode force control active'
(Edge FALSE -> TRUE) StateOPM = 5
AckStart = TRUE
MC = FALSE
DriveIsMoving = TRUE
ActualForce = ...
ActualPosition = ...
StartTask = FALSE AckStart = FALSE
-- DriveIsMoving = FALSE
(Torque specification reached) MC = TRUE

52
Application examples

8.1.7 Setting and operating "Direct mode with speed control"


Signals at the function block Feedback
OPM = 9 OPMString = 'Direct mode velocity control selected'
StateOPMString = Text of the previous operating and control mode
StateOPM = Previous operating and control mode
SetValueRotRamp = ... --
SetValueRotSpeed = ... --
StartTask = TRUE StateOPMString = 'Direct mode velocity control active'
(Edge FALSE -> TRUE) StateOPM = 9
AckStart = TRUE
MC = FALSE
DriveIsMoving = TRUE
ActualRotRamp = ...
ActualRotSpeed = ...
StartTask = FALSE AckStart = FALSE
-- DriveIsMoving = FALSE
(Speed specification reached) MC = TRUE

53
FHPP library for Siemens TIA Portal

8.2 Parameterising a motor controller


In the example, the function block FPC_PNU is used for a motor controller CMMP-AS.

Figure 8-2: Function block FPC_PNU with partial connection

54
Application examples

This function block permits the parameterisation of the motor controller with individual parameters (FHPP PNU):

Note
For a description of the parameters supported per FHPP, see the respective User Documentation.

8.2.1 Fundamental program structure


For correct program execution, the following sequence must be observed cyclically for the function block calls:

1. Read the fieldbus data, e.g. with FHPP_DPRD_DAT. The input data from the motor controller is
prepared in the FML_REF structure.
-> The FPC_aktiv signal must be set to TRUE.
2. Calls the instance of the Parameter function block. This parameterises the assigned motor controller.
3. Writes the fieldbus data, e.g. with FHPP_DPWR_DAT. The output data for the motor controller from
FML_REF are correctly assigned there.

8.2.2 Requirements for ready status


o Motor controller is switched on
o PLC has master control

8.2.3 Reading parameters (e.g. homing method)


Signals at the function block Feedback
PNU = 1011 No feedback
Subindex = 1
Write = FALSE
Execute = TRUE Done = TRUE
(Edge FALSE -> TRUE) Err = FALSE
ErrStr = 'no Error'
ActPNU = 1011
ActSubindex = 1
ParamValueRD = ...
RETVAL = 0
Execute = FALSE Done = FALSE
Err = FALSE

8.2.4 Write parameters (e.g. acceleration for homing method)


Signals at the function block Feedback
PNU = 1013 No feedback
Subindex = 1
ParamValueWR = ...
Write = TRUE
Execute = TRUE Done = TRUE
(Edge FALSE -> TRUE) Err = FALSE
ErrStr = 'no Error'
ActPNU = 1013
ActSubindex = 1
ParamValueRD = ...
RETVAL = 0
Execute = FALSE Done = FALSE
Err = FALSE

The values written to the motor controller using the "FPC_PNU" function block are stored in a volatile memory
and only remain valid until the control voltage of 24 V at the motor controller is interrupted. The values can be
permanently transferred to a non-volatile memory by writing the value 1 to the PNU 127 subindex 2.
The following steps must be taken to permanently adopt written parameters:

55
FHPP library for Siemens TIA Portal

Signals at the function block Feedback


PNU = 127 No feedback
Subindex = 2
ParamValueWR = 1
Write = TRUE
Execute = TRUE Done = TRUE
(Edge FALSE -> TRUE) Err = FALSE
ErrStr = 'no Error'
ActPNU = 127
ActSubindex = 2
ParamValueRD = 1
RETVAL = 0
Execute = FALSE Done = FALSE
Err = FALSE

8.3 Compatibility to Siemens PLCs


The library is tested with the following Siemens PLCs:
- CPU 1217C DC/DC/DC; 6ES7 217-1AG40-0XB0; Firmware 4.1.3
- CPU 1518-4 PN/DP; 6ES7 518-4AP00-0AB0 Firmware 1.6
- CPU 315F-2 PN/DP; 315-2FJ14-0AB0 Firmware 3.2.11

56
9 Glossary

C
Controller: Control electronics that evaluate the control signals and provide the voltage supply for the
motor via the power electronics (power electronics + controller + positioning controller).

E
EDS file: Electronic data sheet which describes the functions and features of a CANopen device in
standardised form.

F
Festo Configuration Tool (FCT): Commissioning software with uniform project and data management for all
supported device types. The special requirements of a device type are supported with the necessary
descriptions and dialogues by means of plug-ins.
Festo Handling and Positioning Profile (FHPP): Uniform fieldbus data profile for positioning controllers
from Festo.
Festo Parameter Channel (FPC): FHPP-specific parameter channel version
FHPP: Uniform fieldbus data profile for positioning controllers from Festo (Festo Handling and Positioning
Profile)
FPC: FHPP-specific parameter channel version (Festo Parameter Channel)

G
GSD/GSG file: Profibus device description file
GSDML: Profinet device description file

I
IODD: IO-Link device description; device description file for IO-Link devices

P
Package: The package allows the installation of target system-specific files for controlling Festo CoDeSys
motor controllers. The program is located in the start menu under "Programs" in the option "CoDeSys
V3"
PDO: Process Data Object
PKE: Integral part of the parameter channel (PKW) which contains the task and reply identifiers (AK) and the
parameter number (PNU).
PKW: Telegram part used for transmitting parameters. PKW refers to a parameter identification value (see
also "Festo Parameter Channel (FPC)").
PNU: Parameters that can be transmitted via the parameter channel are addressed with the parameter
number (PNU). The parameter number is an integral part of the parameter identifier (PKE) and serves
for identifying or addressing the individual parameter.
Profile position mode: Operating mode for executing a position set or a direct positioning job.
Project zero point (PZ): Measuring reference point for all positions in positioning jobs. The project zero
point forms the basis for all absolute position specifications (e.g. in the position set table or with direct
control via the control interface or diagnostic interface). The point of reference for the project zero
point is the axis zero point. With the MTR-DCI, the project zero point PZ and the axis zero point AZ are
identical.

57
FHPP library for Siemens TIA Portal

R
Homing: Homing defines the reference position and thereby the origin of the measuring reference system of
an axis.
Referencing method: Method for determination of the reference position: against a fixed stop (over-
current/speed evaluation) or with reference switch.
Reference point (REF): Point of reference for the incremental measuring system. The reference point defines
a known orientation or position within the travel distance of the drive.

S
Sub-index (IND): Integral part of the parameter channel (PKW) which addresses an element of an array
parameter (sub-parameter number).

T
Teach mode: Operating mode for setting positions by moving to the target position, e.g. when creating
position sets.
Jog operation: Manual travel in a positive or negative direction

X
XML: EtherCAT XML file; device description file for EtherCAT devices

58
Copyright:
Festo AG & Co. KG
Postfach
73726 Esslingen
Germany

Phone:
+49 711 347-0

Fax:
+49 711 347-2144

E-mail:
service_international@festo.com
Reproduction, distribution or sale of this document or communication
Internet:
of its contents to others without express authorization is
www.festo.com
prohibited. Offenders will be liable for damages. All rights reserved
in the event that a patent, utility model or design patent is
registered. Original: de

59

Das könnte Ihnen auch gefallen