You are on page 1of 24

Documentation

Festo_Positioning_Basic EVO3
V3.5.10.43

Festo Positioning Basic Library EVO3 provides basis motion Manual


functionalities for Festo gantries.

1
Title ................................................................................................................................... Festo_Positioning_Basic
Version ............................................................................................................................................................. 1.01
Document no. ........................................................................................................................................................ 1
Original .................................................................................................................................................................en
Author ............................................................................................................................................................. Festo

Last saved ............................................................................................................................................ 05.08.2019

Copyright Notice
This documentation is the intellectual property of Festo AG & Co. KG, which also has the exclusive copyright. Any
modification of the content, duplication or reprinting of this documentation as well as distribution to third par-
ties can only be made with the express consent of Festo AG & Co. KG.
Festo AG & Co KG reserves the right to make modifications to this document in whole or in part. All brand and
product names are trademarks or registered trademarks of their respective owners.

Legal Notice
Hardware, software, operating systems and drivers may only be used for the applications described and only in
conjunction with components recommended by Festo AG & Co. KG.
Festo AG & Co. KG does not accept any liability for damages arising from the use of any incorrect or incomplete
information contained in this documentation or any information missing therefrom.
Defects resulting from the improper handling of devices and modules are excluded from the warranty.
The data and information specified in this document should not be used for the implementation of safety func-
tions relating to the protection of personnel and machinery.
No liability is accepted for claims for damages arising from a failure or functional defect. In other respects, the
regulations with regard to liability from the terms and conditions of delivery, payment and use of software of
Festo AG & Co. KG, which can be found at www.festo.com and can be supplied on request, shall apply.
All data contained in this document do not represent guaranteed specifications, particularly with regard to func-
tionality, condition or quality, in the legal sense.
The information in this document serves only as basic information for the implementation of a specific, hypo-
thetical application and is in no way intended as a substitute for the operating instructions of the respective
manufacturers and the design and testing of the respective application by the user.
The operating instructions for Festo products can be found at www.festo.com.
Users of this document (application note) must verify that all functions described here also work correctly in the
application. By reading this document and adhering to the specifications contained therein, users are also solely
responsible for their own application.

 (Festo AG & CO. KG, D-73726 Esslingen, 2019)


Internet: http://www.festo.com
E-Mail: service_international@festo.com
Table of contents
1 Overview ..................................................................................................................................................... 5
1.1 Target platforms .......................................................................................................................................... 5
1.1.1 PLC ................................................................................................................................................. 5
1.1.2 Motor controller ............................................................................................................................. 5
1.1.3 Kinematics ..................................................................................................................................... 5
1.1.4 Integrating the library .................................................................................................................... 5
1.1.5 CODESYS Online Help .................................................................................................................... 5

2 Architecture ................................................................................................................................................ 7

3 Interface to the CODESYS application ........................................................................................................ 8


3.1 Units ............................................................................................................................................................ 8
3.2 VAR_INOUT.................................................................................................................................................. 8
3.3 Configuration data ....................................................................................................................................... 8
3.3.1 Kinematic configuration (Input Struct) ........................................................................................... 8
3.3.2 Drive configuration (Input struct) ................................................................................................. 10
3.3.3 stDynLimits configuration (Input struct) ...................................................................................... 11
3.3.4 Homing configuration (Input struct) ............................................................................................. 12
3.3.5 Config Control (Input struct) ........................................................................................................ 13
3.3.6 Config Status (Output struct) ....................................................................................................... 14
3.4 Process Input data ..................................................................................................................................... 14
3.5 Process output data .................................................................................................................................. 18
3.6 Pick and Place ........................................................................................................................................... 22
3.6.1 FB_PICK_AND_PLACE_CYCLIC_G10 and FB_PICK_AND_PLACE_CYCLIC_G51_52 ......................... 22
3.7 Message System ....................................................................................................................................... 24
Table of contents
1 Overview
Festo Positioning_Basic_3 is an internal SoftMotion based library for CODESYS V3 provided by Festo.

1.1 Target platforms


1.1.1 PLC
The following PLCs supporting CODESYS V3.5 SP 10 pbF or( > =SP10) can use this library:
CPX-CEC-M1-V3
CPX-E-CEC-M1..
CECC-X-M1-..

1.1.2 Motor controller


The following Festo motor controllers (drive controllers) can be controlled with this library:
CMMP
CMMP-M3 with EtherCat
CMMS
EMCX
CMMT-AS
CMMT-ST

