Anda di halaman 1dari 257

>

Programming Manual
CODESYS for
AS-i Fieldbus Gateways

AC1401/02
AC1411/12
AC1421/22

Firmware release: 3.0.24 and higher


CODESYS release: 3.5.3.6

English
2015-04-23
7391013_00_UK
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Contents

>

Cotents

1 Preliminary note 4
1.1 Legal and copyright information ...........................................................................................5
1.2 The purpose of the document ..............................................................................................5
1.3 Symbols and formats used ..................................................................................................6
1.4 Notes on how to get started .................................................................................................7
1.5 History of the instructions .....................................................................................................7

2 Safety instructions 8
2.1 Required background knowledge ........................................................................................9
2.2 Please note! .........................................................................................................................9
2.3 Start-up behaviour of the controller....................................................................................10
2.4 Tampering with the unit ......................................................................................................10

3 System requirements 11
3.1 Hardware ............................................................................................................................12
3.2 Software .............................................................................................................................12
3.3 Licensing ............................................................................................................................12

4 Installation 13
4.1 Programming software CoDeSys .......................................................................................14
4.1.1 Installation of the CODESYS Development System ................................................................... 14
4.2 ifm AS-i Package................................................................................................................15
4.2.1 Components of the ifm AS-i package ......................................................................................... 16

5 Target Settings 18
5.1 Create CODESYS project ..................................................................................................19
5.1.1 Create new project with AC14nn ................................................................................................ 20
5.1.2 Add AC14nn to a project ............................................................................................................ 22
5.1.3 Overview: Project structure with AC14nn ................................................................................... 23
5.2 Configure Ethernet interface ..............................................................................................25
5.2.1 Available fieldbus stacks ............................................................................................................ 25
5.2.2 Add fieldbus stack ...................................................................................................................... 26

6 PLC configuration 27
6.1 Configure AC14nn controller ..............................................................................................28
6.1.1 Communication settings ............................................................................................................. 28
6.1.2 Applications ................................................................................................................................ 30

7 PLC programming 31
7.1 Supported programming languages ..................................................................................32
7.2 Create PLC application ......................................................................................................33
7.2.1 Use remanent variables.............................................................................................................. 33
7.2.2 Use complex variables ............................................................................................................... 33
7.2.3 Task configuration ...................................................................................................................... 34

2
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Contents

7.3 Access input and output data .............................................................................................35


7.3.1 Options to access input and output data .................................................................................... 36
7.3.2 Validity of the interface data ....................................................................................................... 36
7.3.3 Process data of the AS-i slaves.................................................................................................. 37
7.3.4 Fieldbus data .............................................................................................................................. 39
7.4 Use functions of the ifm AS-i package ...............................................................................41
7.4.1 Control interface of the ifm function blocks ................................................................................. 41
7.4.2 Configure system ....................................................................................................................... 44
7.4.3 Configure AS-i master ................................................................................................................ 44
7.4.4 Configure AS-i slaves ................................................................................................................. 44
7.4.5 Manage AS-i network ................................................................................................................. 45
7.4.6 Send commands to the system and the AS-i master .................................................................. 47
7.5 Use web visualisations .......................................................................................................48
7.5.1 Notes on web visualisations ....................................................................................................... 49
7.5.2 Add web visualisation to a project .............................................................................................. 49
7.5.3 Create web visualisation............................................................................................................. 50
7.5.4 Configure web visualisation ........................................................................................................ 51
7.6 Testing the PLC application ...............................................................................................53

8 Operation 54
8.1 Activate CODESYS PLC ....................................................................................................55
8.2 Load application on AC14nn ..............................................................................................56
8.3 Operating states of the CODESYS PLC ............................................................................57
8.3.1 Display current operating state ................................................................................................... 57
8.3.2 Switch operating states .............................................................................................................. 58
8.4 Reset ..................................................................................................................................60
8.4.1 Supported reset variants ............................................................................................................ 61
8.4.2 Reset PLC application ................................................................................................................ 61
8.5 Display web visualisation ...................................................................................................62
8.6 Delete application from AC14nn ........................................................................................63

9 Annex 64
9.1 ifm AS-i function libraries ...................................................................................................65
9.1.1 ACnnnn_Utils.library ................................................................................................................... 66
9.1.2 ACnnnn_SYS_CMD.library ...................................................................................................... 128
9.2 Acyclic data records .........................................................................................................137
9.2.1 Overview: Acyclic data sets ...................................................................................................... 137
9.2.2 Description of the data records (DSx)....................................................................................... 138
9.3 Command channels .........................................................................................................168
9.3.1 Principle of the command channels .......................................................................................... 169
9.3.2 System commands ................................................................................................................... 170
9.3.3 AS-i master commands ............................................................................................................ 187

10 Index 253

11 ifm weltweit ifm worldwide ifm lchelle internationale 257

3
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Preliminary note Legal and copyright information

1 Preliminary note

Legal and copyright information ...............................................................................................................5


The purpose of the document ..................................................................................................................5
Symbols and formats used .......................................................................................................................6
Notes on how to get started......................................................................................................................7
History of the instructions .........................................................................................................................7
14801

4
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Preliminary note Legal and copyright information

>

1.1 Legal and copyright information


6088

All rights reserved by ifm electronic gmbh. No part of this manual may be reproduced and used
without the consent of ifm electronic gmbh.
All product names, pictures, companies or other brands used on our pages are the property of the respective rights owners:
AS-i is the property of the AS-International Association, ( www.as-interface.net)
CAN is the property of the CiA (CAN in Automation e.V.), Germany ( www.can-cia.org)
CODESYS is the property of the 3S Smart Software Solutions GmbH, Germany ( www.codesys.com)
DeviceNet is the property of the ODVA (Open DeviceNet Vendor Association), USA ( www.odva.org)
EtherNet/IP is the property of the ODVA
IO-Link ( www.io-link.com) is the property of the PROFIBUS Nutzerorganisation e.V., Germany
Microsoft is the property of the Microsoft Corporation, USA ( www.microsoft.com)
PROFIBUS is the property of the PROFIBUS Nutzerorganisation e.V., Germany ( www.profibus.com)
PROFINET is the property of the PROFIBUS Nutzerorganisation e.V., Germany
Windows is the property of the Microsoft Corporation, USA

>

1.2 The purpose of the document


18872

This document applies to the following products from ifm electronic:


AS-i Profinet Gateway (art. no. AC1401/AC1402), firmware version 3.0.24 or higher
AS-i Profibus Gateway (art. no. AC1411/AC1412), firmware version 3.0.24 or higher
AS-i EtherNet/IP Gateway (art. no. AC1421/AC1422), firmware version 3.0.24 or higher
This document describes the integration, configuration and programming of the PLC runtime system
"CODESYS Runtime" of the above-mentioned device with the aid of the PLC programming software
"CODESYS Development System" and the following software component provided by ifm electronic:
Package file "CoDeSys for ifm ASinterface products" (ifm_AC14nn_AC4nnS_1_1_0_3.package)
This document is to complement the following documentations:

Document Manufacturer

User documentation CODESYS V3, installation and first steps 3S-Smart Software Solutions GmbH
Online help for CODESYS V3 programming system 3S-Smart Software Solutions GmbH
Device manual AS-i Fieldbus gateway AC14nn, firmware V3.0.24 or higher ifm electronic gmbh

5
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Preliminary note Symbols and formats used

>

1.3 Symbols and formats used


15989

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 can result in malfunction or interference
Information
Supplementary note
... Request for action
> ... Reaction, result
... "see"
abc Cross-reference
123 Decimal number
0x123 Hexadecimal number
0b010 Binary number
[...] Designation of pushbuttons, buttons or indications

6
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Preliminary note Notes on how to get started

>

1.4 Notes on how to get started


16940

For information about the hardware and software requirements see section System requirements
( page 11).
Familiarise yourself with the programming software CODESYS version 3.5.3.6!
The installation of the programming software CODESYS Development System 3.5.3.6 and of the ifm
AS-i package are described in section Installation ( page 13).
Information on the integration of the project into a CODESYS project is given in section Target
Settings ( page 18).
Information about the programming of the device-internal CODESYS PLC and about the use of the
functions of the ifm AS-i package is given in section PLC programming ( page 31).
Information about the permanent operation of the unit and the control of the PLC applications are
contained in section Operation ( page 54).
The detailed reference of the ifm AS-i function blocks (FB) is given in section ifm AS-i function libraries
( page 65) in the Appendix.
>

1.5 History of the instructions


17986

Issue Topic Date

1.0 New creation of the document 19 Aug 2014

1.0.1 Correction of the available fieldbus stack for the configuration interface 29 Aug 2014
( Available fieldbus stacks ( page 25))
1.0.2 Correction of required CODESYS edition ( Software ( 12)) 18 Feb 2015
1.0.3 Correction of description of the system command 267 in command overview ( Overview: 23 Apr 2015
system commands ( 170))

7
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Safety instructions History of the instructions

2 Safety instructions

Required background knowledge .............................................................................................................9


Please note! ..............................................................................................................................................9
Start-up behaviour of the controller ........................................................................................................10
Tampering with the unit ..........................................................................................................................10
213

8
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Safety instructions Required background knowledge

>

2.1 Required background knowledge


13323

This document is intended for people with knowledge of control technology and PLC programming
with IEC 61131-3.
To program the PLC, the people should also be familiar with the CODESYS software.
This document is intended for specialists. Specialists are people who, based on their relevant training
and experience, are capable of identifying risks and avoiding potential hazards that may be caused
during operation or maintenance of the product. The document contains information about the correct
handling of the product.
Read this document before use to familiarise yourself with operating conditions, installation and
operation. Keep this document during the entire duration of use of the device.
Follow the safety instructions.
>

2.2 Please note!


6091
11212

No characteristics are warranted with the information, notes and examples provided in this manual.
With the drawings, representations and examples given no responsibility for the system is assumed
and no application-specific particularities are taken into account.
The manufacturer of the machine/equipment is responsible for ensuring the safety of the
machine/equipment.
Follow the national and international regulations of the country in which the machine/installation is
to be placed on the market!

WARNING
Non-observance of these instructions can lead to property damage or bodily injury!
ifm electronic gmbh does not assume any liability in this regard.
The acting person must have read and understood the safety instructions and the corresponding
chapters in this manual before working on and with this device.
The acting person must be authorised to work on the machine/equipment.
The acting person must have the qualifications and training required to perform this work.
Adhere to the technical data of the devices!
You can find the current data sheet on ifm's homepage at:
www.ifm.com > Select your country > [Data sheet search] > (article number.) > [Technical data
in PDF format]
Note the installation and wiring information as well as the functions and features of the devices!
supplied installation instructions or on ifm's homepage:
www.ifm.com > Select your country > [Data sheet search] > (article number.) > [Operating
instructions]
Please note the corrections and notes in the release notes for the existing documentation,
available on the ifm website:
www.ifm.com > Select your country > [Data sheet search] > (article number.) > [Operating
instructions]
>

9
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Safety instructions Start-up behaviour of the controller

2.3 Start-up behaviour of the controller


6827
15233

WARNING
Danger due to unintentional and dangerous start of machine or plant sections!
When creating the program, the programmer must ensure that no unintentional and dangerous
start of machines or plant sections after a fault (e.g. e-stop) and the following fault elimination can
occur!
Realise restart inhibit!
In case of an error, set the outputs concerned to FALSE in the program!

A restart can, for example, be caused by:


voltage restoration after power failure
reset after watchdog response because of too long a cycle time
error elimination after an E-stop
To ensure a safe behaviour of the controller:
monitor the voltage supply in the application program.
In case of an error switch off all relevant outputs in the application program.
Additionally monitor relay contacts which can cause hazardous movements in the application
program (feedback).
If necessary, ensure that welded relay contacts in the application project cannot trigger or continue
hazardous movements.
Additionally monitor relay contacts which can cause hazardous movements in the application
program (feedback).
If necessary, ensure that welded relay contacts in the application project cannot trigger or continue
hazardous movements.
>

2.4 Tampering with the unit


11242

WARNING
Tampering with the units can affect the safety of operators and machinery!
Tampering with the units is not allowed.
In case of non-compliance our liability and warranty expire.
Do not open the devices!
Do not insert any objects into the devices!
Prevent metal foreign bodies from penetrating!

10
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
System requirements Tampering with the unit

3 System requirements

Hardware ................................................................................................................................................12
Software..................................................................................................................................................12
Licensing.................................................................................................................................................12
16903

11
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
System requirements Hardware

>

3.1 Hardware
16904

Device of the AC14nn product family, firmware V3.0.24 or higher


PC/laptop ( system requirements CODESYS development system V3.x)
Ethernet connection between CODESYS-PC/laptop and configuration interface (X3) of the
AC14nn ( device manual, section Configuration interface: Connection concepts)
>

3.2 Software
16905

To program the device-internal PLC of the ifm AS-i fieldbus gateways (AC14nn), the following software
components are required:
Programming software CODESYS Development System, version 3.5.3.6
www.3s-software.com
Package file "CoDeSys for ifm ASinterface products" (ifm_AC14nn_AC4nnS_1_1_0_3.package)
www.ifm.com/ifmde/web/asi-download.htm
>

3.3 Licensing
16906

All models of the device family AC14nn, to be programmed using the CODESYS Development System
V3.x, must be licensed. A valid license label can be purchased via ifm's website.

Article description Article no.


1x CODESYS V3 license AC14nn E71400

Use of the device-internal CODESYS PLC of AC14nn without valid license constitutes a
violation of applicable law!

12
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Installation Licensing

4 Installation

Programming software CoDeSys ...........................................................................................................14


ifm AS-i Package ....................................................................................................................................15
17146

13
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Installation Programming software CoDeSys

>

4.1 Programming software CoDeSys


7282

The CODESYS Development System (short: CODESYS) serves as platform for the creation of PLC
applications according to the standard IEC 61131-3.

>

4.1.1 Installation of the CODESYS Development System


18596

To install the software "CODESYS Development System":


CODESYS installation instructions

14
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Installation ifm AS-i Package

>

4.2 ifm AS-i Package

Components of the ifm AS-i package .....................................................................................................16


Install ifm AS-i package ..........................................................................................................................16
Update ifm AS-i package ........................................................................................................................17
Uninstall the ifm AS-i package ...............................................................................................................17
17679

Familiarise yourself with the following CODESYS functions:


Use of the Package Manager
Online help > Menu Commands sorted by Categories > Installation > Package
Manager

15
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Installation ifm AS-i Package

>

4.2.1 Components of the ifm AS-i package


17550

ifm provides the package "CODESYS for ASinterface Products" (short: ifm AS-i package) for the
CODESYS programming software. It contains the following components:

Component Description Reference

AC14nn.devdesc.xml Device description file of the AC14nn basic module


ACnnnn_EthernetAdapter.devdesc.xml Device description file of the Ethernet interface
ACnnnn_EtherCAT.devdesc.xml Device description file for an EtherCat fieldbus interface for the extension
of the Ethernet interface.
ACnnnn_Utils.library Function library with AC14nn specific CODESYS function blocks and
data structures
ACnnnn_SYS_CMD.library Function library with function block for access to the command interface
of AC14nn from a CODESYS application

>

Install ifm AS-i package


7283

To install the package "CODESYS for ifm AS-interface products":


1 Download the current version of the ifm AS-i package
Access the AS-i download area on ifm's website.
( www.ifm.com > Service > Download > Industrial communication)
Download file ifm_AC14nn_AC4nnS_1_1_0_3.package and save it on the CODESYS PC/notebook.
2 Install the ifm AS-i package in CODESYS
Start CODESYS with administrator rights.
Access the package manager with [Tools] > [Package Manager].
> Window [Package Manager] is displayed.
Start the installation dialogue with [Install new packages].
Select the downloaded ifm AS-i package and carry out a complete installation.
> Window [Package Manager] shows the installed ifm AS-i package:

End the package manager with [Exit].

16
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Installation ifm AS-i Package

>

Update ifm AS-i package


12267

To update an installed package "CoDeSys for ifm AS-Interface products":


1 Uninstall the old version of the ifm AS-i package
Uninstall the ifm AS-i package ( page 17)
2 Install a new version of the ifm AS-i package
Install ifm AS-i package ( page 16)
3 Update device libraries
Device window: Mark [Device (AC14nn)] in the project tree.
Activate [Project] > [Update Device].
> Window [Update Device] appears.
Start the update process with [Update Device].
> New device libraries are loaded.
> Project tree view is updated.
Close the Package Manager with [Exit].
Save the project.
>

Uninstall the ifm AS-i package


12270

To uninstall the package "CODESYS for ifm AS-interface products":


Access the package manager with [Tools] > [Package Manager].
> Window [Package Manager] shows the installed packages.
Activate [Display version] checkbox.
> The window shows the version numbers of the installed packages.
Tick the package version to be uninstalled and uninstall with [Uninstall ...].
> The marked package version is uninstalled.
Close the Package Manager with [Exit].

17
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings ifm AS-i Package

5 Target Settings

Create CODESYS project ......................................................................................................................19


Configure Ethernet interface...................................................................................................................25
17034

18
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Create CODESYS project

>

5.1 Create CODESYS project

Create new project with AC14nn ............................................................................................................20


Add AC14nn to a project ........................................................................................................................22
Overview: Project structure with AC14nn ...............................................................................................23
17129

Familiarise yourself with the following CODESYS functions!


CODESYS project
Online help > Concepts and Base Components > Project
Device, device tree
Online help > Concepts and Base Components > Device, Device tree
Application
Online help > Concepts and Base Components > Application
Library manager
Online help > Concepts and Base Components > Library manager

19
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Create CODESYS project

>

5.1.1 Create new project with AC14nn


17130

To create a CODESYS project with an AC14nn:


1 Adjust project attributes
Use [File] > [New Project...] to start the setup dialogue.
> Window for project attributes configuration.

Set the following values:


1. [Templates]: [Standard project] to be highlighted.
2. [Name]: Enter project name (e.g. MyProject).
3. [Location]: Choose storage location for the project file.
Use [OK] to confirm the entered values.

20
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Create CODESYS project

2 Select device and programming language


> Dialogue window for device selection appears.

Set the following values:


1. [Device]: Select AC14nn (ifm electronic).
2. [PLC_PRG in]: Select PLC programming language ( Supported programming languages ( page 32)).
Use [OK] to confirm the entered values.
> CODESYS creates a project with the AC14nn.
> Window [Devices] shows project tree ( Overview: Project structure with AC14nn ( page 23)).

21
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Create CODESYS project

>

5.1.2 Add AC14nn to a project


17131

To add a AC14nn to an existing CODESYS project:


1 Open project
Open a stored project.
2 Add AC14nn to the project
In the project tree: Highlight Wurzelknoten (= project name).
Use [Project] > [Add Device...] to start the configuration dialogue.
Dialogue window for device selection appears.

Set the following values:


1. [Name]: Enter device designation.
2. [Action]: Activate [Append Device] checkbox.
3. [Vendor]: Select ifm electronic.
4. In the list: Highlight AC14nn.
Use [Add Device] to confirm the entered values.
Use [Close] to close the dialogue window.
> Project tree shows structure of the project with added device.

22
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Create CODESYS project

>

5.1.3 Overview: Project structure with AC14nn


17132

A CODESYS project contains all components for the programming and administration of PLC
applications. All components of a project are shown in the window [Devices] in a hierarchic tree view.
CODESYS projects with an AC14nn have the following structure:

[MyProject] is the name of the CODESYS project

[Device (AC14nn)] represents the AC14nn in the CODESYS project.

[PLC Logic] contains the PLC applications to be executed.

[Application] is a container for all components the belong to a PLC application:


Library manager serves for the administration of the function libraries.
PLC_PRG (PRG) contains the program code in the selected programming language.
Task Configuration offers setting options for the processing of the individual tasks.
Interface [ASi_Master_1] contains the process images of the slaves at AS-i master 1:
ASi_1_binaryIO offers access to the digital input and output data.
ASi_1_analogIO offers access to the analogue input and output data incl. status flags

Interface [ASi_Master_2] contains the process images of the slaves at AS-i master 2 ( )
Interface [Fieldbus_Interface] contains the input and output data of the Fieldbus interface.
FieldBusData_ shows all the data that is transmitted from and to the device via the fieldbus.
ASi_1/2_binaryOut contains data that the fieldbus controller sends to the digital AS-i slaves.
ASi_1/2_analogOut contains data that the fieldbus controller sends to the analogue AS-i slaves.

23
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Create CODESYS project

Interface [Ethernet] represents the Ethernet adapter of the device.

24
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Configure Ethernet interface

>

5.2 Configure Ethernet interface

Available fieldbus stacks ........................................................................................................................25


Add fieldbus stack ..................................................................................................................................26
17701

Familiarise yourself with the following CODESYS functions!


Menu command "Attach device"
Online help > Menu Commands sorted by Categories > Devices > Attach Device...
Configure EtherCAT (master)
Online help > Device Editors > EtherCAT Configuration Editor
Configure modbus TCP (master/slave)
Online help > Device Editors > Modbus Configuration Editor

>

5.2.1 Available fieldbus stacks


18518

The Ethernet internet (X3) of the device can be declared and operated as an additional fieldbus
interface. For this, a fieldbus stack must be assigned to the interface in CODESYS. Presently, the
device supports the following fieldbus stacks:

Designation Fieldbus Manufacturer

EtherCAT Master EtherCAT 3S - Smart Software Solutions GmbH


Modbus TCP Master Modbus TCP 3S - Smart Software Solutions GmbH
Modbus TCP Slave Modbus TCP 3S - Smart Software Solutions GmbH

25
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Target Settings Configure Ethernet interface

>

5.2.2 Add fieldbus stack


17702

To declare the Ethernet interface as a fieldbus interface:


1 Create/load CODESYS project
Create or load CODESYS project with AC14nn.
2 Add fieldbus stack
Windows [Devices]: Highlight [Ethernet] in the project tree and use [Project] > [Add Device...] to show the
configuration dialogue.
> Window shows configuration options for Ethernet interface.

Set the following values:


1. Field [Name]: Enter name of the fieldbus stack.
2. Group [Action]: Select [Append Device] radio button.
3. List [Vendor]: Select [<All vendors>].
4. Highlight requested fieldbus stack.
Use [Add Device] to confirm the entries.
> Device tree shows the selected fieldbus stack as sub-element of the interface
(Example: Modbus TCP slave):

Configure fieldbus devices ( CODESYS online help).

26
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC configuration Configure Ethernet interface

6 PLC configuration

Configure AC14nn controller ..................................................................................................................28


18498

Familiarise yourself with the following CODESYS functions!


Generic device editor
Online help > Device Editors > Generic Device Editor

27
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC configuration Configure AC14nn controller

>

6.1 Configure AC14nn controller


18519

To access the configuration options of the device-internal PLC:


In the project tree: Double-click on [Device (AC14nn)].
> Editor window shows tab [Device] with the configuration options for the device-internal PLC:

>

6.1.1 Communication settings


18494

The [Device] > [Communication Settings] tab offers options for the adjustment of the connection
between the CODESYS programming software and the AC14nn.
>

Configure connection with AC14nn


18500

To configure the connection between CODESYS programming software and the AC14nn:
1 Preparations
Connect CODESYS PC/laptop and configuration interface (X3) of the device.
Optional: Adjust IP settings of the Ethernet interfaces.
2 Select gateway
In the editor window: Select [Device] > [Communication Settings] tab.
> Window shows the active communication settings.

If no gateway is available: Create and configure new gateway.

28
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC configuration Configure AC14nn controller

3 Search AC14nn in the network


Highlight [Gateway-1].
Browse the network for accessible devices with the button [Scan network].
> CODESYS browses the Ethernet network of the selected gateway.
> If successful: Window displays AC14nn with active IP address.

> If not successful: Check Ethernet connection and IP settings and repeat process.
4 Set active communication path
Highlight AC14nn and activate the button [Set active path].
> AC14nn contains the attribute (active) and will be highlighted (font weight bold)

> Communication channel between CODESYS PC laptop and AC14nn is set and active.

29
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC configuration Configure AC14nn controller

>

6.1.2 Applications
18495

The [Device] > [Applications] tab offers display and administration options for applications that are
stored on the AC14nn.
>

Display stored applications


18496

To display applications stored on the AC14nn:


set communication channel to the AC14nn.
( Configure connection with AC14nn ( page 28))
In the editor window: Select [Device] > [Applications] tab.
Read the applications stored on the device with [Refresh List].
> Editor window shows the list of applications stored on the AC14nn.
>

Delete applications on the device


18497

To delete one or several applications on the AC14nn:


Display applications on the device ( Display stored applications ( page 30)).
Delete all applications on the device with [Remove All].
OR
Highlight applications in question and delete them with [Remove] on the device.
> A success message appears.
> The list in the editor window shows the message "No application available on the controller".

30
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Configure AC14nn controller

7 PLC programming

Supported programming languages .......................................................................................................32


Create PLC application...........................................................................................................................33
Access input and output data .................................................................................................................35
Use functions of the ifm AS-i package ...................................................................................................41
Use web visualisations ...........................................................................................................................48
Testing the PLC application....................................................................................................................53
7074

