Introduction AFL Standard blocks for CODESYS V3

With AFL standard blocks the functionality of the AMK devices can be integrated into a PLC project. Programming time by using the AFL standard modules is significantly reduced. The AFL standard modules consist of a plurality of function blocks from different AMK libraries.

Overview of the AMK libraries

The AFL Standard blocks consist of AFL Application blocks and they are a part of the AFL Function Library.

Siehe 'AMK AFL Application blocks'.

The AFL Application blocks consist of PLC Basic blocks (See document Software description AmkLibraries (Part no. 205210))

 

 

Example based on standard block 'STANDARD AXIS':

AFL standard blocks

The standard block 'STANDARD_AXIS' (FB) consists of following AFL application blocks 'MANUAL_JOG_VAJ', 'POSITION_ABSOLUT_VAJ', 'MANUAL_VELOCITY', 'POSITION_HOMING_FIXED_STOP' and some more from AMK AFL Library (AmkAfl.lib). The source code of the AFL Standard block is user-editable.

AFL application blocks

AMK support with AFL Application blocks complex functions. They consists of PLC Basic blocks. The functionality of AFL Application blocks is predefined and can not be changed.

Example: MANUAL_JOG_VAJ (FB) from AMK AFL Library (AmkAfl.lib)

The function block 'MANUAL_JOG_VAJ' realises the jog operation (plus/minus) in position control. In addition to position, speed and acceleration, the user can also specify the jerk.

PLC basic function blocks

The function block 'MANUAL_JOG_VAJ' consists of following PLC Basic function blocks 'VGEN_AJ' und 'RATIO_INC' from library AmkBase.lib. The functionality of PLC Basic blocks is predefined and can not be changed.

 

Overview AFL Function library’s and documentation:

The AFL Function Library must be installed separately to AIPEX PRO. The version of the AFL Function Library depends on the used CODESYS version.

Version overview

AIPEX PRO + integrated CODESYS V3 version + compatible AFL Version

AIPEX PRO

version

CODESYS V3

version

CODESYS profile

compatible AFL version

3.04

 

 

 

3.5.10.4

CODESYS V3.5 SP10 Patch 4 AIPEX PRO

AFL V4 Version 3.5.5.0 2015/41

(part-no. 206004)

3.5.5.5

CODESYS V3.5 SP5 Patch 5 AIPEX PRO

3.5.3.6

 

CODESYS V3.5 SP3 Patch 6 AIPEX PRO

 

AFL V4 Version 3.5.3.0 2014/06

(part-no. 204786)

3.03

3.5.5.5

CODESYS V3.5 SP5 Patch 5 AIPEX PRO

AFL V4 version 3.5.5.0 2015/41

(part-no. 206004)

3.02

3.5.3.6

 

 

CODESYS V3.5 SP3 Patch 6 AIPEX PRO

 

 

AFL V4 version 3.5.3.0 2014/06

(part-no. 204786)

 

3.01

3.00

 

 

Steuerung

Firmware Version

CODESYS V3 Profil

iSA / A4

≥ 4.22

CODESYS V3.5 SP10 Patch 4 AIPEX PRO

iSA / A4

≤ 4.21

CODESYS V3.5 SP5 Patch 5 AIPEX PRO

A5 / A6

alle

CODESYS V3.5 SP10 Patch 4 AIPEX PRO (recommended) (with restrictions1))

CODESYS V3.5 SP5 Patch 5 AIPEX PRO (with restrictions1))

CODESYS V3.5 SP3 Patch 6 AIPEX PRO

1)

New features that affect the runtime system are not supported.

 

Corresponding CODESYS version must also be installed when installing AIPEX PRO.

Using the AFL Standard blocks

The AFL Standard blocks allow the user to easily access to all standard functions of the controllers, power supply's and axes. The predefined structures make it possible to access the setpoint/actual values, control/status bits, parameters and diagnostic messages. Advanced functions such as follow-up axis, gear ratios, winders, print mark control and table editing (cams) are available. The functionality will be continuously expanded.