1.1.3 Kinematics
The following kinematics can be controlled with this library:
H-gantry ( Z + 3 additional axes)
T–gantry ( X + 3 additional axes)
XY-gantry single axis ( Z + 3 additional axes)

1.1.4 Integrating the library


Festo Positioning_Basic_3 library is located under "Library Manager" in CODESYS V3 pbF.
Use command "Add Library" to integrate the library.
All elements from this library are assigned to the namespace "FPosB".

1.1.5 CODESYS Online Help

https://help.codesys.com/
2 Architecture

Figure 1 Architecture of the Festo Positioning_Basic_3 library

The basic idea of this architecture is to separate configuration data and process data. For this the following
modes of operation (MOPs) are implemented:
Mode of operation (MOP) Description

Configuration mode At each power cycle, the system needs to be in the configuration
mode to initialize the configuration parameters. After the success-
ful initiation of the parameters, it can switch to different MOPs to
operate with the system.
Homing mode Homing of the system can be triggered in this mode. The parame-
ters to reference the system will be initialized in the configuration
mode.
Jogging mode Jogging of the system.
Stepping mode Stepping of the system.
PTP mode This is a separate mode to do a point-to-point-movement.
Internal CNC mode The CNC path which was created in the CODESYS CNC editor
can be started.
The compile mode of the CNC must be set to SMC_CNC_REF.
External CNC mode The CNC path which is saved as a text-file (*.cnc) can be started.
The CNC file (*.cnc) can be stored in the internal file system of the
PLC.

Table: Mode of operation


Table of contents

3 Interface to the CODESYS application

3.1 Units
The basic units for the Festo Positioning_Basic_3 Library are depending on set Feeds Constance of the Drives:
Parameter type Unit

Position mm
Velocity mm/s
Acceleration and deceleration mm/s²
Jerk mm/s³
Angle ° (degree)

Table: Units

3.2 VAR_INOUT
The Festo Positioning_Basic_3 Library has different function blocks. The communication between the function
blocks is realized via the VAR_INOUT input stKineDataRef. It contains all internal data of the library.

3.3 Configuration data

Figure 2 System configuration function block

The function block FB_CONFIG_SYSTEM contains data to parameterize/configure the system.


The following inputs need to be set:
stKinematic
stDrive
stDynLimits
stHoming
pstConfigControl
stKineDataRef ➔ VAR_INOUT

The following output need to be Set :


stConfigStatus

3.3.1 Kinematic configuration (Input Struct)


Structure stKinematic contains all configuration parameters about the kinematic:
stKinematic (Struct) Type Description

eKinematicType KINEMATIC_TYPE Supported kinematic type:


1. eXY_Gantry
2. eH_Gantry
3. eT_Gantry
stKinematic (Struct) Type Description
eH_GantryBeltLock H_GANTRY_BELT_LOCK Position of the belt lock of the H-gantry:
1. eH_MOTOR_SIDE
2. eH_NOT_MOTOR_SIDE
3. eH_Belt_Lock_Not_Relevant
stKinemat- KINEMATIC_LIMIT Software limits (SW limits) of the system.
icSWLimit They should be lower than HW limits. A
CNC program which is executed in MCS will
be checked with the SW limits. The system
will not start the program if the CNC path
will exceed the SW limits.
stMin(XYZ ABC/UVW)
Lower limits for XYZ ABC/UVW axes
stMax(XYZ ABC/UVW)
Upper limits for XYZ ABC/UVW axes
stKinemat- KINEMATIC_LIMIT Hardware limits are the maximal stroke of
icHWLimit the system, they should be bigger than SW
limits.
stMin(XYZ ABC/UVW)
Lower limits for XYZ ABC/UVW axes
stMax(XYZ ABC/UVW)
Upper limits for XYZ ABC/UVW axes
xUseUvwAxes BOOL There are 2 possibilities to use the addi-
tional axes:
False: use additional axes as ABC axes
(interpolated with a polynomial function)
Additional Axes as Tool Axes ->
xUseUvwAxes := False;
True: use additional axes as UVW axes
(interpolated linearly)
stAddAxesConfig ADDITIONAL_AXES_CONFIG xAbcAxesOrientationAxes
Activate the ABC Axes as Orientation Axes.
A-Position represent the rotation around X-
Axis
B-Position represent the rotation around Y-
Axis
C-Position represent the rotation around Z-
Axis
unToolLength
defines the dimentions of a Tool in XYZ
eOriConv
OrientationConvention for the ABX Axis
lrXY_Compensation LREAL XY Traverse compensation can be set, if the
XY Axis is not 100% orthogonal to each
other, means the angle of XY Axis is greater
than 90° or less than 90°. E.g. if the
measured angle of XY Axis is 91,87° then
then the compensation should be 1,87°.