Familiarise yourself with the programming according to the standard IEC 61131-3!
Create example program
Online help > Quickstart > Create and run a project
Familiarise yourself with the following CODESYS functions!
Program editor
Online help > Editors > Editors for the IEC Programming Languages and CFC
Programming reference
Online help > Programming Reference
Menu commands for programing
Online help > Menu Commands sorted by Categories > FBD/LD/IL
Function libraries
Online help > Libraries

31
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Supported programming languages

>

7.1 Supported programming languages


18034

The following table shows which programming languages according to IEC 61131 are supported by
the ifm function libraries:

Continuous Function Chart (CFC)


Sequential Function Chart (SFC)
Function Block Diagram (FBD)

Ladder Diagram (LD)

Structured Text (ST)


Instruction List (IL)

Library
ACnnnn_Utils.library X X X X X X
ACnnnn_SYS_CMD.library X X X X X X

32
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Create PLC application

>

7.2 Create PLC application


17691

To create a PLC application:


Windows [Devices]: Double-click on [PLC_PRG] in the project tree
> Editor window shows programming surface:

>

7.2.1 Use remanent variables


18522

The CODESYS PLC of the AC14nn supports the use of remanent variables. Variables declared with
VAR RETAIN are stored in a memory area that is also maintained when the device is switched off.
The declaration of a variable as RETAIN also influences its behaviour when the PLC application is
reset ( Supported reset variants ( page 61)).
>

7.2.2 Use complex variables


18528

There are different complex variables (STRUCT) at the programmer's disposal. They bundle logically
associated data sets. Thereby, they facilitate the organisation of the data storage in the application
and at the same time reduce the error rate when variables are declared.
The following complex variables are available:

Designation Description Reference


ASI_NET The complex variable contains the complete process ASI_NET (STRUCT)
image (inputs and outputs) of an AS-i network. ( page 124)
ASI_DATA The complex variable contains the following components: ASI_NET (STRUCT)
( page 124)
Slave lists (LPS, LDS, LAS, LPF, LCE, LCEMS,
LCEAS, LDAE) Get_ASi_Data ( page 110)
Parameter images (PI, PP)
Configuration data of the AS-i slaves (CDI, PCD)

>

33
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Create PLC application

7.2.3 Task configuration


18412

NOTICE
Risk of reduced device performance!
The basic settings of the task properties can cause high system utilisation in case of extensive
applications or projects with several tasks. This can lead to a poor device performance with unwanted
system behaviour.
Set the type of the corresponding task to "Freewheeling" in the task configuration!

To change the type of task:


Windows [Devices]: In the project tree, double-click on [Task Configuration] > [Name_of_the_Task]
> Editor window shows the configuration of the selected task.
Select [Type] the value [Freewheeling] in the list

> Selected value is applied.

34
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Access input and output data

>

7.3 Access input and output data

Options to access input and output data ................................................................................................36


Validity of the interface data ...................................................................................................................36
Process data of the AS-i slaves .............................................................................................................37
Fieldbus data ..........................................................................................................................................39
17447

Familiarise yourself with the following CODESYS functions!


Addresses according to IEC standard 61131-3:
Online help > Programming Reference > Operanden > Addresses > Address
Access to IEC address via AT declaration:
Online help > Programming Reference > Declaration > AT Declaration
Definition of an ALIAS for an IEC address:
Online help > Programming Reference > Data Types > User defined Data Types >
References
coupling of a program variable to an address (mapping):
Online help > Device Editors > Generic Device Editor > I/O Mapping

35
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Access input and output data

>

7.3.1 Options to access input and output data


17621

In a CODESYS project, each input and output has a physical address according to the IEC standard
(e.g. %IW5). CODESYS offers the following options to access this address from a PLC application and
thereby to access the input and outputs data of the device:
Access to IEC address via AT declaration
Definition of an ALIAS for an IEC address
Link a program variable to an IEC address (mapping)
>

7.3.2 Validity of the interface data


18413

In order to facilitate the access to inputs and outputs of peripheral devices, AC14nn projects offer
clearly defined interfaces ( Overview: Project structure with AC14nn ( page 23)).
Depending on the active controller instance of the outputs of the AS-i slaves (manually, gateway,
PLC), the CODESYS data mapper only updates certain interfaces.
The following table shows which interfaces in the project tree the programmer can access and read in
the individual operating modes (e.g. for variable linking):

Controller instance Active I/O interfaces


Manual Fieldbus_Interface AS-i 1 Out (%I)
AS-i 2 Out (%I)
ASi_Master_1 AS-i 1 IN (%I)
ASi_Master_2* AS-i 2 IN (%I)
Gateway Fieldbus_Interface AS-i 1 Out (%I)
AS-i 2 Out (%I)
ASi_Master_1 AS-i 1 IN (%I)
ASi_Master_2* AS-i 2 IN (%I)
PLC Fieldbus_Interface AS-i 1 Out (%I)
AS-i 2 Out (%I)
ASi_Master_1 AS-i 1 IN (%I)
AS-i 1 Out (%Q)
ASi_Master_2* AS-i 2 IN (%I)
AS-i 2 Out (%Q)
* ... only available in devices with two 2 AS-i masters!

When linking variables with inputs and outputs, only use the active interfaces in
the project tree!

36
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC 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
Analogue input and output data of the slaves at AS-
i master 1

Consider validity of the interface data ( Validity of the interface data ( page 36))!

The function library ACnnnn_Utils.library contains the complex variable ASi_NET. The
variable represents all inputs and outputs of a completely developed AS-i network. The
programmer can use this data structure to store the process images of the inputs and outputs
of an AS-i network. ( ASI_NET (STRUCT) ( page 124))

>

Digital input and output data


17625

To access the digital process data of the slaves at AS-i master 1:


In the project tree: Double-click on [ASi_1_binaryIO]
> Editor window shows a structured list of the digital inputs and outputs of the AS-i slaves.

In column [Variable]: Mouse click on to make individual variables visible.

To access the digital process data of the slaves at AS-i master 2 in a system with 2 AS-i masters:
Double-click on [ASi_2_binaryIO]

37
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Access input and output data

>

Analogue input and output data


17626

To access the analogue process data of the slaves at AS-i master 1:


In the device tree: Double-click on [ASi_1_analogIO]
> Editor window shows a structured list of the analogue inputs and outputs of the AS-i slaves.

In column [Variable]: Mouse click on to make individual variables visible.

To access the analogue process data of the slaves atAS-i Master2 in a system with 2 AS-i masters:
Double-click on [ASi_2_analogIO]

38
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC 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.
Output data of the AS-i slaves that is transmitted
by the higher-level fieldbus PLC.

Consider validity of the interface data ( Validity of the interface data ( page 36))!

>

Input and output data of the fieldbus interface


17619

The input and output data of the fieldbus interface os transmitted in cycles of 120 words each. The
programmer can access this data via IEC addresses.
To access the input and output data of the fieldbus interface:
Device window: In the project tree, double-click on [FieldBusData_]
> Editor window shows a structured list of the inputs and outputs:

In column [Variable]: Mouse click on to make individual variables visible.


>

Output data of the AS-i slaves


17620

If the device is operated as a fieldbus gateway (output control = gateway), the fieldbus controller
sends the output data of the AS-i slaves in cycles via the fieldbus. The data is structure like an AS-i
network. The programmer can access this data via IEC addresses.

39
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Access input and output data

>

Digital output data


17630

To access the digital output data of the slaves at AS-i master 1:


Device window: In the project tree, double-click on [ASi_1_binaryOut]
> Editor window shows a structured list of the digital output data:

In column [Variable]: Mouse click on to make individual variables visible.

To access the digital output data of the slaves at AS-i master 2 in a system with 2 AS-i masters:
Double-click on [ASi_2_binaryOut]

>

Analogue output data


17631

To access the analogue output data of the slaves at AS-i master 1:


Device window: In the project tree, double-click on [ASi_1_analogOut]
> Editor window shows the structured list of the analogue output data:

In column [Variable]: Mouse click on to make individual variables visible.

To access the analogue output data of the slaves at AS-i master 2 in a system with 2 AS-i masters:
Double-click on [ASi_2_analogOut]

40
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use functions of the ifm AS-i package

>

7.4 Use functions of the ifm AS-i package


18489

The CODESYS package "CoDeSys for ifm ASinterface products" offers different functions for the
programming of the device-internal CODESYS controller. In the following paragraphs, 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.
>

7.4.1 Control interface of the ifm function blocks


17660

All function blocks (FB) of the libraries ACnnnn_Utils.library and ACnnnn_SYS_CMD.library have
inputs and outputs for control signals. The inputs activate the execution of the function block. The
outputs provide information about the internal condition of the function block. Thanks to the signals,
the programmer can create a control structure for a targeted processing of the FB and react to
possible errors.
Number and designation of the FB control signals provide information about the type of FB execution:
>

FB with one-time execution


17140

These function blocks perform their function exactly once after activation. To execute the function
once again, the FB needs to be reactivated. FBs of this kind feature a control interface with the
following inputs and outputs:

Designation Type Data type Description Possible values


xExecute Input BOOL Control FB execution FALSE = Stop FB execution
TRUE = Start FB execution
xReady Output BOOL Indication of whether execution of FALSE = FB execution not yet completed
the FB has been completed
TRUE = FB execution completed
xBusy Output BOOL Indication of whether FB is active FALSE = Function block is inactive
TRUE = FB is active
xError Output BOOL Indication of whether faults have FALSE = FB executed correctly
occurred during execution of the
FB TRUE = Error occurred during execution of
the FB
wDiagnostic Output WORD Error code FB specific

41
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use functions of the ifm AS-i package

The following figure shows the relation between the connections of the control signals:

xExecute = TRUE: Rising edge (FALSE TRUE) starts execution of the FB.
xBusy = TRUE: FB execution has been started, but has not yet been completed.
xReady = TRUE: FB execution completed; there are valid values on the data outputs.
xBusy = FALSE: FB is no longer active.
xError = FALSE: FB execution without faults.
xExecute = FALSE: All signal outputs are set to FALSE and all internal states are reset.


xReady = TRUE: FB execution is terminated.
xBusy = FALSE: FB is no longer active.
xError = TRUE: Errors occurred during FB execution; wDiagnostic provides error code.


xExecute = FALSE: FB execution interrupted prior to completion; All signal outputs are set to FALSE and all
internal states are reset.

42
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use functions of the ifm AS-i package

>

FB with cyclic execution


17141

Function blocks which, when activated, cyclically perform their function until they are deactivated have
the following control inputs and outputs:

Designation Type Data type Description Possible values


xEnable Input BOOL Control FB execution FALSE = Stop FB execution
TRUE = Start FB execution
xActive Output BOOL Indication of whether execution of FALSE = FB execution not yet completed
the FB has been completed
TRUE = FB execution completed
xError Output BOOL Indication of whether faults have FALSE = FB executed correctly
occurred during execution of the
FB TRUE = Error occurred during execution of
the FB
wCycleCount Output WORD Counters for the FB cycles Integer value (hexadecimal representation)
wDiagnostic Output WORD Error code FB specific

43
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use functions of the ifm AS-i package

>

7.4.2 Configure system


17450

To configure the system of the device, use the following function blocks:

Function block Description Reference


QuickSetupASi_Master Execute quick setup routine on an AS-i master QuickSetupASi_Master
( page 115)
Set_TimeDate Set system time (date, time) of the system Set_TimeDate ( page 117)
Get_FieldbusInfo Read fieldbus type, the status of the field bus connection Get_FieldbusInfo ( page 113)
and the parameters of the fieldbus interface

>

7.4.3 Configure AS-i master


17448

To configure the AS-i master(s) of the device, use the following function blocks:

Function block Description Reference


Set_Mode Set operating mode of the AS-i master (projecting mode Set_Mode ( page 100)
or protected operation)
Set_ASi_Config Set diagnostic functions of the AS-i master (double Set_ASi_Config ( page 96)
address recognition, earth fault detection)
Set_AdressMode Set automatic addressing of the AS-i master Set_AddressMode ( page 94)

>

7.4.4 Configure AS-i slaves


17449

To configure the AS-i slaves, that are connected to the device, use the following function blocks:

Function block Description Reference

Set_SlaveAddress Change address of an AS-i slave Set_SlaveAddress ( page 104)


Set_SlaveParameter Change I/O configuration and ID codes (IO, ID, ID1, ID2) Set_SlaveParameter ( page 108)
of an AS-i slave
Set_SlaveExtendedID1 Extended ID1 of an AS-i slave Set_SlaveExtendedID1
( page 106)

44
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use functions of the ifm AS-i package

>

7.4.5 Manage AS-i network


17126

To manage the AS-i networks controlled by AC14nn, use the following function blocks:
>

Change network settings


17568

Function block Description Reference

Set_ProjectAll Execute projection adaptation on one AS-i master Set_ProjectAll ( page 103)
Set_LPS Change list of the projected slaves (LDS) Set_LPS ( page 98)
Set_PCD Change permanent projecting data (IO, ID, ID1, ID2) of Set_PCD ( page 101)
all slaves on the AS-i master

>

Read network settings


18532

To read the network settings cyclically and offer them in the application:

Function block Description Reference

Get_ASi_Data Read the following datasets for network management in Get_ASi_Data ( page 110)
batches and cycles:
List of activated slaves (LAS)
List of detected slaves (LDS)
List of projected slaves (LPS)
List of peripheral faults (LPF)
List of configuration errors (LCE)
List of configuration errors, missing slaves (LCEMS)
List of configuration errors - additional slaves
(LCEAS)
List of double address errors (LDAE)
Configuration data image (CDI)
Permanent configuration data (PCD)
Input parameters (PI)
Output parameters (PP)

Alternatively, this data can be read separately with the following FB:

45
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use functions of the ifm AS-i package

>

Read parameter images


17569

Function block Description Reference


Get_InputParameter Read parameters of the inputs of the slaves at the AS-i Get_InputParameter ( page 90)
master (PI)
Get_OutputParameter Read parameters of the outputs of the slaves on the AS-i Get_OutputParameter ( page 92)
master (PP)

>

Read slave lists


18530

Function block Description Reference

Get_LPS Read list of projected slaves (LPS) Get_LPS ( page 74)


Get_LDS Read list of detected slaves (LDS) Get_LDS ( page 72)
Get_LAS Read list of activated slaves (LAS) Get_LAS ( page 70)
Get_LPF Read list of peripheral faults (LPF) Get_LPF ( page 84)
Get_LCE Read list of configuration errors (LCE) Get_LCE ( page 76)
Get_LCEMS List of configuration errors - read missing slaves Get_LCEMS ( page 80)
(LCEMS)
Get_LCEAS Read of the configuration errors - read additional slave Get_LCEAS ( page 78)
(LCEAS)
Get_LDAE Read list of double address errors (LDAE) Get_LDAE ( page 82)

>

Read configuration data of the slaves


18533

Function block Description Reference


Get_CDI Read configuration data image (IO, ID, ID1, ID2) of all Get_CDI ( page 86)
slaves on the AS-i master
Get_PCD Read permanent configuration data of all slaves (IO, ID, Get_PCD ( page 88)
ID1, ID2) on the AS-i master

>

Read status of the voltage supply


18529

Function block Description Reference


Get_ASi_PHY_Dat Determine voltage supply status of the AS-i network Get_ASi_PHY_Dat ( page 68)

46
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use functions of the ifm AS-i 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
can send commands to the system or an AS-i master with the FB ACnnnn_SysCmd
( ACnnnn_SysCmd ( page 129)).
System command overview: Table: System commands ( page 130)
Overview AS-i master commands: Table: AS-i master commands ( page 131)

By default, the FB ACnnnn_SysCmd is hidden. To add the FB to a program module:


Highlight the requested network and add an empty function block with [FBD/LD/IL] > [Insert Empty Block].
> Network shows empty FB.
Double-click on the name field of the FB
Enter designation ACnnnn_SysCmd and
confirm with [ENTER].

> FB has inputs and outputs of the


ACnnnn_SysCmd.
Adjust inputs and outputs of the FB in
accordance with the requested command.

47
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use web visualisations

>

7.5 Use web visualisations

Notes on web visualisations ...................................................................................................................49


Add web visualisation to a project ..........................................................................................................49
Create web visualisation .........................................................................................................................50
Configure web visualisation ....................................................................................................................51
17059

Familiarise yourself with the following CODESYS functions!


Visualisation in CODESYS
Online help > Visualization
Web visualisation
Online help > Visualization > Visualization Manager with Clients > The Clients and
their Editors
Task configuration
Online help > Editors > Task Configuration Editor - Task Editor > Configuration
dialogue

48
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use web visualisations

>

7.5.1 Notes on web visualisations


17661

The AC14nn supports web visualisations (WebVisu). A web visualisation offers the possibility to have
a graphic display of process and control data using a web browser.
>

7.5.2 Add web visualisation to a project


17060

To add a web visualisation to a CODESYS project:


Open CODESYS project.
OR:
Create new CODESYS project. ( Create new project with AC14nn ( page 20))
Windows [Devcies]: In the project tree, right-click on [Application]
> Context menu with options appears.
Select [Add Object ] > [Visualization] and use [Add] to create the visualisation.
> The project tree contains the following additional elements:

VISU_TASK:
Configuration options for the parameters of the
visualisation task (request interval, watchdog, etc.)
Set parameters for visualisation task ( page 51)
VisualizationManager:
Administration of several visualisations (determine start
visualisation, change name of the .htm file, adjust
interval for updates)
Change properties of the web visualisation
( page 52)
MyWebVisu:
Area for the creation of the web visualisation
Create web visualisation ( page 50)

49
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use web visualisations

>

7.5.3 Create web visualisation


17061

To create a web visualisation for a PLC application:


Windows [Devices]: In the project tree, double-click on [Visualization]
> The visualisation editor with a tool box appears:

Create the visualisation using the tools.


Save the project.

50
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use web visualisations

>

7.5.4 Configure web visualisation


17064

Each web visualisation is executed separately from the program code in a separate task. Take the
following steps to configure the web visualisation:
>

Set parameters for visualisation task


17066

Execute the visualisation task (VISU_TASK) with a priority that is as low as


possible to avoid interruption of other tasks that are important for the core functions
of the application.
Execute the VISU_TASK in appropriate cyclic intervals to save the resources of
the device-internal CODESYS PLC of the fieldbus network.

To set the attributes of the visualisation task:


In the project tree: Double-click on [VISU_TASK]
> In the editor window: [VISU_TASK] > [Configuration] tab shows parameters of the WebVisu task:

Set the parameters as requested.


Save project in order to apply changed values.

51
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Use web visualisations

>

Change properties of the web visualisation


17065

To change the attributes of the web visualisation:


Device window: In the project tree, double-click on [WebVisualization]
> Editor window shows attributes of the web visualisation:

Set the following values:


1. Field [Start Visualization]: Select the created web visualisation.
2. Field [Name of .htm file]: Enter name of htm. file ( note).
3. Group [Best Fit]: Enter fixed width and height as shown.

Enter the name by which the web visualisation is to be accessible in the web browser in the field [Name
of .htm file] ( Display web visualisation ( page 62)).

Save project in order to apply changed values.

52
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
PLC programming Testing the PLC application

>

7.6 Testing the PLC application


18594

To ensure permanent operation without errors in industrial environments, the created PLC applications
must be tested in detail and possible faults must be remedied.

Familiarise yourself with the following CODESYS functions!


Test and fault elimination
Online help > Concepts and Base Components > Debugging

53
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Testing the PLC application

8 Operation

Activate CODESYS PLC ........................................................................................................................55


Load application on AC14nn ..................................................................................................................56
Operating states of the CODESYS PLC ................................................................................................57
Reset ......................................................................................................................................................60
Display web visualisation ........................................................................................................................62
Delete application from AC14nn .............................................................................................................63
18492

Familiarise yourself with the following CODESYS functions!


Communication between CODESYS and device
Online help > Menu Commands sorted by Categories > Device communication
Translate project/application and transfer to the device
Online help > Menu Commands sorted by Categories > Online

54
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Activate CODESYS PLC

>

8.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 AC14nn.
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.
The following table shows the possible combinations of the parameters [Output access] and [Use PLC]
as well as the rights of the CODESYS PLC resulting thereof.

List Checkbox CODESYS PLC


[Output access] [Use PLC]
Programmable Access to Access to
AS-i inputs AS-i outputs

Gateway no yes no

yes yes no

Manual no yes no

yes yes no

PLC * yes yes yes

Legend:
* ... Value fixed (greyed out)

To set the operating mode of the AC14nn:


1 Call up menu page

Navigation path: >


Select [System settings] tab.
2 Set the controller instance of the outputs
Select the requested controller instance of the AS-i outputs in the list [Output access].
Use [Accept selection] to activate the selection.
3 Activate CODESYS PLC
Activate [Use PLC] checkbox.
> CODESYS PLC is active.
4 Optional: Adjust device cycle
Select the requested device cycle time in the list [Device cycle].
Use [Accept selection] to activate the selected value.

55
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Load application on AC14nn

>

8.2 Load application on AC14nn


18593

To transfer the created PLC application as boot project to the device:


Requirements:
Connection between PC/laptop and AC14nn established ( device manual, appendix: Configuration interface:
Connection concepts).
Communication path is set ( Configure connection with AC14nn ( page 28)).
Project tested.
1 Translate application
In the project tree: highlight application as active application.
Use [Build] > [Rebuild] to translate the active application.
> CODESYS generates program code.
2 Load application on AC14nn
Use [Online] > [Login] to connect with the AC14nn.
> Active application is loaded to AC14nn (download).
> Application on AC14nn is in STOP state.
3 Create boot application
Use [Online] > [Create boot application] to make the application bootable.
> Application storage is non-volatile.
4 Start application
Use [Debug] > [Start] to start the application.
> Application goes to the RUN state.

56
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Operating states of the CODESYS PLC

>

8.3 Operating states of the CODESYS PLC


17544

All applications saved on the device are executed in separate tasks independently of each other. If the
device-internal CODESYS PLC is activated, each of these tasks can have the following operating
states:

Operating status Description/characteristics


STOP The PLC application saved on the device is not processed.
RUN The PLC application saved on the device is cyclically
processed.

If the device-internal PLC is activated and at least 1 application is saved on the device,
the PLC automatically goes into the RUN state.

>

8.3.1 Display current operating state


10272

Execute one of the following actions to display the current operating state of the PLC:
CODESYS:
> Application node in the project tree shows the status:
Connection with CODESYS PLC established.
PLC application is in the STOP state.

Connection with CODESYS PLC established.


PLC application is in the RUN state.

GUI / web interface of the device:

Navigation path: > >


Select the [Applications] register tab.
> The page displays the operating states of the PLC applications saved on the device.

57
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Operating states of the CODESYS PLC

>

8.3.2 Switch operating states


10264

Select one of the following actions to switch between the operating states:
>

Start PLC application


18027

To start a PLC application stored on the device:


CODESYS:
In the project tree: highlight application as active application.
Use [Online] > [Login] to establish the connection with the CODESYS PLC.
Use [Debug] > [Start] to start the processing of the active application.
> Application goes into RUN state.
Optional: repeat process for further applications.
GUI / web interface:

Navigation path: > >


Select [Applications] tab.
Use [] / [] to select the requested application.
> Page shows the operating status of the selected application.
Use [Start] function key to start the processing of the selected application.
> Application goes into RUN state.
Optional: repeat process for further applications.

58
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Operating states of the CODESYS PLC

>

Stop PLC application


18029

To stop a PLC application stored on the device:


CODESYS:
In the project tree: highlight application as active application.
Use [Online] > [Login] to establish the connection with the CODESYS PLC.
Use [Debug] > [Stop] to stop the processing of the active application.
> Application goes into STOP state.
Optional: repeat process for further applications.
GUI / web interface:

Navigation path: > >


Select [Applications] tab.
Use [] / [] to select the requested application.
> Page shows the operating status of the selected application.
Use [Stop] function key to stop the processing of the selected application.
> Application goes into STOP state.
Optional: repeat process for further applications.

59
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Reset

>

8.4 Reset

Supports reset variants ...........................................................................................................................61


Reset PLC application ............................................................................................................................61
18025

60
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Reset

>

8.4.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 Triggering actions


Reset (cold) Application changes to the STOP state Download the application to the device
All variables (VAR, VAR RETAIN) of the CODESYS command: Cold reset
application are initialised.
Reset (warm) Application goes to STOP state CODESYS command:
Warm reset
Standard variables (VAR) of the application are
initialised GUI commands:
Reset all applications
Remanent variables (VAR RETAIN) of the
application keep their current values. Device reboot
Reset (default) Application goes to STOP state CODESYS command: Reset default
The application on the PLC is deleted Firmware update
All variables (VAR, VAR RETAIN) of the
application are initialised.
CODESYS PLC is reset to the original state

A variable that has been declared without an initialisation value is initialised with the
standard initialisation value (e.g. INT = 0).

>

8.4.2 Reset PLC application


18028

To reset a PLC application stored on the device:


1 Connect with the device
In the project tree: highlight application as active application.
Use [Online] > [Login] to establish the connection with the CODESYS PLC.
> CODESYS is in the online mode.
2 Reset application with requested reset function
Select one of the following reset variants ( Supported reset variants ( page 61)):
Reset (warm): [Online] > [Reset warm]
Reset (cold): [Online] > [Reset cold]
Reset (default): [Online] > [Reset origin]
> Application is reset with the selected reset method.

61
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Display web visualisation

>

8.5 Display web visualisation


17063

To display the created web visualisation:


Requirements:
PC/laptop is connected to the configuration interface (X3) of the device ( device manual, paragraph Configuration
interface: Connection concepts)
PLC application with web visualisation is stored and started on AC14nn ( Load application on AC14nn
( page 56)).
On PC/laptop: Start web browser.
Enter the following in the address line and confirm with [ENTER]:
<IP-Adresse-des-Gerts>:<Port>/<MyWebVisu>.htm

<MyWebVisu> is the defined name of the web visualisation ( Change properties of the web visualisation
( page 52)).

> Web browser shows the web visualisation of the device.

62
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Operation Delete application from AC14nn

>

8.6 Delete application from AC14nn


18030

To delete an application stored on the device:


1 Connect with the device
In the project tree: highlight application as active application.
Connect with the device with [Online] > [Login].
> CODESYS is in the online mode.
2 Delete application
In the editor window: Select [Device] > [Applications] tab.
Refresh view with [Refresh List].
> List shows the names of the applications that are stored on the device.
Delete all applications in the device with [Remove All].
OR:
Highlight requested application and delete with [Remove] from the device.
> Selected applications will be deleted.

63
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Delete application from AC14nn

9 Annex

ifm AS-i function libraries ........................................................................................................................65


Acyclic data records .............................................................................................................................137
Command channels ..............................................................................................................................168
7156

64
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

9.1 ifm AS-i function libraries

ACnnnn_Utils.library ...............................................................................................................................66
ACnnnn_SYS_CMD.library ..................................................................................................................128
17128

65
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

9.1.1 ACnnnn_Utils.library

Overview: AS-i functions (FB_ASi) .........................................................................................................67


Overview: System functions (FB_System) ...........................................................................................112
Enumeration types and complex variables ...........................................................................................119
17722

66
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Overview: AS-i functions (FB_ASi)

Get_ASi_PHY_Dat .................................................................................................................................68
Get_LAS .................................................................................................................................................70
Get_LDS .................................................................................................................................................72
Get_LPS .................................................................................................................................................74
Get_LCE .................................................................................................................................................76
Get_LCEAS ............................................................................................................................................78
Get_LCEMS ...........................................................................................................................................80
Get_LDAE...............................................................................................................................................82
Get_LPF .................................................................................................................................................84
Get_CDI ..................................................................................................................................................86
Get_PCD ................................................................................................................................................88
Get_InputParameter ...............................................................................................................................90
Get_OutputParameter ............................................................................................................................92
Set_AddressMode ..................................................................................................................................94
Set_ASi_Config ......................................................................................................................................96
Set_LPS..................................................................................................................................................98
Set_Mode .............................................................................................................................................100
Set_PCD ...............................................................................................................................................101
Set_ProjectAll .......................................................................................................................................103
Set_SlaveAddress ................................................................................................................................104
Set_SlaveExtendedID1 ........................................................................................................................106
Set_SlaveParameter ............................................................................................................................108
Get_ASi_Data .......................................................................................................................................110
17459

67
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16041

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

68
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Output parameters
16042

Parameter Data type Description Possible values

xPS BOOL Voltage source (Power Source) FALSE = unit is supplied via Aux.
TRUE = unit is supplied via AS-i.
xPM BOOL Power24-Modul (PM) FALSE = Power24 module missing.
TRUE = Power24 module is inserted.
xEF BOOL Earth fault FALSE = no earth fault
TRUE = supply voltage is asymmetric,
earth fault suspected.
xSE BOOL Status of the earth fault detection FALSE = earth fault detection does not
provide valid data (e.g. when
AS-i voltage is lacking).
TRUE = earth fault detection provides
valid data.
xPF1 BOOL Voltage <22.5 V (power fail 22.5 V) FALSE = no AS-i power fault (Classic
APF)
TRUE = AS-i power fail (Classic APF),
i.e. AS-i voltage is below
22.5 V
xPF2 BOOL Voltage <19.0V (power fail 19V) FALSE = no AS-i power fail (24V-APF)
TRUE = AS-i power fail (24V-APF), i.e.
AS-i voltage is below 19.0 V
wVoltage1 WORD Voltage AS-i+ to AS-i- in mV
wVoltage2 WORD Voltage FE to AS-i in mV
iSymmetry INT Symmetry in % (-100% ... +100%) 0xFF9C -100%
... ...
0x0000 0%
... ...
0x0064 +100%
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set

69
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16069

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

70
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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
0= no single/A slave available
...
- Bit 31 (MSB) = address 31/31A 1= single/A slave available
dwLAS_B_Slaves DWORD List of the active B slaves. Each bit Per bit:
represents an AS-i address:
- Bit 0 (LSB) = not used 0= no B slave available
- Bit 1 = address 1B
... 1= B slave available
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

71
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16119

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

72
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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
0= no slave detected
...
- Bit 31 (MSB) = address 31/31A 1= slave detected
dwLDS_B_Slaves DWORD List of detected B slaves. Each bit Per bit:
represents an AS-i address:
- Bit 0 (LSB) = not used 0= No slave detected
- Bit 1 = address 1B
1= slave detected
...
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

73
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16131

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

74
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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
0= slave not projected
...
- Bit 31 (MSB) = address 31/31A 1= slave projected
dwLPS_B_Slaves DWORD List of the projected B slaves. Each bit Per bit:
represents an AS-i address:
- Bit 0 (LSB) = not used 0= slave not projected
- Bit 1 = address 1B
1= slave projected
...
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

75
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16076

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

76
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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:
0= no configuration error
- Bit 0 (LSB) = address 0
... 1= configuration error
- Bit 31 (MSB) = address 31/31A
dwLCE_B_Slaves DWORD List of configuration errors of the B Per bit:
slaves. Each bit represents an AS-i
address: 0= no configuration error
- Bit 0 (LSB) = not used
1= configuration error
- Bit 1 = address 1B
...
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

77
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16099

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

78
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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: 0= no configuration error -
- Bit 0 (LSB) = address 0 additional slave
...
- Bit 31 (MSB) = address 31/31A 1= slave exists, but not projected

dwLCEAS_B_Slaves DWORD List of configuration errors of the B Per bit:


slaves. Each bit represents an AS-i
address: 0= no configuration error -
- Bit 0 (LSB) = not used additional slave
- Bit 1 = address 1B
1= slave exists, but not projected
...
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

79
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16107

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

80
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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:
0= no configuration error - missing
- Bit 0 (LSB) = address 0
slave
...
- Bit 31 (MSB) = address 31/31A 1= Slave is projected but not
available
sdwLCEMS_B_Slaves DWORD List of the configured but non-existing Per bit:
B slaves. Each bit represents an AS-i
address: 0= no configuration error - missing
- Bit 0 (LSB) = not used slave
- Bit 1 = address 1B
1= Slave is projected but not
...
available
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

81
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16113

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

82
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Output parameters
16114

Parameter Data type Description Possible values

dwLDAE_SA_Slaves DWORD List of the double address errors. Each Per bit:
bit represents an AS-i address:
- Bit 0 (LSB) = address 0
0= no double address error
...
- Bit 31 (MSB) = address 31/31A 1= double address error
dwLDAE_B_Slaves DWORD List of double address errors. Each bit Per bit:
represents an AS-i address:
- Bit 0 (LSB) = not used 0= no double address error
- Bit 1 = address 1B
1= double address error
...
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

83
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16125

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

84
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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
0= no peripheral fault
...
- Bit 31 (MSB) = address 31/31A 1= peripheral fault detected
dwLPF_B_Slaves DWORD List of peripheral faults on B slaves. Per bit:
Each bit represents an AS-i address:
- Bit 0 (LSB) = not used 0= no peripheral fault
- Bit 1 = address 1B
1= Peripheral fault detected
...
- Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

85
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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. The configuration data of a slave consists of the
registers IO, ID, ID1 and ID2.
>

Input parameters
16046

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

86
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

87
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16142

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

88
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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

Data in Word 0 is invalid!


xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

89
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16057

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

90
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Output parameters
16058

Parameter Data type Description Possible values

abList_SA_Slave ARRAY[0..31] List of output parameters of S/A slaves Per byte:


OF BYTE in the selected AS-i master. Each
byte contains the output parameters of Bits 0...3: P0-P3
an AS-i slave.
byte 0 (LSB) = res.
byte 1 = slave with address 1(A) ...
byte 31 = slave with address 31(A)
abList_B_Slave ARRAY[0..31] List of output parameters of B slaves Per byte:
OF BYTE in the selected AS-i master. Each byte
contains the output parameters of an Bits 0...3: P0-P3
AS-i slave.
byte 0 (LSB) = res.
byte 1 = slave with address 1B
...
byte 31 = slave with address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

91
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16137

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

>

92
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

Output parameters
16138

Parameter Data type Description Possible values


abList_SA_Slave ARRAY[0..31] List of output parameters of S/A slaves Per byte:
OF BYTE in the selected AS-i master. Each
byte contains the output parameters of Bits 0...3: P0-P3
an AS-i slave.
byte 0 (LSB) = res.
byte 1 = slave with address 1(A) ...
byte 31 = slave with address 31(A)
abList_B_Slave ARRAY[0..31] List of output parameters of B slaves Per byte:
OF BYTE in the selected AS-i master. Each byte
contains the output parameters of an Bits 0...3: P0-P3
AS-i slave.
byte 0 (LSB) = res.
byte 1 = slave with address 1B
...
byte 31 = slave with address 31B
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

93
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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 Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
enAuto_Address_Mode ASI_ADDRESS_ Parameter activates/deactivates the Auto_address Automatic addressing
MODE automatic addressing mode. _disable = inactive
Auto_address Automatic addressing
_enable = active

94
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set

95
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16150

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
xDoubleAdrDetection BOOL Activate/deactivate "Double address FALSE = Double address recognition
recognition" inactive
TRUE = Double address recognition
active
xEarthFaultDetection BOOL Activate/deactivate "Earth-fault FALSE = Earth-fault detection inactive
detection"
TRUE = Earth-fault detection active

96
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0001 = wrong parameter transferred,
setting was not adopted.

97
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16154

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
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
0= slave not projected
...
- Bit 31 (MSB) = address 31/31A 1= slave projected
dwLPS_B_Slaves DWORD List of the projected B slaves. Each bit Per bit:
represents an AS-i address:
- Bit 0 (LSB) = not used 0= slave not projected
- Bit 1 = address 1B
1= slave projected
...
- Bit 31 (MSB) = address 31B

98
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0019 = master not in the projecting
mode

99
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16156

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
enMode_ASi_Master ASI_MASTER_ Operating mode of the AS-i master Closed_ protected mode active
MODE mode =
Project_ projection mode active
mode =

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0003 = Slave with address 0 found
(slave not detected)

100
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
16160

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE = Stop FB execution


TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
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

Data in Word 0 is invalid!

101
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0019 = master not in the projecting
mode

102
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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 Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2

>

Output parameters
17020

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0003 = Slave with address 0 found
(slave not detected)
0x0019 = master not in the projecting
mode

>

103
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

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 Description Possible values

xExecute BOOL Control execution of the FB FALSE = Stop FB execution


TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
enASi_Slave ASI_SLAVE Address of the AS-i slave Slave_n = AS-i slave to address n
(n = 1 ... 31)
enASi_SlaveTyp ASI_SLAVE_ Type of the AS-i slave SA_Slave = Single or A slave
TYP
B_Slave = B-Slave
enASi_Slave_new ASI_SLAVE New address of the AS-i slave Slave_n = AS-i slave at address n
(n = 1 ... 31)
enASi_SlaveTyp_new ASI_SLAVE_ New type of the AS-i slave SA_Slave = single slave or A slave
TYP
B_Slave = B slave

104
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0001 = slave does not respond or
change to offline mode during
FB execution
0x0002 = Slave with old address not
found (slave not detected)
0x0003 = Slave with address 0 found
(slave not detected)
0x0004 = slave with new address found
0x0005 = error during deletion of the old
address (Delete Error)
0x0006 = ExtendedID1 could not be read
after writing (Read Error)
0x0007 = Error when writing
ExtendedID1 (Set Error)
0x0008 = New address temporary stored
0x0009 = ExtendedID1 stored
temporarily
0x0018 = Master is not in normal
operation.

105
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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 Description Possible values

xExecute BOOL Control execution of the FB FALSE = Stop FB execution


TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
enASi_Slave ASI_SLAVE Address of the AS-i slave Slave_n = AS-i slave to address n
(n = 1 ... 31)
enASi_SlaveTyp ASI_SLAVE_ Type of the AS-i slave SA_Slave = Single or A slave
TYP
B_Slave = B-Slave
bExtendedID1 BYTE Extended ID1 code of the selected Extended ID1 code
AS-i slave (hexadecimal representation)

106
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0003 = Slave with address 0 found
(slave not detected)
0x0005 = error during deletion of the old
address (Delete Error)
0x0006 = ExtendedID1 could not be read
after writing (Read Error)
0x0007 = Error when writing
ExtendedID1 (Set Error)
0x0009 = ExtendedID1 stored
temporarily
0x000E = Invalid slave address
(e.g. 0 or 0B specified)
0x0018 = Master is not in normal
operation.
0x0021 = invalid ExtendedID1 code

107
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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 Description Possible values

xExecute BOOL Control execution of the FB FALSE = Stop FB execution


TRUE = Start one-time FB execution
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
enASi_Slave ASI_SLAVE Address of the AS-i slave Slave_n = AS-i slave to address n
(n = 1 ... 31)
enASi_SlaveTyp ASI_SLAVE_ Type of the AS-i slave SA_Slave = Single or A slave
TYP
B_Slave = B-Slave
enASi_SlaveParam BYTE Parameters of the selected AS-i slave Slave parameters
(hexadecimal representation)

108
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0001 = slave does not respond or
change to offline mode during
FB execution
0x000A = slave not in LAS
0x000B = data content invalid (e.g.
parameter value >7 for A/B
slaves)
0x000E = Invalid slave address
(e.g. 0 or 0B specified)
0x0018 = Master is not in normal
operation.

109
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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
variable of data type ASI_DATA ( ASI_DATA (STRUCT) ( page 122)):
List of activated slaves LAS
List of detected slaves LDS
List of projected slaves LPS
List of configuration errors LCE
List of configuration errors - additional slave LCEAS
List of configuration errors - missing slave LCEMS
List of peripheral faults LPF
List of double address errors LDAE
Configuration data image CDI
Projected configuration data PCD
Input parameters of the AS-i slaves
Output parameters of the AS-i slaves
>

Input parameters
16034

Parameter Data type Description Possible values


xEnable BOOL Control activiy of the FB TRUE = FB is activated
FALSE = FB is deactivated
enASi_Master ASI_MASTER Select AS-i master Master_1 = AS-i master 1
Master_2 = AS-i master 2
pASi_Data POINTER TO Structure variable in which the read Variable must be declared!
ASI_DATA data is to be stored.

110
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0xnF01 = unknown error 1

0xnF02 = unknown/invalid target 1


0xnF03 = unknown command ID 1
0xnF04 = unknown parameters 1
0xnF05 = timeout during processing 1
Legend:
1
Get_ASi_Data executes the FB ACnnnn_SysCmd sequentially with different command IDs in order to determine the individual
elements of the complex variable. In the returned error code, the nibble n indicates the command request where the error
occurred. n can have the following values:
1 = error with "Get LAS, LDA, LPF, LCE"
2 = error with "Get LPS"
3 = error with "Get CDI"
4 = error with "Get PCD"
5 = error with "Get Input Parameter"
6 = error with "Get Output Parameter"
7 = error with "Get LCEMS, LCEAS, LDAE"

111
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Overview: System functions (FB_System)

Get_FieldbusInfo ..................................................................................................................................113
QuickSetupASi_Master ........................................................................................................................115
Set_TimeDate .......................................................................................................................................117
17460

112
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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:
Status of the fieldbus
Fieldbus type
Status of the Ethernet connection at port X6 and X7
MAC addresses
IP address of the fieldbus host
>

Input parameters
17455

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE = Stop FB execution
TRUE = Start one-time FB execution

113
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Output parameters
17456

Parameter Data type Description Possible values

aw_InfoList ARRAY[0...18] Fieldbus information Position of the data within the individual
OF WORD words DS18 Fieldbus information
( page 166)
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

114
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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 Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE = Stop FB execution


TRUE = Start one-time FB execution
xMaster1 BOOL Select AS-i master 1 for quick setup FALSE = No execution of quick setup,
AS-i configuration remains
unchanged.
TRUE = Execution of quick set up on
AS-i master
xMaster2 BOOL Select AS-i master 2 for quick setup FALSE = No execution of quick setup,
AS-i configuration remains
unchanged.
TRUE = Execution of quick set up on
AS-i master

115
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0003 = Slave with address 0 found
(slave not detected)

116
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
>

Input parameters
15988

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE = Stop FB execution


TRUE = Start one-time FB execution
bDay BYTE Day 0x01 = 1
... ...
0x1F = 31
bMonth BYTE Month 0x01 = January
... ...
0x0C = December
wYear WORD Year 0x07B3 = 1971
... ...
0x07F5 = 2037
bHour BYTE Hour 0x00 = 0
... ...
0x17 = 23
bMinute BYTE Minute 0x00 = 0
...
0x3B = 59
bSecond BYTE Second 0x00 = 0
...
0x3B = 59

117
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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.
xBusy BOOL Signal indicates if the FB is executed. FALSE = FB is deactivated or FB
execution is terminated.
TRUE = FB execution is started but not
yet terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
wDiagnositic WORD Diagnostic data 0x0000 = no specific error is set
0x0001 = Transferred values for
date/time are invalid and could
not be set.
0x0002 = NTP active, time could not be
adopted.

118
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Enumeration types and complex variables

Enumeration types (ENUM)..................................................................................................................119


Complex variables (STRUCT) ..............................................................................................................122
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)


16176

The library ACnnnn_Utils provides the following enumeration types (ENUM):


>

ASI_ADDRESS_MODE (ENUM)
16177

Designation Description Variable Data type Value


ASI_ADDRESS_MODE AS-i autoaddressing mode Auto_address_enable INT 0
Auto_address_disable INT 1

>

ASI_MASTER (ENUM)
16178

Designation Description Variable Data type Value

ASI_MASTER Identifier for AS-i masters Master_1 INT 1


Master_2 INT 2

>

ASI_MASTER_MODE (ENUM)
16179

Designation Description Variable Data type Value

ASI_MASTER_MODE Operating mode of the AS-i master Closed_mode INT 0


Project_mode INT 1

119
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

ASI_SLAVE (ENUM)
16180

Designation Description Variable Data type Value

ASI_SLAVE Identifier for AS-i slaves Slave_1 INT 1


Slave_2 INT 2
Slave_3 INT 3
Slave_4 INT 4
Slave_5 INT 5
Slave_6 INT 6
Slave_7 INT 7
Slave_8 INT 8
Slave_9 INT 9
Slave_10 INT 10
Slave_11 INT 11
Slave_12 INT 12
Slave_13 INT 13
Slave_14 INT 14
Slave_15 INT 15
Slave_16 INT 16
Slave_17 INT 17
Slave_18 INT 18
Slave_19 INT 19
Slave_20 INT 20
Slave_21 INT 21
Slave_22 INT 22
Slave_23 INT 23
Slave_24 INT 24
Slave_25 INT 25
Slave_26 INT 26
Slave_27 INT 27
Slave_28 INT 28
Slave_29 INT 29
Slave_30 INT 30
Slave_31 INT 31

120
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

ASI_SLAVE_TYP (ENUM)
16181

Designation Description Variable Data type Value

ASI_SLAVE_TYP Type of the AS-i slave SA_Slave INT 0


B_Slave INT 1

121
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Complex variables (STRUCT)


15991

The library ACnnnn_Utils.library provides the following 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.
>

ASI_DATA (STRUCT)
15992

Designation 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
LDS_B_Slave DWORD List of active B slaves
DS9 Slave lists LAS, LDS, LPF, LCE
( page 154), words 4...7

LAS_SA_Slave DWORD List of active S/A slaves


Each bit represents an AS-i address:
0 = no active slave
1 =active slave
LAS_B_Slave DWORD List of active B slaves
DS9 Slave lists LAS, LDS, LPF, LCE
( page 154), words 0...3

LPF_SA_Slave DWORD List of peripheral faults (S/A slaves) Each bit represents an AS-i address:
0 = no peripheral fault
1 = peripheral fault

LPF_B_Slave DWORD List of peripheral faults (B slaves) DS9 Slave lists LAS, LDS, LPF, LCE
( page 154), words 8...11

LCE_SA_Slave DWORD List with configuration errors (S/A Each bit represents an AS-i address:
slaves) 0 = no configuration error
1 = configuration error

LCE_B_Slave DWORD List with configuration errors (B DS9 Slave lists LAS, LDS, LPF, LCE
slaves) ( page 154), words 12...15

LPS_SA_Slave DWORD List of projected S/A slaves


Each bit represents an AS-i address:
0 = no projected slave
1 = projected slave
LPS_B_Slave DWORD List of active B slaves
DS10 Slave list LPS ( page 155)

LCEMS_SA_Slave DWORD List of configuration errors: Each bit represents an AS-i address:
projected, but missing S/A slave 0 = no configuration error
1 = configuration error
LCEMS_B_Slave DWORD List of configuration errors:
projected, but missing B slave DS17 Error lists LCEMS, LCEAS, LDAE
( page 165), words 0...3
LCEAS_SA_Slave DWORD List of configuration errors:
additional S/A slave Each bit represents an AS-i address:
0 = no error
1 = error
LCEAS_B_Slave DWORD List of configuration errors:
DS17 Error lists LCEMS, LCEAS, LDAE
additional B slave
( page 165), words 4...7

LDAE_SA_Slave DWORD List of double address errors (S/A Each bit represents an AS-i address:
slaves) 0 = no double address error
1 = double address error

122
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

Designation Data type Description Possible values

LDAE_B_Slave DWORD List of double address errors (B DS17 Error lists LCEMS, LCEAS, LDAE
slaves) ( page 165), words 8...11

CDI ARRAY[0..63] Image of the current configuration One word is available per slave:
OF WORD data Bits 0...3 = IO code
(CDI = Configuration Data Image) Bits 4...7 = ID code
Bits 8...11 = Extended ID1 code
Bits 12...15 = Extended ID2 code
DS11 Current configuration data CDI
( page 156)
PCD ARRAY[0..63] Image of the projected configuration Each word contains data of one slave:
OF WORD data Bits 0...3 = IO
(PCD = Projected Configuration Bits 4...7 = ID
Data) Bits 8...11 = ID1
Bits 12...15 = ID2
DS12 Projected configuration data PCD
( page 158)
InputParam_SA_Slave ARRAY[0..31] Input parameters of the S/A slaves Each byte contains parameters of one S/A
OF BYTE slave:
Bits 0...3 = P0-P3
Bits 4...7 = reserved
DS13 Image of the input parameters of the
slaves ( page 160), words 0...15
InputParam_B_Slave ARRAY[0..31] Input parameters of the B slaves Each byte contains parameters of one B
OF BYTE slave:
Bits 0...3 = P0-P3
Bits 4...7 = reserved
DS13 Image of the input parameters of the
slaves ( page 160), words 16...31
OutputParam_SA_Slave ARRAY[0..31] Output parameters of the S/A Each byte contains parameters of one S/A
OF BYTE slaves slave:
Bits 0...3 = P0-P3
Bits 4...7 = reserved
DS14 Image of the output parameters of the
slaves ( page 161), words 0...15
OutputParam_B_Slave ARRAY[0..31] Output parameters of the B slaves Each byte contains parameters of one B
OF BYTE slave:
Bits 0...3 = P0-P3
Bits 4...7 = reserved
DS14 Image of the output parameters of the
slaves ( page 161), words 16...31

123
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

ASI_NET (STRUCT)
15993

The structure contains the complete process image (inputs and outputs) of an AS-i network.

Designation Data type Description Possible values

binIO ASI_BIN_IO Binary input and output data ASI_BIN_IO (STRUCT) ( page 124)
anaIO ASI_ANA_IO Analogue input and output data ASI_ANA_IO (STRUCT) ( page 125)
-
>

ASI_BIN_IO (STRUCT)
16002

The structure contains the process data of the digital input and output slaves:

Designation Data type Description Possible values


bin_IN_Slaves ASI_BIN_IN Input data of the digital AS-i slaves ASI_BIN_IN (STRUCT) ( page 124)
bin_OUT_Slaves ASI_BIN_OUT Output data of the digital AS-i -ASI_BIN_OUT (STRUCT) ( page 125)
slaves

>

ASI_BIN_IN (STRUCT)
16004

The structure contains the input data of the digital AS-i slaves:

Designation 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 acyclic data record 2 (DS2)
DS2 Digital inputs of the slaves and master
flags ( page 139)
B_Slave ARRAY[1...31] Input data of the digital B slaves, corresponds to the 16th to 31st word of the
OF BYTE 1 byte per B slave acyclic data record 2 (DS2)
DS2 Digital inputs of the slaves and master
flags ( page 139)

124
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

ASI_BIN_OUT (STRUCT)
16003

The structure contains the output data of the digital AS-i slaves.

Designation Data type Description Possible values

SA_Slave_bin_OUT ARRAY[1...31] Output data of the digital S/A slaves corresponds to the 1st to 15th word of the
OF BYTE (1 byte per S/A slave) acyclic data record 5 (DS5)
DS5 Digital outputs of the slaves
( page 149)
B_Slave_bin_OUT ARRAY[1...31] Output data of the digital B slaves corresponds to the 16th to 31st word of the
OF BYTE (1 byte per B slave) acyclic data record 5 (DS5)
DS5 Digital outputs of the slaves
( page 149)

>

ASI_ANA_IO (STRUCT)
16001

The structure contains the process data of the analogue input and output slaves.

Designation Data type Description Possible values

ana_IN_Slave ARRAY[1..31] Input data and status flags of the ASI_ANALOG_IN (STRUCT) ( page 125)
OF analogue AS-i slaves
ASI_ANALOG_
IN
ana_OUT_Slave ARRAY[1..31] Output data and status flags of the ASI_ANALOG_OUT (STRUCT) ( page 126)
OF analogue AS-i slaves
ASI_ANALOG_
OUT

>

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 INT Analogue value channel 1: corresponds to the 1st to 4th word of an
S or A input slave area comprising 5 words in the acyclic data
records 3 and 4 (DS3+4)
chan_2 INT Analogue value channel 2:
S or A input slave DS3 Analogue inputs of slaves 1(A)...15(B)
( page 145)
chan_3 INT Analogue value channel 3:
S or B input slave DS4 Analogue inputs of slaves 16(A)...31(B)
( page 147)
chan_4 INT Analogue value channel 4:
S or B input slave
flags ASI_ANALOG_OUT_ Status flags ASI_ANALOG_IN_FLAGS (STRUCT)
FLAGS ( page 126)

>

125
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

ASI_ANALOG_IN_FLAGS (STRUCT)
15996

The structure contains the status flags of the analogue input slave.

Designation Data type Description Possible values

V0 BOOL Valid bit, channel 1 corresponds to the fifth word of an area


comprising 5 words in the acyclic data
O0 BOOL Overflow bit, channel 1 records 3 and 4 (DS3+4)
V1 BOOL Valid bit, channel 2 DS3 Analogue inputs of slaves 1(A)...15(B)
( page 145)
O1 BOOL Overflow bit, channel 2
DS4 Analogue inputs of slaves 16(A)...31(B)
V2 BOOL Valid bit channel 3 ( page 147)
O2 BOOL Overflow bit, channel 3
V3 BOOL Valid bit, channel 4
O3 BOOL Overflow bit, channel 5
na1 BOOL --
TOA BOOL Transfer output, S/A slave
na2 BOOL --
TOB BOOL Transfer output, B slave
na3 BOOL --
TIA BOOL Transfer input, S/A slave
na4 BOOL --
TIB BOOL Transfer input, B slave

>

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 INT Analogue value channel 1: corresponds to the acyclic data records 6
S or A output slave and 7 (DS6, DS7)
chan_2 INT Analogue value channel 2: DS6 Analogue outputs of slaves 1(A)...15(B)
S or A output slave ( page 150)

chan_3 INT Analogue value channel 3: DS7 Analogue outputs of slaves 16(A)...31(B)
S or B output slave ( page 151)

chan_4 INT Analogue value channel 4:


S or B output slave
flags ASI_ANALOG_OUT_ Status flags -ASI_ANALOG_OUT_FLAGS (STRUCT)
FLAGS ( page 127)

126
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

ASI_ANALOG_OUT_FLAGS (STRUCT)
15997

The structure contains the status flags of the analogue output slave.

Designation Data type Description Possible values

na1 BOOL -- corresponds to the acyclic data record 8


(DS8)
na2 BOOL -- DS8 Status of the analogue output data of
the slaves 1...31 ( page 152)
na3 BOOL --
na4 BOOL --
na5 BOOL --
na6 BOOL --
na7 BOOL --
na8 BOOL --
OVA BOOL Output valid, S/A slave
na9 BOOL --
OVB BOOL Output valid, B slave
n10 BOOL --
TOA BOOL Transfer Output, S/A slave
na11 BOOL --
TOB BOOL Transfer Output, B slave
na12 BOOL --

127
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

9.1.2 ACnnnn_SYS_CMD.library

ACnnnn_SysCmd .................................................................................................................................129
17723

128
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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:
Command request channel ( Example: Change language setting of the device ( page 134))
Command reply channel ( Example: Date / time / read NTP settings ( page 135))
Acyclic data record (DSx) ( Example: Read LCEMS, LCEAS and LDAE of AS-i master 2
( page 136))
>

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
uCommandID WORD ID of the command to be executed Table: System commands ( page 130)
Table: AS-i master commands ( page 131)
uTarget INT Device component to which the 0= system
command is to be sent
1= AS-i master 1
2= AS-i master 2
pDataIn POINTER TO Buffer for data that is assigned to the Commando parameter described in the
WORD command as input parameters. command request channel (word 3 to 120)
uSizeIn WORD Size of the buffer for the input
parameters (number of bytes)
pDataOut POINTER TO Buffer for data that is returned as Return values described in the command
WORD output parameters (results) reply channel (data as of word 5)
uSizeOut WORD Size of the buffer for the output
parameters (number of bytes)

129
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Table: System commands


17053

uCommandID Description Note

0x0001 Read system information DS1 Read system information ( page 138)
0x1101 Quick setup AS-i master 1 + 2 Command 257 (0x0101) Quick setup AS-i master 1 + 2
( page 171)
0x1103 Select user language Command 259 (0x0103) Select user language ( page 173)
0x1104 Change display settings Command 260 (0x0104) Change display settings ( page 175)
0x1105 Set output control Command 261 (0x0105) Set output control ( page 176)
0x1109 Set date / time Command 265 (0x0109) Date / Time ( page 178)
0x110A Set parameters of the NTP server Command 266 (0x010A) Set parameters of the NTP server
( page 180)
0x110B Date / time / read NTP settings Command 267 (0x010B) Date / time / read NTP settings
( page 182)
0x110C Reboot system Command 268 (0x010C) Reboot system ( page 184)
0x110D Read fieldbus info Command 269 (0x010D) Read fieldbus info ( page 186)

Only execute system commands with the input parameter uTarget = 0!

Detailed information about the acyclic data sets and command channels:
Acyclic data sets: Acyclic data sets ( page 137, page 137)
Command channels: Command channels

130
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Table: AS-i master commands


17054

uCommandID Description Note

0x0002 Digital input data, read all slaves, master DS2 Digital inputs of the slaves and master flags ( page 139)
flags (DS2)

0x0003 Analogue inputs, read slaves 01...15 (DS3) DS3 Analogue inputs of slaves 1(A)...15(B) ( page 145)
0x0004 Analogue inputs, read slaves 16...31 (DS4) DS4 Analogue inputs of slaves 16(A)...31(B) ( page 147)
0x0005 Digital outputs, read all slaves (DS5) DS5 Digital outputs of the slaves ( page 149)
0x0006 Analogue outputs, read slaves 01...15 DS6 Analogue outputs of slaves 1(A)...15(B) ( page 150)
(DS6)
0x0007 Analogue outputs, read slaves 16...31 DS7 Analogue outputs of slaves 16(A)...31(B) ( page 151)
(DS7)
0x0008 Read status flags of the analogue outputs DS8 Status of the analogue output data of the slaves 1...31
(DS8) ( page 152)
0x0009 Read slave lists LAS, LDS, LPF, LCE (DS9) DS9 Slave lists LAS, LDS, LPF, LCE ( page 154)
0x000A Read LPS (DS10) DS10 Slave list LPS ( page 155)
0x000B Read CDI (DS11) DS11 Current configuration data CDI ( page 156)
0x000C Read PCD (DS12) DS12 Projected configuration data PCD ( page 158)
0x000D Read input parameter image (DS13) DS13 Image of the input parameters of the slaves ( page 160)
0x000E Read output parameter image (DS14) DS14 Image of the output parameters of the slaves ( page 161)
0x000F Slave error counter, configuration counter, DS15 Slave error counter, configuration error counter, AS-i cycle
read AS-i cycle counter (DS15) counter ( page 162)
0x0011 Read LCEMS, LCEAS, LDAE (DS17) DS17 Error lists LCEMS, LCEAS, LDAE ( page 165)
0x1001 Change slave parameters Command 01 (0x0001) change parameters of an AS-i slave
( page 193)
0x1003 Project current AS-i network Command 03 (0x0003) project currrent AS-i network ( page 195)
0x1004 Change LPS Command 04 (0x0004) change LPS ( page 196)
0x1005 Change AS-i master operating mode Command 05 (0x0005) change the operating mode of the AS-i
master ( page 197)
0x1006 Change slave address Command 06 (0x0006) change AS-i slave address ( page 198)
0x1007 Set the auto address mode of the AS-i Command 07 (0x0007) - set the auto address mode of the AS-i master
master ( page 200)
0x1009 Change extended ID1 in the AS-i slave Command 09 (0x0009) Change extended ID1 in the AS-i slave
( page 201)
0x100A Change PCD Command 10 (0x000A) - change PCD ( page 203)
0x100D Supply voltage, symmetry, lead earth fault Command 13 (0x000D) AS-i master supply voltage, symmetry, earth
fault ( page 206)
0x1015 AS-i profile 7.4; Real ID string Command 21 (0x0015) Read ID string of an AS-i profile (S-7.4)
( page 208)
0x101A Read AS-i master info Command 26 (0x001A) read AS-i master info ( page 211)
0x101C Deactivate slave reset when changing to Command 28 (0x001C) Deactivate slave reset when changing to the
the protected mode protected mode ( page 212)

0x1021 AS-i profile 7.4; Read diagnostic string Command 33 (0x0021) - read diagnosis string of an AS-i slave (S-7.4)
( page 213)
0x1022 AS-i profile 7.4; Read parameter string Command 34 (0x0022) - read parameter string of an AS-i slave (S-7.4)
( page 215)

131
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

uCommandID Description Note

0x1023 AS-i profile 7.4; Write parameter string Command 35 (0x0022) - write parameter string of an AS-i slave (S-7.4)
( page 217)
0x1024 CTT2 Standard Read Command 36 (0x0024) CTT2 Standard ( page 219)
0x1025 CTT2 Standard Write Command 37 (0x0025) CTT2 standard write ( page 221)
0x1026 CTT2 Vendor Specific Read Command 38 (0x0026) CTT2 Vendor Specific Read ( page 223)
0x1027 CTT2 Vendor Specific Write Command 39 (0x0027) CTT2 Vendor Specific Write ( page 225)
0x1040 CTT2 Device Group Read Command 64 (0x0040) CTT2 device group read ( page 227)
0x1041 CTT2 Device Group Write Command 65 (0x0041) CTT2 Device Group Write ( page 229)
0x1042 CTT2 Vendor Specific Selective Read from Command 66 (0x0042) CTT2 Vendor Specific Selective Read From
Buffer Buffer ( page 231)
0x1043 CTT2 Vendor Specific Selective Write from Command 67 (0x0043) CTT2 Vendor Specific Selective Write From
Buffer Buffer ( page 233)
0x1044 CTT2 Vendor Specific Selective Read Command 68 (0x0044) CTT2 Vendor Specific Selective Read
( page 235)
0x1045 CTT2 Vendor Specific Selective Write Command 69 (0x0045) CTT2 Vendor Specific Selective Write
( page 237)
0x1046 CTT2 Device Group Selective Read Command 70 (0x0046) CTT2 device group selective Rread
( page 239)
0x1047 CTT2 Device Group Selective Write Command 71 (0x0047) CTT2 Device Group Selective Write
( page 241)
0x1049 CTT2 Vendor Specific Exchange Command 73 (0x0049) CTT2 Vendor Specific Exchange
( page 243)
0x104A CTT2 Device Group Exchange Command 74 (0x004A) CTT2 Device Group Exchange
( page 245)
0x104B CTT2 Device Group Selective Read from Command 75 (0x004B) CTT2 Device Group Selective Read From
Buffer Buffer ( page 247)
0x104C CTT2 Device Group Selective Write from Command 76 (0x004C) CTT2 Device Group Selective Write From
Buffer Buffer ( page 249)
0x1050 Adjust AS-i master settings (double address Command 80 (0x0050) Adjust AS-i master settings ( page 251)
detection, earth fault detection)
0x1051 Reset error counter Command 81 (0x0051) Reset error counter ( page 252)

Only execute AS-i master commands with input parameter uTarget = 1 or 2!

Detailed information about the acyclic data sets and command channels:
Acyclic data sets: Acyclic data sets ( page 137, page 137)
Command channels: Command channels

132
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

Output parameters
15897

Parameter Data type Description Possible values

uCount WORD Number of valid bytes in pDataOut integer value in hexadecimal representation
(uCount <= uSizeOut)
xReady BOOL Signal indicates if the execution of the FALSE = FB is inactive or being
FB is terminated. executed.
TRUE = FB execution is terminated.
xError BOOL Signal indicates if errors occurred FALSE = FB is deactivated or presently
while the FB was executed. executed or FB was executed
without error.
TRUE = An error occurred when the FB
was executed.
uErrorCode WORD Error code of the executed command Command error code of the corresponding
command channel
OR:
0x0F01 = Unknown error
0x0F02 = Unknown/invalid target
0x0F03 = Unknown command ID
0x0F04 = invalid parameters
0x0F05 = timeout during processing

133
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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 Explanation
uCommandID 0x1103 Corresponding commando channel: Command 259 (0x0103) select user language
( page 173)
uTarget 0 System command
pDataIn arDataIn Variable of the data type Array of Words
arDataIn contains the command parameters
uSizeIn 0x0001 arDataIn only consists of 1 line since word 1 and 2 as well as 4 to 120 of the command
request channel are not considered.
pDataOut -- irrelevant since command request channel
uSizeOut -- irrelevant since command request channel

Content of arDataIn:
Word Contents Explanation
no.

1 0x4553 Spanish

134
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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

uCommandID 0x110B Corresponding commando channel: Command 267 (0x010B) Date / time / read NTP settings
( page 182)
uTarget 0 System command
pDataIn -- irrelevant, since command reply channel
-- irrelevant, since command reply channel

pDataOut arDataOut Variable of the data type Array of Words


contains the return values of the reply channel
uSizeOut 0x0007 Array consists of 7 lines since the reply channel returns 7 words (words 5 ... 11).

Content of arDataOut:
Word Content
no.

1 Month Day
2 Year Year
3 Minutes Hours
4 reserved Seconds
5 NTP offset NTP status
6 ... 7 IP address NTP server

135
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex ifm AS-i function libraries

>

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 Value Declaration
uCommandID 0x0011 Corresponding acyclic data set: DS17 Error lists LCEMS, LCEAS, LDAE ( page 165)
uTarget 1 Master command (1 = AS-i master 2))
pDataIn -- irrelevant
uSizeIn -- irrelevant
pDataOut arDataOut Variable of the data type Array of Words
contains the return values
uSizeOut 0x000C Array consists of 12 lines since the data set DS17 has exactly 12 words

Content of arDataOut:
Word Content
no.
1 ... 4 LCEMS (list of configuration errors - missing slaves)

5 ... 8 LCEAS (list of configuration errors - additional slaves)


9 ... 12 LDAE (list of double address errors)

136
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

9.2 Acyclic data records

Overview: Acyclic data sets ..................................................................................................................137


Description of the data records (DSx) ..................................................................................................138
17036

The data records are transmitted acyclically upon request of the <fieldbus> master.

>

9.2.1 Overview: Acyclic data sets


17035

Data Content Access Words


set no. r = read
w = write
DS1 System information r 26
DS2 Digital slave inputs 1(A)31(A) and 1B31B + master flags r 36
(status AS-i master and exec.-ctl. flags and host flags)
DS3 Analogue slave inputs 1(A)15(B) r 75
DS4 Analogue slave inputs 16(A)31(B) r 80
DS5 Digital slave outputs 1(A)31(A) and 1B31B r/w 32
DS6 Analogue slave outputs 1(A)15(B) r/w 60
DS7 Analogue slave outputs 16(A)31(B) r/w 64
DS8 Status flags analogue outputs 1(A)31(A) and 1B31B r 32
DS9 Slave lists LAS, LDS, LPF, LCE r 16
DS10 Slave lists LPS r 4
DS11 Current configuration data CDI r 64
DS12 Projected configuration data PCD r 64
DS13 Input parameter image r 32
DS14 Input parameter image r/w 32
DS15 Slave error counter, configuration error counter, AS-i cycle counter r 72
DS16 n.a. -- --
DS17 Error lists LCEMS, LCEAS, LDAE r 12
DS18 Read fieldbus info (only available via CODESYS) r 19
DS19 n.a. -- --
DS20 n.a. -- --

137
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

9.2.2 Description of the data records (DSx)

DS1 Read system information


8753

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

0 Article number 1) (byte 0) = "A" Article number 1) (byte 1) = C"

1 Article number 1) (byte 2) = "1" Article number 1) (byte 3) = "4"


2 Article number 1) (byte 4) = A1 Article number 1) (byte 5) = A2
3 Device number 2) (byte 1) = G1 Device number 2) (byte 0) = G2
4 Serial number 3) (byte 0, MSB) Serial number 3) (byte 1)
5 Serial number 3) (byte 2) Serial number 3) (byte 3)
6 Serial number 3) (byte 4) Serial number 3) (byte 5)
7 Serial number 3) (byte 6) Serial number 3) (byte 7)
8 Serial number 3) (byte 8) Serial number 3) (byte 9)
9 Serial number 3) (byte 10) Serial number 3) (byte 11)
10 Software type Software Version (Major Version)
11 Software Version (Minor Version) Software Version (Build Version)
12 Operating hours 5) Total (byte 3, high byte) Operating hours 5) Total (byte 2)
5
13 Operating hours ) Total (byte 1) Operating hours 5) Total (byte 0, low byte)
14 Operating hours 5) Uptime (byte 3, high byte) Operating hours 5) Uptime (byte 2)
15 Operating hours 5) Uptime (byte 1) Operating hours 5) Uptime (byte 0, low byte)
16 Operating hours 5) PLC (byte 3, high byte) Operating hours 5) PLC (byte 2)
17 Operating hours 5) PLC (byte 1) Operating hours 5) PLC (byte 0, low byte)
18 Operating hours 5) display (byte 3, high byte) Operating hours 5) display (byte 2)
19 Operating hours 5) display (byte 1) Operating hours 5) display (byte 0, low byte)
20 Device temperature 6) (byte 0, high byte) Device temperature 6) (byte 1, low byte)
21 reserved Number of AS-i masters
7
22 Language ) (1st letter) Language 7) (2nd letter)
23 Return to start screen (on/off) Screen saver (on/off)
24 CODESYS operating mode (activ/inactiv) Output access
25 Device cycle in s (high byte) Device cycle in s (low byte)
1
) Article number: "AC14" + A1 + A2 as character string, e.g. "AC1401"
2
) Device number: G1 + G2 as character string, e.g. "AB"
3
) Serial number: 12-digit character string
5
) Operating hours: in seconds, Unsigned Double word (32 bit)
6
) Device temperature: in 1/100 C, signed Word (16 bit), e.g. 4232 = 42.32 C
7)
Language: LANG_ID as ASCII code, e.g. "DE" = "D" + "E" = 0x44 + 0x45

138
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS2 Digital inputs of the slaves and master flags


8754

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 reserved Slave 1(A): D3...D0 reserved reserved
1 reserved Slave 3(A): D3...D0 reserved Slave 2(A): D3...D0
2 reserved Slave 5(A): D3...D0 reserved Slave 4(A): D3...D0
3 reserved Slave 7(A): D3...D0 reserved Slave 6(A): D3...D0
4 reserved Slave 9(A): D3...D0 reserved Slave 8(A): D3...D0
5 reserved Slave 11(A): D3...D0 reserved Slave 10(A): D3...D0
6 reserved Slave 13(A): D3...D0 reserved Slave 12(A): D3...D0
7 reserved Slave 15(A): D3...D0 reserved Slave 14(A): D3...D0
8 reserved Slave 17(A): D3...D0 reserved Slave 16(A): D3...D0
9 reserved Slave 19(A): D3...D0 reserved Slave 18(A): D3...D0
10 reserved Slave 21(A): D3...D0 reserved Slave 20(A): D3...D0
11 reserved Slave 23(A): D3...D0 reserved Slave 22(A): D3...D0
12 reserved Slave 25(A): D3...D0 reserved Slave 24(A): D3...D0
13 reserved Slave 27(A): D3...D0 reserved Slave 26(A): D3...D0
14 reserved Slave 29(A): D3...D0 reserved Slave 28(A): D3...D0
15 reserved Slave 31(A): D3...D0 reserved Slave 30(A): D3...D0
16 reserved Slave 1B: D3...D0 reserved reserved
17 reserved Slave 3B: D3...D0 reserved Slave 2B: D3...D0
18 reserved Slave 5B: D3...D0 reserved Slave 4B: D3...D0
19 reserved Slave 7B: D3...D0 reserved Slave 6B: D3...D0
20 reserved Slave 9B: D3...D0 reserved Slave 8B: D3...D0
21 reserved Slave 11B: D3...D0 reserved Slave 10B: D3...D0
22 reserved Slave 13B: D3...D0 reserved Slave 12B: D3...D0
23 reserved Slave 15B: D3...D0 reserved Slave 14B: D3...D0
24 reserved Slave 17B: D3...D0 reserved Slave 16B: D3...D0
25 reserved Slave 19B: D3...D0 reserved Slave 18B: D3...D0
26 reserved Slave 21B: D3...D0 reserved Slave 20B: D3...D0
27 reserved Slave 23B: D3...D0 reserved Slave 22B: D3...D0
28 reserved Slave 25B: D3...D0 reserved Slave 24B: D3...D0
29 reserved Slave 27B: D3...D0 reserved Slave 26B: D3...D0
30 reserved Slave 29B: D3...D0 reserved Slave 28B: D3...D0
31 reserved Slave 31B: D3...D0 reserved Slave 30B: D3...D0
32 AS-i master status flags ( AS-i master status flags ( page 141))
33 Execution control flags ( Execution control flags ( page 142))
34 Host flags ( Host flags ( page 144))
35 DAE / EE-Flags ( DAE/EE flags ( page 144))
>

139
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

Master flags

AS-i master status flags........................................................................................................................141


Execution control flags .........................................................................................................................142
Host flags ..............................................................................................................................................144
DAE/EE flags ........................................................................................................................................144
16936

The master flags contain information about the status of the AS-i master and the fieldbus host.
The master flags are transmitted along with the input data of the digital AS-i slaves in the acyclic data
set DS2 ( programming manual, appendix DS2 Digital inputs of the slaves and master flags
( page 139)).

140
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

AS-i master status flags


7160

The AS-i master status flags provide information about the status of the AS-i master. After a status
change, the AS-i master immediately updates the flags.
The AS-i master status flags are saved in the following register:
AS-i master status flags

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

ECPS ECP -- -- WCD CM -- HWDT SER HER

Legend:

Flag Designation Description Initial value at power-on


HER Hardware Error 1 (TRUE): a hardware error occurred during the power-on 0 (FALSE)
self test
SER Software Error 1 (TRUE): Software error occurred: 0 (FALSE)
Stack Overflow, Stack Underflow, Undefined
Opcode, Instruction Fault, Illegal Access,
Watchdog Timeout
HWDT Host Watchdog 1 (TRUE): Host watchdog not triggered by the host within 0 (FALSE)
Timeout 200 ms; master changed to the offline mode
CM Configuration Missing 1 (TRUE): Configuration not yet fully received from the host. 1 (TRUE)
Becomes FALSE as soon as PCD, PP and LPS
have been set
WCD Watchdog Control 1 (TRUE): Signals the host that the watchdog signal is not 0 (FALSE)
Disabled processed in the master.
ECP Execution Control Display of the different phases the execution control goes 0
Phase through during boot ( table).
ECPS Execution Control Display of the substates of the different execution control 0
Phase State phases ( table).

Execution Control Phase Execution Control Phase State


0 = inactive --
1 = start phase 0 = master start and initialisation
1 = wait for configuration
2 = wait for start
2 = reserved --
3 = offline phase --
4 = detection phase --
5 = activation phase --
6 = normal operation 0 = normal data exchange
1 = slave finder activated

141
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

Execution control flags


7161

The execution control flags provide information about the execution control of the AS-i master. The
flags are updated by the AS-i master immediately after each change.
The execution control flags are saved in the following register:
Execution control flags

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

-- NOPF CCOK PE -- DEA AAE POK OR APF NOA CA AA AN S0 COK