The AFL Standard blocks will be imported inside the PLC project. The source code is open and can be edited by the user for customer specific applications. The AFL Standard blocks are called in the CODESYS program block 'PLC_PRG'. Axis blocks also include a synchronous action (actSync). The synchronous action is called in 'FPLC_PRG'.

 

Example: Standard instanced block type 'STANDARD_AXIS'

Program block 'PLC_PRG':

Freewheeling task for asynchronous functionality / call and declaration 'STANDARD_AXIS'

Program block 'FPLC_PRG': External event task, synchronized to ID2 'SERCOS cycle time' for synchronous functionality / call synchronous action (actSync)

 

Editable source 'STANDARD_AXIS'

 

A PLC project can be enlarged AFL Application blocks and PLC Basic function blocks.

Make sure that the functionality of used function blocks do not contradict each other. Eg. several blocks in a project that can set or reset the control signal 'RF Controller enable'.

Program structure with CODESYS V3 and AFL Standard blocks

Insert for each device (supply, control, drives ...), on that you want to have access with the PLC, an AFL Standard block.

The AFL Standard blocks are called in the CODESYS program block 'PLC_PRG'. Axis blocks also has a synchronous action (act Sync). The synchronous action must be called in 'FPLC_PRG'.

The FB 'BASIC_MOTION' is integrated into each standard axis block. That means FB 'BASIC_MOTION' must not be called separately in the PLC program. The interface between the device and AFL Standard block is realized with the Variable 'ST_DEVICE'. 'SET_CONTROL' summarizes the control-specific and 'ST_AXIS_DRIVE' the axis-specific data together.

The AMK file 'V3_Import.export' contains the AFL Standard blocks and associated structures. The contents of the folder 'Basic', 'Control' and 'Type' must necessarily be imported for each CODESYS V3 project. Using CODESYS V3 the AFL Standard blocks are imported in the current PLC project with the menu 'Project' → 'Import'.

The visualization elements of AFL Standard blocks are contained in an additional library.

 

Requirements:

AMK software AFL Library for CODESYS V3 AMK part no. O913 installed.

AFL template selected. Siehe 'Basic AIPEX PRO Settings'.

 

CODESYS V3 Menü 'Projekt' → 'Import'

(C:\Program Files (x86)\3S CODESYS\AmkAddition\Imports\Application\V3_import\V3_Import.export)

 

Overview of standard blocks and the associated macros:

Standard blocks

Macro folder

Macro

For device

STANDARD_CONTROL (FB) 1)

AflImportStandard

AflImportStandardControl

AMKAMAC
A4, A5, A6

STANDARD_CONTROL _iSA (FB) 1)

AflImportStandard

AflImportStandardControl_iSA

AMKASMART iSA

STANDARD_KE (FB)

AflImportStandard

AflImportStandardKE

AMKASYN KE/KEN/KES

STANDARD_AXIS_IDT4 (FB) 2)

AflImportStandard

AflImportStandardAxisIDT4

AMKASMART iDT4

STANDARD_AXIS_KWZ (FB) 2)

AflImportStandard

AflImportStandardAxisKWZ

AMKASYN KWZ

STANDARD_AXIS_ihX (FB) 2)

AflImportStandard

AflImportStandardAxis_ihX

AMKASMART ihX

STANDARD_AXIS (FB) 2)

AflImportStandard

AflImportStandardAxis

STANDARD_AXIS_

POSITION_INTERPOSED (FB) 2)

AflImportAdvanced-

Positioning

AflImportAdvancedPositioning

AMKASYN KW/KWD

(KW-R06,

KW-R07,

KW-R16,

KW-R17,

KW-R24-R,

KW-R25,

KW-R26,

KW-R27)

 

AMKASMART iDT5

 

AMKASMART
ihX 3)