Table: stKinematic

stAddAxesConfig TYPE Description

xAbcAxesAsOrienta- BOOL Set the Additional Axes as Orientation Axes


tionAxes
Table of contents

stAddAxesConfig TYPE Description


unToolLength UNION ar0_2: ARRAY [0..2] OF LREAL;
stIJK: TOOL_LENGTH_IJK;

Toollength definition for the Orientation Axes.


ar0_2 stIJK Descrip-
TOOL_LENGTH_IJK tion

[0] lrI Length of


A Axis
[1] lrJ Length of
B Axis
[2] lrK Length of
C Axis

eOriConv SM3_CNC.SMC_ORI_CONVENTION Represents different interpretations of an orienta-


tion given by three Euler angles.
A/B/C are treated as additional axes
ADDAXES
and not as an orientation;
ZYZ Rotation around the axes z, y’, z’‘;
Rotation around the axes z, y’, x’‘;
ZYX
also known as Yaw-Pitch-Roll;
XYZ Rotation around the axes x, y’, z’‘;

Table 3.1: stAddAxesConfig

Differences between ABC- and UVW-axes ➔ CODESYS online help > SoftMotion > CNC Ed-
itor > CNC Language DIN 66025 > Additional spline axes A, B, C.

If using Additional Axes as Tool Axis (Orientation Axes ), the Additional Axes should
be set as ABC Axes. -> xUseUvwAxes = False.

Additional Information about TOOL Axes and G43


LINK:
G43
SMC_ToolLengthCorr

3.3.2 Drive configuration (Input struct)


stDrive (Struct) Type Description

arxAvailable ARRAY [1..6] of BOOL Set the available drives.


areControllerType ARRAY [1..6] of Supported Festo controller:
CONTROLLER_TYPE 1. eFestoCMMP
2. eFestoCMMS
3. eFestoEmcxST_EC
4. eFestoEMCA
5. -Not Supported-
6. eFestoCMMP_ETC
4. eFestoCMMT_ETC
stDrive (Struct) Type Description
areMotorOrientation ARRAY [1..6] of Supported mounting position relevant for H-
MOTOR_ORIENTATION gantry or T-gantry:
0. eNoOrientation
1. eTop
2. eBottom
3. eOritation_Not_Relevant
arstRef ARRAY [1..6] of Pointer Axis reference to the CAN drives (Interface
to AXIS_REF_SM3 motor controller / Festo Positioning_Basic_3
library).
arlrFeedConstance ARRAY [1..6] of LREAL Feed constance of the Axis

Table: stDrive

When using a T-gantry the motors 1 and 2 must be referenced with axes 2 and 3, to be
able to move in the correct coordinate system (YZ-System).

3.3.3 stDynLimits configuration (Input struct)


stDynLimits (Struct) Type Description

arstMaxAxisDyn DYNAMIC Max Dynamic of a Motor same in Devices


arxLimitAxes ARRAY [1..6] of Select the axis which should be limited by the
BOOL dynamics.
stLimitAxisDyn DYNAMIC Dynamic limits for the axis which needs to be
limited.
lrPathAngleToler- LREAL Path angle tolerance describes the angle of a
ance sharp bend between 2 segments, which do
not cause a stop at the sharp bend.
lrMaxJerk LREAL Magnitude of the maximum allowed jerk. If
xLimitJerk is activated IrMaxJerk must be
positive.
lrQuickStopDec LREAL Max Value of the QuickStop Deceleration
lrQuickStopJerk LREAL Max Value of the QuickStop Jerk limit
eIpoVelMode SMC_INT_VELMODE Velocity Mode for the Interpolator:
0 = TRAPEZOID
1 = SIGMOID
2 = SIGMOID_LIMIT
3 = QUADRATIC
4 = QUADRATIC_SMOOTH

Table: stDynLimits
Table of contents

3.3.4 Homing configuration (Input struct)


stHoming (Struct) Type Description

xSetHomingCornerA- BOOL Set the Coordinate Origin to Active


