Manual - PTP - Package - Festo: Codesys, Twincat and Sysmac Studio Library For Festo Motor Controllers in Point-To-Point Mode
Manual - PTP - Package - Festo: Codesys, Twincat and Sysmac Studio Library For Festo Motor Controllers in Point-To-Point Mode
Manual - PTP - Package - Festo: Codesys, Twincat and Sysmac Studio Library For Festo Motor Controllers in Point-To-Point Mode
Codesys, TwinCAT
and Sysmac Studio
library for Festo
motor controllers in
point-to-point mode
Date
30.06.2020
www.festo.com/contact
Contents
2 Introduction ........................................................................................................ 6
2. 1 Installing the library package .............................................................................. 6
2. 1. 1 Codesys extension in Automation Suite .............................................................. 6
2. 1. 2 Codesys 3.5 (stand-alone) .................................................................................. 6
2. 1. 3 Beckhoff TwinCAT 3 ............................................................................................ 7
2. 1. 4 Omron Sysmac Studio ......................................................................................... 9
2. 2 Correct use of acyclic communication (SDO access) ......................................... 11
5 Diagnostics ....................................................................................................... 39
6 BufferMode ....................................................................................................... 43
7 Direction ........................................................................................................... 44
PtP_Package_Festo
4
1 Important information
1. 2 Intended use
The function blocks based on PLCopen or the direct method calls allow the varied functions of the motor controllers
from Festo to be conveniently integrated into the PLC program. The function blocks are called cyclically using a
separate instance for each motor controller (each axis) integrated into the user program. Simultaneous use of other
function blocks for controlling the same device is not permitted. The library described is used to control and
parameterise the following motor controllers:
Observe the "Safety instructions" and instructions on the intended 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.
1. 3 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.
1. 4 Target group
This description 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.
1. 5 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
Festo_PtP_Package
5
2 Introduction
2. 1 Installing the library package
2. 1. 3 Beckhoff TwinCAT 3
The package described above cannot be used if the motor controller CMMT-AS from Festo is integrated into a TwinCAT 3
project from Beckhoff. In this case, the device description file and the libraries must be integrated manually. The
EtherCAT® slave information (esi) must be copied into the TwinCAT installation path provided for this (see Figure 3).
Note
The specified libraries will not be supported by TwinCAT XAE engineering enviroments older than version 3.1.4020.0.
(Reason: Compiler version is not compatible).
The programmer can stat TwinCAT once the device description file has been added. The libraries for the drive must then
be installed in the Library Repository. If, for example, the motor controller CMMT-AS is being used, the user must install
five libraries (see Figure 4).
In the next step, the user must add the installed libraries to the project (see Figure 5 – purple frame). The drive
library must then be instanced and called cyclically (Figure 5 – red frames). Once the user project has been
successfully compiled, the library variables can be linked with the drive's project data objects (PDOs). This is done by
linking the library variables with the motor controller variables of the same name (see Figure 5 – orange and green
frames). The created block instance can then be used as an axis reference in the user project. On the one hand, it can
be used as an axis variable of the type "AXIS_REF_FESTO" for the blocks described below. On the other hand,
methods can be started directly from this instance. A more detailed description of the method call can be found in
section 4.
Festo_PtP_Package
7
2 Introduction
Note
The instance variables “WcState_In”, “SlaveState_In” and “AdsAddr_In” must be linked to the drive . Only this linking
enables SDO communication (Service-Data-Object communication) between PLC and CMMT-AS or CMMT-ST.
After successful configuration of the network, the servo drive must be linked to the library’s axis structure
(PTP_AXIS_REF_FESTO). The axis structure and the logic variables for the drive’s input and output data (PDOs) must
be instantiated to this end. This can be accomplished, for example, in the global variables list (see Figure 6: Global
variables list Sysmac Studio).
Note
A separate type “PTP_AXIS_REF_FESTO” axis structure must be instantiated in the PLC program for each servo drive.
After successful instantiation, the motor controller’s cyclical process data must be linked to the available variables (PDO
mapping) (see Figure 7: PDO mapping Sysmac Studio).
Festo_PtP_Package
9
2 Introduction
The axis module must then be instantiated in the PLC program and cyclically invoked (red frames). The previously set
up axis structure (green frames) and the logic variables (purple frames) of the drive’s inputs and outputs serve as
input and output variables, (see Figure 8: Cyclical invocation of the axis module). The input variable „EC_PDActive“ of
the axis module (PTP_CIA402_CMMT_AS) must be active for processing. It can be assigned, for example, with the
"_EC_PDActive" system variable (yellow frame). In order to ensure mandatory SDO communication (service data
object communication) between the PLC and the drive, the “SlaveNodeInfo” must also be transferred to the axis
module (blue arrow).
Note
The type “PTP_CIA402_CMMT_FESTO” axis module must always be cyclically invoked.
Festo_PtP_Package
10
2 Introduction
Via the service data object (SDO) write or read command, the PLC can access the object directory of the drive acyclically.
As a result, the data of a parameter are written or read. After the SDO command has been processed, the drive sends an
acknowledgement to the PLC. This communication generates acyclic bus load. Depending on the number of drives and
the number of SDO commands sent at the same time, the PLC can reach the limit of the maximum number of SDO
communication commands permitted at the same time. It is therefore recommended to keep the number of acyclic read
and write accesses to a minimum.
The function blocks of the PtP library from Festo also implicitly generate SDO commands if input data at the function
block change compared to the previous call (e.g. "Acceleration", "Decceleration", "Jerk", "Direction", "BufferMode",
"HomingMethod", etc.). If the values remain unchanged from the previous call, the respective block generates one SDO
write command per input parameter only with the very first call. This first write command can also be prevented if the
input "Acceleration", "Deceleration", "Jerk", "Direction" or "BufferMode" is = 0 at the time of the start of movement. In
this case, the value set in the motor controller is used for this parameter. No acyclic write command is generated.
In addition, the PtP library generates several SDO commands per drive during the initialization phase in order to read out
set parameters such as the factor group. These acyclic read commands cannot be deactivated.
Note
Omron controllers can execute a maximum of 32 instructions simultaneously. If the number of 32 is exceeded, the error
"Communication Resource Overflow" is displayed. In this case it is recommended to implement the above instructions
to minimize acyclic instructions.
The following Omron blocks generate an instruction: EC_CoESDOWrite, EC_CoESDORead, EC_StartMon, EC_StopMon,
EC_SaveMon, EC_CopyMon, EC_DisconnectSlave, EC_ConnectSlave, EC_ChangeEnableSetting, IOL_ReadObj, and
IOL_WriteObj.
Festo_PtP_Package
11
3 PLCopen function blocks
3. 1 General
The blocks described here were developed using the technical PLCopen specification "Function blocks for motion
control - Version 2.0". Most of the single-axis blocks have been implemented. In order to extend the function range
for motor controllers from Festo, further blocks have been additionally implemented with the same design and the
same behaviour. Further information such as time charts can be found in the PLCopen specification. This library
contains the following elements:
- MC_Power_Festo
- MC_Home_Festo
- MC_Stop_Festo
- MC_Halt_Festo
- MC_MoveAbsolute_Festo
- MC_MoveRelative_Festo
- MC_MoveAdditive_Festo
- MC_MoveVelocity_Festo
- MC_TorqueControl_Festo
- MC_ReadParameter_Festo
- MC_WriteParameter_Festo
- MC_ReadStringParameter_Festo
- MC_WriteStringParameter_Festo
- MC_ReadActualPosition_Festo
- MC_ReadActualVelocity_Festo
- MC_ReadActualTorque_Festo
- MC_ReadStatus_Festo
- MC_ReadAxisError_Festo
- MC_Reset_Festo
- MC_Jog_Festo
- MC_RecordTable_Festo
- MC_ReadAxisInfo_Festo
- MC_DeviceService_Festo
Note
Function block inputs have to set in user units partly (e.g. position, distance, velocity und dynamic values). This is
always the user unit parameterized in the drive in the "Fieldbus" tab (e.g. rounds, degree, inch, etc.).
Peculiarity:
If the user unit "Metric" was set in the drive, the function block inputs must be specified in mm, mm/s, mm/s² oder
mm/s³. The function block outputs, for example the current position, are also specified in mm in this case.
Festo_PtP_Package
12
3 PLCopen function blocks
3. 2 PLCopen diagram
The diagram below shows the individual states of an axis and the transitions possible in each case. The current status
of the axis can be queried using the variable "DeviceName.AxisState". A detailed description of the individual states is
not provided here since can this also be found in the PLCopen specification.
Figure 9: PLCopen diagram (source: Technical Specification PLCopen - FB for motion control)
Festo_PtP_Package
13
3 PLCopen function blocks
3. 3 MC_Power_Festo
This function block controls the power output stage (enable or block).
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Enable drive
• TRUE = Enable power output stage
• FALSE = Block power output stage
VAR_OUTPUT
Status BOOL Status of the output stage
• TRUE = Enabled
• FALSE = Blocked
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
14
3 PLCopen function blocks
3. 4 MC_Home_Festo
This function block starts homing. If the reference signal is detected, the value of the "Position" input is set as the
absolute position. The homing method can be selected via the "HomingMethod" input.
Note
If the "HomingMethod" input = 0, the homing method and axis zero point parameterised in the device are used. The
axis zero point specified in the block ("Position" input) is ignored.
If the "HomingMethod" input <> 0, the homing method and axis zero point parameterised in the device are overwritten.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Start homing
• FALSE --> True = Start homing
Position REAL Absolute position if reference switch was detected
(axis zero point in user unit).
HomingMethod DINT Homing method to CiA402 specification.
The homing methods supported by the device can be found in the
manual for the device.
VAR_OUTPUT
Done BOOL Homing successfully completed
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Homing was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
15
3 PLCopen function blocks
3. 5 MC_Stop_Festo
This function block stops an axis with the stop ramp parameterised in the Automation Suite and sets the axis to the
status "Stopping". All other motion commands are aborted. No other block can move this axis as long as it has the
status "Stopping". The output "Done" is set once the current axis velocity is zero. The axis remains in the status
"Stopping" as long as "Execute" is active (TRUE) or the current velocity is not equal to zero. The axis status changes
to "Standstill" as soon as "Done" has been set and "Execute" is inactive (FALSE).
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Stop axis motion
• FALSE --> True = Stop axis motion
VAR_OUTPUT
Done BOOL Current axis velocity is zero (axis stopped)
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
CommandAborted BOOL Job was aborted due to power output stage
being switched off (only abort option)
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
16
3 PLCopen function blocks
3. 6 MC_Halt_Festo
This function block pauses an axis with the set braking ramp for the current motion and sets it to the status
"DiscreteMotion". The output "Done" is set and the axis assumes the status "Standstill" once the current axis
velocity is zero.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Pause axis motion
• FALSE --> True = Pause axis motion
VAR_OUTPUT
Done BOOL Current axis velocity is zero (axis stopped)
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Pausing the axis was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
17
3 PLCopen function blocks
3. 7 MC_MoveAbsolute_Festo
This function block starts a motion to an absolute position on the basis of the set dynamic parameters.
Note
If one of the inputs "Acceleration", "Deceleration" or "Jerk" = 0 when the motion starts, the dynamic value set in the
motor controller is used for this motion parameter.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Start positioning task
• FALSE --> True = Start positioning task
ContinuousUpdate BOOL Continuous motion update
• If input is TRUE during rising edge of Execute,
changes at input variables will start a
new movement immediately
Position REAL Absolute target position (in user unit)
Velocity REAL Maximum velocity (in user unit)
Acceleration REAL Acceleration (in user unit)
Deceleration REAL Deceleration (in user unit)
Jerk REAL Jerk (in user unit)
Direction MC_DIRECTION Defines the positioning direction if "modulo" is activated
(see section 7 – Direction)
BufferMode MC_BUFFER_MODE Defines the chronological sequence of the block
(see section 6 – BufferMode)
VAR_OUTPUT
Done BOOL Positioning task successfully completed
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Positioning task was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
18
3 PLCopen function blocks
3. 8 MC_MoveRelative_Festo
This function block starts a motion by a distance relative to the axis set position at the time of block enable on the
basis of the set dynamic parameters.
Note
If one of the inputs "Acceleration", "Deceleration" or "Jerk" = 0 when the motion starts, the dynamic value set in the
motor controller is used for this motion parameter.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Start positioning task
• FALSE --> True = Start positioning task
ContinuousUpdate BOOL Continuous motion update
• If input is TRUE during rising edge of Execute,
changes at input variables will start a
new movement immediately
Distance REAL Relative distance of the motion (in user unit)
Velocity REAL Maximum velocity (in user unit)
Acceleration REAL Acceleration (in user unit)
Deceleration REAL Deceleration (in user unit)
Jerk REAL Jerk (in user unit)
Direction MC_DIRECTION Defines the positioning direction if "modulo" is activated
(see section 7 – Direction)
BufferMode MC_BUFFER_MODE Defines the chronological sequence of the block
(see section 6 – BufferMode)
VAR_OUTPUT
Done BOOL Positioning task successfully completed
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Positioning task was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
19
3 PLCopen function blocks
3. 9 MC_MoveAdditive_Festo
This function block starts a motion by a distance relative to the currently planned target position in the axis status
"DiscreteMotion" on the basis of the set dynamic parameters. This target position can be a result of a previous block
of the same type which has been aborted. If the function block is started when the axis status is
"ContinuousMotion", it executes a motion by a distance relative to the axis position at the time of block enable.
Note
If one of the inputs "Acceleration", "Deceleration" or "Jerk" = 0 when the motion starts, the dynamic value set in the
motor controller is used for this motion parameter.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Start positioning task
• FALSE --> True = Start positioning task
ContinuousUpdate BOOL Continuous motion update
• If input is TRUE during rising edge of Execute,
changes at input variables will start a
new movement immediately
Distance REAL Relative distance to the target position (in user unit)
Velocity REAL Maximum velocity (in user unit)
Acceleration REAL Acceleration (in user unit)
Deceleration REAL Deceleration (in user unit)
Jerk REAL Jerk (in user unit)
Direction MC_DIRECTION Defines the positioning direction if "modulo" is activated
(see section 7 – Direction)
BufferMode MC_BUFFER_MODE Defines the chronological sequence of the block
(see section 6 – BufferMode)
VAR_OUTPUT
Done BOOL Positioning task successfully completed
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Positioning task was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
20
3 PLCopen function blocks
3. 10 MC_MoveVelocity_Festo
This function block starts a controlled motion with a defined velocity. This is velocity mode (ProfileVelocityMode).
Note
If one of the inputs "Acceleration", "Deceleration" or "Jerk" = 0 when the motion starts, the dynamic value set in the
motor controller is used for this motion parameter.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Start velocity mode
• FALSE --> True = Start velocity mode (with set
dynamic parameters)
ContinuousUpdate BOOL Continuous motion update
• If input is TRUE during rising edge of Execute,
changes at input variables will start a
new movement immediately
Velocity REAL Maximum velocity (in user unit)
Acceleration REAL Acceleration (in user unit)
Deceleration REAL Deceleration (in user unit)
Jerk REAL Jerk (in user unit)
BufferMode MC_BUFFER_MODE Defines the chronological sequence of the block
(see section 6 – BufferMode)
VAR_OUTPUT
InVelocity BOOL Target velocity reached
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Positioning task was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
21
3 PLCopen function blocks
3. 11 MC_TorqueControl_Festo
This function block starts a motion with a continuous torque measured at the motor shaft. The specified velocity is
not exceeded. This is force mode (ProfileTorqueMode).
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Start force mode
• FALSE --> True = Start force mode
Torque REAL Setpoint torque at the motor shaft (in Nm)
ContinuousUpdate BOOL Continuous motion update
• If input is TRUE during rising edge of Execute,
changes at input variables will start a
new movement immediately
TorqueRamp REAL Torque ramp (in Nm/s)
Velocity REAL Maximum velocity (in user unit)
BufferMode MC_BUFFER_MODE Defines the chronological sequence of the block
(see section 6 – BufferMode)
VAR_OUTPUT
InTorque BOOL Target torque reached
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Positioning task was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
22
3 PLCopen function blocks
3. 12 MC_ReadParameter_Festo
This function block reads out the value of a parameter via service data object access (SDO access).
Note
This function block causes a steady SDO-communication between drive and PLC. Permanent reading leads to a heavy
load of the fieldbus. Please use this function block situational.
Note
This block is not suitable for reading parameters of the data type "STRING". The block
"MC_ReadStringParameter_Festo" must be used for this.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read SDO value
• TRUE = Read SDO continuously as long as TRUE
• FALSE = Disable reading
ParameterNumber UINT Number of the parameter to be read
SubindexNumber USINT Subindex of the parameter to be read
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
Value LREAL Value of the read parameter
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
23
3 PLCopen function blocks
3. 13 MC_WriteParameter_Festo
This function block modifies the value of a parameter via service data object access (SDO access).
Note
This block is not suitable for writing parameters of the data type "STRING". The block
"MC_WriteStringParameter_Festo" must be used for this.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Modify SDO value
• FALSE --> TRUE = Write new SDO value
ParameterNumber UINT Number of the parameter to be written
SubindexNumber USINT Subindex of the parameter to be written
Value LREAL New value of the parameter to be written
VAR_OUTPUT
Done BOOL Parameter successfully written
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
24
3 PLCopen function blocks
3. 14 MC_ReadStringParameter_Festo
This function block reads out the value of a service data object (SDO) of the data type "STRING". A character string
with a maximum length of 35 characters is read out.
Note
This function block causes a steady SDO-communication between drive and PLC. Permanent reading leads to a heavy
load of the fieldbus. Please use this function block situational.
Note
This block is only suitable for reading parameters of the data type "STRING". The block "MC_ReadParameter_Festo"
must be used for parameters with other data types.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read SDO value
• TRUE = Read SDO continuously as long as TRUE
• FALSE = Disable reading
ParameterNumber UINT Number of the parameter to be read
SubindexNumber USINT Subindex of the parameter to be read
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
Value STRING(35) Character string of the read parameter
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
25
3 PLCopen function blocks
3. 15 MC_WriteStringParameter_Festo
This function block modifies the character string of a service data object (SDO) of the data type "STRING". A
character string with a maximum length of 35 characters is written.
Note
This block is only suitable for writing parameters of the data type "STRING". The block "MC_WriteParameter_Festo"
must be used for parameters with other data types.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Modify SDO value
• FALSE --> TRUE = Write new SDO value
ParameterNumber UINT Number of the parameter to be written
SubindexNumber USINT Subindex of the parameter to be written
Value STRING(35) New character string of the parameter to be written
VAR_OUTPUT
Done BOOL Parameter successfully written
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
26
3 PLCopen function blocks
3. 16 MC_ReadActualPosition_Festo
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read current axis position (ActPos)
• TRUE = Read ActPos continuously as long as TRUE
• FALSE = Disable reading
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
Position REAL Current axis position (in user unit)
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
27
3 PLCopen function blocks
3. 17 MC_ReadActualVelocity_Festo
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read current axis velocity (ActVelo)
• TRUE = Read ActVelo continuously as long as TRUE
• FALSE = Disable reading
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
Velocity REAL Current axis velocity (in user unit)
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
28
3 PLCopen function blocks
3. 18 MC_ReadActualTorque_Festo
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read current axis torque (ActTorq)
• TRUE = Read ActTorq continuously as long as TRUE
• FALSE = Disable reading
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
Torque REAL Read current axis torque (in user unit)
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
29
3 PLCopen function blocks
3. 19 MC_ReadStatus_Festo
This function block reads the current status of the motor controller according to the "PLCopen state diagram" (see
Section 3. 2).
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read current axis status
• TRUE = Read status continuously as long as TRUE
• FALSE = Disable reading
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
ErrorStop BOOL Drive is in status “ErrorStop”
(see the section 3. 2 – PLCopen diagram)
Disabled BOOL Drive is in status “Disabled”
(see the section 3. 2 – PLCopen diagram)
Stopping BOOL Drive is in status “Stopping”
(see the section 3. 2 – PLCopen diagram)
Homing BOOL Drive is in status “Homing”
(see the section 3. 2 – PLCopen diagram)
Standstill BOOL Drive is in status “Standstill”
(see the section 3. 2 – PLCopen diagram)
DiscreteMotion BOOL Drive is in status “DiscreteMotion”
(see the section 3. 2 – PLCopen diagram)
ContinuousMotion BOOL Drive is in status “ContinuousMotion”
(see the section 3. 2 – PLCopen diagram)
SynchronizedMotion BOOL Drive is in status “SynchronizedMotion”
(see the section 3. 2 – PLCopen diagram))
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
30
3 PLCopen function blocks
3. 20 MC_ReadAxisError_Festo
This function block continuously reads the current motor controller error.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read current axis error
• TRUE = Read error continuously as long as TRUE
• FALSE = Disable reading
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
AxisErrorID WORD Current axis error number
AxisErrorString STRING Current axis error description
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
31
3 PLCopen function blocks
3. 21 MC_Reset_Festo
This function block triggers a reset of the motor controller errors using the control word from the drive profile. In
addition, the errors of the EtherCAT® slave in the PLC program are reset by the "ClearEmergency" method.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Reset errors
• FALSE --> TRUE = Reset axis errors
VAR_OUTPUT
Done BOOL Errors successfully reset (no axis errors)
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
32
3 PLCopen function blocks
3. 22 MC_Jog_Festo
Note
The axis remains stationary if the "JogPositive" and "JogNegative" inputs have the same status (both TRUE or both
FALSE).
Note
The "JogMode" input has three permissible input values (modes). If the input value 0 is specified, the drive only jogs at
velocity 1. After a parameterised time, the drive accelerates/decelerates to velocity 2. The respective velocity and the
time can be set in the motor controller (further information can be found in the manual for the device).
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
JogPositive BOOL Jog in positive direction
• TRUE = Axis jogs in positive direction
JogNegative BOOL Jog in negative direction
• TRUE = Axis jogs in negative direction
JogMode MC_JOG_MODE Jog mode
• 0 (mcDefault) = Velocity 1 and 2
• 1 (mcOnlyVelocity1) = Only velocity 1
• 2 (mcOnlyVelocity2) = Only velocity 2
VAR_OUTPUT
Velocity1 BOOL Drive jogs at velocity 1
Velocity2 BOOL Drive jogs at velocity 2
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
CommandAborted BOOL Positioning task was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
33
3 PLCopen function blocks
3. 23 MC_RecordTable_Festo
This function block starts a position record parameterised in the motor controller. This is RecordTableMode.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Start position record
• FALSE --> True = Start position record
ContinuousUpdate BOOL Continuous motion update
• If input is TRUE during rising edge of Execute,
changes at input variables will start a
new movement immediately
RecordNumber DINT Number of the position record to be started
BufferMode MC_BUFFER_MODE Defines the chronological sequence of the block
(see section 6 – BufferMode)
VAR_OUTPUT
Done BOOL Position record successfully executed
ActualRecordNumber DINT Active position record number
Busy BOOL Job is not yet complete
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Active BOOL Indicates that FB has control on the axis
• TRUE = FB has control on the axis
• FALSE = No control on the axis by this FB
CommandAborted BOOL Positioning task was aborted by another job
during processing
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
34
3 PLCopen function blocks
3. 24 MC_ReadAxisInfo_Festo
This function block reads information concerning the axis, like home switch and end switches.
Note
This function block causes a steady SDO-communication between drive and PLC. Permanent reading leads to a heavy
load of the fieldbus. Please use this function block situational. A lot of information also available via the „Properties“
(see section 4 – Control via method call). This aren´t load the fieldbus additionally.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Enable BOOL Read axis information continuously
• TRUE = Read axis info continuously as long as TRUE
• FALSE = Disable reading
UpdateTime TIME Delay time between request of two SDO read commands
(default = T#1S = 1 second)
VAR_OUTPUT
Valid BOOL Status of the block outputs
• TRUE = Output status valid
• FALSE = Output status invalid
Busy BOOL Job is not yet complete
• TRUE = Job active
• FALSE = Job completed or not started
HomeAbsSwitch BOOL Digital home switch is active
IsHomed BOOL Absolute reference position is knwon for the axis (axis is homed)
IsMoving BOOL Achse bewegt sich
HwLimitSwitchPos BOOL Positive hardware end switch is active
HwLimitSwitchNeg BOOL Negative hardware end switch is active
SwLimitSwitchPos BOOL Positive software end switch is active
SwLimitSwitchNeg BOOL Negative software end switch is active
StrokeLimitPos BOOL Positve stroke limit reached
StrokeLimitNeg BOOL Negative stroke limit reached
CommunicationReady BOOL Network is initialized and ready for communication
PowerOn BOOL Power stage is switched ON
AxisWarning BOOL Warning(s) on the axis is present
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
35
3 PLCopen function blocks
3. 25 MC_DeviceService_Festo
This function block requests a selected device service of the servo drive.
VAR_IN_OUT
Axis AXIS_REF_FESTO Reference structure for the axis
VAR_INPUT
Execute BOOL Request of device service
FALSE --> True = request device service
DeviceService DEVICE_SERVICE Selection of the device service
• 0 (none) = no selection
• 1 (SaveZeroPointOffset) = save zero point offset to encoder
• 2 (SaveParameterset) = save parameterset
• 3 (ReinitDrive) = reinitialization of drive
• 4 (ResetDrive) = reset drive
• 5 (OpenHoldingBrake) = open holding brake
• 6 (CloseHoldingBrake) = close holding brake
VAR_OUTPUT
Done BOOL Device service successfully executed
Busy BOOL Device service will be requested
• TRUE = Job started but not completed
• FALSE = Job completed or not started
Error BOOL An error occurred during processing
• TRUE = Error active (see output ErrorID)
• FALSE = No error
ErrorID WORD Error number (see the section 5 – Diagnostics)
ErrorString STRING Error report using the error number
Festo_PtP_Package
36
4 Control via method call
In addition to calling the function blocks cyclically, a function can alternatively also be executed by calling a method. In
contrast to executing a function by means of a block, instancing is not required with a method call. If the device name is
typed in followed by a full stop, the available methods appear in a drop-down box (blue "M"). A method signals the
successful execution with a Boolean return value. This is set in the same PLC cycle in which the method is called. In
addition, each method has the outputs (ErrorID and ErrorString). These can be used to output any errors that may occur
(see the section 5 – Diagnostics). It must be ensured that a method is only called once, not cyclically. Further
information about how to use methods can be found in the section "Example of a method call" or in the online help for
Codesys. The table below shows the available methods together with the respective transfer parameters. A detailed
explanation of the individual transfer parameters (data types and meaning) can be found in the description of the
respective function block (see above).
MoveAdditive(Distance, Velocity, Acceleration, Deceleration, Jerk, BufferMode) Start positioning relative to current
target position
MoveRelative(Distance, Velocity, Acceleration, Deceleration, Jerk, BufferMode) Start positioning relative to current
position
MoveVelocity(Velocity, Acceleration, Deceleration, Jerk, BufferMode) Start motion with constant velocity
(ProfileVelocityMode)
RecordTable(RecordNumber, BufferMode) Start parameterised position
record
Festo_PtP_Package
37
4 Control via method call
In the case of the blocks described above, a successfully executed is action is usually signaled with the output variable
"Done". In contrast, the return value of a method only means that it could be started successfully. Motion monitoring
(e.g. "Target reached") must take place in the user program. Properties are available to the user for this. These can also
be seen in the drop-down box by typing in the device name followed by a full stop (red "E"). Properties are updated
before every call. Further general information about properties can be found in the online help for Codesys. An example
of how to use a property can be found in the section Example of a method call. The table below shows the properties
available for motor controllers from Festo.
Festo_PtP_Package
38
5 Diagnostics
A distinction is made between three error categories: initialization error, motor controller errors and function block
errors. The error category can be identified by means of the prefix in the "ErrorString" output variable of a function
block:
- “Init:” prefix (ErrorID <10) = Error during initialization of EtherCAT slave or library (Diagnostics listed below)
- "Axis:" prefix (ErrorID >10 and < 1000) = Controller error (Diagnostics and fault clearance must be looked up in
the user manual)
- "FB:" prefix (ErrorID > 1000) = Function block error (Diagnostics and fault clearance are listed below)
General errors
0 0x00 No error
Initialization errors
1 0x1 Error in profile library (for example CiA402) – one or more PDO pointer to NULL
2 0x2 Error in device library (for example CMMT-AS – right EtherCAT master not found
3 0x3 Error in device library (for example CMMT-AS – right EtherCAT slave not found
4 0x4 Error in fielbus library (EtherCAT – error while reading SDO List of EtherCAT slave
5 0x5 Error in fielbus library (EtherCAT – error while reading SDO List Length of EtherCAT slave
(only Beckhoff PLCs)
8 0x8 Input „EC_PDActive“ of axis function block not active (systemvariable „_EC_PDActive“)
Festo_PtP_Package
39
5 Diagnostics
1051 0x041B Communication error between PLC and drive – bus error
- Check whether connecting cable is plugged in
1052 0x041C Communication error between PLC and drive – general error
1053 0x041D Communication error between PLC and drive – extended error
1054 0x041E Communication error between PLC and drive – drive does not have "Operational"
communication state
1110 0x0456 An error occurred during the homing process/the homing process was terminated
- Check diagnostic message of drive
1112 0x0458 An additional "MC_Halt_Festo" function block has adopted master control
- At least two different instances of "MC_Reset_Festo" are accessing the drive at the
same time
Festo_PtP_Package
40
5 Diagnostics
1113 0x0459 Too many motion commands active at the same time
- Too many buffered motion commands were entered
1124 0x0464 Option code for positioning (object 0x60F2) could not be written
1125 0x0465 Force ramp in force mode (object 0x6087) could not be written
1126 0x0466 Velocity limit in force mode (object 0x2060) could not be written
1128 0x0468 Error during read access to the "Homing Method" (object 0x6098)
1129 0x0469 Error during write access to the "Homing Method" (object 0x6098)
1130 0x046A Error during read access to the "Home Offset" (object 0x607C)
1131 0x046B Error during write access to the "Home Offset" (object 0x607C)
Festo_PtP_Package
41
5 Diagnostics
1402 0x057A Read parameter file entry is invalid (SDO description invalid)
1404 0x057C Read parameter file entry is invalid (unknown data type)
Hardware errors
2048 0x0800 Axis error ID is currently being read. An axis error occurred and the description is
currently being read.
Note:
It is an acyclic service data object (SDO command). The processing is typically longer
than with the cyclic process data (PDOs) and can take up to 300 ms. Maybe at the time
when the error occurred (Fault bit in the status word) there was no corresponding error
description available and has to be read.
Note:
The "Emergency Message" is an acyclic service data object (SDO command). The
processing is typically longer than with the cyclic process data (PDOs) and can take up to
300 ms. Maybe at the time when the error occurred (Fault bit in the status word) there
was no corresponding "Emergency Message" available. Read out the current ErrorID and
the ErrorString again via the "MC_ReadAxisError_Festo" block. If this function block also
outputs the same error, there is no "Emergency Message".
Festo_PtP_Package
42
6 BufferMode
A number of modules have the input variable "BufferMode". This variable can be used to select whether a block should
be started with or without buffering. In non-buffered mode, the block is started immediately. If another block is active, it
is aborted. By default, each block is started in non-buffered mode. In buffered mode, the started block does not
interrupt an active block; it waits until this block has been completed and then starts. This option can be used, for
example, to add a motion to an active motion. The following modes are available:
Festo_PtP_Package
43
7 Direction
If the funtion „modulo“ is parametrized in the drive, the positioning direction can be forced by the input “Direction”.
This input is of type “MC_DIRECTION” and can be accept all the values of followintg table. The input is in the function
blocks „MC_MoveAbsolute_Festo“, „MC_MoveRelative_Festo“ and „MC_MoveAdditive_Festo“ available.
Note
How the "modulo" functionality is parameterized can be found in the respective device manual.
Festo_PtP_Package
44
8 Visualisation of function blocks
A visualisation element is available for each function block. Its main purpose is to help with the initial commissioning
of the motor controller. The visualisation element must be linked to the respective cyclically called block instance.
The diagram below shows this by way of example using "MC_Power_Festo".
Festo_PtP_Package
45
9 Application examples
As already described, there are two ways of executing a function in the user program. The sections below show both
ways of executing a function to enable a drive and then execute a relative motion of 100 mm. The drive must be homed
for this.
Festo_PtP_Package
46
9 Application examples
Festo_PtP_Package
47
Copyright:
Festo SE & Co. KG
Ruiter Straße 82
Reproduction, distribution or sale of this document or communication of its 73734 Esslingen
contents to others without express authorization is prohibited. Offenders will Deutschland
be liable for damages. All rights reserved in the event that a patent, utility
model or design patent is registered. www.festo.com/contact
Festo_PtP_Package
48