STANDARD_AXIS_

POSITION_TO_THE_MARK (FB) 2)

AflImportPrintMarkAxis

AflImportStandardAxis-

PrintMarkPositionToTheMark

STANDARD_AXIS_

PRINTMARK_INSETTER_

INTERVAL (FB) 2)

AflImportPrintMarkAxis

AflImportStandardAxis-

PrintMarkInsetterInterval

STANDARD_AXIS_

PRINTMARK_INSETTER_

CONT (FB) 2)

AflImportPrintMarkAxis

AflImportStandardAxis-

PrintMarkInsetterCont

STANDARD_AXIS_

PRINTMARK_REGISTER_CONTROL_CONT (FB) 2)

AflImportPrintMarkAxis

AflImportStandardAxis-

PrintMarkRegisterControlCont

STANDARD_AXIS_

PRINTMARK_REGISTER_CONTROL_DISCONT (FB) 2)

AflImportPrintMarkAxis

AflImportStandardAxis-

PrintMarkRegisterControlDiscont

STANDARD_FOLLOW_AXIS_GEAR (FB) 2)

AflImportFollowAxis

AflImportFollowAxisGear

 

STANDARD_FOLLOW_AXIS_

CONTINUOUS_TABLE1_TABLE2 (FB) 2)

AflImportFollowAxis

AflImportFollowAxis-

ContinuousTable1Table2

STANDARD_FOLLOW_AXIS_

SWITCHING_TABLE_WITH_OUTGEAR (FB) 2)

AflImportFollowAxis

AflImportFollowAxis-

SwitchingTableWithOutgear

 

STANDARD_FOLLOW_AXIS_

SWITCHING_TABLE1_TABLE2 (FB) 2)

AflImportFollowAxis

AflImportFollowAxis-

SwitchingTable1Table2

 

STANDARD_FOLLOW_AXIS_

TABLE_CONTINUOUS (FB) 2)

AflImportFollowAxis

AflImportFollowAxis-

ContinuousTable

 

STANDARD_FOLLOW_TABLE_

ENGAGE_DISENG_AXIS (FB) 2)

AflImportFollowAxis

AflImportFollowAxis-

TableEngageDiseng

 

STANDARD_FOLLOW_TABLE_

START_AUTOSTOP_AXIS (FB) 2)

AflImportFollowAxis

AflImportFollowAxis-

TableStartAutoStop

 

STANDARD_WINDER_DANCER_AXIS (FB) 2)

AflImportStandardWinder

AflImportStandardWinderDancer

 

STANDARD_WINDER_TORQUE_AXIS (FB) 2)

AflImportStandardWinder

AflImportStandardWinderTorque

 

1) All standard blocks of the type CONTROL require the 'AMK CONTROL STRUCTURE' 'ST_CONTROL (STRUCT)'. 'ST_CONTROL (STRUCT)' is imported with the macro AflImportBasicControl from the folder AflImportBasic. 'ST_CONTROL (STRUCT)' needs imported 1 x per PLC project.

2) All standard blocks of the type AXIS call the FB 'BASIC_MOTION'. Der FB 'BASIC_MOTION' s imported with the macro AflImportBasicDrive from the folder AflImportBasic. FB 'BASIC_MOTION' needs imported 1 x per PLC project.

3) All standard blocks with expanded functionality can be used with a modification for the ihX. Siehe 'Modified 'Standard axes' for ihX drives'.

 

Application example:

 

Structure PLC program:

The macros 'AflImport ...' Importing the AFL Standard blocks and structures in the current PLC project.

*1

AflImportBasicControl import the structure 'ST_CONTROL'. It has to call one time for each project.

*2

Only if you use power supply module KE/KEN/KES (exception KEN 05-xx).

The devices AMKASMART iC and AMKASYN KEN 05-xx charge automatically the DC-Bus to supply the connected inverters.

*3