sOrigin Homing Corner
eHomingCorner HOMING_CORNER There are 4 homing corners defined for
(H/T Portal) the H/T-gantry:
Corner 1 is located at the motor 1.
Corner 2 is located at the motor 2.
Corner 3 is located at the opposite of
motor 1.
Corner 4 is located at the opposite of
motor 2.
stParkDynamic DYNAMIC Dynamic for move to park position.
areHoming- ARRAY[1..6] of The homing position of a single axis.
PosSingleAxis HOMING_POS_ The homing position can be set either to
SINGLE_AXIS the positive HW limit or negative HW
limit.
0. eZeroPos
1. eHWLimitsMin
2. eHWLimitsMax
areHoming- ARRAY [1..6] OF Homing Methode for the XY-Gantry /Sin-
MethodeSingleAxis HOMING_METHODE gle-Axes
eBlockPositive -18
eBlockNegative -17
eLSNegative 17

eLSPositive 18
eActPos (For CMMT) 35 (37)
eDefault 0
arxSaveHomingOffset- ARRAY [1..6] OF BOOL Save the Homing Position into the Motor
ToEncoder Controller, can be manual triggered after
homing Done
arxExcludeAxis ARRAY[1..6] of BOOL Select the axis that doesn’t need a hom-
ing. E. g. if an absolute encoder is used
ariHomingOrder ARRAY[1..6] of INT Set the homing order of the 6 axes.
Rules to set the homing order:
Zero means no homing for the axis
Range from 1-6
Always start with No 1
No gaps between the order No
If using H/T-gantry the order for axes 1 and
2 (H-gantry) or axes 2 and 3 (T-gantry)
should be the same
E. g. when using a H-gantry and follow-
ing order [4.3.1.2.0.0], the axes will be
referenced in the following order:
1. Z Axis
2. the 4th axis
3. H-gantry Y-Axis
4. H-gantry X-Axis
5th and 6th axis will not execute a Hom-
ing.
stHoming (Struct) Type Description
xPortalAlreadyHomed BOOL Set HomingDone if no Axis need to Home
xMoveToParkPos BOOL Execute a moving to park position after
homing is done.
stParkPos CART_POS Define the park position.
tHomingTimeOut TIME Define a timeout for homing.
stEmcxHomingSensor- EMCX_HOMING_SENSOR Digital Input Configuration for the
Config EMCX, When using Homing Methode
with Sensor support

Table: stHoming

stEmcxHomingSensorConfig Type Description

arxEnableHomingSensor ARRAY[1..6] OF BOOL Enable Inputs on EMCX Motor to use as Hom-


ing switch input
ariSensorTypeAtDI3 ARRAY[1..6] OF Homing Sensor Type For Digital Input 3 of the
EMCX_SENSOR_TYPE EMCX Motor
ariSensorTypeAtDI4 ARRAY[1..6] OF Homing Sensor Type For Digital Input 3 of the
EMCX_SENSOR_TYPE EMCX Motor

Table 3.2: stEmcxHomingSensorConfig

EMCX_SENSOR_TYPE Type (ENUM) Description

NLS BYTE 1 = Negativ Limit Switch


PLS BYTE 2 = Positive Limit Switch
HS BYTE 3 = Home Switch / Reference Switch

Table 3.3: EMCX_SENSOR_TYPE

3.3.5 Config Control (Input struct)

CONFIG_PARAMETER_CONTROL Type Description

xSaveConfigToPlc BOOL Save ActConfigData


xAutoLoadParameter BOOL TurnOn Load AutoParameter
xLoadConfigFromPlc BOOL Load ActConfigData of PLC
xDeleteConfigFromPlc BOOL Delete ActConfigData
xChangePW BOOL Set Change Password
xLogin BOOL Login
xLogout BOOL Logout
sPWStringOld STRING Old Password
sPWStringNew STRING New Password
sPWStringConfirm STRING Conform Password for Password
change

Table 3.4: Config Control


Table of contents

3.3.6 Config Status (Output struct)


CONFIG_PARAMETER_STATUS Type Description

xParameterLoadedFromFile BOOL Parameter from File is Loaded


xNoParameterFileFounded BOOL No Parameter File founded
xParameterFileDeleted BOOL Parameter File deleted
xParameterSavedToFile BOOL Hardcoded Parameter is saved
xPasswordChangeConfirmed BOOL Password change confirmed
xPasswordChangeFailed BOOL Password change Fail
xPasswordLoggedIn BOOL Password Check OK and Logged In
xPasswordLoginFailed BOOL Password Check Failed

Table 3.5: Config Status

3.4 Process Input data

Figure 3 Figure: Process Input data


Input (Struct) Type Description

