IFM AC1401 Programming Manual

IFM AC1401 Programming Manual

As-i gateway ac14 with firldbus interfaces
Hide thumbs Also See for AC1401:
Table of Contents

Advertisement

Quick Links

Programming Manual
AS-i Gateway AC14
with fieldbus interfaces
AC1401/02
AC1411/12
AC1421/22
Firmware release: 4.2.x
CODESYS release: 3.5.9.73 or higher
English

Advertisement

Table of Contents
loading

Summary of Contents for IFM AC1401

  • Page 1 Programming Manual AS-i Gateway AC14 with fieldbus interfaces AC1401/02 AC1411/12 AC1421/22 Firmware release: 4.2.x CODESYS release: 3.5.9.73 or higher English...
  • Page 2: Table Of Contents

    Installation CODESYS programming software ..................11 4.1.1 Install CODESYS Development System..................11 ifm AS-i Package........................12 4.2.1 Components of the ifm package ....................12 4.2.2 Install the ifm package ........................ 13 4.2.3 Update ifm package ........................13 4.2.4 Uninstall the ifm package ......................14 Getting started Create CODESYS project ....................16...
  • Page 3 9.1.1 Overview: AS-i functions (FB_ASi) ..................... 60 9.1.2 Overview: System functions (FB_System) ................106 9.1.3 Enumeration types and complex variables ................113 Library ACnnnn_SYS_CMD.library ..................121 9.2.1 ACnnnn_SysCmd ........................121 Index ifm weltweit • ifm worldwide • ifm à l’échelle internationale...
  • Page 4: Preliminary Note

    Purpose of the document 18872 This document applies to the following devices of the type"AS-i Gateway AC14":  AS-i Gateway AC14 with Profinet device interface (AC1401/AC1402)  AS-i Gateway AC14 with Profibus slave interface (AC1411/AC1412)  SmartSPS AC14 with EtherNet/IP device interface (AC1421/AC1422) It is part of the device and contains information about the correct handling of the product.
  • Page 5: Symbols And Styles Used

    [...] Designation of pushbuttons, buttons or indications > Overview: User documentation for AS-i Gateway AC14 6998 ifm electronic provides the following user documentation for the models of the device class "AS-i Gateway AC14": Document Content / Description Data sheet Technical data of the device as a table ...
  • Page 6: Overview: Codesys Documentation Of 3S

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Preliminary note Overview: CODESYS documentation of 3S > Overview: CODESYS documentation of 3S 18296 3S GmbH provides the following user documentation for programming PLC of AC4S: Document Content / Description  Online help Context-sensitive help ...
  • Page 7: Safety Instructions

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Safety instructions General safety instructions Safety instructions General safety instructions ........................7 Required background knowledge ......................7 Warnings used ............................8 > General safety instructions 8516 Read this document before setting up the product and keep it during the entire service life. Only use the product for its intended purpose.
  • Page 8: Warnings Used

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Safety instructions Warnings used > Warnings used 13685 WARNING Death or serious irreversible injuries may result. CAUTION Slight reversible injuries may result. NOTICE Property damage is to be expected or may result. Important note Non-compliance may result in malfunction or interference.
  • Page 9: System Requirements

    Function libraries for programming of the PLC The assured characteristics and functions described in this manuals are only accessible with the indicated releases of the software components! ifm electronic provides the software components for downloading on its website: → www.ifm.com...
  • Page 10: Licensing

    All models of the device family AS-i Gateway AC14, to be programmed using the CODESYS Development System 3.5 SP9 Patch 7 Hotfix 3, must be licensed. A valid license label can be purchased from ifm electronic. Article description Article no.
  • Page 11: Installation

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Installation CODESYS programming software Installation CODESYS programming software ......................11 ifm AS-i Package ............................12 17146 > CODESYS programming software 7282 The CODESYS Development System (short: CODESYS) is a platform for the creation of PLC applications according to the standard IEC 61131-3.
  • Page 12: Ifm As-I Package

    → Online help > CODESYS Development System > Manage packages and licences > 4.2.1 Components of the ifm package 17552 To program the AS-i Gateway AC14, ifm provides the CODESYS package "CODESYS for ifm SmartPLC StandardLine" (short: ifm package). The ifm package (file: ifm_SmartPLC_StandardLine_V1_6_4_14.package) contains the following components: Component Description AC14SL.devdesc.xml...
  • Page 13: Install The Ifm Package

    To update an installed package "CODESYS for ifm SmartPLC StandardLine": Download new version of the ifm package ► Got to the product page of the device on the ifm website. ► Download ifm_SmartPLC_StandardLine_V1_6_4_14.package and save it on the CODESYS PC/laptop.
  • Page 14: Uninstall The Ifm Package

    Installation ifm AS-i Package > 4.2.4 Uninstall the ifm package 12270 To uninstall the package "CODESYS for ifm SmartPLC StandardLine": Start CODESYS ► Start CODESYS with administrator rights. > CODESYS programming interface appears. Uninstall the ifm package ► Select [Tools] > [Package Manager] to access the package manager.
  • Page 15: Getting Started

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Getting started ifm AS-i Package Getting started Create CODESYS project ........................16 Use CODESYS online help ........................19 Set the programming interface .......................20 15858...
  • Page 16: Create Codesys Project

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Getting started Create CODESYS project > Create CODESYS project Create new project with AS-i Gateway AC14 ..................17 Overview: Project structure with AS-i Gateway AC14 ................18 17129 ► Familiarise yourself with the following CODESYS functions! ...
  • Page 17: Create New Project With As-I Gateway Ac14

    5.1.1 Create new project with AS-i Gateway AC14 17682 To avoid errors during manual system configuration, it is explicitly recommended to use the project template from ifm electronic when creating the AS-i Gateway AC14 project in CODESYS. Qualifications > All required software components are correctly installed (→...
  • Page 18: Overview: Project Structure With As-I Gateway Ac14

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Getting started Create CODESYS project Save the project ► Select [File] > [Save Project]. > CODESYS saves the project. > 5.1.2 Overview: Project structure with AS-i Gateway AC14 17132 A CODESYS project contains all components for the programming and administration of PLC applications.
  • Page 19: Use Codesys Online Help

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Getting started Use CODESYS online help > Use CODESYS online help 6989 This manual only describes the integration, configuration and the programming of the AS-i Gateway AC14 using the CODESYS development system. For the description of user actions and user interface elements the CODESYS terminology will be used.
  • Page 20: Set The Programming Interface

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Getting started Set the programming interface > Set the programming interface 18494 To download the created projects and applications to the device a valid network path between the CODESYS programming system and the PLC of the device has to be selected. >...
  • Page 21: System Configuration

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 System configuration Configure PLC System configuration Configure PLC ............................21 Configure Ethernet interface........................22 18498 > Configure PLC 18961 ► Familiarise yourself with the following CODESYS functions!  Generic device editor → Online help > CODESYS Development System > Reference user interface > Objects>...
  • Page 22: Configure Ethernet Interface

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 System configuration Configure Ethernet interface > Configure Ethernet interface Available fieldbus stacks ........................22 Add fieldbus stack ..........................23 17701 ► Familiarise yourself with the following CODESYS functions!  Menu command "Attach device" → Online help > CODESYS Development System > Devices > Attach Device... ...
  • Page 23: Add Fieldbus Stack

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 System configuration Configure Ethernet interface > 6.2.2 Add fieldbus stack 18659 ► Familiarise yourself with the following CODESYS functions!  Modbus configurator → Online help > Fieldbus support > Modbus configurator To declare the Ethernet interface as a fieldbus interface: Create/load CODESYS project ►...
  • Page 24: Programming

    Objects of a PLC application Programming Objects of a PLC application ........................24 Create PLC application ...........................25 Access input and output data .........................27 Use functions of the ifm package ......................33 Use visualisations ...........................40 Configure task processing ........................45 Testing the PLC application........................46 7074 This chapter provides information about the programming of the PLC of the device.
  • Page 25: Create Plc Application

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Create PLC application > Create PLC application 17691 ► Familiarise yourself with the following CODESYS functions!  Program application → Online help > CODESYS Development System > Program application  Programming reference →...
  • Page 26: Supported Programming Languages

    12/2017 Programming Create PLC application > 7.2.2 Supported programming languages 18034 The following table shows which programming languages according to IEC 61131 are supported by the ifm function libraries: Library ACnnnn_Utils.library ACnnnn_SYS_CMD.library Legend: X ... is supported > 7.2.3 Change system time of the device...
  • Page 27: Access Input And Output Data

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Access input and output data > Access input and output data Options to access input and output data ....................27 Validity of the interface data ........................28 Process data of the AS-i slaves ......................29 Fieldbus data ............................31 17447 ►...
  • Page 28: Validity Of The Interface Data

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Access input and output data > 7.3.2 Validity of the interface data 18413 In order to facilitate the access to inputs and outputs of AS-i slaves, AS-i Gateway AC14 projects offer Overview: Project structure with AS-i Gateway AC14 clearly defined interfaces in the device tree (→...
  • Page 29: Process Data Of The As-I Slaves

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Access input and output data > 7.3.3 Process data of the AS-i slaves 17584 The project tree offers direct access to the cyclically updated process images of the inputs and outputs of the AS-i slaves. Digital input and output data of the slave at AS-i master 1: →...
  • Page 30 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Access input and output data > Digital input and output data 17625 To access the digital process data of the slaves at AS-i master 1: ► In the device tree: Double click on [ASi_1_binaryIO] >...
  • Page 31: Fieldbus Data

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Access input and output data > 7.3.4 Fieldbus data 17585 The device tree offers direct access to the data that is transmitted between fieldbus and device. Data that the fieldbus transmits/receives via the fieldbus. →...
  • Page 32 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Access input and output data > Output data of the AS-i slaves 17620 The area contains all data, the higher-level Fieldbus controller cyclically sends to the outputs of the AS-i slaves via the fieldbus network. The data is structure like an AS-i network. The programmer can access this data via IEC addresses.
  • Page 33: Use Functions Of The Ifm Package

    Use functions of the ifm package 18489 The CODESYS package "CODESYS for ifm SmartPLC StandardLine" offers different functions for the programming of the device-internal CODESYS controller. In the following sections, these functions will be briefly described. To make orientation easier, the functions are grouped according to corresponding subjects and provided with a cross-reference to a detailed explanation in the document's appendix.
  • Page 34 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use functions of the ifm package xExecute = TRUE: Rising edge (FALSE  TRUE) starts execution of the FB. xBusy = TRUE: FB execution has been started, but has not yet been completed.
  • Page 35: Configure System

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use functions of the ifm package > 7.4.2 Configure system 17450 To configure the system of the device, use the following function blocks: Name Description Reference QuickSetupASi_Master → QuickSetupASi_Master Execute quick setup routine on an AS-i master (→...
  • Page 36: Manage As-I Network

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use functions of the ifm package > 7.4.5 Manage AS-i network 17126 To manage the AS-i networks controlled by AS-i Gateway AC14, use the following function blocks: > Use complex variables 18528 There are different complex variables (STRUCT) at the programmer's disposal.
  • Page 37 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use functions of the ifm package > Read network settings 18532 To read the network settings cyclically and offer them in the application: Name Description Reference Get_ASi_Data → Get_ASi_Data Read the following datasets for network management in (→...
  • Page 38 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use functions of the ifm package > Read configuration data of the slaves 18533 Name Description Reference Get_CDI → Get_CDI Read configuration data image (IO, ID, ID1, ID2) of all (→ p. 79)
  • Page 39: Send Commands To The System And The As-I Master

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use functions of the ifm package > 7.4.6 Send commands to the system and the AS-i master 17659 Similar to the acyclic transmission command channels and data sets of the device, the programmer...
  • Page 40: Use Visualisations

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use visualisations > Use visualisations Supported visualisation types .........................40 Add visualisation to a project ........................41 Create a visualisation ..........................42 Configure visualisation ...........................43 17059 ► Familiarise yourself with the following CODESYS functions!  Visualisations in CODESYS →...
  • Page 41: Add Visualisation To A Project

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use visualisations > 7.5.2 Add visualisation to a project 17060 To add a visualisation to a CODESYS project: ► Open CODESYS project. Create new CODESYS project. (→ Create new project with AS-i Gateway AC14 (→...
  • Page 42: Create A Visualisation

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use visualisations > 7.5.3 Create a visualisation 17061 Create a seperate visualisation object for each target and web visualisation. To create a visualisation for a PLC application: ► In the device tree: double-click on [Visualization] >...
  • Page 43: Configure Visualisation

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use visualisations > 7.5.4 Configure visualisation 6953 In order to change the properties of the created visualisations, choose one of the following options:  Change properties of the web visualisation (→ p. 43) ...
  • Page 44 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Use visualisations > Change the properties of the target visualisation 17064 To change the properties of the target visualisation: ► In device tree: Double-click on [TargetVisu] > Editor window shows properties of the target visualisation. ►...
  • Page 45: Configure Task Processing

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Configure task processing > Configure task processing 4109 ► Familiarise yourself with the following CODESYS functions!  Task configuration → Online help > CODESYS Development System > application programmable > task configuration The processing of the tasks is controlled by parameters.
  • Page 46: Testing The Plc Application

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Programming Testing the PLC application > Testing the PLC application 18594 ► Familiarise yourself with the following CODESYS functions!  Test and fault elimination → Online help > CODESYS Development System > Testing and Debugging To ensure permanent operation without errors in industrial environments, the created PLC application must be tested in detail and possible faults must be remedied.
  • Page 47: Operation

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Testing the PLC application Operation Transfer CODESYS project to device ....................48 Operating states of the PLC ........................52 Reset ..............................54 Display web visualisation ........................56 Display target visualisation ........................57 18492...
  • Page 48: Transfer Codesys Project To Device

    ► Before loading an application to the device delete all ifm system solutions saved on the device (→ Device manual, Uninstall ifm apps)! To be able to use an ifm system solution in a user project the functions must be integrated into the project via libraries to be ordered separately.
  • Page 49: Activate Codesys Plc

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Transfer CODESYS project to device > 8.1.1 Activate CODESYS PLC 17692 To enable the processing of the created PLC application, the device-internal CODESYS PLC must be activated in the setup menu of AS-i Gateway AC14. If the PLC application is to have a write access to the outputs of the AS-i slaves, the CODESYS PLC must be activated additionally as controller instance of the AS-i slave outputs.
  • Page 50: Download The Application To The Device

    Set communication path to PLC (→ p. 20)). > Project tested. > All ifm system solutions stored on the devie are deleted (→ device manual: Uninstall ifm apps) Build application ► In the device tree: Highlightt application as active application.
  • Page 51: Delete Boot Application Via Sd Card

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Transfer CODESYS project to device > 8.1.4 Delete boot application via SD card 15970 If after the start of a complex boot application the device is overloaded and does not respond any more to user inputs or login attempts, the boot application on the device needs to be forcibly deleted.
  • Page 52: Operating States Of The Plc

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Operating states of the PLC > Operating states of the PLC 17544 This section provides information about the operating states of the device and the states of the PLC of the device as well as information about the states of the applications. >...
  • Page 53: Switch Operating States

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Operating states of the PLC > 8.2.3 Switch operating states 10264 To switch between the operating states of the application choose one of the following options: > Start PLC application 18027 To start a PLC application stored on the device: ...
  • Page 54: Reset

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Reset > Reset Supported reset variants ........................54 Reset the application (warm) ........................55 Reset the application (cold) ........................55 Reset the application (origin) ........................55 18025 > 8.3.1 Supported reset variants 18613 The following table shows the reset variants supported by the device-internal CODESYS PLC and the resulting system behaviour: Type of reset System behaviour...
  • Page 55: Reset The Application (Warm)

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Reset > 8.3.2 Reset the application (warm) 13131 9069 To reset the application on the PLC, choose one of the following options:  CODESYS: command [Reset (warm)] ► In the device tree: Highlight the required application as active application.
  • Page 56: Display Web Visualisation

    Change properties of the web visualisation (→ p. 43)). > Web browser shows the web visualisation of the device. ifm system solution ► Install the ifm system solution on the device and start it (→ device manual, Install single/basic app Install multi app).
  • Page 57: Display Target Visualisation

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Operation Display target visualisation > Display target visualisation 20256 After compilation of the project and download to the device the user has to start the target visualisation:  CODESYS / higher-level Fieldbus controller: ►...
  • Page 58: Appendix

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Display target visualisation Appendix Library ACnnnn_Utils.library ........................59 Library ACnnnn_SYS_CMD.library ......................121 7156...
  • Page 59: Library Acnnnn_Utils.library

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Library ACnnnn_Utils.library Overview: AS-i functions (FB_ASi) ......................60 Overview: System functions (FB_System) ...................106 Enumeration types and complex variables ...................113 17722...
  • Page 60: Overview: As-I Functions (Fb_Asi)

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > 9.1.1 Overview: AS-i functions (FB_ASi) Get_ASi_PHY_Dat ..........................61 Get_LAS ..............................63 Get_LDS ..............................65 Get_LPS ..............................67 Get_LCE ..............................69 Get_LCEAS ............................71 Get_LCEMS ............................73 Get_LDAE...............................75 Get_LPF ..............................77 Get_CDI ..............................79 Get_PCD ..............................81 Get_InputParameter ..........................83 Get_OutputParameter ..........................85 Set_AddressMode ..........................87 Set_ASi_Config ............................89 Set_LPS..............................91...
  • Page 61: Get_Asi_Phy_Dat

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_ASi_PHY_Dat 16005 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16040 The FB reads the physical data of the selected AS-i master and provides the values. >...
  • Page 62 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16042 Parameter Data type Description Possible values BOOL Voltage source (Power Source) FALSE Unit is supplied via Aux. TRUE Unit is supplied via AS-i. BOOL Power24-Modul (PM) FALSE Power24 module missing.
  • Page 63: Get_Las

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LAS 16008 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16068 The FB reads the list of activated slaves (LAS) of the selected AS-i master and provides the values. >...
  • Page 64 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16070 Parameter Data type Description Possible values dwLAS_SA_Slaves DWORD List of the active S/A slaves. Each bit Per bit: represents an AS-i address:  Bit 0 (LSB) = address 0 No single/A slave available Single/A slave available Bit 31 (MSB) = address 31/31A...
  • Page 65: Get_Lds

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LDS 16013 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16118 The FB reads the list of detected slaves (LDS) of the selected AS-i master and provides the values. >...
  • Page 66 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16120 Parameter Data type Description Possible values dwLDS_SA_Slaves DWORD List of detected S/A slaves. Each bit Per bit: represents an AS-i address:  Bit 0 (LSB) = address 0 no slave detected slave detected ...
  • Page 67: Get_Lps

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LPS 16015 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16130 The FB reads the list of projected slaves (LPS) at the selected AS-i master and provides the values. >...
  • Page 68 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16132 Parameter Data type Description Possible values dwLPS_SA_Slaves DWORD List of the projected S/A slaves. Each Per bit: bit represents an AS-i address:  Bit 0 (LSB) = address 0 Slave not projected Slave projected ...
  • Page 69: Get_Lce

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LCE 16009 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16075 The FB reads the list of configuration errors (LCE) of the selected AS-i master and provides the values.
  • Page 70 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16077 Parameter Data type Description Possible values dwLCE_SA_Slaves DWORD List of configuration errors of the S/A Per bit: slaves. Each bit represents an AS-i address: No configuration error ...
  • Page 71: Get_Lceas

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LCEAS 16010 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16098 The FB reads the list of existing but not projected slaves (List of Configuration Error – Additional Slave = LCEAS) of the selected AS-i master and provides the values.
  • Page 72 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16100 Parameter Data type Description Possible values dwLCEAS_SA_Slaves DWORD List of configuration errors of the S/A Per bit: slaves. Each bit represents an AS-i address: No configuration error - additional slave ...
  • Page 73: Get_Lcems

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LCEMS 16011 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16106 The FB reads the list of projected but missing slaves (List of Configuration Error – Missing Slave = LCEMS) at the selected AS-i master and provides the values.
  • Page 74 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16108 Parameter Data type Description Possible values dwLCEMS_SA_Slaves DWORD List of configured but missing S/A Per bit: slaves. Each bit represents an AS-i address: No configuration error - ...
  • Page 75: Get_Ldae

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LDAE 16012 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16112 The FB reads the double address errors (LDAE) of the selected AS-i master and provides the values in a list.
  • Page 76 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16114 Parameter Data type Description Possible values dwLDAE_SA_Slaves DWORD List of the double address errors. Per bit: Each bit represents an AS-i address:  Bit 0 (LSB) = address 0 No double address error Double address error Bit 31 (MSB) = address 31/31A...
  • Page 77: Get_Lpf

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_LPF 16014 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16124 The FB reads the list of peripheral faults (LPF) of the selected AS-i master and provides the values. >...
  • Page 78 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16126 Parameter Data type Description Possible values dwLPF_SA_Slaves DWORD List of peripheral faults on S/A slaves. Per bit: Each bit represents an AS-i address:  Bit 0 (LSB) = address 0 No peripheral fault Peripheral fault detected Bit 31 (MSB) = address 31/31A...
  • Page 79: Get_Cdi

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_CDI 16006 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16045 The FB reads the configuration data (Configuration Data Image = CDI) of the slaves at the selected AS-i master and provides the values in an array.
  • Page 80 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16047 Parameter Data type Description Possible values awCDI ARRAY [0...63] Configuration data of the slaves at the Per Word: OF WORD selected AS-i master Bits 0...3: I/O-Code Bits 4...7: ID-Code Bits 8...11: ID1-Code Bits 12...15: ID2-Code...
  • Page 81: Get_Pcd

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_PCD 16017 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16141 The FB reads the projected configuration data (Projected Configuration Data Image = PCD) of the slaves on the selected AS-i master and provides the values in an array.
  • Page 82 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16143 Parameter Data type Description Possible values awPCD ARRAY [0...63] Permanent configuration files of the per word: OF WORD slaves on the selected AS-i master Bits 0...3: I/O-Code Bits 4...7: ID-Code Bits 8-11: ID1-Code Bits 12-15: ID2-Code...
  • Page 83: Get_Inputparameter

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_InputParameter 16007 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16056 The FB reads the input parameters of the slaves on the selected AS-i master and provides the values in 2 arrays for single A slaves and B slaves.
  • Page 84 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16058 Parameter Data type Description Possible values abList_SA_Slave ARRAY[0..31] List of output parameters of S/A Per byte: OF BYTE slaves in the selected AS-i master. Bits 0...3: P0-P3 Each byte contains the output parameters of an AS-i slave.
  • Page 85: Get_Outputparameter

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_OutputParameter 16016 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16136 The FB reads the output parameters of the slaves on the selected AS-i master and provides the values for S/A slaves and B slaves in 2 separate arrays.
  • Page 86 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16138 Parameter Data type Description Possible values abList_SA_Slave ARRAY[0..31] List of output parameters of S/A Per byte: OF BYTE slaves in the selected AS-i master. Bits 0...3: P0-P3 Each byte contains the output parameters of an AS-i slave.
  • Page 87: Set_Addressmode

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_AddressMode 16018 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16146 The FB activates/deactivates the parameter "Automatic addressing" for the selected AS-i master. > Input parameters 16147 Parameter...
  • Page 88 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 17017 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 89: Set_Asi_Config

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_ASi_Config 16019 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16149 The FB activates/deactivates the parameters "double address recognition" and "earth fault detection" for the selected AS-i master. >...
  • Page 90 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 17015 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 91: Set_Lps

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_LPS 16020 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16153 The FB changes the list of projected slaves (LPS) in the selected AS-i master. >...
  • Page 92 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 17016 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 93: Set_Mode

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_Mode 16021 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16155 The FB changes the operating mode (protected operation, projection mode) of the selected AS-i master.
  • Page 94 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 17018 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 95: Set_Pcd

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_PCD 16022 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16151 The FB changes the configuration file (Permanent Configuration Data = PCD) of the slaves at the selected AS-i master.
  • Page 96 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 15574 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 97: Set_Projectall

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_ProjectAll 16023 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16161 The FB starts the projection adaptation on the selected AS-i master. > Input parameters 16125 Parameter Data type...
  • Page 98: Set_Slaveaddress

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_SlaveAddress 16024 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16162 The FB changes the address of the selected AS-i slaves. > Input parameters 16165 Parameter Data type...
  • Page 99 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 17021 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 100: Set_Slaveextendedid1

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_SlaveExtendedID1 16025 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16169 The FB changes the Extended ID1 of the selected AS-i slave. > Input parameters 16170 Parameter Data type...
  • Page 101 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16148 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 102: Set_Slaveparameter

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_SlaveParameter 16026 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16172 The FB changes the parameters of the selected AS-i slave. > Input parameters 16173 Parameter Data type...
  • Page 103 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 17025 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 104: Get_Asi_Data

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_ASi_Data 16000 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 16033 The FB reads the following data from the selected AS-i master and stores the values in a structure ASI_DATA (STRUCT) variable of data type ASI_DATA (→...
  • Page 105 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 16035 Parameter Data type Description Possible values xActive BOOL Signal confirms the FB execution FALSE Function block is inactive TRUE FB is active (=is executed) wCycleCount WORD Counter for FB cycles that were fully Number in hexadecimal representation run through...
  • Page 106: Overview: System Functions (Fb_System)

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > 9.1.2 Overview: System functions (FB_System) Get_FieldbusInfo ..........................107 QuickSetupASi_Master ........................109 Set_TimeDate ............................111 17460...
  • Page 107 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Get_FieldbusInfo 17453 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 17454 The FB reads information about the fieldbus and provides the values in a list. The following information are read: ...
  • Page 108 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 17456 Parameter Data type Description Possible values aw_InfoList ARRAY[0...18] Fieldbus information Position of the data within the individual words → DS18: Fieldbus information OF WORD xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being...
  • Page 109 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > QuickSetupASi_Master 15999 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 15902 The FB executes the quick setup routine on the selected AS-i masters. > Input parameters 15903 Parameter...
  • Page 110 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 15920 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 111 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Set_TimeDate 15998 Function block type: Function block (FB) Library: ACnnnn_Utils.library Symbol in CODESYS: > Description 15949 The FB sets the system time (time and date) of the device using the transmitted input values. >...
  • Page 112 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Output parameters 15990 Parameter Data type Description Possible values xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated. executed. TRUE FB execution is terminated.
  • Page 113: Enumeration Types And Complex Variables

    Enumeration types and complex variables Enumeration types (ENUM)........................113 Complex variables (STRUCT) ......................115 15986 In addition to the standard data types, the CODESYS package from ifm electronic also features the following enumeration types (ENUM) and complex variables (STRUCT): > Enumeration types (ENUM)
  • Page 114 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > ASI_SLAVE (ENUM) 16180 Designation Description Variable Data type Value  ASI_SLAVE Identifier for AS-i slaves Slave_1  Slave_2  Slave_3  Slave_4  Slave_5  Slave_6  Slave_7  Slave_8 ...
  • Page 115 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > Complex variables (STRUCT) 15991 The library ACnnnn_Utils.library provides complex variables of the data type STRUCT. They are used by the FBs, but they can also be used by the programmer in CODESYS projects for the device-internal PLC.
  • Page 116 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library Name Data type Description Possible values  LDS_SA_Slave DWORD List of the active S/A slaves Each bit represents an AS-i address: 0 = no slave active 1 = slave active ...
  • Page 117 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library Name Data type Description Possible values  ARRAY[0..63] Image of the projected Each word contains data of one slave: OF WORD configuration data Bits 0...3 = IO (PCD = Projected Configuration Bits 4...7 = ID Data) Bits 8...11 = ID1...
  • Page 118 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > ASI_BIN_IN (STRUCT) 16004 The structure contains the input data of the digital AS-i slaves: Name Data type Description Possible values  SA_Slave ARRAY[1...31] Input data of the digital S/A slaves, corresponds to the 1st to 15th word of the OF BYTE 1 byte per S/A slave...
  • Page 119 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > ASI_ANALOG_IN (STRUCT) 15994 The structure contains the process data of the analogue input slave as well as the transmitted status flags. Designation Data type Description Possible values  chan_1 Analogue value channel 1: corresponds to the 1st to 4th word of an S or A input slave...
  • Page 120 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_Utils.library > ASI_ANALOG_OUT (STRUCT) 15995 The structure represents the process data of the analogue output slaves as well as the transmitted flags. Designation Data type Description Possible values  chan_1 Analogue value channel 1: corresponds to the acyclic data records 6 S or A output slave and 7 (DS6, DS7)
  • Page 121: Library Acnnnn_Sys_Cmd.library

    Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library > Library ACnnnn_SYS_CMD.library ACnnnn_SysCmd ..........................121 17723 > 9.2.1 ACnnnn_SysCmd 15890 Function block type: Function block (FB) Library: ACnnnn_SYS_CMD.library Symbol in CODESYS: > Description 15893 Using the FB, individual commands can be sent to the system or to an AS-i master. Each command refers to the data structures of one of the following elements: ...
  • Page 122 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library > Input parameters 15895 Parameter Data type Description Possible values xExecute BOOL Control execution of the FB FALSE Stop FB execution TRUE Start one-time FB execution → Table: System commands uCommandID WORD ID of the command to be executed...
  • Page 123 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library > Table: AS-i master commands 17054 uCommandID Description / corresponding command DS2 – Digital slave inputs and master flags 0x0002 DS3 – Analogue inputs of the slaves 1(A)...15(B) 0x0003 DS4 – Analogue inputs of the slaves 16(A)...31(B) 0x0004 DS5 –...
  • Page 124 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library uCommandID Description / corresponding command Command 0x0044 – CTT2 vendor specific selective read 0x1044 Command 0x0045 – CTT2 vendor specific selective write 0x1045 Command 0x0046 – CTT2 device group selective read 0x1046 Command 0x0047 –...
  • Page 125 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library > Output parameters 15897 Parameter Data type Description Possible values uCount WORD Number of valid bytes in pDataOut integer value in hexadecimal (uCount <= uSizeOut) representation xReady BOOL Signal indicates if the execution of the FALSE FB is inactive or being FB is terminated.
  • Page 126 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library > Example: Change language setting of the device 17051 Task: Set the language of the graphic user surface of the device to "Spanish" with the FB ACnnnn_SysCmd. Command type: Command request channel Input parameters of the FB: Parameter Value...
  • Page 127 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library > Example: Date / time / read NTP settings 17423 Task: Read the current system time and the NTP settings with the FB ACnnnn_SysCmd. Command type: Command reply channel Input parameters of the FB: Parameter Value Declaration...
  • Page 128 Programming Manual AS-i Gateway AC14 (4.2.x) 12/2017 Appendix Library ACnnnn_SYS_CMD.library > Example: Read LCEMS, LCEAS and LDAE of AS-i master 2 17424 Task: Read the error lists LCEMS, LCEAS and LDAE of the AS-i master 2 with the FB ACnnnn_SysCmd. Command type: acyclic data set Input parameters of the FB: Parameter...
  • Page 129: Index

    Configure Ethernet interface..............22 ifm AS-i Package ................... 12 Configure main task ................45 ifm weltweit • ifm worldwide • ifm à l’échelle internationale ....131 Configure PLC ..................21 Input and output data of the fieldbus interface ........31 Configure system ...................
  • Page 130 Use CODESYS online help ..............19 PI controller ....................4 Use complex variables ................36 Preliminary note ..................4 Use functions of the ifm package ............33 Process data of the AS-i slaves ............29 Use remanent variables ................. 25 Programming ..................24 Use visualisations ..................
  • Page 131: Ifm Weltweit • Ifm Worldwide • Ifm À L'échelle Internationale

    • 3843 GA Harderwijk • phone +31 341-438 438 ifm efector pty ltd • 930 Great South Road Penrose, Auckland • phone +64 / 95 79 69 91 ifm electronic sp. z o.o. • 40-106 Katowice • phone +48 32 70 56 400 ifm electronic s.a.

This manual is also suitable for:

Ac1411Ac1402Ac1412Ac1421Ac1422

Table of Contents