AflImportBasicDrive import 'BASIC_MOTION' (FB). It has to call one time for each project. 'BASIC_MOTION' must not be called by the user. It will be called automatically by the function block 'STANDARD_AXIS'.

 

You have to call for each project an instance of 'STANDARD_CONTROL' (for A-series) or 'STANDARD_CONTROL_iSA (for iSA) must be necessarily used in each PLC project.

 

The combination between AFL Standard block 'STANDARD_AXIS' and ID32796 'Source RF' Code 0: 'Controller enable (RF) via binary input' is not allowed.

The control signal RF 'inverter on' must be set via a function block.

Allowed:

Code 5: 'Controller enable via EtherCAT'

Code 25: 'RF via EtherCAT AND-linked with the binary input RF'

Visualization Standard blocks

The Standard block visualizations will be integrated (with CODESYS V3) inside the actual project by using the 'Import' function. CODESYS menu 'Project' → 'Import'.

C:\Programs (x86)\3S CODESYS\AmkAddition\Imports\Application\V3_import.

(The AFL Application block visualizations contained in an additional library. Siehe 'Visualization of AFL blocks'. )

 

The visualizations are integrated with Vis-tool 'Frame'.

 

Chose the desired visualization with the button 'add'.

 

The inserted frame in the visualization must be linked to the instanced AFL Standard block and the associated structure ST_AXIS_DRIVE.

With m_Input_stDevice_Str specified a name (STRING) which will be displayed in the visualization.

 

Selection visualization language.

 

Language-dependent texts are displayed only in the online mode.

 

The displayed texts (German and English) are stored in a text list: folder 'POUs' → 'Standard' → 'Visualizations' → 'Standard' → 'TextListStandard'

 

Display in 'RUN mode'

Overview - AFL Standard blocks and axis structures

The AFL Standard blocks will be integrated (with CODESYS V3) inside the actual project by using the 'Import' function. See CODESYS menu 'Project' → 'Import'.

 

STANDARD_CONTROL (FB)

(Import Ordner: POUs → Control)

The following basic functionalities for the controller are available:

Siehe 'STANDARD_CONTROL (FB)'.

 

STANDARD_CONTROL_iSA (FB)

(Import Ordner: POUs → Control)

The following basic functionalities for the controller with supply are available:

Siehe 'STANDARD_CONTROL_iSA (FB)'.

 

STANDARD_KE (FB)

(Import Ordner: POUs → Standard)

The following basic functionalities for the input are available:

Siehe 'STANDARD_KE (FB)'.

 

STANDARD_AXIS (FB)

STANDARD_IDT4 (FB)

STANDARD_ihX (FB)

STANDARD_KWZ (FB)

(Import Ordner: POUs → Standard)

The following basic functionalities for the axis are available:

 

Inputs/outputs on the function block

 

Access via program code

Siehe 'STANDARD_AXIS (FB) (STANDARD_AXIS_KWZ, STANDARD_AXIS_IDT4, STANDARD_AXIS_ihX)'.

Advanced standard axes

The advanced axes feature the same basic functionalities as function block 'STANDARD_AXIS'.

 

It is possible to implement a dancer winder or sensorless rewinder and unwinder with 'Winder' type axes.

It is possible to implement a printing mark control or interposed positioning with 'Position' type axes.

It is possible to implement a printing mark control with 'Printmark' type axes.

'Follow' type axes are available. These follow a setpoint value (master) synchronously.
In addition tables can also be calculated for cam functions, for example.

 

STANDARD_AXIS_POSITION_INTERPOSED (FB)

(Import Ordner: POUs → Advanced Positioning)

Expanded functionality:

Siehe 'STANDARD_AXIS_POSITION_INTERPOSED (FB)'.

 

STANDARD_AXIS_POSITION_TO_THE_MARK (FB)

(Import Ordner: POUs → Print marks)

Expanded functionality:

Siehe 'STANDARD_AXIS_POSITION_TO_THE_MARK (FB)'.

 

STANDARD_AXIS_PRINTMARK_INSETTER_CONT (FB)

(Import Ordner: POUs → Print marks)

Expanded functionality:

Siehe 'STANDARD_AXIS_PRINTMARK_INSETTER_CONT (FB)'.

 

STANDARD_AXIS_PRINTMARK_INSETTER_INTERVAL (FB)

(Import Ordner: POUs → Print marks)

Expanded functionality:

Siehe 'STANDARD_AXIS_PRINTMARK_INSETTER_INTERVAL (FB)'.

 

STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_CONT (FB)

(Import Ordner: POUs → Print marks)

Expanded functionality:

Siehe 'STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_CONT (FB)'.

 

STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_DISCONT (FB)

(Import Ordner: POUs → Print marks)

Expanded functionality:

Siehe 'STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_DISCONT (FB)'.

 

STANDARD_FOLLOW_AXIS_GEAR (FB)

(Import Ordner: POUs → Follow)

Expanded functionality:

Siehe 'STANDARD_FOLLOW_AXIS_GEAR (FB)'.

 

STANDARD_FOLLOW_AXIS_CONTINUOUS_TABLE1_TABLE2 (FB)

(Import Ordner: POUs → Follow)

Expanded functionality:

Siehe 'STANDARD_FOLLOW_AXIS_CONTINUOUS_TABLE1_TABLE2 (FB)'.

 

STANDARD_FOLLOW_AXIS_SWITCHING_TABLE_WITH_OUTGEAR (FB)

(Import Ordner: POUs → Follow)

Expanded functionality:

Siehe 'STANDARD_FOLLOW_AXIS_SWITCHING_TABLE_WITH_OUTGEAR (FB)'.

 

STANDARD_FOLLOW_AXIS_SWITCHING_TABLE1_TABLE2 (FB)

(Import Ordner: POUs → Follow)

Expanded functionality:

Siehe 'STANDARD_FOLLOW_AXIS_SWITCHING_TABLE1_TABLE2 (FB)'.

 

STANDARD_FOLLOW_AXIS_TABLE_CONTINUOUS (FB)

(Import Ordner: POUs → Follow)

Expanded functionality:

Siehe 'STANDARD_FOLLOW_AXIS_TABLE_CONTINUOUS (FB)'.

 

STANDARD_FOLLOW_TABLE_ENGAGE_DISENG_AXIS (FB)

(Import Ordner: POUs → Follow)

Expanded functionality:

Siehe 'STANDARD_FOLLOW_TABLE_ENGAGE_DISENG_AXIS (FB)'.

 

STANDARD_FOLLOW_TABLE_START_AUTOSTOP_AXIS (FB)

(Import Ordner: POUs → Follow)

Expanded functionality:

Siehe 'STANDARD_FOLLOW_TABLE_START_AUTOSTOP_AXIS (FB)'.

 

STANDARD_WINDER_DANCER_AXIS (FB)

(Import Ordner: POUs → Winder)

Expanded functionality:

The function block 'STANDARD_WINDER_DANCER_AXIS' realizes a dancer winder with the following characteristics with following features:

Siehe 'STANDARD_WINDER_DANCER_AXIS (FB)'.

 

STANDARD_WINDER_TORQUE_AXIS (FB)

(Import Ordner: POUs → Winder)

Expanded functionality:

Siehe 'STANDARD_WINDER_TORQUE_AXIS (FB)'.

Structures

The following access options are available:

 

PLC controller (ST_CONTROL):

(Import Ordner: POUs → Data typs → AMK_CONTROL_STRUCTURE)

Siehe 'ST_CONTROL (ST)'.

 

Axis (ST_AXIS_DRIVE):

(Import Ordner: POUs → Data typs → AMK_AXIS_STRUCTURE)

Siehe 'ST_AXIS_DRIVE (ST)'.