peMOP POINTER to OP_MODE Supported modes of operation for the Festo Posi-
tioning_Basic_3 Library (enum):
eNoMode = 0
eConfigMode = 10
eHomingMode = 20
eJoggingMode = 30
eSteppingMode = 40
ePTPMode = 50
eInternalCncMode = 60
eExternalCncMode = 70
pstCW POINTER TO ➔ table Control_Word
CONTROL_WORD
eSetCS COORDINATE_SYSTEM Select the possible coordinate system CS:
eMCS (machine coordinate system)
eUCS (user coordinate system)
eWPCS (workpiece coordinate system)
stUCS CS_ORIGIN Parameters of the user coordinate system
➔ table stUCS/stWPCS
Default: UCS = MCS.
stWPCS CS_ORIGIN Parameters of the workpiece coordinate system
➔ table stUCS/stWPCS
Default: WPCS = MCS.
pstDynPtp POINTER to DYNAMIC Dynamics for PTP mode.
pstPosPtp POINTER to CART_POS Position for PTP mode.
pstDynJogInch POINTER to DYNAMIC Dynamics for jogging /inching mode.
plrStepWidth POINTER to LREAL Inch/step distance for inching mode.
eSelectAxis AXIS Select the axis for joging /inching mode (enum):
eX = 1
eY = 2
eZ = 3
eA = 4
eB = 5
eC = 6
eU = 7
eV = 8
eW = 9
sCNCFilePath STRING External CNC mode: path of the CNC file, default:
'/ffx/codesys/_cnc/*.cnc' (absolute path)
'/_cnc/*.cnc' (relative path)
uiUserCNCNo UINT Internal CNC mode: Select the CNC from the CNC
pool:1-16
➔ parCNCUser
stCNCCorr CNC_ ➔ table CNC_CORRECTION_PARAMETERS
Parameters CORRECTION_
PARAMETERS
Table of contents

Input (Struct) Type Description


uiOverride UINT Percentage specification for override.
Permitted value range: [1..100%].
Values over 100 are not taken into account.
xEnableRampIn BOOL Activation of the override with a ramp function.
The output uiActualOverride is repeatedly reduced
by 1 percent in accordance with the delay time
(tRampInDelay input) until the value of the input
SetOverride is reached and maintained.
tRampInDelay TIME Ramp in delay time for override to avoid sudden
changes of the dynamic override.
It means that every tRampInDelay time the over-
ride will reduce its value by 1 percent.
Default setting: 8 ms
pCNCVarList POINTER to SMC_VARLIST is the link between the variables in
SMC_VarList the CNC file and variables in the Codesys project.
When ever variables in the CNC file are used, they
need to be published/referenced via this structure.
For more information ➔ CODESYS online help,
keyword SMC_VARLIST.
pstDefault- POINTER to DYNAMIC Default dynamic; used if dynamic is not specified
DynCNC inside the CNC file.
pstDefaultDyn POINTER to DYNAMIC Default dynamic for G0; used if dynamic is not
FFCNCG0 specified inside the CNC file.
parCNCUser Pointer to ARRAY [1..16] CNC Pool:
of POINTER to An array of pointers to SMC_CNC_Ref to refer-
SMC_CNC_Ref ence up to 16 CNC programs which are created by
the CODESYS CNC Editor (Internal CNC Mode).
stKineDataRef VAR_INOUT ➔ VAR_INOUT

Table: Input data

stUCS/stWPCS Type Description


(Struct)

vOrigin SMC_VECTOR3D Origin of the new coordinate system


default MCS vOrigin [dx, dy, dz]: [0, 0, 0]
vPointOnX SMC_VECTOR3D Coordinate X of the new coordinate system
default MCS vPointOnX [dx, dy, dz]: [0, 1,
0]
vPointOnY SMC_VECTOR3D Coordinate Y of the new coordinate system
default MCS vPointOnY [dx, dy, dz]: [0, 0,
1]

Table: stUCS/stWPCS

Control_Word (Struct) Type Description

xEnable BOOL Switching on (TRUE) by rising edge (regulator release)