Legend:

Flag Designation Description Initial value at power-on

COK Config_OK 1 (TRUE): The configuration of all AS-i slaves on the 0 (FALSE)
network corresponds to the projection data
(CDI=PCD for all activated slaves) &&
(LDS=LPS=LAS)
Exception:
Flag APF = 1 and LPS = empty, then COK
=1
S0 LDS.0 1 (TRUE): Slave with address 0 found 0 (FALSE)

AN Auto_Address_Assign 1 (TRUE): Auto addressing possible 0 (FALSE)


(protected mode = active && auto
addressing = active && PCD = CDI &&
LDS <=LPS)
AA Auto_Address_Available 1 (TRUE): All the necessary conditions for auto 0 (FALSE)
addressing are fulfilled. The master waits
for slave 0.
CA Configuration_Active 0 (FALSE): Master in protected mode 0 (FALSE)
1 (TRUE): Master in projection mode
NOA Normal_Operation_Active 1 (TRUE): Master is in the normal mode 0 (FALSE)
(The AS-i master has communicated with
at least one slave since the last offline
phase. Even if the slave disappears after
this, the signal will remain set.)
APF Asi_Power_Fail 0 (FALSE): AS-i voltage OK 1 (TRUE)
1 (TRUE): AS-i voltage too low
OR Offline_Ready 1 (TRUE): Master has gone through the offline phase 0 (FALSE)
and waits for:
APF = 0 and a timeout of 1s
POK Periphery_OK 1 (TRUE): No peripheral faults present, all bits of 0 (FALSE)
LPF = 0.
AAE Auto_Address_Enable 1 (TRUE): Auto addressing switched on 0 (FALSE)
(Echo of Set_Auto_Address_Enable of
host)
DEA Data_Exchange_Active 1 (TRUE): Data exchange between master and 1 (TRUE)
slaves activated (reflects DEA of host
flags)

0 (FALSE): Instead of the data exchange, ReadID is


continually executed on the slaves.
PE Protocol Error 1 (TRUE): CTT protocol error 0 (FALSE)
0 (FALSE): No CTT protocol error

142
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

Flag Designation Description Initial value at power-on

CCOK CTT_Config_OK 1 (TRUE): The configuration of all CTT slaves on the 0 (FALSE)
network corresponds to the projected CCT
data.
(CCDI = PCCD for all CTT slaves)
NOPF No_Offline_Phase_Flag 1 (TRUE): The master skips the offline phase if one 0 (FALSE)
of the following actions is performed:
- change to protected mode
- change of PCD
- change of LPS
- change of PCCD
0 (FALSE): The master goes through the offline phase
when changing to the protected mode the
next time.

143
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

Host flags
7162

The host flags are regularly updated by the host. The AS-i master cyclically checks the host flags for
changes.
The host flags are saved in the following register:
Host Flags

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

-- -- -- -- -- -- -- -- -- -- -- -- -- -- DEA OFF

Legend:

Flag Designation Description Initial value at power-on

OFF Offline 1 (TRUE): Execution control of the master changes to the 0 (FALSE)
offline mode. The function Set_Offline_Mode()
is implemented via this flag.
DEA Data_Exchange_Active 1 (TRUE): Data exchange activated between master and 1 (TRUE)
slaves. The function
Set_Data_Exchange_Active() is implemented
via this flag
>

DAE/EE flags
16935

The DAE/EE flags indicate if the double address detection and the earth fault detection are on.
The DEA/EE flags are saved in the following register:

DAE/EE flags

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
-- -- -- -- -- -- -- DAE -- -- -- -- -- -- -- EE
active active

Legend:

Flag Designation Description Initial value at PowerOn

DAE Double address 1 (TRUE): Double address detection is on. 0 (FALSE)


active detection active 0 (FALSE): Double address detection is off.
EE active Earth fault detection is 1 (TRUE): Earth fault detection is on. 1 (TRUE)
active 0 (FALSE): Earth fault detection is off.

144
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS3 Analogue inputs of slaves 1(A)...15(B)


8756

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0...4 Analogue input data of single slave 1 or of (slave 1A and slave 1B)
5...9 Analogue input data of single slave 2 or of (slave 2A and slave 2B)
10...14 Analogue input data of single slave 3 or of (slave 3A and slave 3B)
15...19 Analogue input data of single slave 4 or of (slave 4A and slave 4B)
20...24 Analogue input data of single slave 5 or of (slave 5A and slave 5B)
25...29 Analogue input data of single slave 6 or of (slave 6A and slave 6B)
30...34 Analogue input data of single slave 7 or of (slave 7A and slave 7B)
35...39 Analogue input data of single slave 8 or of (slave 8A and slave 8B)
40...44 Analogue input data of single slave 9 or of (slave 9A and slave 9B)
45...49 Analogue input data of single slave 10 or of (slave 10A and slave 10B)
50...54 Analogue input data of single slave 11 or of (slave 11A and slave 11B)
55...59 Analogue input data of single slave 12 or of (slave 12A and slave 12B)
60...64 Analogue input data of single slave 13 or of (slave 13A and slave 13B)
65...69 Analogue input data of single slave 14 or of (slave 14A and slave 14B)
70...74 Analogue input data of single slave 15 or of (slave 15A and slave 15B)

145
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

Details of the 5-word areas


8758

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n Analogue value channel 0 of single slave x or channel 0 of slave xA
n+1 Analogue value channel 1 of single slave x or channel 1 of slave xA
n+2 Analogue value channel 2 of single slave x or channel 0 of slave xB
n+3 Analogue value channel 3 of single slave x or channel 1 of slave xB
n+4 TIB -- TIA -- TOB -- TOA -- O3 V3 O2 V2 O1 V1 O0 V0

Legend:
On overflow bit 1 bit 0 = data is in the valid range
1 = data is in the invalid range (especially in case of input modules when
the measuring range is not reached or exceeded)
TIx transfer to the slave 1 bit from master profile M4 onwards:
(transfer Input) 0 = slave transmits input data as a value
(15 bits long, plus sign)
1 = slave transmits input data as a bit pattern
(16 bits long, no sign)
TOx transfer from the slave 1 bit from master profile M4 onwards:
(transfer output) 0 = slave receives output data as a value
(15 bits long, plus sign)
1 = slave receives output data as a bit pattern
(16 bits long, no sign)
Vn valid bit 1 bit 0 = values in channel n are invalid
1 = values in channel n are valid
Output data must be valid (Vn = 1) to be enabled in the AS-i slave!

146
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS4 Analogue inputs of slaves 16(A)...31(B)


8759

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0...4 Analogue input data of single slave 16 or of (slave 16A and slave 16B)
5...9 Analogue input data of single slave 17 or of (slave 17A and slave 17B)
10...14 Analogue input data of single slave 18 or of (slave 18A and slave 18B)
15...19 Analogue input data of single slave 19 or of (slave 19A and slave 19B)
20...24 Analogue input data of single slave 20 or of (slave 20A and slave 20B)
25...29 Analogue input data of single slave 21 or of (slave 21A and slave 21B)
30...34 Analogue input data of single slave 22 or of (slave 22A and slave 22B)
35...39 Analogue input data of single slave 23 or of (slave 23A and slave 23B)
40...44 Analogue input data of single slave 24 or of (slave 24A and slave 24B)
45...49 Analogue input data of single slave 25 or of (slave 25A and slave 25B)
50...54 Analogue input data of single slave 26 or of (slave 26A and slave 26B)
55...59 Analogue input data of single slave 27 or of (slave 27A and slave 27B)
60...64 Analogue input data of single slave 28 or of (slave 28A and slave 28B)
65...69 Analogue input data of single slave 29 or of (slave 29A and slave 29B)
70...74 Analogue input data of single slave 30 or of (slave 30A and slave 30B)
75...79 Analogue input data of single slave 31 or of (slave 31A and slave 31B)

147
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

Details of the 5-word areas


8758

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n Analogue value channel 0 of single slave x or channel 0 of slave xA
n+1 Analogue value channel 1 of single slave x or channel 1 of slave xA
n+2 Analogue value channel 2 of single slave x or channel 0 of slave xB
n+3 Analogue value channel 3 of single slave x or channel 1 of slave xB
n+4 TIB -- TIA -- TOB -- TOA -- O3 V3 O2 V2 O1 V1 O0 V0

Legend:
On overflow bit 1 bit 0 = data is in the valid range
1 = data is in the invalid range (especially in case of input modules when
the measuring range is not reached or exceeded)
TIx transfer to the slave 1 bit from master profile M4 onwards:
(transfer Input) 0 = slave transmits input data as a value
(15 bits long, plus sign)
1 = slave transmits input data as a bit pattern
(16 bits long, no sign)
TOx transfer from the slave 1 bit from master profile M4 onwards:
(transfer output) 0 = slave receives output data as a value
(15 bits long, plus sign)
1 = slave receives output data as a bit pattern
(16 bits long, no sign)
Vn valid bit 1 bit 0 = values in channel n are invalid
1 = values in channel n are valid
Output data must be valid (Vn = 1) to be enabled in the AS-i slave!

148
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS5 Digital outputs of the slaves


8761

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 reserved slave 1(A): D3...D0 reserved reserved
1 reserved Slave 3(A): D3...D0 reserved Slave 2(A): D3...D0
2 reserved Slave 5(A): D3...D0 reserved Slave 4(A): D3...D0
3 reserved Slave 7(A): D3...D0 reserved Slave 6(A): D3...D0
4 reserved Slave 9(A): D3...D0 reserved Slave 8(A): D3...D0
5 reserved Slave 11(A): D3...D0 reserved Slave 10(A): D3...D0
6 reserved Slave 13(A): D3...D0 reserved Slave 12(A): D3...D0
7 reserved Slave 15(A): D3...D0 reserved Slave 14(A): D3...D0
8 reserved Slave 17(A): D3...D0 reserved Slave 16(A): D3...D0
9 reserved Slave 19(A): D3...D0 reserved Slave 18(A): D3...D0
10 reserved Slave 21(A): D3...D0 reserved Slave 20(A): D3...D0
11 reserved Slave 23(A): D3...D0 reserved Slave 22(A): D3...D0
12 reserved Slave 25(A): D3...D0 reserved Slave 24(A): D3...D0
13 reserved Slave 27(A): D3...D0 reserved Slave 26(A): D3...D0
14 reserved Slave 29(A): D3...D0 reserved Slave 28(A): D3...D0
15 reserved Slave 31(A): D3...D0 reserved Slave 30(A): D3...D0
16 reserved Slave 1B: D3...D0 reserved reserved
17 reserved Slave 3B: D3...D0 reserved Slave 2B: D3...D0
18 reserved Slave 5B: D3...D0 reserved Slave 4B: D3...D0
19 reserved Slave 7B: D3...D0 reserved Slave 6B: D3...D0
20 reserved Slave 9B: D3...D0 reserved Slave 8B: D3...D0
21 reserved Slave 11B: D3...D0 reserved Slave 10B: D3...D0
22 reserved Slave 13B: D3...D0 reserved Slave 12B: D3...D0
23 reserved Slave 15B: D3...D0 reserved Slave 14B: D3...D0
24 reserved Slave 17B: D3...D0 reserved Slave 16B: D3...D0
25 reserved Slave 19B: D3...D0 reserved Slave 18B: D3...D0
26 reserved Slave 21B: D3...D0 reserved Slave 20B: D3...D0
27 reserved Slave 23B: D3...D0 reserved Slave 22B: D3...D0
28 reserved Slave 25B: D3...D0 reserved Slave 24B: D3...D0
29 reserved Slave 27B: D3...D0 reserved Slave 26B: D3...D0
30 reserved Slave 29B: D3...D0 reserved Slave 28B: D3...D0
31 reserved Slave 31B: D3...D0 reserved Slave 30B: D3...D0

>

149
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

DS6 Analogue outputs of slaves 1(A)...15(B)


8763

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0...3 analogue output data of single slave 1 or of (slave 1A and slave 1B)
4...7 Analogue output data of single slave 2 or of (slave 2A and slave 2B)
8...11 Analogue output data of single slave 3 or of (slave 3A and slave 3B)
12...15 Analogue output data of single slave 4 or of (slave 4A and slave 4B)
16...19 Analogue output data of single slave 5 or of (slave 5A and slave 5B)
20...23 Analogue output data of single slave 6 or of (slave 6A and slave 6B)
24...27 Analogue output data of single slave 7 or of (slave 7A and slave 7B)
28...31 Analogue output data of single slave 8 or of (slave 8A and slave 8B)
32...35 Analogue output data of single slave 9 or of (slave 9A and slave 9B)
36...39 Analogue output data of single slave 10 or of (slave 10A and slave 10B)
40...43 Analogue output data of single slave 11 or of (slave 11A and slave 11B)
44...47 Analogue output data of single slave 12 or of (slave 12A and slave 12B)
48...51 Analogue output data of single slave 13 or of (slave 13A and slave 13B)
52...55 Analogue output data of single slave 14 or of (slave 14A and slave 14B)
56...59 Analogue output data of single slave 15 or of (slave 15A and slave 15B)

>

Details 4 channels per analogue slave


8765

The following table shows the structure of the data image to set the parameter:
Analogue channels per input slave = 4
Analogue channels per output slave

Word Content of the transferred word for parameter setting = 4 channels


Offset-Nr.
n Mx / slave m(A) / channel
n+1 Mx / slave m(A) / channel
n+2 Mx / slave m(A) / channel 1 = Mx / slave mB / channel 1
n+3 Mx / slave m(A) / channel 2 = Mx / slave mB / channel 2
Legend:
n ... Number of 4 word blocks
1 = for setting 4 words
...
15 = for setting 60 words
x ... 1 = AS-i master 1
2 = AS-i master 2

m ... Numeric part of the selected AS-i slave address

150
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS7 Analogue outputs of slaves 16(A)...31(B)


8766

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0...3 analogue output data of single slave 16 or of (slave 16A and slave 16B)
4...7 Analogue output data of single slave 17 or of (slave 17A and slave 17B)
8...11 Analogue output data of single slave 18 or of (slave 18A and slave 18B)
12...15 Analogue output data of single slave 19 or of (slave 19A and slave 19B)
16...19 Analogue output data of single slave 20 or of (slave 20A and slave 20B)
20...23 Analogue output data of single slave 21 or of (slave 21A and slave 21B)
24...27 Analogue output data of single slave 22 or of (slave 22A and slave 22B)
28...31 Analogue output data of single slave 23 or of (slave 23A and slave 23B)
32...35 Analogue output data of single slave 24 or of (slave 24A and slave 24B)
36...39 Analogue output data of single slave 25 or of (slave 25A and slave 25B)
40...43 Analogue output data of single slave 26 or of (slave 26 and slave 26B)
44...47 Analogue output data of single slave 27 or of (slave 27 and slave 27B)
48...51 Analogue output data of single slave 28 or of (slave 28 and slave 28B)
52...55 Analogue output data of single slave 29 or of (slave 29 and slave 29B)
56...59 Analogue output data of single slave 30 or of (slave 30 and slave 30B)
60...63 Analogue output data of single slave 31 or of (slave 31and slave 31B)
>

Details 4 channels per analogue slave


8765

The following table shows the structure of the data image to set the parameter:
Analogue channels per input slave = 4
Analogue channels per output slave

Word Content of the transferred word for parameter setting = 4 channels


Offset-Nr.

n Mx / slave m(A) / channel


n+1 Mx / slave m(A) / channel
n+2 Mx / slave m(A) / channel 1 = Mx / slave mB / channel 1
n+3 Mx / slave m(A) / channel 2 = Mx / slave mB / channel 2
Legend:
n ... Number of 4 word blocks
1 = for setting 4 words
...
15 = for setting 60 words
x ... 1 = AS-i master 1
2 = AS-i master 2

m ... Numeric part of the selected AS-i slave address


>

151
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

DS8 Status of the analogue output data of the slaves 1...31


8768

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

0 reserved

1 Status of the analogue output data of single slave 1 or of (slave 1A and slave 1B)

2 Status of the analogue output data of single slave 2 or of (slave 2A and slave 2B)
3 Status of the analogue output data of single slave 3 or of (slave 3A and slave 3B)
4 Status of the analogue output data of single slave 4 or of (slave 4A and slave 4B)
5 Status of the analogue output data of single slave 5 or of (slave 5A and slave 5B)
6 Status of the analogue output data of single slave 6 or of (slave 6A and slave 6B)
7 Status of the analogue output data of single slave 7 or of (slave 7A and slave 7B)
8 Status of the analogue output data of single slave 8 or of (slave 8A and slave 8B)
9 Status of the analogue output data of single slave 9 or of (slave 9A and slave 9B)
10 Status of the analogue output data of single slave 10 or of (slave 10A and slave 10B)
11 Status of the analogue output data of single slave 11 or of (slave 11A and slave 11B)
12 Status of the analogue output data of single slave 12 or of (slave 12A and slave 12B)
13 Status of the analogue output data of single slave 13 or of (slave 13A and slave 13B)
14 Status of the analogue output data of single slave 14 or of (slave 14A and slave 14B)
15 Status of the analogue output data of single slave 15 or of (slave 15A and slave 15B)
16 Status of the analogue output data of single slave 16 or of (slave 16A and slave 16B)
17 Status of the analogue output data of single slave 17 or of (slave 17A and slave 17B)
18 Status of the analogue output data of single slave 18 or of (slave 18A and slave 18B)
19 Status of the analogue output data of single slave 19 or of (slave 19A and slave 19B)
20 Status of the analogue output data of single slave 20 or of (slave 20A and slave 20B)
21 Status of the analogue output data of single slave 21 or of (slave 21A and slave 21B)
22 Status of the analogue output data of single slave 22 or of (slave 22A and slave 22B)
23 Status of the analogue output data of single slave 23 or of (slave 23A and slave 23B)
24 Status of the analogue output data of single slave 24 or of (slave 24A and slave 24B)
25 Status of the analogue output data of single slave 25 or of (slave 25A and slave 25B)
26 Status of the analogue output data of single slave 26 or of (slave 26A and slave 26B)
27 Status of the analogue output data of single slave 27 or of (slave 27A and slave 27B)
28 Status of the analogue output data of single slave 28 or of (slave 28A and slave 28B)
29 Status of the analogue output data of single slave 29 or of (slave 29A and slave 29B)
30 Status of the analogue output data of single slave 30 or of (slave 30A and slave 30B)
31 Status of the analogue output data of single slave 31 or of (slave 31A and slave 31B)
32 reserved

152
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

Details of the words shown above:


bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n -- TOB -- TOA -- OVB -- OVA reserved
Legend:
OVx output valid 1 bit channel-independent bit "output data valid" from the slave:
CTT1:
0 = more than 3.5 s have elapsed since the last update of the output
values
1 = slave requests new output data within the next 3 s
CTT2CTT5:
0 = slave receives no new output data
1 = slave receives new output data

Only valid for analogue output slaves.


For input slaves set OVx = "0"!
TOx transfer from the slave 1 bit from master profile M4 onwards:
(transfer output) 0 = slave receives output data as a value
(15 bits long, plus sign)
1 = slave receives output data as a bit pattern
(16 bits long, no sign)

153
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS9 Slave lists LAS, LDS, LPF, LCE


8770

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0...3 LAS / list of active slaves
4...7 LDS / list of detected slaves
8...11 LPF / list of slaves with periphery faults
12...15 LCE / list of slaves with configuration errors
>

Details of the slave lists


8772

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n 15(A) 14(A) 13(A) 12(A) 11(A) 10(A) 9(A) 8(A) 7(A) 6(A) 5(A) 4(A) 3(A) 2(A) 1(A) 0 *)
n+1 31(A) 30(A) 29(A) 28(A) 27(A) 26(A) 25(A) 24(A) 23(A) 22(A) 21(A) 20(A) 19(A) 18(A) 17(A) 16(A)
n+2 15B 14B 13B 12B 11B 10B 9B 8B 7B 6B 5B 4B 3B 2B 1B res.
n+3 31B 30B 29B 28B 27B 26B 25B 24B 23B 22B 21B 20B 19B 18B 17B 16B
*) LAS and LPS have no slave 0, therefore this bit is set to 0!

154
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS10 Slave list LPS


8773

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0...3 List of projected slaves LPS

>

Details of the slave lists


8772

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n 15(A) 14(A) 13(A) 12(A) 11(A) 10(A) 9(A) 8(A) 7(A) 6(A) 5(A) 4(A) 3(A) 2(A) 1(A) 0 *)
n+1 31(A) 30(A) 29(A) 28(A) 27(A) 26(A) 25(A) 24(A) 23(A) 22(A) 21(A) 20(A) 19(A) 18(A) 17(A) 16(A)
n+2 15B 14B 13B 12B 11B 10B 9B 8B 7B 6B 5B 4B 3B 2B 1B res.
n+3 31B 30B 29B 28B 27B 26B 25B 24B 23B 22B 21B 20B 19B 18B 17B 16B
*) LAS and LPS have no slave 0, therefore this bit is set to 0!

155
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS11 Current configuration data CDI


8775

bit
Offset
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word no.
ID2 code ID1 code ID code IO code
0 Slave 0 *)
1 Slave 1(A)
2 Slave 2(A)
3 Slave 3(A)
4 Slave 4(A)
5 Slave 5(A)
6 Slave 6(A)
7 Slave 7(A)
8 Slave 8(A)
9 Slave 9(A)
10 Slave 10(A)
11 Slave 11(A)
12 Slave 12(A)
13 Slave 13(A)
14 Slave 14(A)
15 Slave 15(A)
16 Slave 16(A)
17 Slave 17(A)
18 Slave 18(A)
19 Slave 19(A)
20 Slave 20(A)
21 Slave 21(A)
22 Slave 22(A)
23 Slave 23(A)
24 Slave 24(A)
25 Slave 25(A)
26 Slave 26(A)
27 Slave 27(A)
28 Slave 28(A)
29 Slave 29(A)
20 Slave 30(A)
31 Slave 31(A)
32 reserved
33 Slave 1B
34 Slave 2B

156
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

bit
Offset
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word no.
ID2 code ID1 code ID code IO code
35 Slave 3B
36 Slave 4B
37 Slave 5B
38 Slave 6B
39 Slave 7B
40 Slave 8B
41 Slave 9B
42 Slave 10B
43 Slave 11B
44 Slave 12B
45 Slave 13B
46 Slave 14B
47 Slave 15B
48 Slave 16B
49 Slave 17B
50 Slave 18B
51 Slave 19B
52 Slave 20B
53 Slave 21B
54 Slave 22B
55 Slave 23B
56 Slave 24B

57 Slave 25B

58 Slave 26B
59 Slave 27B
60 Slave 28B
61 Slave 29B
62 Slave 30B

63 Slave 31B

*) contents for slave 0 only valid in CDI

157
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS12 Projected configuration data PCD


8779

bit
Offset
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word no.
ID2 code ID1 code ID code IO code
0 reserved
1 Slave 1(A)
2 Slave 2(A)
3 Slave 3(A)
4 Slave 4(A)
5 Slave 5(A)
6 Slave 6(A)
7 Slave 7(A)
8 Slave 8(A)
9 Slave 9(A)
10 Slave 10(A)
11 Slave 11(A)
12 Slave 12(A)
13 Slave 13(A)
14 Slave 14(A)
15 Slave 15(A)
16 Slave 16(A)
17 Slave 17(A)
18 Slave 18(A)
19 Slave 19(A)
20 Slave 20(A)
21 Slave 21(A)
22 Slave 22(A)
23 Slave 23(A)
24 Slave 24(A)
25 Slave 25(A)
26 Slave 26(A)
27 Slave 27(A)
28 Slave 28(A)
29 Slave 29(A)
20 Slave 30(A)
31 Slave 31(A)
32 reserved
33 Slave 1B
34 Slave 2B

158
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

bit
Offset
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word no.
ID2 code ID1 code ID code IO code
35 Slave 3B
36 Slave 4B
37 Slave 5B
38 Slave 6B
39 Slave 7B
40 Slave 8B
41 Slave 9B
42 Slave 10B
43 Slave 11B
44 Slave 12B
45 Slave 13B
46 Slave 14B
47 Slave 15B
48 Slave 16B
49 Slave 17B
50 Slave 18B
51 Slave 19B
52 Slave 20B
53 Slave 21B
54 Slave 22B
55 Slave 23B
56 Slave 24B

57 Slave 25B

58 Slave 26B
59 Slave 27B
60 Slave 28B
61 Slave 29B
62 Slave 30B
63 Slave 31B

159
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS13 Image of the input parameters of the slaves


