Professional Documents
Culture Documents
www.festo.com
Library for
Festo Motion_FHPP_3 library motor controllers with FHPP
(CODESYS V3.5 and TwinCat 3)
10.03.2020
Table of Contents
1 Important instructions................................................................................................................................... 1
1.1 Designated use ................................................................................................................................... 1
1.2 Safety instructions .............................................................................................................................. 2
1.3 Danger categories ............................................................................................................................... 2
1.4 Marking special information ............................................................................................................... 3
2 Overview ........................................................................................................................................................ 5
2.1 General Information ............................................................................................................................ 5
2.2 Requirements ..................................................................................................................................... 5
2.3 General information on Festo motor controllers .................................................................................. 6
2.4 Festo Handling and Positioning Profile (FHPP) .................................................................................... 7
2.4.1 FHPP+..................................................................................................................................... 8
2.5 FHPP Operating modes ....................................................................................................................... 8
2.6 Function blocks for Festo motor controllers ........................................................................................ 9
2.7 Basic program structure ...................................................................................................................... 9
3
Printed Documentation
8 Examples ..................................................................................................................................................... 67
8.1 Controlling a Festo motor controller .................................................................................................. 67
8.1.1 Basic program structure ....................................................................................................... 68
8.1.2 Prerequisites for ready status............................................................................................... 68
8.1.3 Establishing the ready state ................................................................................................. 68
8.1.4 Homing ................................................................................................................................ 68
8.1.5 Setting and operation of "Record selection" ........................................................................ 68
8.1.6 Setting and operation of "Direct mode position control" ..................................................... 69
8.1.7 Setting and operation of "Direct mode force / torque control" ............................................ 69
8.1.8 Setting and operation of "Direct mode speed control" ......................................................... 70
8.2 Parameterising a Festo motor controller ........................................................................................... 71
8.2.1 Basic program structure ....................................................................................................... 71
8.2.2 Prerequisites for communication .......................................................................................... 71
8.2.3 Reading parameters ............................................................................................................. 72
8.2.4 Writing parameters............................................................................................................... 72
9 Glossary ...................................................................................................................................................... 73
10 Index ................................................................................................................................................ 75
4
1 Important instructions
1.1 Designated use
The function blocks (FB) of the Festo Motion_FHPP_3 library are used to control and parameterise
o the CMMD-AS-C8-3A double motor controller,
o the CMMO-ST-C5-1-LKP motor controller,
o the CMMP-AS motor controller family,
o the CMMS-AS motor controller,
o the CMMS-ST motor controller,
o the CMXH-ST motor controller family,
o the SFC-DC motorcontroller family,
o the EMCA-EC motor unit,
o and the MTR-DCI motor unit.
You can use them to conveniently integrate the many functions of the device into your CODESYS control
program. Function blocks are integrated into the user program for each motor unit or motor controller (each axis)
and called cyclically using a separate instance. Simultaneous use of other function blocks for controlling the
same device is not permitted.
Read the "Safety instructions" and instructions on the designated use of the relevant devices, components and
modules. If additional commercially available components such as sensors and actuators are connected, the
specified limits for pressures, temperatures, electrical data, torques, etc. must not be exceeded.
Target group
This manual is intended exclusively for technicians trained in control and automation technology, who have
experience in installation, commissioning, programming and diagnostics of positioning systems and the relevant
fieldbuses.
Service
If you have a technical problem, please contact your local Festo service partner or use the respective contact
form at the following website.
www.festo.com/contact
1
Printed Documentation
Warning
Pneumatic and electric axes can move with high force and at high speed. Collisions can lead to serious
injury to people and damage to components.
• 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
still connected to a power supply.
Warning
Parameterisation errors can cause injury to people and damage to property.
• Only enable the controller if the axis system has been installed and parameterised by
technically qualified staff.
Warning
... means that serious injury to people and damage to property can occur if this warning is not
observed.
Caution
... means that injury to people and damage to property can occur if this warning is not observed.
Note
... means that damage to property can occur if this warning is not observed.
You can find information on how special information is represented under "Marking special information".
2
Important instructions
Text markings
1. Figures denote activities that must be carried out in the order specified.
• Bullets denote activities that may be carried out in any desired order.
o denote general listings.
Further conventions
[Project | New] Menu items are framed in square brackets, for example the [New] command in the [Project]
menu opens a new project.
"OK" The names of windows, dialogs and buttons, e.g. "Message window," "Dearchivate project,"
"OK" as well as designations are displayed in inverted commas.
CTRL Names of keys on the PC keyboard are represented in the text with uppercase letters
(e.g. ENTER KEY, CTRL, C, F1 etc.).
CTRL+C For some functions you need to press two keys simultaneously. For example, press and hold
down the CTRL key and also press the C key. This is written in the text as CTRL+C.
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.
3
2 Overview
2.1 General Information
The "Festo_Motion_FHPP_3.library" is a library for CODESYS V3 provided by Festo. The following Festo motor
controllers can be controlled with this library:
oCMMD-AS-C8-3A double motor controller,
oCMMO-ST-C5-1-LKP motor controller,
oCMMP-AS motor controller family,
oCMMS-AS and CMMS-ST motor controller families,
oCMXH-ST motor controller family,
oSFC-DC motor controller family,
oEMCA-EC motor unit,
oMTR-DCI motor unit.
Communication takes place via the specific fieldbus communication protocol.
Actuation of the Festo motor controllers takes place via the Festo Handling and Positioning Profile (FHPP).
The library contains function blocks for controlling and parameterising the individual drives.
Refer to the documentation for the motor controller for further information on operating and configuring the
relevant motor controller type.
Architecture
Each motor controller is integrated into the CODESYS project using a controller-specific hardware configuration.
o All function blocks that access I/O data directly to control a motor controller requires a copy of the
input data and output data as transit variables.
o All function blocks that access I/O data directly to parameterise a motor controller requires a copy of
the input data and output data of the Festo Parameter Channel (FPC) as transit variables.
An instance of the function blocks for control must be generated for each motor controller instance.
2.2 Requirements
During installation of CODESYS V3 provided by Festo, the supplied device files are installed
automatically and stored in the device repository
Device files that are not supplied can be installed via the standard CODESYS dialog "Device
Repository".
Please add the "Festo_Motion_FHPP_3.library" to the package "CODESYS provided by Festo" with the Library
manager tool.
For adding a CODESYS library to a project, you will find information in the general CODESYS help at
item "Library Manager".
5
Printed Documentation
Note
Always read the information and safety instructions contained in this documentation.
6
Overview
Parameter channel
The controller can access all parameter values of the controller by means of the parameter channel. A further 8
bytes of I/O data are used for this purpose.
The function blocks for parameter transfer are described in a separate chapter.
7
Printed Documentation
2.4.1 FHPP+
FHPP+ allows a cyclic exchange of parameters between the motor controller and the PLC. Therefore up to
additional 24 bytes are defined in the I/O section of the device.
FHPP is only supported by the motor controller families CMMP-AS and EMCA-EC!
Direct application
In direct application operating mode, the important data is transferred directly via the control bytes.
o Target positions and velocities can be ascertained and specified by the controller during runtime,
depending on the operating status.
o No limitations due to the number of saved positioning records.
In direct mode values can be taught/parameterised via the PLC.
The following direct mode types can be selected:
o Direct application - position mode
o Direct application -force/torque mode
o Direct application - velocity mode
8
Overview
The library namespace for the Festo Motion_FHPP_3 library is "FML". This prefix is used to have a
worldwide unique name for a specific function block.
The prefix is placed before the function block name, separated by a dot.
1. Instance of FML_Read Preparing the incoming data from the motor controller
2. Instance of FHPP_CTRL Function block for control the motor controller
If required: Instances of FPC_xxx Some parameter FBs
3. Instance of FML_Write Prepare the outgoing data to the motor controller
9
3 FML_READ: Prepare the input data
3.1 FML_Read: Functional description
The function block FML_Read prepares the raw data from the motor controller and stores them in normalized
form in a data structure of type DT_FML_REF for the control FB and the parameters FBs.
o Normalising big / little endian fieldbus data.
o Normalising the special data format of Modbus/TCP.
Note
This FB must be called before the execution of the control and parameter FBs!
11
Printed Documentation
Remark (1): If FHPP+ is used (FHPP_PLUS_active := TRUE) this values must be set See "Normalising of FHPP+
objects".
12
FML_READ: Prepare the input data
13
Printed Documentation
Note
This FB must be called before the execution of the control and parameter FBs!
FHPP_Source VAR_INPUT ARRAY [0..15] OF Copy of the control input data for 2 axis (from motor
BYTE controller)
FPC_Source VAR_INPUT ARRAY [0..7] OF BYTE Copy of the parameter-input data (from motor controller)
Error VAR_OUTPUT BOOL Status and error messages, see chapter "Status and
error messages"
= FALSE: No error detected
= TRUE: Error detected with more information in Status
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status and
error messages".
14
FML_READ: Prepare the input data
Some components of this structure must be known and used by the customer, especially when
FHPP+ is used.
15
Printed Documentation
Figure: CANopen I/O mapping with control array FHPP_IN and parameter array FPC_IN
16
FML_READ: Prepare the input data
The following figure shows the data passing to the FML_Read function block:
Figure: Passing the data to the FML_Read function block (FUP editor)
The raw fieldbus data need special attention to the specific byte / word arrangement.
Typical values for CANopen are (for Festo controllers CECC and CPX-CEC):
o Modbus := FALSE;
o HighByteFirst := FALSE;
17
Printed Documentation
Note
The master must be implemented according to the IO-Link specification 1.1! A matching IODD device
description file can be found in the Festo Support Portal.
The following figures show an example of the device configuration with an IO-Link master.
Figure: IO-Link I/O mapping with control array FHPP_IN and parameter array FPC_IN
18
FML_READ: Prepare the input data
The following figure shows the data passing to the FML_Read function block:
Figure: Passing the data to the FML_Read function block (FUP editor)
The raw fieldbus data need special attention to the specific byte / word arrangement.
Typical values for IO-Link are (for Festo controllers CECC and CPX-CEC):
o Modbus := FALSE;
o HighByteFirst := FALSE;
19
Printed Documentation
Note
Not all devices support Modbus / TCP. The operating instructions of the motor controller must be
checked before use.
The following figures show an example of the device configuration with a Modbus/TCP Master.
Necessary actions:
20
FML_READ: Prepare the input data
Figure: Modbus/TCP I/O mapping with control array FHPP_IN and parameter array FPC_IN
21
Printed Documentation
The following figure shows the data passing to the FML_Read function block:
Figure: Passing the data to the FML_Read function block (FUP editor)
The raw fieldbus data need special attention to the specific byte / word arrangement.
Typical values for Modbus/TCP are (for Festo controllers CECC and CPX-CEC):
o Modbus := TRUE;
o HighByteFirst := TRUE;
22
FML_READ: Prepare the input data
Note
Not all devices support FHPP+. The operating instructions of the motor controller must be checked
before use.
Each object has up to 4 byte (32 bit) width and must be adapted to the fieldbus transfer specialities:
o Big- or little endian for objects with 2 or 4 byte width.
o The Modbus/TCP special word alignment.
The FML_Read function block normalises the FHPP+ objects transferred from the motor controller to
the PLC.
The transferred FHPP+ objects are described with the PlcConfigFHPP_PLUS_IN variable. Each digit represents the
width of an FHPP+ object.
o 1 stands for an object with 8 bit width,
o 2 stands for an object with 16 bit width,
o 4 stands for an object with 32 bit width.
All other digits are not used!
Up to 10 FHPP+ objects with different sizes may be transferred. The objects are arranged in 8-byte packages. Up
to 3 FHPP+ packages are possible.
The access to the FHPP+ objects is described below.
In the example "Control Data" and "Parameter Channel" are used, therefore 16 byte are available for FHPP+. The
FHPP+ objects size is given right of "PLC Configuration".
The "PLC Configuration" must be assigned to PlcConfigFHPP_PLUS_IN := 44224.
The meaning of the digits from left to right:
o 4 = 32 bit object (FHPP+ object 1)
o 4 = 32 bit object (FHPP+ object 2)
o 2 = 16 bit object (FHPP+ object 3)
o 2 = 16 bit place holder
o 4 = 32 bit place holder
Therefore 2 FHPP+ packets are used.
23
Printed Documentation
24
FML_READ: Prepare the input data
The assignment to the FML_Read input variables is shown in the following figure:
Figure: Assignment of the input variables to the FML_Read type function block in a FDB-type POU
25
4 FHPP_CTRL - Control function block
4.1 FHPP_CTRL: Functional description
The FHPP_CTRL function block is used to control a Festo motor controller. The input and output variables resides
in the DT_FML_REF structure.
Note
The associated FML_Read instance must be called before a call to the FHPP_CTRL instance, because
FML_Read prepares the input data from the motor controller.
After the FHPP_CTRL execution the associated FML_Write instance must be called to prepare the
output data for the motor controller in the correct format for fieldbus transfer.
27
Printed Documentation
28
FHPP_CTRL - Control function block
Remark (1): This input variables are working only with the CMMP-AS family.
29
Printed Documentation
30
FHPP_CTRL - Control function block
31
Printed Documentation
Note
The associated FML_Read_CMXH instance must be called before a call to the FHPP_CTRL_CMXH
instance, because FML_Read_CMXH prepares the input data from the motor controller.
After the FHPP_CTRL_CMXH execution the associated FML_Write_CMXH instance must be called to
prepare the output data for the motor controller in the correct format for fieldbus transfer.
Note
The FHPP_CTRL_CMXH function block supports the CMXH-ST motor controller only!
32
FHPP_CTRL - Control function block
33
Printed Documentation
34
FHPP_CTRL - Control function block
35
5 Parameterisation function blocks
5.1 Parameterisation function blocks: Overview
The table shows the existing parameterisation FBs with the motor controllers that they support.
X = The motor controller supports the function block with CODESYS 3.5 and TwinCAT 3.
(X) = the function block is only present in the CODESYS 3.5 library (not in the TwinCAT 3 version).
- = The function block is not usable with this motor controller.
Note
The associated FML_Read(1) instance must be called before a call to the FPC_xxx instance, because
FML_Read prepares the input data from the motor controller. The FPC_active input of this FB must be
set to TRUE.
After the FPC_xxx execution the associated FML_Write(1) instance must be called to prepare the
output data for the motor controller in the correct format for fieldbus transfer.
Remark (1): The special modules FML_Read_CMXH and FML_Write_CMXH must be used for the CMXH-
ST motor controller!
37
Printed Documentation
Error VAR_OUTPUT BOOL Status and error messages, see chapter "Status
and error messages"
= FALSE: No error detected
= TRUE: Error detected with more information in
Status
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status
and error messages".
MessageNumber VAR_OUTPUT INT Received message number.
If MessageNumber = 0, no error is present.
MessageDescription VAR_OUTPUT STRING Related error description ("--" if no error)
38
Parameterisation function blocks
The diagnosis buffer size differs for the motor controller types:
• CMMO-ST, CMXH-ST and EMCA-EC: 200 entries
• CMMP-AS: 32 entries
• SFC-DC and MTR-DCI: 16 entries
• CMMS-xx and CMMD-AS: 4 entries
39
Printed Documentation
40
Parameterisation function blocks
PNU Parameter
540.1 Basic velocity
541.1 Acceleration
542.1 deceleration
FML_REF VAR_IN_OUT DT_FML_REF This data structure holds all necessary data to control and
parameterise a motor controller.
Execute VAR_INPUT BOOL Starts the transfer with a rising edge (FALSE -> TRUE).
The parameters are transferred in the given order
Write VAR_INPUT BOOL Read or write
= FALSE: Read the parameters from motor controller
= TRUE: Write the parameters to the motor controller
Velocity VAR_INPUT DINT PNU 540.1: Basic velocity (only for Write)
Acceleration VAR_INPUT DINT PNU 541.1: Acceleration (only for Write)
Deceleration VAR_INPUT DINT PNU 542.1: deceleration (only for Write)
Done VAR_OUTPUT BOOL Transfer status
= FALSE: Transfer is active (or not started yet)
= TRUE: Transfer has finished
Error VAR_OUTPUT BOOL Status and error messages, see chapter "Status and error
messages"
= FALSE: No error detected
= TRUE: Error detected with more information in Status
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status and error
messages".
ActVelocity VAR_OUTPUT DINT PNU 540.1: Actual Basic velocity
ActAcceleration VAR_OUTPUT DINT PNU 541.1: Actual acceleration
ActDecceleration VAR_OUTPUT DINT PNU 542.1: Actual deceleration
41
Printed Documentation
Note
The FPC_FILE function block is only usable with the CMMO-ST and EMCA-EC controller type!
The function block is only present in the CODESYS 3.5 library (not for TwinCAT 3)!
Functional description
o The transfer direction is selected with the "Upload" or "Download" input to "TRUE" state.
o The parameter set are stored in a fix named folder of the PLC file system.
o For CMMO-ST: Folder name = "CMMOparameter".
o For EMCA-EC: Folder name = "EMCAparameter"
o "Upload" will overwrite a file with the given name in "FileName" when it exists.
o A communication error will abort a transfer immediately.
o At an error during Upload the related file is deleted.
o Each transfer unit is monitored by a time-out.
o The overall transfer may use a couple of minutes!
42
Parameterisation function blocks
Error VAR_OUTPUT BOOL Status and error messages, see chapter "Status and
error messages"
= FALSE: No error detected
= TRUE: Error detected with more information in
Status
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status and
error messages".
CountByte VAR_OUTPUT DINT Shows the current byte counter during an active
transfer
FileSize VAR_OUTPUT DINT Size of the whole parameter set (also file size).
Remark (1): Please document the used file names safely to remember it for a later Download!
Remark (2): Only one of the both signals "Upload" or "Download" should be set!
43
Printed Documentation
Note
The FPC_FILE_ARRAY function block is only usable with the CMMO-ST and EMCA-EC controller type!
Recommended size of the byte array: approx. 24000 bytes ( <Name>: ARRAY [0..24000]
OF BYTE; ).
Functional description
o The transfer direction is selected with the "Upload" or "Download" input to "TRUE" state.
o The parameter set is stored in a declared byte array.
o If the byte array holds a parameter set, an "Upload" will overwrite it.
o A communication error will abort a transfer immediately.
o Each transfer unit is monitored by a time-out.
o The overall transfer may use a couple of minutes!
44
Parameterisation function blocks
Error VAR_OUTPUT BOOL Status and error messages, see chapter "Status and error
messages"
= FALSE: No error detected
= TRUE: Error detected with more information in Status
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status and error
messages".
CountByte VAR_OUTPUT DINT Shows the current byte counter during an active transfer
FileSize VAR_OUTPUT DINT Size of the whole parameter set (also used bytes in the
byte array).
Remark (1): Only one of the both signals "Upload" or "Download" should be set!
45
Printed Documentation
46
Parameterisation function blocks
The example writes to the "Target Value" (PNU=404) of the records 2..6 in the record table.
47
Printed Documentation
Note
The FPC_DATA_OBJECT function block is only usable with the CMMD-AS, the CMMP-AS and the
CMMS-AS/-ST controller types!
Note
The device specific objects are not published! If required, please contact the Festo Service.
Error VAR_OUTPUT BOOL Status and error messages, see chapter "Status and error
messages"
= FALSE: No error detected
= TRUE: Error detected with more information in Status
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status and error
messages".
ActObject VAR_OUTPUT INT Number of the actual transferred device specific object
ActSubindex VAR_OUTPUT INT Subindex of the actual transferred device specific object
ActValue VAR_OUTPUT DINT Object value in case of "Read"
Remark 1:
The device specific objects are not published! If required, please contact the Festo Service.
48
Parameterisation function blocks
Error VAR_OUTPUT BOOL Status and error messages, see chapter "Status and error
messages"
= FALSE: No error detected
= TRUE: Error detected with more information in Status
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status and error
messages".
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
49
Printed Documentation
The both FML_Read and FML_Write FBs uses the status and error system in a similar way.
At FB execution and at data transfer between the PLC and the motor controller many faults may occur. These are
signalled in a couple of two output variables:
Note
If Error = TRUE: a fault is active. Additional information is stored in the Status structure (see chapter
"Fault messages").
If Error = FALSE: The Status structure may hold a FB status information (see chapter "Status
Information").
If DONE = TRUE and Error = FALSE then the function block has finished correctly.
Structure Data
Content
component Type
TRUE: a fault is active, additional Information is given in the other three structure
components.
Err BOOL
FALSE: No fault is active.
The state of the Err component will be copied to the Error output variable!
Category to identify the source of the fault (or FB status)
0: No fault and no status is active - all things runs well.
Cat DINT 1: The function block has a fault detected or there is a status information present.
2: Reserved
3: The function block has detected a transmission fault (FPC).
ID DINT Fault or status number (see Tables below)
Msg STRING An fault description, related to the ID structure component
50
Parameterisation function blocks
51
Printed Documentation
52
6 FML_Write: Prepare the output data
6.1 FML_Write: Functional description
The FML_Write function block prepares the output data for the motor controller and transfers it. Data preparing
consist of:
o Byte arrangement for big / little endian transfer via fieldbus,
o Special word arrangement if Modbus/TCP is used.
Note
The related instance of this FB must be called after execution of the control FB and the
parameterisation FBs!
53
Printed Documentation
Note
The related instance of this FB must be called after execution of the control FB and the
parameterisation FBs!
Status VAR_OUTPUT DT_FML_STATUS Status and error messages, see chapter "Status and error
messages".
54
FML_Write: Prepare the output data
Figure: CANOpen I/O mapping with control array FHPP_OUT and parameter array FPC_OUT
The following figure shows the data passing to the FML_Write function block:
Figure: Passing the data to the FML_Read function block (FUP editor)
55
Printed Documentation
The following figure shows the data passing to the FML_Write function block:
Figure: Passing the data to the FML_Read function block (FUP editor)
56
FML_Write: Prepare the output data
The following figure shows the data passing to the FML_Write function block:
Figure: Passing the data to the FML_Read function block (FUP editor)
57
Printed Documentation
Note
Not all devices support FHPP+. The operating instructions of the motor controller must be checked
before use.
Each object has up to 4 byte (32 bit) width and must be adapted to the fieldbus transfer specialities:
o Big- or little endian for objects with 2 or 4 byte width.
o The Modbus/TCP special word alignment.
The FML_Write function block prepares the FHPP+ objects for the transmission to the motor
controller.
The transferred FHPP+ objects are described with the PlcConfigFHPP_PLUS_OUT variable. Each digit represents
the width of an FHPP+ object.
o 1 stands for an object with 8 bit width,
o 2 stands for an object with 16 bit width,
o 4 stands for an object with 32 bit width.
All other digits are not used!
Up to 10 FHPP+ objects with different sizes may be transferred. The objects are arranged in 8-byte packages. Up
to 3 FHPP+ packages are possible.
The access to the FHPP+ objects is described below.
In the example "Control Data" and "Parameter Channel" are used, therefore 16 byte are available for FHPP+. The
FHPP+ objects size is given right of "PLC Configuration".
The "PLC Configuration" must be assigned to PlcConfigFHPP_PLUS_OUT := 44224.
The meaning of the digits from left to right:
o 4 = 32 bit object (FHPP+ object 1)
o 4 = 32 bit object (FHPP+ object 2)
o 2 = 16 bit object (FHPP+ object 3)
o 2 = 16 bit place holder
o 4 = 32 bit place holder
58
FML_Write: Prepare the output data
Figure: Assignment of the variables to the FML_Write type function block in a FDB-type POU
59
Printed Documentation
60
7 Visualising function blocks
7.1 Visualisation: Overview
The table shows all present function blocks with its associated visualisation.
Refer to the "Visualisation" section in the general CODESYS Help for information on how to create a
visualisation object.
61
Printed Documentation
Control: The input data of a function block linked to the visualisation is displayed in the left half of the
visualisation.
o Active boolean input data is shown with an orange square.
o The input fields may be used for input of numeric values.
Display: The output of a function block linked to the visualisation is displayed in the right half of the
visualisation.
o Active boolean input data is shown with a green square.
o The active Fault and Warning-LEDs shows a red coloured square.
o Numeric values are typically shown in the right of the corresponding set value.
Data elements which are not used for the active operating mode are shown with different colours:
o A blue coloured signal is used for the active function.
o A light gray coloured signal is therefore not used.
62
Visualising function blocks
The desired visualization element appears in the editing window of the visualization.
Hints for creating a visualization object can be found in the general CODESYS help in the chapter
"Visualization".
Refer to the "Visualisation" section in the general CODESYS Help for information on how to create a
visualisation object.
1. Adjust the size and position of the visualisation element if necessary. To do this, click on the element
and use the borders.
2. For configuration, click on the visualisation element with the left mouse button. In the "Property" area
of the editing window (➔ [View] [Element Properties]) you can make various settings for displaying and
linking the visualisation element.
3. Click in the edit field of the "Object" "m_Input_INST" and then on the button for opening the "Input
Assistant" window.
4. Link the visualisation element with the corresponding instance (name of axis).
There are two options here:
o In the line "m_Input_INST", enter the name of the function block in combination with the higher-level
program name.
o Double-click in the input line using the mouse. Using the left mouse button, click on the button that is
now displayed in the line at right. The "Input Assistant" window opens, where you can select the
corresponding instance. Confirm the selection with "OK."
63
Printed Documentation
Control: The input data of a function block linked to the visualisation is displayed in the left half of the
visualisation.
o Active boolean input data is shown with an orange square.
o The input fields may be used for input of numeric values.
Display: The output of a function block linked to the visualisation is displayed in the right half of the
visualisation.
o Active boolean input data is shown with a green square.
o The active Error-LED shows a red coloured square.
o Numeric values are typically shown in the right of the corresponding set value.
o The Status structure elements are shown in the lower right corner:
• Status.Cat as the "Status Category" value,
• Status.ID as the "Status ID" value,
• Status.Msg as an textual fault description in the last line.
The desired visualization element appears in the editing window of the visualization.
Hints for creating a visualization object can be found in the general CODESYS help in the chapter
"Visualization".
64
Visualising function blocks
Refer to the section "Visualisation" in the general CODESYS Help for information on how to create a
visualisation object.
1. Adjust the size and position of the visualisation element if necessary. To do this, click on the element
and use the borders.
2. For configuration, click on the visualisation element with the left mouse button. In the "Property" area
of the editing window (➔ [View] [Element Properties]) you can make various settings for displaying and
linking the visualisation element.
3. Click in the edit field of the "Object" "m_Input_INST" and then on the button for opening the "Input
Assistant" window.
4. Link the visualisation element with the corresponding instance (name of axis).
There are two options here:
o In the line "m_Input_INST", enter the name of the function block in combination with the higher-level
program name.
o Double-click in the input line using the mouse. Using the left mouse button, click on the button that is
now displayed in the line at right. The "Input Assistant" window opens, where you can select the
corresponding instance. Confirm the selection with "OK."
65
8 Examples
8.1 Controlling a Festo motor controller
This example uses the motor controller CMMO-ST with the corresponding function block FHPP_CTRL.
With this function block, the motor controller CMMO-ST can be controlled using the following four operating and
control mode combinations:
o Record selection
o Direct mode position control
o Direct mode torque control
o Direct mode speed control
The set operating and control mode is only accepted and displayed with the start of a movement, i.e.
with a rising edge at the "StartTask" input.
67
Printed Documentation
1. Calling the FML_READ instance. There, the input data of the motor controller are prepared
in the structure FML_REF.
2. Calling the FHPP_CTRL instance. This controls the assigned motor controller.
3. Calling the FML_WRITE. instace. There, the output data to the motor controller from
FML_REF are correctly arranged.
8.1.4 Homing
User action Feedback
StartHoming = FALSE -> TRUE AckStart = TRUE
MC = FALSE
DriveIsMoving = TRUE
HaltActive = TRUE
-- DriveIsMoving = FALSE,
MC = TRUE, DriveIsReferenced = TRUE, HaltActive = TRUE (homing
completed)
68
Examples
69
Printed Documentation
70
Examples
Note
For a description of the parameters supported by the various motor controllers according to FHPP,
please refer to the respective product documentation.
1. Calling the FML_READ instance. There, the input data of the motor controller are prepared
in the structure FML_REF.
2. Calling the FHPP_CTRL instance. This controls the assigned motor controller.
3. Calling the FML_WRITE. instace. There, the output data to the motor controller from
FML_REF are correctly arranged.
71
Printed Documentation
The values written to the motor controller with the function block ..._PRM_SINGLE are stored in a volatile
memory and are valid until the control voltage of 24 V at the motor controller is interrupted.
In a non-volatile memory, the values can be assumed permanently by describing PNU 127 Subindex 2 with the
value 1.
The following actions must be performed in order for the described parameters to be assumed permanently:
72
9 Glossary
C
Consistency: A data range, which is defined as consistent, is transmitted complete, i.e. in a bus cycle.
D
Device: Device is a synonym for a Festo motor 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 by means of plug-ins
with the necessary descriptions and dialogs.
Festo Handling and Positioning Profile (FHPP): Uniform field bus 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.
FPC: FHPP-specific parameter PKW version (Festo Parameter Channel).
H
Homing: Homing defines the reference position and thereby the origin of the measuring reference system of
an axis.
Homing method: Method for defining the reference position.
J
Jog mode: Manual movement in positive or negative direction.
N
Node ID: Used for unique identification of a bus station.
73
Printed Documentation
P
Package: The package allows the installation of target system-specific files for the control of Festo
CODESYS motor controllers. The program can be found in the Start menu under "Programs" in the
selection "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 which 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.
Position record: Positioning command defined in the record table, consisting of target position, positioning
mode, positioning speed and accelerations.
Profile position mode: Operating mode for processing a position record or a direct positioning task.
Project zero point (PZ): Measuring reference point for all positions in positioning tasks. The project zero
point forms the basis for all absolute position specifications (e.g. in the record table or with direct
control via the control interface or diagnostic interface). The basis point for the project zero point is the
axis zero point.
R
Reference point (REF): Basis point for the incremental measuring system. The reference point defines a
known orientation or position within the positioning path of the drive.
S
Subindex (IND): Integral part of the parameter channel (PKW) which addresses an element of an array
parameter (subparameter number).
T
Teach mode: Operating mode for setting positions by moving to the target position e.g. when creating
position sets.
74
Index
10 Index
B FPC ...........................................5, 14, 20, 23, 48, 61
big / little endian ........................................... 11, 53
I
C Input Variables .................................. 12, 14, 23, 28
CANopen.....................................5, 6, 16, 23, 55, 61
L
CMMD-AS .................................................... 5, 6, 33
Library Manager .............................. 5, 6, 11, 27, 45
CMMP-AS......................................... 5, 6, 33, 35, 45
CMMS-AS..................................................... 5, 6, 33 M
CMMS-ST ..................................................... 5, 6, 33 Modbus .......... 11, 12, 14, 16, 18, 20, 23, 53, 59, 61
Configuration5, 7, 12, 16, 18, 20, 23, 48, 54, 55, 57, N
59, 61, 66, 69
Namespace ...................................................... 5, 10
D
O
DeviceType .............................12, 14, 16, 18, 20, 23
Operating mode......................................... 8, 28, 66
Direct application ............................................ 8, 28
OPM .............................................................. 28, 71
DT_FML_REF .. 11, 12, 14, 23, 27, 28, 34, 35, 37, 39,
41, 43, 45, 47, 54, 55, 57, 59, 61 Output Variables ............................... 14, 27, 28, 48
E P
EMCA-EC .................................................... 5, 33, 35 Parameter Channel ................................ 5, 8, 23, 61
Error messages .................................................... 48 PLC ................... 8, 12, 23, 28, 39, 48, 54, 61, 71, 75
PNU ..................................14, 35, 37, 43, 47, 48, 75
F Position mode ................................................. 8, 28
FCT ...................................................... 7, 12, 28, 54
Positioning Profile ................................................. 8
Festo Configuration Tool .................................... 7, 8
FHPP ....... 6, 8, 12, 14, 20, 23, 28, 47, 48, 54, 61, 75 R
FHPP_CTRL ....................... 10, 14, 27, 28, 65, 66, 71 Record Mode ................................................. 28, 71
FHPP+ ........................................................ 8, 23, 61 Record selection ........................................ 8, 28, 71
Fieldbus 1, 5, 6, 8, 11, 12, 16, 18, 20, 23, 27, 33, 53, S
61
Signal Name .. 12, 28, 34, 35, 37, 39, 41, 43, 45, 47,
FML_Read 10, 11, 12, 14, 16, 18, 20, 23, 27, 33, 48, 54
55, 57, 59
FML_Write ...... 10, 27, 33, 48, 53, 54, 55, 57, 59, 61 V
Force/torque mode ................................................ 8 Velocity mode .................................................. 8, 28
75