or switching off (FALSE) of all parameterised drives.
xReset BOOL Reset the system by rising edge (Reinitialisation of the
drives/regulator).
xMovePositive BOOL Move positive (jogging/inching).
Control_Word (Struct) Type Description
xMoveNegative BOOL Move negative (jogging/inching).
xStart BOOL Start an action by rising edge depending on MOP:
eHomingMode: Start homing
ePTPMode: Move PTP
eInternalCncMode: Start CNC
eExternalCncMode: Start CNC file
xQuickStop BOOL QuickStop a Movement (CNC/PTP)
xHalt BOOL Pause the actual CNC movement.
xAbort BOOL Stop/abort the actual CNC movement or homing (Always
abort a movement if the system is not moving ).
xEnablePathCorrec- BOOL Enable the path correction of the CNC in MCS (e. g.
tion Translate/rotate the CNC).
xAckM BOOL Acknowledge the actual M-function by rising edge.
xAckAllM BOOL Pre-acknowledge all the M-functions.
xEnableStepMode BOOL Enable the step mode to step the CNC program segment
by segment.
In step mode the M-functions can be acknowledged via
xAckAllM bit of the Controlword.
xNextStep BOOL By rising edge the next segment of a CNC will be exe-
cuted.
xAckError BOOL Acknowledge existing errors.
xSetOpMode BOOL Set operation mode by rising edge.
Change of the MOP only possible if the system is not
moving or no CNC is started and xStart bit of the control
word is FALSE.
xNoAbortByEMCYErr BOOL Do Not Abort CNC if Error -> Continue the CNC after Error
xReadDriveError BOOL Read the Error from Motor Controller

Table: Control_Word

CNC_CORRECTION_ Type Description


PARAMETERS (Struct)

lrdPhi LREAL Rotation angle [°].


stStatic_Rot_Pos CART_POS Fix rotating position of the CNC.
stDynamic_Rot_Pos CART_POS New dynamic rotating position of the CNC.

Table CNC_CORRECTION_PARAMETERS
Table of contents

3.5 Process output data

Figure 4: Process output data

Output (Struct) Type Description

stSW STATUS_WORD ➔ table STATUS_WORD


uiActualOverride UINT Output of the current value as a
function of the inputs xEnableRam-
pIn and tRampInDelay.
lrActualPathVelocity LREAL Current velocity resulting from an
object that is moving from the pre-
ceding position to the next stI-
POActSetPos within the given inter-
polation time.
arstSWLimitSwitch ARRAY [1..6] of Output of the status of the software
LIMIT_SWITCH limit switches stKinematicsSWLimit
for all 6 axes
➔ table LIMIT_SWITCH.
arstActualDynam- ARRAY [1..6] of DYNAMIC Output of dynamic values of param-
icACS eterised axes.
stActualPositionACS CART_POS Output of position of parameterised
axes.
stActualPositionMCS CART_POS Output of cartesian position in MCS
of parameterised axes.
stActualPosi-
tionMCS_TOOL
stActualPositionUCS CART_POS Output of cartesian position in UCS
of parameterised axes.
Output (Struct) Type Description
stActualPositionWPCS CART_POS Output of cartesian position in
WPCS of parameterised axes.
xIPOWorking BOOL Interpolator Working Bit
iIPOStatus SM3_CNC.SMC_INT_STATUS Current interpolator status
stIPOActSetPos SM3_CNC.SMC_POSINFO Current set position of the interpola-
tor
stActualTangent SMC_VECTOR3D This structure contains the direction
of the path valid for position stI-
POActSetPos.
The structure SMC_VECTOR3D
(Struct) describes an unit vector.
lrCoveredDistance LREAL Past Way length of the CNC
stActSelect- STRING Current CNC program name.
edPrgName
eMoPDisplay OP_MODE Modes of operation display.
eActiveKinematicType KINEMATIC_TYPE Reflects the configured kinematic
type:
1. eXY_Gantry
2. eH_Gantry
3. eT_Gantry
eActiveCS COORDINATE_SYSTEM Acknowledgement of the activated
coordinate system:
eMCS (machine coordinate system)
eUCS (user coordinate system)
eWPCS (workpiece coordinate system)
stActiveCSData CS_NEW Shows the new coordinate data
➔ table CS_New.
lrQualityOfUCS LREAL Quality of UCS.
Ranging from 0 (invalid) to 1(orthog-
onal).
lrQualityOfWPCS LREAL Quality of WPCS.
Ranging from 0 (invalid) to 1(orthog-
onal).
eSelectedAxis AXIS Reflects the selected axis for Jog or
Inch.
stCncFunctions CNC_FUNCTIONS Active CNC functions
➔ table CNC_FUNCTIONS.
stMostSignificantEr- FMsgS.MESSAGE Error that occurs at first.
rorMessage
arstMessageBuffer ARRAY [1..16] of Message buffer of active error mes-
MSG_SYS.MESSAGE sages
➔ Message System.
stCNCList CNC_LIST List of all available CNC of the Sys-
tem
arbDriveCommunica- ARRAY[1..6] OF BOOL Axis Communication Status
tionOK