8781

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 reserved Slave 1(A): P3...P0 reserved reserved
1 reserved Slave 3(A): P3...P0 reserved Slave 2(A): P3...P0
2 reserved Slave 5(A): P3...P0 reserved Slave 4(A): P3...P0
3 reserved Slave 7(A): P3...P0 reserved Slave 6(A): P3...P0
4 reserved Slave 9(A): P3...P0 reserved Slave 8(A): P3...P0
5 reserved Slave 11(A): P3...P0 reserved Slave 10(A): P3...P0
6 reserved Slave 13(A): P3...P0 reserved Slave 12(A): P3...P0
7 reserved Slave 15(A): P3...P0 reserved Slave 14(A): P3...P0
8 reserved Slave 17(A): P3...P0 reserved Slave 16(A): P3...P0
9 reserved Slave 19(A): P3...P0 reserved Slave 18(A): P3...P0
10 reserved Slave 21(A): P3...P0 reserved Slave 20(A): P3...P0
11 reserved Slave 23(A): P3...P0 reserved Slave 22(A): P3...P0
12 reserved Slave 25(A): P3...P0 reserved Slave 24(A): P3...P0
13 reserved Slave 27(A): P3...P0 reserved Slave 26(A): P3...P0
14 reserved Slave 29(A): P3...P0 reserved Slave 28(A): P3...P0
15 reserved Slave 31(A): P3...P0 reserved Slave 30(A): P3...P0
16 reserved Slave 1B: P3...P0 reserved reserved
17 reserved Slave 3B: P3...P0 reserved Slave 2B: P3...P0
18 reserved Slave 5B: P3...P0 reserved Slave 4B: P3...P0
19 reserved Slave 7B: P3...P0 reserved Slave 6B: P3...P0
20 reserved Slave 9B: P3...P0 reserved Slave 8B: P3...P0
21 reserved Slave 11B: P3...P0 reserved Slave 10B: P3...P0
22 reserved Slave 13B: P3...P0 reserved Slave 12B: P3...P0
23 reserved Slave 15B: P3...P0 reserved Slave 14B: P3...P0
24 reserved Slave 17B: P3...P0 reserved Slave 16B: P3...P0
25 reserved Slave 19B: P3...P0 reserved Slave 18B: P3...P0
26 reserved Slave 21B: P3...P0 reserved Slave 20B: P3...P0
27 reserved Slave 23B: P3...P0 reserved Slave 22B: P3...P0
28 reserved Slave 25B: P3...P0 reserved Slave 24B: P3...P0
29 reserved Slave 27B: P3...P0 reserved Slave 26B: P3...P0
30 reserved Slave 29B: P3...P0 reserved Slave 28B: P3...P0
31 reserved Slave 31B: P3...P0 reserved Slave 30B: P3...P0

160
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS14 Image of the output parameters of the slaves


8783

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 reserved Slave 1(A): P3...P0 reserved reserved
1 reserved Slave 3(A): P3...P0 reserved Slave 2(A): P3...P0
2 reserved Slave 5(A): P3...P0 reserved Slave 4(A): P3...P0
3 reserved Slave 7(A): P3...P0 reserved Slave 6(A): P3...P0
4 reserved Slave 9(A): P3...P0 reserved Slave 8(A): P3...P0
5 reserved Slave 11(A): P3...P0 reserved Slave 10(A): P3...P0
6 reserved Slave 13(A): P3...P0 reserved Slave 12(A): P3...P0
7 reserved Slave 15(A): P3...P0 reserved Slave 14(A): P3...P0
8 reserved Slave 17(A): P3...P0 reserved Slave 16(A): P3...P0
9 reserved Slave 19(A): P3...P0 reserved Slave 18(A): P3...P0
10 reserved Slave 21(A): P3...P0 reserved Slave 20(A): P3...P0
11 reserved Slave 23(A): P3...P0 reserved Slave 22(A): P3...P0
12 reserved Slave 25(A): P3...P0 reserved Slave 24(A): P3...P0
13 reserved Slave 27(A): P3...P0 reserved Slave 26(A): P3...P0
14 reserved Slave 29(A): P3...P0 reserved Slave 28(A): P3...P0
15 reserved Slave 31(A): P3...P0 reserved Slave 30(A): P3...P0
16 reserved Slave 1B: P3...P0 reserved reserved
17 reserved Slave 3B: P3...P0 reserved Slave 2B: P3...P0
18 reserved Slave 5B: P3...P0 reserved Slave 4B: P3...P0
19 reserved Slave 7B: P3...P0 reserved Slave 6B: P3...P0
20 reserved Slave 9B: P3...P0 reserved Slave 8B: P3...P0
21 reserved Slave 11B: P3...P0 reserved Slave 10B: P3...P0
22 reserved Slave 13B: P3...P0 reserved Slave 12B: P3...P0
23 reserved Slave 15B: P3...P0 reserved Slave 14B: P3...P0
24 reserved Slave 17B: P3...P0 reserved Slave 16B: P3...P0
25 reserved Slave 19B: P3...P0 reserved Slave 18B: P3...P0
26 reserved Slave 21B: P3...P0 reserved Slave 20B: P3...P0
27 reserved Slave 23B: P3...P0 reserved Slave 22B: P3...P0
28 reserved Slave 25B: P3...P0 reserved Slave 24B: P3...P0
29 reserved Slave 27B: P3...P0 reserved Slave 26B: P3...P0
30 reserved Slave 29B: P3...P0 reserved Slave 28B: P3...P0
31 reserved Slave 31B: P3...P0 reserved Slave 30B: P3...P0

>

161
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

DS15 Slave error counter, configuration error counter, AS-i cycle counter
8785

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Error counter in slave 0
1 Error counter in slave 1(A)
2 Error counter in slave 2(A)
3 Error counter in slave 3(A)
4 Error counter in slave 4(A)
5 Error counter in slave 5(A)
6 Error counter in slave 6(A)
7 Error counter in slave 7(A)
8 Error counter in slave 8(A)
9 Error counter in slave 9(A)
10 Error counter in slave 10(A)
11 Error counter in slave 11(A)
12 Error counter in slave 12(A)
13 Error counter in slave 13(A)
14 Error counter in slave 14(A)
15 Error counter in slave 15(A)
16 Error counter in slave 16(A)
17 Error counter in slave 17(A)
18 Error counter in slave 18(A)
19 Error counter in slave 19(A)
20 Error counter in slave 20(A)
21 Error counter in slave 21(A)
22 Error counter in slave 22(A)
23 Error counter in slave 23(A)
24 Error counter in slave 24(A)
25 Error counter in slave 25(A)
26 Error counter in slave 26(A)
27 Error counter in slave 27(A)
28 Error counter in slave 28(A)
29 Error counter in slave 29(A)
20 Error counter in slave 30(A)
31 Error counter in slave 31(A)
32 reserved
33 Error counter in slave 1B
34 Error counter in slave 2B
35 Error counter in slave 3B

162
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
36 Error counter in slave 4B
37 Error counter in slave 5B
38 Error counter in slave 6B
39 Error counter in slave 7B
40 Error counter in slave 8B
41 Error counter in slave 9B
42 Error counter in slave 10B
43 Error counter in slave 11B
44 Error counter in slave 12B
45 Error counter in slave 13B
46 Error counter in slave 14B
47 Error counter in slave 15B
48 Error counter in slave 16B
49 Error counter in slave 17B
50 Error counter in slave 18B
51 Error counter in slave 19B
52 Error counter in slave 20B

53 Error counter in slave 21B

54 Error counter in slave 22B


55 Error counter in slave 23B
56 Error counter in slave 24B
57 Error counter in slave 25B
58 Error counter in slave 26B
59 Error counter in slave 27B
60 Error counter in slave 28B
61 Error counter in slave 29B
62 Error counter in slave 30B
63 Error counter in slave 31B
64 AS-i cycle counter
65 Configuration error counter
66 AS-i error status
67 Telegram error rate
68 Message error counter
69 Voltage error counter 22.5V

70 Voltage error counter 19V

71 Earth fault counter

163
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

Legend:
AS-i error status ... Bit 0: Configuration error type 1 (missing slave)
Bit 1: Configuration error type 2 (too many slaves)
Bit 2: Configuration error type 3 (slave with wrong profile)
Bit 3: Peripheral fault
Bit 4: Double address
Bit 8: internal AS-i master error
Bit 9: Projection mode
Bit 10: Slave address 0 detected
Bit 11: Earth fault
Bit 12: Voltage drop below 22.5 V
Bit 13: Voltage drop below 19.0 V
Bit 14: reserved
Bit 15: reserved
Telegram error rate ... Number of faulty telegrams during the past 2000 telegram cycles
Symmetry ... AS-i symmetry from -100% to +100%, 0% = symmetrical-to-ground
Bit15: bit with sign

164
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS17 Error lists LCEMS, LCEAS, LDAE


15911

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0...3 LCEMS (list of configuration errors - missing slaves)
4...7 LCEAS (list of configuration errors - additional slaves)
8...11 LDAE (list of double address errors)

>

Details of the error lists


6658

The error lists (LCEMS, LCEAS, LDAE) have a size of 64 bits each. The respective bits each
represent a slave address:

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
n 15(A) 14(A) 13(A) 12(A) 11(A) 10(A) 9(A) 8(A) 7(A) 6(A) 5(A) 4(A) 3(A) 2(A) 1(A) 0
n+1 31(A) 30(A) 29(A) 28(A) 27(A) 26(A) 25(A) 24(A) 23(A) 22(A) 21(A) 20(A) 19(A) 18(A) 17(A) 16(A)
n+2 15B 14B 13B 12B 11B 10B 9B 8B 7B 6B 5B 4B 3B 2B 1B -
n+3 31B 30B 29B 28B 27B 26B 25B 24B 23B 22B 21B 20B 19B 18B 17B 16B

165
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

>

DS18 Fieldbus information


17038

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Fieldbus state Fieldbus type
1 Ethernet connection status Profibus slave address
2 Profinet/EtherNet/IP IP address (byte 2) Profinet/EtherNet/IP IP address (byte 1, MSB)
3 Profinet/EtherNet/IP IP address (byte 4, LSB) Profinet/EtherNet/IP IP address (byte 3)

4 Profinet/EtherNet/IP subnet mask (byte 2) Profinet/EtherNet/IP subnet mask (byte 1, MSB)

5 Profinet/EtherNet/IP subnet mask (byte 4, LSB) Profinet/EtherNet/IP subnet mask (byte 3)


6 Profinet/EtherNet/IP gateway address (byte 2) Profinet/EtherNet/IP gateway address (byte 1, MSB)
7 Profinet/EtherNet/IP gateway address (byte 4, LSB) Profinet/EtherNet/IP gateway address (byte 3)
8 MAC0 (byte 2) MAC0 (byte 1, LSB)
9 MAC0 (byte 4) MAC0 (byte 3)
10 MAC0 (byte 6, MSB) MAC0 (byte 5)
11 MAC1 (byte 2) MAC1 (byte 1, LSB)

12 MAC1 (byte 4) MAC1 (byte 3)

13 MAC1 (byte 6, MSB) MAC1 (byte 5)


14 MAC2 (byte 2) MAC2 (byte 1, LSB)
15 MAC2 (byte 4) MAC2 (byte 3)

16 MAC2 (byte 6, MSB) MAC2 (byte 1, LSB)

17 Profinet host address (byte 2) Profinet host address (byte 1, MSB)


18 Profinet host address (byte 4, LSB) Profinet host address (byte 3)

Legend:

Fieldbus Name of the fieldbus 1 byte 0x00 = no fieldbus present


type 0x01 = Profinet
0x02 = Profibus
0x03 = EtherNet/IP
Fieldbus Status of the fieldbus 1 byte 0x00 = initialisation
status connection 0x01 = waiting for connection
0x02 = connection is being established
0x03 = configuration of the connection in progress
0x04 = parameter setting in progress
0x05 = waiting for module configuration
0x06 = cyclic data exchange with the fieldbus controller/host
0x07 = connection establishment
Profibus Profibus address of the 1 byte 0x00 = no Profibus?
slave device 0x03 = address 3
address ...
0x7B = address 123
Ethernet Status and Ethernet 1 byte 0x00 = no connection
connection connections on ports X6 0x01 = connection on port X7 established, no connection on port X6
status and X7 0x02 = connection on port X6 established, no connection on port X7
0x03 = connection on ports X6 and X7 established

166
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Acyclic data records

Profinet/ IP address of the device 4 bytes One address segment per byte.
EtherNet/IP e.g. 192.168.0.102
IP address Byte 1: 192 = 0xC0
Byte 2: 168 = 0xA8
Byte 3: 0 = 0x00
Byte 4: 102 = 0x66
Profinet/ Subnet mask of the 4 bytes see Profinet/EtherNet/IP IP address
EtherNet/IP- Ethernet network
Subnet
mask
Profinet/ IP address of the 4 bytes see Profinet/EtherNet/IP IP address
EtherNet/IP EtherNet gateway
gateway
address
MAC0 MAC0-ID of the device 6 bytes One MAC segment per byte:
e.g. 00:02:01:01:98:D2
Note: For EtherNet/IP, Byte 1: D2
MAC0 = ...
00:00:00:00:00:00. Byte 6: 00
MAC1 MAC1-ID of the device 6 bytes see MAC0
MAC2 MAC2-ID of the device 6 bytes see MAC0
Note: MAC 1 equals
MAC2
Profinet host IP address of the Profinet 4 bytes see Profinet/EtherNet/IP IP address
address host
Note: No host address is
displayed in EtherNet/IP

167
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

9.3 Command channels

Principle of the command channels .....................................................................................................169


System commands ...............................................................................................................................170
AS-i master commands ........................................................................................................................187
16573

168
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

9.3.1 Principle of the command channels


13543

A command channel consists of a request channel and a response channel.


Command request channel (fieldbus master >>> device)
bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 user ID
2 command number
3...120 command parameters

Command response channel (device >>> fieldbus master)


bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
reply data to the command
5...120
Unused bytes receive invalid values from old command replies. DO NOT evaluate!

>

Command status
8795

Status Status code Description


[hex]
OK 00 Command execution was successful. Response data is available and valid.

FAILED 01 Error when executing the command. The exact cause of the error occurred is stated in the
command-specific error code. The response data is invalid.
TO 02 Timeout error: The command was cancelled due to timeout.

UC 03 Unknown Command: The transmitted command number is not known in the system.
NOP 04 Not valid parameter: The transmitted command parameter is invalid.

169
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

9.3.2 System commands


11077
>

Overview: System commands


11078

Comm. no. Comm. no.


Description
[hex] [dec]
0101 257 Quick setup AS-i master 1 (and AS-i master 2, if available)
0103 259 Change the user language
0104 260 Change the display settings
0105 261 Configure the output access
0106 262 Set the PLC operating mode
0109 265 Set the date / time
010A 266 Configure the NTP server settings
010B 267 Read date / time / NTP settings
010C 268 Reboot the system
010D 269 Read fieldbus information (can only be executed in CODESYS!)

170
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 257 (0x0101) Quick setup AS-i master 1 + 2


11079
>

Command request channel (fieldbus master >>> device)


11080

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

3 reserved reserved M2 M1

The area is completely ignored.


4 ...120
It does not matter whether the data area exists or what data is contained.

Legend:
M1 AS-i master 1 1 bit 0 = "Quick set-up" command is NOT executed on the master
1 = "Quick set-up" command is executed on the master
M2 AS-i master 2 1 bit 0 = "Quick set-up" command is NOT executed on the master
1 = "Quick set-up" command is executed on the master
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

The command "blocks" further processing as long as the quick set-up needs. That means that
the WRREC command signals "busy" until the function result is available. This may take a few
seconds.

171
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11081

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
command error code AS-i master 2 command error code AS-i master 1
4
Possible command error codes ( page 172) Possible command error codes ( page 172)

>

Possible command error codes


11087

Error Error Code Meaning


[hex]
0x00 no error
SD0 0x03 slave with address 0 connected
IM 0x04 - no master M1 and/or M2 specified or:
- master M2 does not exist (for units with 1 AS-i master)

When the Quick Setup is not executed for an AS-i master, the return value is always 0x00 (=
OK).

The command status has the value Failed when one of the errors is present on AS-i master 1
or 2 after command execution.

172
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 259 (0x0103) Select user language


11089

Via the command the user lanaguage for the local HMI and the web interface can be set. The
language setting always refers to both user interfaces.
>

Command request channel (fieldbus master >>> device)


11090

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

3 LANG_ID
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
MSG_ID User language 1 word 0x0000 = no language selection, only return active language
0x4445 = DE, German
0x454E = EN, English (default)
0x4652 = FR, French
0x4954 = IT, Italian
0x4553 = ES, Spanish
0x5054 = PT, Portuguese
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

173
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18011

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
5 current LANG_ID

>

Possible command error codes


11095

Error Error Code Meaning


[hex]
0x00 no error
IL 0x01 Language is unknown or not available in this software version

Error code only appears if command status = FAILED.


The error code 0x01 appears when querying the currently set language (LANG_ID = 0x0000).
This is to be interpreted as correct processing of the command.

174
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 260 (0x0104) Change display settings


11099
>

Command request channel (fieldbus master >>> device)


11100

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

3 reserved reserved RS DS
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DS Screen saver 1 bit 0 = no screen saver for local display
1 = screen saver for local display activated
RS return to splash screen 1 bit 0 = when the time has elapsed, device remains on current page
1 = when the time has elapsed, devices changes to the splash screen
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11101

There are no error messages for this command.

175
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 261 (0x0105) Set output control


16673

Using this command, the controller instance for the outputs of the AS-i slaves can be set.
>

Command request channel (fieldbus master >>> device)


16683

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

3 reserved OC
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
OC Output Control 1 byte 0x01 = GW, gateway
0x02 = MAN, manual
0x03 = PLC, device-internal PLC

>

Command response channel (device >>> fieldbus master)


16685

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

>

Possible command error codes


16687

Error Error Code Meaning


[hex]
0x00 no error
IO 0x01 Invalid parameter value transmitted for OC.
OR:
Control of the outputs could not be set.

Error code only appears if command status = FAILED.

176
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 262 (0x0106) set PLC operating mode


16674

Using this command, the operating mode of the device-internal PLC can be set.
>

Command request channel (fieldbus master >>> device)


16689

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved PLC

The area is completely ignored.


4 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
PLC Operating mode of the 1 bit 0x00 = stop PLC application and switch off PLC
device-internal PLC 0x01 = switch on PLC and start PLC application (boot application)

>

Command response channel (device >>> fieldbus master)


16690

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

>

Possible command error codes


16691

Error Error Code Meaning


[hex]
0x00 no error
PF 0x01 PLC operating mode could not be set.

Error code only appears if command status = FAILED.

177
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 265 (0x0109) Date / time


16677

Using this command, the system time (date and time) of the device can be set.
>

Command request channel (fieldbus master >>> device)


16694

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

3 month day
4 year (byte 2, MSB) year (byte 1, LSB)
5 minutes hours
6 reserved seconds
The area is completely ignored.
7 ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
day day 1 byte 0x01 = 1
0x02 = 2
...
0x1F = 31
month month 1 byte 0x01 = January
0x02 = February
...
0x0C = December
Year Year 1 word Possible values: 1971 ... 2037
0x07B3 = 1971
0x07B4 = 1972
...
0x07F5 = 2037
Example:
2014 = 0x07DE
year (MSB) = 0x07, year (LSB) = 0xDE
hours hours 1 byte 0x00 = 0
0x01 = 1
...
0x17 = 23
minutes minutes 1 byte 0x00 = 0
0x01 = 1
...
0x3B = 59
seconds seconds 1 byte 0x00 = 0
0x01 = 1
...
0x3B = 59

>

Command response channel (device >>> fieldbus master)


16695

178
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

>

Possible command error codes


16696

Error Error Code Meaning


[hex]
0x00 no error
IDT 0x01 Transferred values for date/time are invalid and could not be set. Error
NAE 0x02 NTP is active, transmitted value for time could not be set.

Deactivate NTP to be able to set the time.

Error code appears if command status = FAILED

179
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 266 (0x010A) Set parameters of the NTP server


16707

Using this command, the IP parameters of the NTP server can be set.
>

Command request channel (fieldbus master >>> device)


16705

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

3 NTP Offset reserved NTP


4 NTP server IP address (high byte, net address) NTP server IP address
5 NTP server IP address NTP server IP address (low byte, host address)
The area is completely ignored.
6 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
NTP Setting the NTP client 1 bit 0x0 = NTP client is inactive
0x1 = NTP client is active
NTP Offset NTP server provides the 1 byte 0x00 = system clock in local time
time in UTC. NTP Offset 0x01 = UTC -12:00
indicates the difference 0x02 = UTC -11:00
between UTC and local 0x03 = UTC -10:00
time. 0x04 = UTC -09:00
0x05 = UTC -08:00
0x06 = UTC -07:00
0x07 = UTC -06:00
0x08 =.UTC -05:00
0x09 = UTC -04:00
0x0A = UTC -03:30
0x0B = UTC -03:00
0x0C = UTC -02:00
0x0D = UTC -01:00
0x0E = UTC +00:00
0x0F = UTC +01:00
0x10 = UTC +02:00
0x11 = UTC +03:00
0x12 = UTC +03:30
0x13 = UTC +04:00
0x14 = UTC +04:30
0x15 = UTC +05:00
0x16 = UTC +05:30
0x17 = UTC +05:45
0x18 = UTC +06:00
0x19 = UTC +06:30
0x1A = UTC +07:00
0x1B = UTC +08:00
0x1C = UTC +09:00
0x1D = UTC +09:30
0x1E = UTC +10:00
0x1F = UTC +11:00
0x20 = UTC +12:00

180
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

NTP server IP address (IP-V4) of the 2 words Per segment of an IP address: 0 ....255
IP address NTP server
0x00 = 000
0x01 = 001
...
0x0FF = 255
Example:
IP address: 192.168.150.5
192 = 0xC0 (high byte)
168 = 0xA8
150 = 0x96
005 = 0x05 (low byte)

The duration of the synchronisation process depends on the settings of the NTP server. This
means that the synchronised system time is not immediately available after activation of the
NTP client.
Do not query the synchronised system time immediately after activation of the NTP client.

>

Command response channel (device >>> fieldbus master)


16706

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

>

Possible command error codes


16707

Error Error Code Meaning


[hex]
0x00 no error
IS 0x01 Wrong parameters transmitted. NTP server settings were not transmitted.

Error code appears if command status = FAILED

181
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 267 (0x010B) Date / time / read NTP settings


16679

Using this command, the current values for time, date and NTP settings can be read.
>

Command request channel (fieldbus master >>> device)


16712

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
The area is completely ignored.
3 ... 120
It does not matter whether the data area exists or what data is contained.

182
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


16713

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
5 month day
6 year (byte 2, MSB) year (byte 1, LSB)
7 minutes hours
8 reserved seconds
9 NTP Offset reserved NTP
10 NTP server IP address (high byte, net address) NTP server IP address
11 NTP server IP address NTP server IP address (low byte, host address)
Legend:
- day Command 266 (0x010A) Set parameters of the NTP server ( page 180)
- month
- year
- hours
- minutes
- seconds
- NTP Command 266 (0x010A) Set parameters of the NTP server ( page 180)
- NTP Offset
- NTP server IP address

>

Possible command error codes


16714

Error Error Code Meaning


[hex]
0x00 no error

183
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 268 (0x010C) Reboot system


16680

Using the command, the device can be restarted.


>

Command request channel (fieldbus master >>> device)


7032

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 0x4F (= O) 0x42 (= B)
4 0x54 (= T) 0x4F (= O)
The area is completely ignored.
5 ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

To prevent an unintended or unauthorised restart of the system by calling the command


0x010C, a signature must be transmitted in addition. The command execution is stopped when
a wrong signature is transmitted.
The signature is: BOOT

184
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


7044

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

>

Possible command error codes


7050

Error Error Code Meaning


[hex]
0x01 Command error: Reboot could not be carried out.

Error code only appears if command status = FAILED.

185
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 269 (0x010D) Read fieldbus info


7052

The command reads information via the fieldbus.

The command can only be executed using the function block ACnnnn_SysCmd under
CODESYS! ( ACnnnn_SysCmd ( page 129))

>

Command request channel (fieldbus master >>> device)


7064

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

The area is completely ignored.


3 ... 120
It does not matter whether the data area exists or what data is contained.

>

Command response channel (device >>> fieldbus master)


8909

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
5 ... 23 DS18 Fieldbus information ( page 166)

>

Possible command error codes


7030

Error Error Code Meaning


[hex]
0x00 no error

186
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

9.3.3 AS-i master commands

Overview: AS-i master commands .......................................................................................................188


