Introduction AFL Standard blocks for CODESYS V2
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 documentSoftware description AmkLibraries (Part no. 205210))
|
Example based on standard block 'STANDARD AXIS':
AFL standard blocks
The standard block
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
PLC basic function blocks
The function block 'MANUAL_JOG_VAJ' consists of following PLC Basic function blocks
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 V2 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.
For each standard block a matching visualization is imported.
The standard blocks will imported in the current PLC project by using an macros. The macro contains all the instructions to import an imported standard block in the current project.
Requirements:
AMK software AFL Library for CODESYS V2 AMK part no. O877 installed.
AFL template selected. Siehe 'Configuration create'.
By using CODESYS V2 the macros are execute with the menu 'Edit' → 'Macros'.
Standard blocks |
Macro folder |
Macro |
For device |
---|---|---|---|
STANDARD_CONTROL (FB) 1) |
AflImportStandard |
AflImportStandardControl |
AMKAMAC |
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,
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 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 visualizations of the standard blocks will be imported into the tap/folder 'visualization'.
For each standard block an instance of the visualization must be generated.
Overview - Standard function blocks and axis structures
The standard function blocks will be integrated (with CODESYS V2) inside the actual project with ‘macros’. See CODESYS menu 'Edit' → 'Marcros'.
STANDARD_CONTROL (FB)
(Macro: AflImportBasic - AflImportBasicControl + AflImportStandard - AflImportStandardControl)
The following basic functionalities for the controller are available:
- Status bits (SBM System ready message, QFL Acknowl. error cleared, network and bus information)
- The controlling of FL
- The reading out of diagnostic messages
Siehe 'STANDARD_CONTROL (FB)'.
STANDARD_CONTROL_iSA (FB)
(Macro: AflImportBasic - AflImportBasicControl + AflImportStandard - AflImportStandardControl_iSA)
The following basic functionalities for the controller with supply are available:
- The importing of status bit information (network ready, bus ready, bus warning, bus error, SBM, QUE and QFL)
- The controlling of FL
- The reading out of diagnostic messages
Siehe 'STANDARD_CONTROL_iSA (FB)'.
STANDARD_KE (FB)
(Macro: AflImportStandard - AflImportStandardKE)
The following basic functionalities for the input are available:
- Status bits (QUE Acknowl. DC bus ON, SBM System ready message)
- Control bits (UE DC bus ON, FL Clear error)
- Output of diagnostics number
STANDARD_AXIS (FB)
STANDARD_IDT4 (FB)
STANDARD_ihX (FB)
STANDARD_KWZ (FB)
(Macro: AflImportBasic - AflImportBasicDrive + AflImportStandard - AflImportStandardAxis)
The following basic functionalities for the axis are available:
Inputs/outputs on the function block
- Control bits (RF Controller enable, FL Clear error)
- Emergency stop
- Speed control
- Homing cycle
- Positioning (absolute/relative)
- Jog mode (minus/plus)
- Status signals of axis functions
Access via program code
- Configuration of status messages (ID26 'Configuration status bits')
- Reading of parameters according to a specifications list
- Actual position cached
- Control with feedforward (torque and speed)
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)
(Macro: AflImportAdvancedPositioning - AflImportAdvancedPositioning )
Expanded functionality:
- Interposed positioning
Siehe 'STANDARD_AXIS_POSITION_INTERPOSED (FB)'.
STANDARD_AXIS_POSITION_TO_THE_MARK (FB)
(Macro: AflImportPrintMarkAxis - AflImportStandardPrintMarkAxisPositionToTheMark)
Expanded functionality:
- Printing mark control
Siehe 'STANDARD_AXIS_POSITION_TO_THE_MARK (FB)'.
STANDARD_AXIS_PRINTMARK_INSETTER_CONT (FB)
(Macro: AflImportPrintMarkAxis - AflImportStandardAxisPrintMarkInsetterCont)
Expanded functionality:
- Print mark control: The position of the web to be treated is controlled in relation to a master format (insetting)
Siehe 'STANDARD_AXIS_PRINTMARK_INSETTER_CONT (FB)'.
STANDARD_AXIS_PRINTMARK_INSETTER_INTERVAL (FB)
(Macro: AflImportPrintMarkAxis - AflImportStandardAxisPrintMarkInsetterInterval)
Expanded functionality:
- Print mark control: The position of the web to be treated is controlled in relation to a master format (insetting)
Siehe 'STANDARD_AXIS_PRINTMARK_INSETTER_INTERVAL (FB)'.
STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_CONT (FB)
(Macro: AflImportPrintMarkAxis - AflImportStandardAxisPrintMarkRegisterControlCont)
Expanded functionality:
- Print mark control: The position of the treating tool (e.g. cutter, punch) is controlled in relation to a master format (register control)
Siehe 'STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_CONT (FB)'.
STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_DISCONT (FB)
(Macro: AflImportPrintMarkAxis - AflImportStandardAxisPrintMarkRegisterControlDiscont)
Expanded functionality:
- Print mark control: The position of the treating tool (e.g. cutter, punch) is controlled in relation to a master format (register control)
Siehe 'STANDARD_AXIS_PRINTMARK_REGISTER_CONTROL_DISCONT (FB)'.
STANDARD_FOLLOW_AXIS_GEAR (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisGear)
Expanded functionality:
- The slave axis continuously follows a master.
- A gear ratio can be defined.
Siehe 'STANDARD_FOLLOW_AXIS_GEAR (FB)'.
STANDARD_FOLLOW_AXIS_CONTINUOUS_TABLE1_TABLE2 (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisContinuousTable1Table2)
Expanded functionality:
- The slave axis continuously follows a freely selectable table.
- At the end of the table, a table switchover can be carried out.
Siehe 'STANDARD_FOLLOW_AXIS_CONTINUOUS_TABLE1_TABLE2 (FB)'.
STANDARD_FOLLOW_AXIS_SWITCHING_TABLE_WITH_OUTGEAR (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisSwitchingTableWithOutgear)
Expanded functionality:
- The slave axis continuously follows a freely selectable table.
- At the end of the table, a table switchover can be carried out.
- The table can be modified via a gear ratio (compress and extend).
Siehe 'STANDARD_FOLLOW_AXIS_SWITCHING_TABLE_WITH_OUTGEAR (FB)'.
STANDARD_FOLLOW_AXIS_SWITCHING_TABLE1_TABLE2 (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisSwitchingTable1Table2)
Expanded functionality:
- The slave axis continuously follows a freely selectable table with a phasing-in and phasing out table.
- At the end of the table, a table switchover can be carried out.
Siehe 'STANDARD_FOLLOW_AXIS_SWITCHING_TABLE1_TABLE2 (FB)'.
STANDARD_FOLLOW_AXIS_TABLE_CONTINUOUS (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisContinuousTable)
Expanded functionality:
- The slave axis continuously follows a freely selectable table.
Siehe 'STANDARD_FOLLOW_AXIS_TABLE_CONTINUOUS (FB)'.
STANDARD_FOLLOW_TABLE_ENGAGE_DISENG_AXIS (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisTableEngageDiseng)
Expanded functionality:
- The slave axis continuously follows a freely selectable table with a phasing-in and phasing out table.
Siehe 'STANDARD_FOLLOW_TABLE_ENGAGE_DISENG_AXIS (FB)'.
STANDARD_FOLLOW_TABLE_START_AUTOSTOP_AXIS (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisTableStartAutoStop)
Expanded functionality:
- The slave axis continuously follows a freely selectable table with a phasing-in and phasing out table.
Siehe 'STANDARD_FOLLOW_TABLE_START_AUTOSTOP_AXIS (FB)'.
STANDARD_WINDER_DANCER_AXIS (FB)
(Macro: AflImportFollowAxis - AflImportFollowAxisTableEngageDiseng)
Expanded functionality:
The function block 'STANDARD_WINDER_DANCER_AXIS' realizes a dancer winder with the following characteristics with following features:
- PID regulated dancer winder
- Operation as unwinder and rewinder
- Diameter calculation
- Search diameter at the start of the winder
Siehe 'STANDARD_WINDER_DANCER_AXIS (FB)'.
STANDARD_WINDER_TORQUE_AXIS (FB)
(Macro: AflImportStandardWinder - AflImportStandardWinderTorque)
Expanded functionality:
- The function block 'STANDARD_WINDER_TORQUE_AXIS' realizes a sensorless rewinder and unwinder with following features:
- Torque controlled center winder
- Operation as rewinder and unwinder
- Diameter calculation
- Search diameter at the start of the winder
- Determine the reel of inertia of unknown diameter
- Synchronize onto a running web
(Further information: See documentation on application blocks part no. 203694 FB 'WINDER_TORQUE_CONTROL'
Siehe 'STANDARD_WINDER_TORQUE_AXIS (FB)'.
Structures
The following access options are available:
PLC controller (ST_CONTROL):
- Status bits (SBM System ready message, network status)
- Control bits (FL Clear error, Read diagnostic message)
- Diagnostic array (memory for ten diagnostic messages)
Axis (ST_AXIS_DRIVE):
- Setpoint values (speed, position, torque, pilot control values)
- Actual values (speed, position, actual torque, probe values, etc.)
- Control bits (RF controller enable, FL Clear error, Read diagnostic message)
- Status bits (Speed window, Standstill window, etc.)
- Diagnostic array (memory for ten diagnostic messages)
- Read parameter list
- Configuration (PLC functions)