Table: Process output data


Table of contents

Status_Word Type Description


(Struct)

xEnabled BOOL Confirmation of activation of the regulator release for all pa-
rameterised drives.
xResetting BOOL Reinitialization of all parameterised drives.
xIsMoving BOOL Signalling that the system is in motion.
xBusy BOOL Signaling the status of the system.
xPathCorrAc- BOOL Path correction active.
tive
xHaltActive BOOL Signalling pause of actual CNC movement.
xAborted BOOL Signalling that the actual CNC movement or homing is
aborted.
xHomed BOOL Signalling that the system is referenced.
xReadyToEna- BOOL Indication of readiness of all parameterised drives:
ble Communication with the drives is active
All drives are ready to switch on
xError BOOL Signalling of exitisting error.
For further information ➔ arstMessageBuffer of the Output.
xMotionCom- BOOL Signalling the end of the executing of a CNC Program.
plete
xStepModeAc- BOOL Signalling the activation of the step mode.
tive
xStepDone BOOL Signalling that the end of the actual step is reached.
xConfigDone BOOL Signalling that the configuration paramerter initialized suc-
cessfully.
xM_Active BOOL M-Function Active
arxMotorHomed ARRAY[1..6] Motor Homing Status
of BOOL
xInterruptActive BOOL interrupt in CNC active
xIPODone BOOL Signalling that the internal interpolator is done.

Table: Status_Word

LIMIT_SWITCH Type Description


(Struct)

xMin BOOL If TRUE, the respective limit switch is active.


xMax BOOL If TRUE, the respective limit switch is active.

Table: Limit_Switch

CS_NEW (Struct) Type Description

vX SMC_VECTOR3D Coordinate X of unit vector of new coordinate


system.
vY SMC_VECTOR3D Coordinate Y of unit vector of new coordinate
system.
vZ SMC_VECTOR3D Coordinate Z of unit vector of new coordinate
system.
CS_NEW (Struct) Type Description
vT SMC_VECTOR3D Translation vector for origin = origin of new coor-
dinate system in old coordinates.
fQuality LREAL Quality of set coordinate system.
Ranging from 0 (vX, vY invalid) to 1(vX,vY or-
thogonal).

Table: CS_New

CNC_FUNCTIONS (Struct) Type Description

wActiveMNumber WORD Active M-function.


Range from 1 to 65532.
Note:
65533 to 65535 are reserved for internal
use and can not be used.
stMParameters M_PARAMETERS Additional parameters for the currently ac-
tive M-function to display additional values
for the respective M-function.
For more information ➔ CODESYS online
help, keyword M_Parameters.
xM_Active BOOL Signaling that a M-function is active.
dwActSwitchPoint DWORD Active switch point (H-function).
Range from 1 to 32.
Bit 0 = Switch Point1;
...
Bit 31 = Switch Point32;
iLastSwitchPoint INT Last active switch point (H-function).
diActGCODELine DINT Active G-code line.
diActGCODELine is the line number of the
active G-code line, starting from zero incl.
blank lines and comment lines.
It is not the sentence number N.
If no CNC code is started diActGCODELine
will be -1.

Table: CNC_FUNCTION

M_PARAMETERS (Struct) Type Description

lrKParameter LREAL Passing parameter.


lrKParameter LREAL Passing parameter.
stlrOParameter SMC_M_PARAMETERS Additional M parameters.
For more information ➔ CODESYS
online help, keyword M-function

Table: M_PARAMETERS

CNC_LIST TYPE Description


uiMaxInternalCNC UINT Max No Internal CNC

uiMaxExternalCNC UINT max No of External CNC File


Table of contents

CNC_LIST TYPE Description


arStrExternalCNCPath ARRAY [1..255] OF STRING Internal CNC List

arStrInternalCncName ARRAY [1..255] OF STRING External CNC List

Table 3.6: CNC List

3.6 Pick and Place


3.6.1 FB_PICK_AND_PLACE_CYCLIC_G10 and FB_PICK_AND_PLACE_CYCLIC_G51_52

Figure 5 FB_PICK_AND_PLACE_CYCLIC

The FPosB Library provides two Function Blocks for Pick and Place applications.
- FB_PICK_AND_PLACE_CYCLIC

FB_PICK_AND_PLACE_CYCLIC Type Description