Error codes of the AS-i master commands ..........................................................................................190
Command 01 (0x0001) change parameters of an AS-i slave ...........................................................193
Command 03 (0x0003) project currrent AS-i network .......................................................................195
Command 04 (0x0004) change LPS .................................................................................................196
Command 05 (0x0005) change the operating mode of the AS-i master...........................................197
Command 06 (0x0006) change AS-i slave address ..........................................................................198
Command 07 (0x0007) - set the auto address mode of the AS-i master............................................200
Command 09 (0x0009) Change extended ID1 in the AS-i slave ......................................................201
Command 10 (0x000A) - change PCD .................................................................................................203
Command 13 (0x000D) AS-i master supply voltage, symmetry, earth fault .....................................206
Command 21 (0x0015) Read ID string of an AS-i profile (S-7.4) ......................................................208
Command 26 (0x001A) read AS-i master info ..................................................................................211
Command 28 (0x001C) Deactivate slave reset when changing to the protected mode ...................212
Command 33 (0x0021) - read diagnosis string of an AS-i slave (S-7.4) ..............................................213
Command 34 (0x0022) - read parameter string of an AS-i slave (S-7.4) ............................................215
Command 35 (0x0022) - write parameter string of an AS-i slave (S-7.4) ............................................217
Command 36 (0x0024) CTT2 Standard ............................................................................................219
Command 37 (0x0025) CTT2 standard write ....................................................................................221
Command 38 (0x0026) CTT2 Vendor Specific Read ........................................................................223
Command 39 (0x0027) CTT2 Vendor Specific Write ........................................................................225
Command 64 (0x0040) CTT2 device group read ..............................................................................227
Command 65 (0x0041) CTT2 Device Group Write ...........................................................................229
Command 66 (0x0042) CTT2 Vendor Specific Selective Read From Buffer ....................................231
Command 67 (0x0043) CTT2 Vendor Specific Selective Write From Buffer ....................................233
Command 68 (0x0044) CTT2 Vendor Specific Selective Read ........................................................235
Command 69 (0x0045) CTT2 Vendor Specific Selective Write ........................................................237
Command 70 (0x0046) CTT2 device group selective Rread ............................................................239
Command 71 (0x0047) CTT2 Device Group Selective Write ...........................................................241
Command 73 (0x0049) CTT2 Vendor Specific Exchange ................................................................243
Command 74 (0x004A) CTT2 Device Group Exchange ...................................................................245
Command 75 (0x004B) CTT2 Device Group Selective Read From Buffer .......................................247
Command 76 (0x004C) CTT2 Device Group Selective Write From Buffer .......................................249
Command 80 (0x0050) Adjust AS-i master settings .........................................................................251
Command 81 (0x0051) Reset error counter......................................................................................252
8797

187
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Overview: AS-i master commands


7250

Command Command
Description Note
[hex] [dec]
0001 1 write parameters to a connected AS-i slave

adopt and save currently connected AS-i slaves in the configuration ConfDataInput Slave
Projected
0003 3 With this command the fieldbus connection is reset. The device Configuration Data
must be rebooted! and LDS LPS
0004 4 Change the list of the projected AS-i slaves (LPS)
0005 5 set the operating mode of the AS-i master
0006 6 readdress a connected AS-i slave
0007 7 set the auto addressing mode of the AS-i master
0009 9 change the extended ID code 1 in the connected AS-i slave
000A 10 change PCD
000D 13 AS-i master supply voltage, symmetry, earth fault
0015 21 read ID string of an AS-i slave with profile S-7.4 Slave profile S-7.4
0019 25 Set test mode
001A 26 read AS-i master info
Deactivation of the slave reset when changing to the protected
001C 28
mode
0021 33 read diagnosis string of an AS-i slave with profile S-7.4 Slave profile S-7.4
0022 34 read parameter string of an AS-i slave with profile S-7.4 Slave profile S-7.4
0023 35 write parameter string of an AS-i slave with profile S-7.4 Slave profile S-7.4
CTT2 standard read:
0024 36 CTT2 slave profile *)
Acyclic standard read call of an AS-i slave with CTT2 profile
CTT2 standard write:
0025 37 CTT2 slave profile *)
Acyclic standard write call of an AS-i slave with CTT2 profile
CTT2 vendor specific read:
0026 38 acyclic manufacturer-specific read call of an AS-i slave with CTT2 CTT2 slave profile *)
profile
CTT2 vendor specific write:
0027 39 acyclic manufacturer-specific write call of an AS-i slave with CTT2 CTT2 slave profile *)
profile
CTT2 device group read:
0040 64 CTT2 slave profile *)
Acyclic devicegroup read call of an AS-i slave with CTT2 profile
CTT2 device group write:
0041 65 CTT2 slave profile *)
Acyclic devicegroup write call of an AS-i slave with CTT2 profile
CTT2 vendor specific selective read from buffer:
0042 66 CTT2 slave profile *)
Selective standard read call of an AS-i slave with CTT2 profile
CTT2 vendor specific selective write from buffer:
0043 67 CTT2 slave profile *)
Selective standard write call of an AS-i slave with CTT2 profile
CTT2 vendor specific selective read:
0044 68 Selective manufacturer-specific read call of an AS-i slave with CTT2 CTT2 slave profile *)
profile
CTT2 vendor specific selective write:
0045 69 Selective manufacturer-specific write call of an AS-i slave with CTT2 slave profile *)
CTT2 profile

188
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

Command Command
Description Note
[hex] [dec]
CTT2 device group selective read:
0046 70 CTT2 slave profile *)
Selective devicegroup read call of an AS-i slave with CTT2 profile
CTT2 device group selective write:
0047 71 CTT2 slave profile *)
Selective devicegroup write call of an AS-i slave with CTT2 profile
CTT2 vendor specific exchange:
0049 73 Manufacturer-specific data exchange with an AS-i slave with CTTS CTT2 slave profile *)
profile
CTT2 device group exchange:
004A 74 CTT2 slave profile *)
Devicegroup data exchange with an AS-i slave with CTTS profile
CTT2 device group selective read from buffer:
004B 75 Manufacturer-specific write/read call of an AS-i slave with CTTS CTT2 slave profile *)
profile
CTT2 device group selective write from buffer:
004C 76 CTT2 slave profile *)
Devicegroup write/read call of an AS-i slave with CTTS profile

0050 80 Set AS-i master parameters

0051 81 Reset error counter


Legend:
CTT chapter Combined transaction Use of analogue channels in the gateway depending on the slave profile
*) CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5

189
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Error codes of the AS-i master commands

General error codes ..............................................................................................................................191


Standard CTT2 error codes ..................................................................................................................192
CTT2 error object .................................................................................................................................192
8836

190
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

General error codes


5682

Revision: 2014-03-05

Error Error Code Meaning


[hex]
NOK 0x01 no slave response OR:
master is in the offline mode when requesting the command
SND 0x02 no slave with the old address found
SD0 0x03 slave with address 0 connected
SD2 0x04 slave with the new address already exists
DE 0x05 error when deleting the old address
0x06 error when reading the IO configuration
SE 0x07 error when writing the new address or extended ID code 1
AT 0x08 new address could only be saved temporarily
ET 0x09 extended ID code 1 could only be saved temporarily
NA 0x0A the slave is not in the LAS

ID 0x0B parameter or address invalid


0x0C faulty S-7.4 protocol sequence

ST 0x0D S-7.4 protocol aborted (timeout)


IA 0x0E invalid AS-i slave address for the S-7.4 protocol (e.g. B slaves)
SSA 0x0F AS-i slave has aborted the S-7.4 string
0x10 AS-i S-7.4 no longer connected (no longer in LAS)
STA 0x11 another S-7.4 transfer to the addressed AS-i slave is already active
HSE 0x12 the previous segmented S-7.4 transfer was not yet completed
IDL 0x13 invalid S-7.4 data length
0x14 master is in the wrong operating mode *)
0x16 timeout during command processing
CMD_PRE 0x17 start requirements for S-7.4 command not met:
- wrong slave profile (is not S-7.4) or:
- slave is not in LAS or:
- master is not in the Protected mode
NM 0x18 master is not in the protected mode
0x19 master is not in the normal mode
0x20 command could not be processed within the specified time
0xE0...0xEF CTT2 error detected by AS-i slave; Standard CTT2 error codes ( page 192)
0xF0 invalid CTT2 command
0xF1 invalid CTT2 response
0xF2 S-7.5 data length longer than 30 bytes

191
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Standard CTT2 error codes


8931

The "standard CTT2 error code" provides information about errors occurred during processing of a
CTT2 command. It is transmitted in data byte 0 of the response channel of a CTT2 command. The
following table shows the possible values:

Error code Description


0x00 No fault
0x01 Invalid index
0x02 Invalid length
0x03 Command not implemented
0x04 Used, the command could not be completed in the specified time
0x05 Command was not acknowledged
0x06 Invalid sub-index
0x07 Command 'Selective Read Request' is missing

>

CTT2 error object


18393

In addition to the standard CTT2 error code, the "CTT2 error object" provides further manufacturer-
specific information about errors which occurred during processing of a CTT2 command. It is
transmitted in the response channel of a CTT2 command in the data bytes 0...5. The CTT2 error
object has the following structure:

Data byte Content


0 standard CTT2 error code
( Standard CTT2 error codes ( page 192))
1...4 manufacturer-specific error information
( data sheet of the AS-i slave)

192
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 01 (0x0001) Change parameters of an AS-i slave


8799

Requirement: The addressed AS-i master must be in the protected mode.


Command 05 (0x0005) change the operating mode of the AS-i master ( page 197)
>

Command request channel (fieldbus master >>> device)


11103

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 reserved reserved New output parameter
The area is completely ignored.
5...120
It does not matter whether the data area exists or what data is contained.
Legend:
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

If the requested slave address (SLA) is not in the list of activated slaves (LAS), the new
parameters are stored in the AS-i master despite error message (error code 0x0A). If an AS-i
slave with this address is added to the AS-i network at a later point, the slave automatically
adopts the saved parameters.

193
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11104

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
5 reserved reserved Input parameters
The area is completely ignored.
6 ... 120
It does not matter whether the data area exists or what data is contained.
>

Possible command error codes


11105

Error Error Code Meaning


[hex]
0x00 no error
NOK 0x01 no slave response OR:
master is in the offline mode when requesting the command
NA 0x0A the slave is not in the LAS

ID 0x0B parameter or address invalid


IA 0x0E invalid AS-i slave address for the S-7.4 protocol (e.g. B slaves)
NM 0x18 master is not in the protected mode

194
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 03 (0x0003) Project currrent AS-i network


8805

(= project all)
Requirement: The addressed AS-i master must be in the projection mode.
Command 05 (0x0005) change the operating mode of the AS-i master ( page 197)

With this command the fieldbus connection is reset. The device must be rebooted!

>

Command request channel (fieldbus master >>> device)


11107

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
The area is completely ignored.
3 ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11109

Error Error Code Meaning


[hex]
0x00 no error
SD0 0x03 slave with address 0 connected
0x19 master is not in the normal mode

195
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 04 (0x0004) Change LPS


8806

Requirement: The addressed AS-i master must be in the projection mode.


Command 05 (0x0005) change the operating mode of the AS-i master ( page 197)
>

Command request channel (fieldbus master >>> device)


11111

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 15(A) 14(A) 13(A) 12(A) 11(A) 10(A) 9(A) 8(A) 7(A) 6(A) 5(A) 4(A) 3(A) 2(A) 1(A) --
4 31(A) 30(A) 29(A) 28(A) 27(A) 26(A) 25(A) 24(A) 23(A) 22(A) 21(A) 20(A) 19(A) 18(A) 17(A) 16(A)
5 15B 14B 13B 12B 11B 10B 9B 8B 7B 6B 5B 4B 3B 2B 1B --
6 31B 30B 29B 28B 27B 26B 25B 24B 23B 22B 21B 20B 19B 18B 17B 16B
The area is completely ignored.
7...120
It does not matter whether the data area exists or what data is contained.

Legend:
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11112

Error Error Code Meaning


[hex]
0x00 no error
0x19 master is not in the normal mode
>

196
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 05 (0x0005) Change the operating mode of the AS-i master


8807
>

Command request channel (fieldbus master >>> device)


11114

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved MOD
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
MOD operating mode 1 byte 0x00 = set master to the normal mode (protected mode)
0x01 = set master to the projection mode
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11115

Error Error Code Meaning


[hex]
0x00 no error
SD0 0x03 slave with address 0 connected

197
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 06 (0x0006) Change AS-i slave address


8808

Requirement: The addressed AS-i master must be in the projection mode.


Command 05 (0x0005) change the operating mode of the AS-i master ( page 197)
>

Command request channel (fieldbus master >>> device)


11117

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST old SLA
4 reserved reserved ST new SLA
The area is completely ignored.
5...120
It does not matter whether the data area exists or what data is contained.

Legend:
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

198
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11118

Error Error Code Meaning


[hex]
0x00 no error
NOK 0x01 no slave response OR:
master is in the offline mode when requesting the command
SND 0x02 no slave with the old address found
SD0 0x03 slave with address 0 connected
SD2 0x04 slave with the new address already exists
DE 0x05 error when deleting the old address
0x06 error when reading the extended ID code 1
SE 0x07 error when writing the new address or extended ID code 1
AT 0x08 new address could only be saved temporarily
ET 0x09 extended ID code 1 could only be saved temporarily
NM 0x18 master is not in the protected mode

199
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 07 (0x0007) - Set the auto address mode of the AS-i master
8811
>

Command request channel (fieldbus master >>> device)


11120

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved AutoAd
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
AutoAd automatic addressing 1 byte 00 = deactivate automatic addressing
01 = activate automatic addressing
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11101

There are no error messages for this command.

200
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 09 (0x0009) Change extended ID1 in the AS-i slave


8812
>

Command request channel (fieldbus master >>> device)


11121

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 reserved new Extended ID-Code 1
The area is completely ignored.
5 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

201
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11121

Error Error Code Meaning


[hex]
0x00 no error
SND 0x02 no slave with the old address found
SD0 0x03 slave with address 0 connected
DE 0x05 error when deleting the old address
0x06 error when reading the extended ID code 1
SE 0x07 error when writing the new address or extended ID code 1
ET 0x09 extended ID code 1 could only be saved temporarily
IA 0x0E invalid AS-i slave address 0 or 0B, or address 0 indicated twice
NM 0x18 master is not in the protected mode
0x21 invalid ID code 1 (if bit 3 is set for A/B slave)

202
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 10 (0x000A) - Change PCD


8814
>

Command request channel (fieldbus master >>> device)


11125

Bit
Offset
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word no.
ID2-Code ID1-Code ID-Code IO-Code
1 UID
2 command number
3 reserved
4 Slave 1(A)
5 Slave 2(A)
6 Slave 3(A)
7 Slave 4(A)
8 Slave 5(A)
9 Slave 6(A)
10 Slave 7(A)
11 Slave 8(A)
12 Slave 9(A)
13 Slave 10(A)
14 Slave 11(A)
15 Slave 12(A)
16 Slave 13(A)
17 Slave 14(A)
18 Slave 15(A)
19 Slave 16(A)
20 Slave 17(A)
21 Slave 18(A)
22 Slave 19(A)
23 Slave 20(A)
24 Slave 21(A)
25 Slave 22(A)
26 Slave 23(A)
27 Slave 24(A)
28 Slave 25(A)
29 Slave 26(A)
30 Slave 27(A)
31 Slave 28(A)
32 Slave 29(A)

203
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

Bit
Offset
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word no.
ID2-Code ID1-Code ID-Code IO-Code
33 Slave 30(A)
34 Slave 31(A)
35 reserved
36 Slave 1B
37 Slave 2B
38 Slave 3B
39 Slave 4B
40 Slave 5B
41 Slave 6B
42 Slave 7B
43 Slave 8B
44 Slave 9B
45 Slave 10B
46 Slave 11B
47 Slave 12B
48 Slave 13B
49 Slave 14B
50 Slave 15B
51 Slave 16B
52 Slave 17B
53 Slave 18B
54 Slave 19B
55 Slave 20B
56 Slave 21B
57 Slave 22B
58 Slave 23B
59 Slave 24B
60 Slave 25B
61 Slave 26B
62 Slave 27B
63 Slave 28B
64 Slave 29B
65 Slave 30B
66 Slave 31B
The area is completely ignored.
67...120
It does not matter whether the data area exists or what data is contained.

Legend:

204
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

UID user ID 1 word 0x00000xFFFF = 065535


The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11112

Error Error Code Meaning


[hex]
0x00 no error
0x19 master is not in the normal mode

205
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 13 (0x000D) AS-i master supply voltage, symmetry, earth fault


8815
>

Command request channel (fieldbus master >>> device)


11107

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
The area is completely ignored.
3 ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

206
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11128

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
5 reserved reserved PF1 PF2 SE EF PM PS
6 Voltage ASi+ to ASi- in [mV]
7 Voltage FE to ASi- in [mV]
8 Symmetry (-100...100) in [%]
The area is completely ignored.
9 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
EF earth fault 1 bit 0 = no earth fault is detected
1 = asymmetric supply voltage; classified as earth fault
PF1 powerfail 22.5 V 1 bit 0 = no AS-i Power Fail (classic APF)
1 = AS-i voltage < 22.5 V
There is an AS-i power fail (classic APF)
PF2 powerfail 19 V 1 bit 0 = no AS-i Power Fail (24V APF)
1 = AS-i voltage < 19 V
There is an AS-i power fail (24V APF)
PM powermodule 1 bit 0 = no data decoupling module is connected
1 = a data decoupling module is connected
PS powersource 1 bit 0 = the device is supplied from AUX
1 = the device is supplied from AS-i
SE status earth fault 1 bit 0 = no earth fault detection possible (e.g. no AS-i voltage)
detection 1 = earth fault detection provides valid data

>

Possible command error codes


11101

There are no error messages for this command.

207
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 21 (0x0015) Read ID string of an AS-i profile (S-7.4)


8822
>

Command request channel (fieldbus master >>> device)


11130

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

208
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11131

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 Number of bytes received as from word no. 4 reserved ST reflected slave address

6 I/O 2D DT Start DT Count Mux field E type


7 number of parameter bytes to be read EDT Read reserved Diag reserved
8 EDT Write reserved Number of parameter bytes to be written
9 Device-specific information Manufacturer identification
10...m Device-specific information Device-specific information
The area is completely ignored.
(m+1)...120
It does not matter whether the data area exists or what data is contained.
Legend:
2D double data transfer 1 bit double data transfer (redundancy) possible
0 = simple data transfer
1 = double data transfer
number of parameter 1 byte number of bytes which can be read as parameter string
bytes to be read
00 = no parameter string readable
01...DBhex = 01...219dec = number of bytes
number of parameter 1 byte number of bytes which can be written as parameter string
bytes to be written
00 = no parameter string readable
01...DBhex = 01...219dec = number of bytes
Diag slave supports the 7.4 1 bit 0 = diagnosis string is not supported
diagnosis string 1 = diagnosis string is supported
DT-Count number of data triples 3 bits (information for the driver in the master)
DT-Start start triple 3 bits (information for the driver in the master)
E type slave function + 5 bits characterises the slave as regards functionality and data structure
data structure
00 = reserved
01 = transmitted values are measured values
02 = transmitted values are 16 digital bit values
03 = normal operation in 4-bit mode (4I/4O)
04...1Fhex = 04...31dec = reserved
EDT read reserved 3 bits reserved for later profiles
EDT write reserved 3 bits reserved for later profiles
device-specific 1 byte as an option more bytes for the manufacturer-specific device description
information
manufacturer 1 byte defined manufacturer number assigned by AS-International
identification
I/O direction of data 1 bit direction of data for the devices with E type 3
0 = input
1 = output

209
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

Mux field number of multiplexed 3 bits 03


data words number = value in "Mux field" +1
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)

>

Possible command error codes


11132

Error Error Code Meaning


[hex]
0x00 no error
NOK 0x01 no slave response OR:
master is in the offline mode when requesting the command
ST 0x0D S-7.4 protocol aborted (timeout)
IA 0x0E invalid AS-i slave address for the S-7.4 protocol (e.g. B slaves)
0x10 AS-i S-7.4 slave deleted from LAS during current transmission
STA 0x11 another S-7.4 transfer to the addressed AS-i slave is already active
CMD_PRE 0x17 start requirements for S-7.4 command not met:
- wrong slave profile (is not S-7.4) or:
- slave is not in LAS or:
- master is not in the Protected mode

210
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 26 (0x001A) Read AS-i master info


8827
>

Command request channel (fieldbus master >>> device)


11107

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
The area is completely ignored.
3 ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11137

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
5 M12 reserved
6 Master firmware version, places before the decimal point
7 Master firmware version, decimal places
The area is completely ignored.
8 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
M12 number of AS-i masters 1 byte 0x00 = device has 1 AS-i master
0x01 = device has 2 AS-i masters

>

Possible command error codes


11101

There are no error messages for this command.

211
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 28 (0x001C) Deactivate slave reset when changing to the protected mode
8828

When changing from the projection mode to the protected mode, all slaves are normally briefly reset
(reset or offline phase). This may lead to problems when the system is running. In such cases the
"deactivation of the slave reset" prevents the short deactivation of the slave outputs during changing of
the operating mode.
>

Command request channel (fieldbus master >>> device)


11139

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved OLP
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
OLP offline phase 1 byte 0x00 = offline phase when changing over to the protected mode
= slave reset 0x01 = no offline phase when changing over to the protected mode
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

>

Command response channel (device >>> fieldbus master)


11086

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
>

Possible command error codes


11101

There are no error messages for this command.

212
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 33 (0x0021) - read diagnosis string of an AS-i slave (S-7.4)


8829
>

Command request channel (fieldbus master >>> device)


11130

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

213
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11141

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 Number of bytes received reserved ST reflected slave address

6...m Diagnosis byte n+1 Diagnosis byte n


The area is completely ignored.
(m+1)...120
It does not matter whether the data area exists or what data is contained.
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)

>

Possible command error codes


11132

Error Error Code Meaning


[hex]
0x00 no error
NOK 0x01 no slave response OR:
master is in the offline mode when requesting the command
ST 0x0D S-7.4 protocol aborted (timeout)
IA 0x0E invalid AS-i slave address for the S-7.4 protocol (e.g. B slaves)
0x10 AS-i S-7.4 slave deleted from LAS during current transmission
STA 0x11 another S-7.4 transfer to the addressed AS-i slave is already active
CMD_PRE 0x17 start requirements for S-7.4 command not met:
- wrong slave profile (is not S-7.4) or:
- slave is not in LAS or:
- master is not in the Protected mode

214
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 34 (0x0022) - read parameter string of an AS-i slave (S-7.4)


8830
>

Command request channel (fieldbus master >>> device)


11130

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

215
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11143

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 Number of bytes received reserved ST reflected slave address

6 ... m Parameter byte n+1 Parameter byte n


The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)

>

Possible command error codes


11132

Error Error Code Meaning


[hex]
0x00 no error
NOK 0x01 no slave response OR:
master is in the offline mode when requesting the command
ST 0x0D S-7.4 protocol aborted (timeout)
IA 0x0E invalid AS-i slave address for the S-7.4 protocol (e.g. B slaves)
0x10 AS-i S-7.4 slave deleted from LAS during current transmission
STA 0x11 another S-7.4 transfer to the addressed AS-i slave is already active
CMD_PRE 0x17 start requirements for S-7.4 command not met:
- wrong slave profile (is not S-7.4) or:
- slave is not in LAS or:
- master is not in the Protected mode

216
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 35 (0x0022) - write parameter string of an AS-i slave (S-7.4)


8831
>

Command request channel (fieldbus master >>> device)


11145

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 Number of bytes to be transmitted reserved ST SLA
4...m parameter byte n+1 parameter byte n
The area is completely ignored.
(m+1)...120
It does not matter whether the data area exists or what data is contained.

Legend:
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

The number of the bytes to be sent must be divisible by 2 since the system always transmits
only multiples of 2 bytes in the S7.4 protocol.

217
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11143

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 Number of bytes received reserved ST reflected slave address

6 ... m Parameter byte n+1 Parameter byte n


The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)

>

Possible command error codes


11146

Error Error Code Meaning


[hex]
0x00 no error
0x0C 7.4 sequence failed. AS-i slave generated wrong 7.4 sequence

ST 0x0D S-7.4 protocol aborted (timeout)


IA 0x0E invalid AS-i slave address for the S-7.4 protocol (e.g. B slaves)
SSA 0x0F AS-i slave has aborted the S-7.4 string
0x10 AS-i S-7.4 slave deleted from LAS during current transmission
STA 0x11 another S-7.4 transfer to the addressed AS-i slave is already active
HSE 0x12 the previous segmented S-7.4 transfer was not yet completed
IDL 0x13 invalid S-7.4 data length
0x14 invalid S-7.4 command
CMD_PRE 0x17 start requirements for S-7.4 command not met:
- wrong slave profile (is not S-7.4) or:
- slave is not in LAS or:
- master is not in the Protected mode

218
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 36 (0x0024) CTT2 Standard


8832

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11148

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 DL IX
The area is completely ignored.
5 ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

219
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18370

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1* data byte n
* ... If the number of bytes to be transmitted is odd, a zero byte (= 0x00) is transmitted in the data byte n+1.

Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x50 = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x90 = CTT2 error on command execution:
- Data byte 0 contains Standard CTT2 error codes ( page 192).
- The data in the following data bytes is irrelevant.

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

>

220
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

Command 37 (0x0025) CTT2 standard write


8848
>

Command request channel (fieldbus master >>> device)


11152

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 DL IX
5 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

221
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18375

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 Command error code

5 reserved reserved ST Reflected slave address

6 data byte 0 RC
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x51 = No CTT2 error on command execution :
The data in the following data bytes is irrelevant.
0x91 = CTT2 error on command execution:
Data byte 0 contains Standard CTT2 error codes ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

222
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 38 (0x0026) CTT2 Vendor Specific Read