(Inputs)

Goto Parkpos after Pick Place Cycle if no Re-


xGotoParkPos BOOL
peat
pstDynamic POINTER TO DYNAMIC Dynamic for the Pick and Place Cycle

pstDynamicAddAxes POINTER TO DYNAMIC Dynamic for the 4th Axis


xRepeat BOOL Continous Run of Pick and Place
xAlreadyPicked BOOL If Already Picked -> direcly goto PlacePos
pstPickPos POINTER TO CART_POS Pick Pos

pstPlacePos POINTER TO CART_POS PlacePos


FB_PICK_AND_PLACE_CYCLIC Type Description
(Inputs)
pstParkPos POINTER TO CART_POS ParkPos

plrPrePickZ_Offset POINTER TO LREAL Z-Offset for Pick Position


plrPrePlaceZ_Offset POINTER TO LREAL Z-Offset for Place Position
plrPrePickZ_OffsetVel POINTER TO LREAL Offset Velocity for Pick Z-Offset
plrPrePlaceZ_OffsetVel POINTER TO LREAL Offset Velocity for Place Z-Offset
Continuous Move From PrePick to PickPos
xContinousPrePick BOOL
without stopping
Continuous Move From PrePlace to PlacePos
xContinousPrePlace BOOL
withoutsStopping
xTeachPickPos BOOL Teach the PickPos
xTeachPlacePos BOOL Teach the PlacePos
xTeachParkPos BOOL Teach the ParkPos
xAckPickOrPlace BOOL Acknowledge the Pick or Place Action
lrUpPosZ LREAL Upper Z-Pos
lrRadius LREAL Pick Place Radius
udiPickTimer UDINT Wait time at Pickpos [ms]
udiPlaceTimer UDINT Wait time at Placepos [ms]
xPickPosReady BOOL Signal for PickPos Ready
xPlacePosReady BOOL Signal for PlacePos Ready

Table 3.7: FB_PICK_AND_PLACE_CYCLIC (Inputs)

FB_PICK_AND_PLACE_CYCLIC Type Description


(Outputs)

xError BOOL Error: Internal Error


xDone BOOL Done: CNC Ready
POINTER TO Pointer of the Pick Place CNC
pCNC
SMC_CNC_REF
Signal for Portal at PrePickPos. Need to Ack to
xPrePick BOOL
Continuous
Signal for Portal at PrePlacePos. Need to Ack to
xPrePlace BOOL
Continuous
xPick BOOL Signal for Pick
xPlace BOOL Signal for Place
iPickCounter INT Counter for Pick
iPlaceCounter INT Counter for Place
udiCycle UDINT Pick and Place Cycle
udiCycleTime UDINT Pick Place Cycletime [ms]
tCycleTimePickPlace TIME Pick Place Cycletime [t#xS]
lrPickRatePerMin LREAL PickPlace rate per Minute
sCNC STRING Name of the Pick Place CNC

Table 3.8: FB_PICK_AND_PLACE_CYCLIC_G10 / _G51_52 (Outputs)


Table of contents

3.7 Message System


The message system can store up to 16 Message. Each Message (Struct) contains further information of current
occurred error or warning.
MESSAGE (Struct) Type Description

TimeStamp DATE_AND_TIME Date and time at message issue.


The time refers to the RTC of the PLC.
Category CATEGORY Category of the message:
NONE = 0
INFO = 1
WARNING = 2
ERROR = 3
Ack BOOL If true this message needs to be
acknowledged.
Reaction UINT Reaction of a message
➔ table Error Reaction.
Source SOURCE Source where the message occurs:
SubSystem
Can be set by superior PLC if more than
one system is being used.
Device
Axis 1 to 6.
MessageID DWORD Message ID
➔ table Error-ID_Table.
MessageIdent MESSAGE_IDENT Further Information:
Table
➔ table Error-ID (hex)
Additional01
Further Information 1
Additional02
Further Information 2

Table: MESSAGE

ERROR-ID_Table Description (ENUM)

0 NO_TABLE_USED
1 SMC_ERROR_Table (CODESYS Error Codes)
Check for SMC_ERROR in CODESYS.
2 CANOPEN_KERNEL_ERROR_Table
3 SDO_ERROR_TABLE
4 EMCX_ERROR_Table

5 CMMP_ERROR_TABLE

6 CMMT_ERROR_TABLE

Table: ERROR-ID_Table

Note
The Complete list of all ErrorID and description are in the following Excel List

You might also like