8849

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11148

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 DL IX
The area is completely ignored.
5 ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

223
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18371

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1* data byte n
* ... If the number of bytes to be transmitted is odd, a zero byte (= 0x00) is transmitted in the data byte n+1.
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x52 = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x92 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

224
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 39 (0x0027) CTT2 Vendor Specific Write


8850

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11152

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 DL IX
5 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

225
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


11153

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 reserved reserved ST reflected slave address

6 Data byte 0 RC

7 ... m Data byte n+1 Data byte n


Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x53 = No CTT2 error on command execution :
The data in the following data bytes is irrelevant.
0x93 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description

0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

226
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 64 (0x0040) CTT2 device group read


8851

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11148

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 DL IX
The area is completely ignored.
5 ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

227
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18372

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1* data byte n

* ... If the number of bytes to be transmitted is odd, a zero byte (= 0x00) is transmitted in the data byte n+1.
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x54 = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x94 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

>

228
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

Command 65 (0x0041) CTT2 Device Group Write


8852

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11152

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 DL IX
5 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

229
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18386

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 reserved reserved ST reflected slave address

6 data byte 0 RC

7 ... m data byte n+1 data byte n

Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x55 = No CTT2 error on command execution :
The data in the following data bytes is irrelevant.
0x95 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

230
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 66 (0x0042) CTT2 Vendor Specific Selective Read From Buffer


8853

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11159

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 ... m reserved DL
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

231
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18387

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x58 = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x98 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

232
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 67 (0x0043) CTT2 Vendor Specific Selective Write From Buffer


8855

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11162

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 Data byte 0 DL
6 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

233
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18388

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x59 = No CTT2 error on command execution :
Data byte 0 contains the number of bytes to be read (block length); Valid
values: 0x00 ... 0xFF ( data sheet of the AS-i slave)
0x99 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

234
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 68 (0x0044) CTT2 Vendor Specific Selective Read


8857

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11159

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 ... m reserved DL
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

235
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18387

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x58 = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x98 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

236
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 69 (0x0045) CTT2 Vendor Specific Selective Write


8858

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11162

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 Data byte 0 DL
6 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

237
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18388

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x59 = No CTT2 error on command execution :
Data byte 0 contains the number of bytes to be read (block length); Valid
values: 0x00 ... 0xFF ( data sheet of the AS-i slave)
0x99 = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

238
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 70 (0x0046) CTT2 device group selective Rread


8857

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11159

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 ... m reserved DL
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

239
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18392

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n

Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x5A = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x9A = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

240
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 71 (0x0047) CTT2 Device Group Selective Write


8860

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11162

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 Data byte 0 DL
6 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

241
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18391

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x5B = No CTT2 error on command execution :
Data byte 0 contains the block length (= number of bytes to be read); Valid
values: 0x00 ... 0xFF ( data sheet of the AS-i slave)
0x9B = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

>

242
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

Command 73 (0x0049) CTT2 Vendor Specific Exchange


8863

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11168

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 RL IX
5 Data byte 0 WL
6 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
RL read length 1 byte number of bytes to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.
WL write length 1 byte number of bytes to be written
permitted values: 0x000xFF = 0255 ( data sheet of the slave)

243
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18389

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1* data byte n
* ... If the number of bytes to be transmitted is odd, a zero byte (= 0x00) is transmitted in the data byte n+1.
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x5D = No CTT2 error on command execution
The following data bytes contain the requested data.
0x9D = CTT2 error on command execution
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

244
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 74 (0x004A) CTT2 Device Group Exchange


8866

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11168

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 RL IX
5 Data byte 0 WL
6 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
RL read length 1 byte number of bytes to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.
WL write length 1 byte number of bytes to be written
permitted values: 0x000xFF = 0255 ( data sheet of the slave)

245
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18390

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code
5 number of bytes received reserved ST reflected slave address
6 data byte 0 RC
7 ... m data byte n+1* data byte n
* ... If the number of bytes to be transmitted is odd, a zero byte (= 0x00) is transmitted in the data byte n+1.
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x5E = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x9E = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

246
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 75 (0x004B) CTT2 Device Group Selective Read From Buffer


8861

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11159

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 ... m reserved DL
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legend:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

247
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18392

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x5A = No CTT2 error on command execution :
The following data bytes contain the requested data.
0x9A = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

248
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 76 (0x004C) CTT2 Device Group Selective Write From Buffer


8862

CTT2 profiles = S-7.5.5, S-7.A.5 or S-B.A.5


>

Command request channel (fieldbus master >>> device)


11162

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 reserved reserved ST SLA
4 SIX IX
5 Data byte 0 DL
6 ... m Data byte (n+1) Data byte n
The area is completely ignored.
(m+1) ... 120
It does not matter whether the data area exists or what data is contained.

Legende:
DL data length 1 byte number of bytes to be transferred
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
IX index 1 byte pointer to the page to be read
permitted values: 0x000xFF = 0255 ( data sheet of the slave)
SIX sub-index 1 byte pointer on element on this page ( data sheet of the slave)
SLA slave address 5 bits 0x000x1F = 031
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
UID user ID 1 word 0x00000xFFFF = 065535
The user ID ensures clear identification of the commmand response data
of the command request data sent before. The user can assign any user
ID in the command request. The AS-i master reflects the user ID from the
command request into the corresponding command response.

249
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command response channel (device >>> fieldbus master)


18391

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

5 number of bytes received reserved ST reflected slave address

6 data byte 0 RC
7 ... m data byte n+1 data byte n
Legend:
ST slave type 1 bit 0 = single slave or A slave
1 = B slave (= addition of 0x20 or 32 to the slave address)
RC CTT2 Response Code 1 byte 0x5B = No CTT2 error on command execution :
Data byte 0 contains the block length (= number of bytes to be read); Valid
values: 0x00 ... 0xFF ( data sheet of the AS-i slave)
0x9B = CTT2 error on command execution:
The following data bytes 0...5 contain CTT2 error object ( page 192).

>

Possible command error codes


11150

Error code Error Description


0x00 No fault
0x0A NA Slave is not in the LAS
0x14 IC Invalid S-7.4 command
0x17 CMD_PRE Start requirements for S-7.4 command not met:
- Wrong slave profile (is not S-7.4) or:
- Slave is not in LAS or:
- Master is not in the protected mode

0xE1 CTT2_ACYCL_RD_NOK Command execution error


0xE2 CTT2_ACYCL_CMD_NOK Invalid command
0xE3 CTT2_ACYCL_RESP_NOK Wrong response data or internal error
0xE4 CTT2_ACYCL_WR_LEN_NOK Wrong data length when writing
0xE5 CTT2_ACYCL_STATE_NOK Invalid state of the CTT2 state machine when executing the command
0xE6 CTT2_ACYCL_STATE_RESET Reset when executing the command
0xE7 CTT2_ACYCL_RD_LEN_NOK Wrong data length when reading
0xE8 CTT2_ACYCL_RD_WR_LEN_NOK Wrong data length when reading / writing
0xEF CTT2_ACYCL_CMD_TIMEOUT Timeout

250
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 80 (0x0050) Adjust AS-i master settings


16772
>

Command request channel (fieldbus master >>> device)


16774

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 UID
2 command number
3 Setting reserved MOD
The area is completely ignored.
4 ... 120
It does not matter whether the data area exists or what data is contained.
Legend:
Setting Selection of the 0x01 = ground-fault detection (EE)
diagnostic function 0x02 = double address recognition (DAE)
MOD Activate/deactivate the 0 = deactivate function
selected diagnostic 1 = activate function
function in the settings

>

Command response channel (device >>> fieldbus master)


16775

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

>

Possible command error codes


16776

Error Error Code Meaning


[hex]
0x00 no error
IP 0x01 Wrong parameter assigned. Setting was not adopted.

251
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Annex Command channels

>

Command 81 (0x0051) Reset error counter


16773

Command sets the following counters to 0:


Telegram errors
All slave telegram errors
Configuration errors
Voltage drops < 22.5 V
Voltage drops < 19.0 V
Earth faults
Error distribution telegram errors
>

Command request channel (fieldbus master >>> device)


16778

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

1 UID

2 command number

The area is completely ignored.


3 ... 120
It does not matter whether the data area exists or what data is contained.

>

Command response channel (device >>> fieldbus master)


16779

bit
Offset
Word no.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 reflected user ID
2 reflected command number
3 reserved Command status ( page 169)
4 command error code

>

Possible command error codes


11101

There are no error messages for this command.

252
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Index

Command 21 (0x0015) Read ID string of an AS-i profile (S-7.4) ....208


10 Index Command 257 (0x0101) Quick setup AS-i master 1 + 2 .................171
Command 259 (0x0103) Select user language................................173
A Command 26 (0x001A) Read AS-i master info ................................211
Access input and output data ................................................................35 Command 260 (0x0104) Change display settings ...........................175
ACnnnn_SYS_CMD.library .................................................................128 Command 261 (0x0105) Set output control .....................................176
ACnnnn_SysCmd ................................................................................129 Command 262 (0x0106) set PLC operating mode ..........................177
ACnnnn_Utils.library ..............................................................................66 Command 265 (0x0109) Date / time ................................................178
Activate CODESYS PLC .......................................................................55 Command 266 (0x010A) Set parameters of the NTP server ...........180
Acyclic data records.............................................................................137 Command 267 (0x010B) Date / time / read NTP settings................182
Add AC14nn to a project .......................................................................22 Command 268 (0x010C) Reboot system .........................................184
Add fieldbus stack..................................................................................26 Command 269 (0x010D) Read fieldbus info ....................................186
Add web visualisation to a project .........................................................49 Command 28 (0x001C) Deactivate slave reset when changing to the
protected mode ....................................................................................212
Analogue input and output data ............................................................38
Command 33 (0x0021) - read diagnosis string of an AS-i slave (S-7.4)
Analogue output data ............................................................................40 .............................................................................................................213
Annex .....................................................................................................64 Command 34 (0x0022) - read parameter string of an AS-i slave (S-7.4)
Applications ...........................................................................................30 .............................................................................................................215
AS-i master commands .......................................................................187 Command 35 (0x0022) - write parameter string of an AS-i slave (S-7.4)
.............................................................................................................217
AS-i master status flags.......................................................................141
Command 36 (0x0024) CTT2 Standard ...........................................219
ASI_ADDRESS_MODE (ENUM) ........................................................119
Command 37 (0x0025) CTT2 standard write ...................................221
ASI_ANA_IO (STRUCT)......................................................................125
Command 38 (0x0026) CTT2 Vendor Specific Read ......................223
ASI_ANALOG_IN (STRUCT) ..............................................................125
Command 39 (0x0027) CTT2 Vendor Specific Write .......................225
ASI_ANALOG_IN_FLAGS (STRUCT) ................................................126
Command 64 (0x0040) CTT2 device group read ............................227
ASI_ANALOG_OUT (STRUCT) ..........................................................126
Command 65 (0x0041) CTT2 Device Group Write ..........................229
ASI_ANALOG_OUT_FLAGS (STRUCT) ............................................127
Command 66 (0x0042) CTT2 Vendor Specific Selective Read From
ASI_BIN_IN (STRUCT) .......................................................................124 Buffer ...................................................................................................231
ASI_BIN_IO (STRUCT) .......................................................................124 Command 67 (0x0043) CTT2 Vendor Specific Selective Write From
ASI_BIN_OUT (STRUCT) ...................................................................125 Buffer ...................................................................................................233
ASI_DATA (STRUCT) .........................................................................122 Command 68 (0x0044) CTT2 Vendor Specific Selective Read.......235
ASI_MASTER (ENUM) ........................................................................119 Command 69 (0x0045) CTT2 Vendor Specific Selective Write .......237
ASI_MASTER_MODE (ENUM) ...........................................................119 Command 70 (0x0046) CTT2 device group selective Rread ...........239
ASI_NET (STRUCT) ............................................................................124 Command 71 (0x0047) CTT2 Device Group Selective Write ..........241
ASI_SLAVE (ENUM) ...........................................................................120 Command 73 (0x0049) CTT2 Vendor Specific Exchange ...............243
ASI_SLAVE_TYP (ENUM) ..................................................................121 Command 74 (0x004A) CTT2 Device Group Exchange ..................245
Available fieldbus stacks .......................................................................25 Command 75 (0x004B) CTT2 Device Group Selective Read From
Buffer ...................................................................................................247
C Command 76 (0x004C) CTT2 Device Group Selective Write From
Buffer ...................................................................................................249
Change network settings .......................................................................45
Command 80 (0x0050) Adjust AS-i master settings ........................251
Change properties of the web visualisation ..........................................52
Command 81 (0x0051) Reset error counter ....................................252
Command 07 (0x0007) - Set the auto address mode of the AS-i master
.............................................................................................................200 Command channels.............................................................................168

Command 01 (0x0001) Change parameters of an AS-i slave .........193 Command status..................................................................................169

Command 03 (0x0003) Project currrent AS-i network .....................195 Communication settings ........................................................................28

Command 04 (0x0004) Change LPS ...............................................196 Complex variables (STRUCT) .............................................................122

Command 05 (0x0005) Change the operating mode of the AS-i Components of the ifm AS-i package ....................................................16
master ..................................................................................................197 Configure AC14nn controller .................................................................28
Command 06 (0x0006) Change AS-i slave address........................198 Configure AS-i master ...........................................................................44
Command 09 (0x0009) Change extended ID1 in the AS-i slave .....201 Configure AS-i slaves ............................................................................44
Command 10 (0x000A) - Change PCD ...............................................203 Configure connection with AC14nn .......................................................28
Command 13 (0x000D) AS-i master supply voltage, symmetry, earth Configure Ethernet interface..................................................................25
fault ......................................................................................................206
Configure system ...................................................................................44
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Index Command channels

Configure web visualisation ...................................................................51


Control interface of the ifm function blocks ...........................................41
F
Create CODESYS project .....................................................................19 FB with cyclic execution ........................................................................43
Create new project with AC14nn ...........................................................20 FB with one-time execution ...................................................................41
Create PLC application..........................................................................33 Fieldbus data .........................................................................................39
Create web visualisation........................................................................50
CTT2 error object.................................................................................192
G
General error codes.............................................................................191
D Get_ASi_Data ......................................................................................110
DAE/EE flags .......................................................................................144 Get_ASi_PHY_Dat ................................................................................68
Delete application from AC14nn............................................................63 Get_CDI .................................................................................................86
Delete applications on the device..........................................................30 Get_FieldbusInfo .................................................................................113
Description of the data records (DSx) .................................................138 Get_InputParameter ..............................................................................90
Details 4 channels per analogue slave....................................... 150, 151 Get_LAS ................................................................................................70
Details of the 5-word areas......................................................... 146, 148 Get_LCE ................................................................................................76
Details of the error lists ........................................................................165 Get_LCEAS ...........................................................................................78
Details of the slave lists .............................................................. 154, 155 Get_LCEMS...........................................................................................80
Digital input and output data ..................................................................37 Get_LDAE ..............................................................................................82
Digital output data ..................................................................................40 Get_LDS ................................................................................................72
Display current operating state..............................................................57 Get_LPF.................................................................................................84
Display stored applications ....................................................................30 Get_LPS ................................................................................................74
Display web visualisation.......................................................................62 Get_OutputParameter ...........................................................................92
DS1 Read system information..........................................................138 Get_PCD................................................................................................88
DS10 Slave list LPS ........................................................................155
DS11 Current configuration data CDI...............................................156
H
DS12 Projected configuration data PCD ..........................................158 Hardware ...............................................................................................12
DS13 Image of the input parameters of the slaves ..........................160 History of the instructions ........................................................................7
DS14 Image of the output parameters of the slaves........................161 Host flags .............................................................................................144
DS15 Slave error counter, configuration error counter, AS-i cycle
counter .................................................................................................162 I
DS17 Error lists LCEMS, LCEAS, LDAE .........................................165 ifm AS-i function libraries .......................................................................65
DS18 Fieldbus information ...............................................................166 ifm AS-i Package ...................................................................................15
DS2 Digital inputs of the slaves and master flags ............................139 ifm weltweit ifm worldwide ifm lchelle internationale.................257
DS3 Analogue inputs of slaves 1(A)...15(B).....................................145 Input and output data of the fieldbus interface ......................................39
DS4 Analogue inputs of slaves 16(A)...31(B)...................................147 Install ifm AS-i package .........................................................................16
DS5 Digital outputs of the slaves .....................................................149 Installation ..............................................................................................13
DS6 Analogue outputs of slaves 1(A)...15(B) ..................................150 Installation of the CODESYS Development System .............................14
DS7 Analogue outputs of slaves 16(A)...31(B) ................................151
DS8 Status of the analogue output data of the slaves 1...31 ...........152 L
DS9 Slave lists LAS, LDS, LPF, LCE ...............................................154 Legal and copyright information ..............................................................5
Licensing ................................................................................................12
E
Load application on AC14nn .................................................................56
Enumeration types (ENUM).................................................................119
Enumeration types and complex variables .........................................119 M
Error codes of the AS-i master commands .........................................190 Manage AS-i network ............................................................................45
Example Master flags .........................................................................................140
Change language setting of the device ...................................................... 134
Date / time / read NTP settings ................................................................... 135 N
Read LCEMS, LCEAS and LDAE of AS-i master 2 ................................... 136
Notes on how to get started.....................................................................7
Execution control flags ........................................................................142
Notes on web visualisations ..................................................................49
ifm Programming Manual CODESYS for AS-i Fieldbus Gateways AC14nn Firmware 3.0.24 or higher 2015-04-23
Index

Standard CTT2 error codes .................................................................192


O Start PLC application .............................................................................58
Operating states of the CODESYS PLC ...............................................57 Start-up behaviour of the controller .......................................................10
Operation ...............................................................................................54 Stop PLC application .............................................................................59
Options to access input and output data ...............................................36 Supported programming languages ......................................................32
Outputs data of the AS-i slaves .............................................................39 Supports reset variants..........................................................................61
Overview Switch operating states .........................................................................58
Acyclic data sets .......................................................................................... 137 Symbols and formats used ......................................................................6
AS-i functions (FB_ASi) ................................................................................ 67 System commands ..............................................................................170
AS-i master commands ............................................................................... 188
System requirements.............................................................................11
Project structure with AC14nn ...................................................................... 23
System commands ...................................................................................... 170 T
System functions (FB_System) .................................................................. 112
Table
P AS-i master commands ............................................................................... 131
System commands ...................................................................................... 130
PLC configuration ..................................................................................27
Tampering with the unit .........................................................................10
PLC programming..................................................................................31
Target Settings ......................................................................................18
Please note! .............................................................................................9
Task configuration .................................................................................34
Preliminary note .......................................................................................4
Testing the PLC application...................................................................53
Principle of the command channels ....................................................169
The purpose of the document..................................................................5
Process data of the AS-i slaves ............................................................37
Programming software CoDeSys ..........................................................14 U
Q Uninstall the ifm AS-i package...............................................................17
Update ifm AS-i package .......................................................................17
QuickSetupASi_Master .......................................................................115
Use complex variables ..........................................................................33
R Use functions of the ifm AS-i package ..................................................41
Use remanent variables.........................................................................33
Read configuration data of the slaves ...................................................46
Use web visualisations ..........................................................................48
Read network settings ...........................................................................45
Read parameter images ........................................................................46 V
read slave lists .......................................................................................46
Validity of the interface data ..................................................................36
Read status of the voltage supply .........................................................46
Required background knowledge ............................................................9
Reset......................................................................................................60
Reset PLC application ...........................................................................61

S
Safety instructions ...................................................................................8
Send commands to the system and the AS-i master ............................47
Set parameters for visualisation task ....................................................51
Set_AddressMode .................................................................................94
Set_ASi_Config .....................................................................................96
Set_LPS .................................................................................................98
Set_Mode.............................................................................................100
Set_PCD ..............................................................................................101
Set_ProjectAll ......................................................................................103
Set_SlaveAddress ...............................................................................104
Set_SlaveExtendedID1 .......................................................................106
Set_SlaveParameter............................................................................108
Set_TimeDate ......................................................................................117
Software .................................................................................................12
11 ifm weltweit ifm worldwide ifm lchelle
internationale
Stand: 2014-04-03 8310

www.ifm.com E-Mail: info@ifm.com


Service-Hotline: 0800 16 16 16 4 (nur Deutschland, Mo...Fr, 07.00...18.00 Uhr)
ifm Niederlassungen Sales offices Agences
D ifm electronic gmbh Vertrieb Deutschland
Niederlassung Nord 31135 Hildesheim Tel. 0 51 21 / 76 67-0
Niederlassung West 45128 Essen Tel. 02 01 / 3 64 75 -0
Niederlassung Mitte-West 58511 Ldenscheid Tel. 0 23 51 / 43 01-0
Niederlassung Sd-West 64646 Heppenheim Tel. 0 62 52 / 79 05-0
Niederlassung Baden-Wrttemberg 73230 Kirchheim Tel. 0 70 21 / 80 86-0
Niederlassung Bayern 82178 Puchheim Tel. 0 89 / 8 00 91-0
Niederlassung Ost 07639 Tautenhain Tel. 0 36 601 / 771-0
ifm electronic gmbh Friedrichstrae 1 45128 Essen
A ifm electronic gmbh 1120 Wien Tel. +43 16 17 45 00
AUS ifm efector pty ltd. Mulgrave Vic 3170 Tel. +61 3 00 365 088
B, L ifm electronic N.V. 1731 Zellik Tel. +32 2 / 4 81 02 20
BR ifm electronic Ltda. 03337-000, Sao Paulo SP Tel. +55 11 / 2672-1730
CH ifm electronic ag 4 624 Hrkingen Tel. +41 62 / 388 80 30
CN ifm electronic (Shanghai) Co. Ltd. 201203 Shanghai Tel. +86 21 / 3813 4800
CND ifm efector Canada inc. Oakville, Ontario L6K 3V3 Tel. +1 800-441-8246
CZ ifm electronic spol. s.r.o. 25243 Prhonice Tel. +420 267 990 211
DK ifm electronic a/s 2605 BROENDBY Tel. +45 70 20 11 08
E ifm electronic s.a. 08820 El Prat de Llobregat Tel. +34 93 479 30 80
F ifm electronic s.a. 93192 Noisy-le-Grand Cedex Tl. +33 0820 22 30 01
FIN ifm electronic oy 00440 Helsinki Tel . +358 75 329 5000
GB, IRL ifm electronic Ltd. Hampton, Middlesex TW12 2HD Tel. +44 208 / 213-0000
GR ifm electronic Monoprosopi E.P.E. 15125 Amaroussio Tel. +30 210 / 6180090
H ifm electronic kft. 9028 Gyr Tel. +36 96 / 518-397
I ifm electronic s.a. 20041 Agrate-Brianza (MI) Tel. +39 039 / 68.99.982
IL Astragal Ltd. Azur 58001 Tel. +972 3 -559 1660
IND ifm electronic India Branch Office Kolhapur, 416234 Tel. +91 231-267 27 70
J efector co., ltd. Chiba-shi, Chiba 261-7118 Tel. +81 043-299-2070
MAL ifm electronic Pte. Ltd 47100 Puchong Selangor Tel. +603 8063 9522
MEX ifm efector S. de R. L. de C. V. Monterrey, N. L. 64630 Tel. +52 81 8040-3535
N Sivilingenir J. F. Knudtzen A/S 1396 Billingstad Tel. +47 66 / 98 33 50
NL ifm electronic b.v. 3843 GA Harderwijk Tel. +31 341 / 438 438
P ifm electronic s.a. 4430-208 Vila Nova de Gaia Tel. +351 223 / 71 71 08
PL ifm electronic Sp. z o.o. 40-524 Katowice Tel. +48 32-608 74 54
RA, ROU ifm electronic s.r.l. 1107 Buenos Aires Tel. +54 11 / 5353 3436
ROK ifm electronic Ltd. 140-884 Seoul Tel. +82 2 / 790 5610
RP Gram Industrial, Inc. 1770 Mantilupa City Tel. +63 2 / 850 22 18
RUS ifm electronic 105318 Moscow Tel. +7 495 921-44-14
S ifm electronic a b 41250 Gteborg Tel. +46 31 / 750 23 00
SGP ifm electronic Pte. Ltd. Singapore 609 916 Tel. +65 6562 8661/2/3
SK ifm electronic s.r.o. 835 54 Bratislava Tel. +421 2 / 44 87 23 29
THA SCM Allianze Co., Ltd. Bangkok 10 400 Tel. +66 02 615 4888
TR ifm electronic Ltd. Sti. 34381 Sisli/Istanbul Tel. +90 212 / 210 50 80
UA TOV ifm electronic 02660 Kiev Tel. +380 44 501 8543
USA ifm efector inc. Exton, PA 19341 Tel. +1 610 / 5 24-2000
ZA ifm electronic (Pty) Ltd. 0157 Pretoria Tel. +27 12 345 44 49
Technische nderungen behalten wir uns ohne vorherige Ankndigung vor.
We reserve the right to make technical alterations without prior notice.
Nous nous rservons le droit de modifier les donnes techniques sans pravis.

Anda mungkin juga menyukai