0% found this document useful (0 votes)
116 views272 pages

AC402S Programing Manual

ASi Profinet Gateway Codesys manual

Uploaded by

Tapfumanei Zhou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views272 pages

AC402S Programing Manual

ASi Profinet Gateway Codesys manual

Uploaded by

Tapfumanei Zhou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 272

>

>

Programming Manual

SmartPLC SafeLine AC4S with fieldbus interfaces

AC402S
AC422S
AC432S

Firmware: 4.3.9
CODESYS Development System: 3.5.9.7 HF 3

English
12 / 2020
7391150 / 04
SmartPLC SafeLine AC4S with fieldbus interfaces

Contents

1 Preliminary note 5
1.1 Legal and copyright information ...........................................................................................5
1.2 Purpose of the document .....................................................................................................5
1.3 Explanation of Symbols .......................................................................................................6
1.4 Overview: User documentation for AC4S ............................................................................7
1.5 Overview: CODESYS documentation of 3S ........................................................................8
1.6 Modification history ..............................................................................................................8

2 Safety instructions 9
2.1 General safety instructions ..................................................................................................9
2.2 Required background knowledge ........................................................................................9

3 System requirements 10
3.1 Hardware ............................................................................................................................10
3.2 Software .............................................................................................................................10
3.3 Licensing ............................................................................................................................10

4 Installation 11
4.1 CODESYS Development System ......................................................................................11
4.1.1 Install CODESYS Development System..................................................................................... 11
4.2 ifm CODESYS package .....................................................................................................12
4.2.1 Components of the ifm package ................................................................................................. 12
4.2.2 Install the ifm package ................................................................................................................ 13
4.2.3 Uninstall ifm package ................................................................................................................. 13

5 Getting started 14
5.1 Start CODESYS .................................................................................................................14
5.2 Create CODESYS project ..................................................................................................15
5.2.1 Create new project with AC4S.................................................................................................... 16
5.2.2 Overview: Project structure with AC4S ....................................................................................... 17
5.3 Use CODESYS online help ................................................................................................19
5.4 Create user account ...........................................................................................................19
5.5 Configure programming interface ......................................................................................20
5.5.1 Set communication path of Standard PLC.................................................................................. 20
5.5.2 Set communication path of the fail-safe PLC.............................................................................. 21

6 System configuration 22
6.1 Configure Standard PLC ....................................................................................................22
6.2 Configure fail-safe PLC ......................................................................................................23
6.3 Configure safe AS-i slaves .................................................................................................24
6.3.1 Remarks ..................................................................................................................................... 24
6.3.2 Add safe AS-i slaves to the project ............................................................................................. 26
6.3.3 Remove safe AS-i slave from project ......................................................................................... 31
6.4 Configure safe devices at local I/O interface .....................................................................32
6.4.1 Remarks ..................................................................................................................................... 32
6.4.2 Add safe local device to project .................................................................................................. 34
6.4.3 Create test signal at local output ................................................................................................ 39
6.4.4 Remove safe local device from project ....................................................................................... 39

2
SmartPLC SafeLine AC4S with fieldbus interfaces

6.5 Configure standard devices at local I/O interface ..............................................................40


6.6 Change IP settings .............................................................................................................40
6.7 Add additional device to the project ...................................................................................41
6.8 Extend fieldbus functionality ..............................................................................................42
6.8.1 Available fieldbus stacks ............................................................................................................ 42
6.8.2 Use EtherCAT master ................................................................................................................ 43
6.8.3 Add fieldbus stack ...................................................................................................................... 46

7 Programming 47
7.1 Objects of a Standard PLC application ..............................................................................47
7.2 Create Standard PLC application ......................................................................................48
7.2.1 Use remanent variables.............................................................................................................. 49
7.2.2 Supported programming languages ........................................................................................... 49
7.2.3 Change system time of the device ............................................................................................. 49
7.3 Access standard input and output data .............................................................................50
7.3.1 Options to access input and output data .................................................................................... 50
7.3.2 Validity of the interface data ....................................................................................................... 51
7.3.3 Process data of the AS-i slaves.................................................................................................. 52
7.3.4 Fieldbus data .............................................................................................................................. 54
7.3.5 Process data of the non-safe local devices ................................................................................ 56
7.4 Use functions of the ifm package .......................................................................................57
7.4.1 Control interface of the ifm function blocks ................................................................................. 57
7.4.2 Configure system ....................................................................................................................... 58
7.4.3 Configure AS-i master ................................................................................................................ 59
7.4.4 Configure AS-i slaves ................................................................................................................. 59
7.4.5 Manage AS-i network ................................................................................................................. 60
7.4.6 Send commands to the system and the AS-i master .................................................................. 62
7.5 Use visualisations ..............................................................................................................63
7.5.1 Supported visualisation types ..................................................................................................... 63
7.5.2 Add visualisation to a project ...................................................................................................... 64
7.5.3 Create a visualisation ................................................................................................................. 65
7.5.4 Configure visualisation ............................................................................................................... 66
7.6 Cross communication ........................................................................................................67
7.6.1 Use network variables ................................................................................................................ 68
7.7 Configure task processing .................................................................................................69
7.7.1 Configure main task ................................................................................................................... 69
7.7.2 Set parameters for visualisation task .......................................................................................... 69

8 Programming of the fail-safe PLC 70


8.1 Objects of a safe application ..............................................................................................71
8.2 Create safe application ......................................................................................................72
8.2.1 Supported program organization units (POUs)........................................................................... 73
8.2.2 Available safety libraries ............................................................................................................. 73
8.2.3 Supported programming languages ........................................................................................... 73
8.2.4 Minimum number of AS-i slaves ................................................................................................. 74
8.2.5 Variable declaration with data transfer between standard and safety area ................................ 75
8.2.6 Available memory space ............................................................................................................ 75
8.2.7 Pin safe project........................................................................................................................... 75
8.3 Use safety functions of the ifm AS-i package ....................................................................76
8.3.1 Safe AS-i slaves: Reset logical device ....................................................................................... 76
8.3.2 Safe AS-i slaves: Provide diagnostic information ....................................................................... 77
8.3.3 Safe AS-i slaves: Transmit help signals HSI_1 and HSI_2 to safe AS-i output modules............ 77
8.3.4 Local I/O interface: Reset logical device..................................................................................... 77
8.3.5 Local I/O interface: Provide diagnostic information .................................................................... 78
8.3.6 Local I/O interface: Access non-safe inputs/outputs ................................................................... 78
8.3.7 PLCopen Safety: Provide diagnostic information ....................................................................... 78
8.4 Use safety functions of CODESYS ....................................................................................79
8.4.1 SafetyStandard library ................................................................................................................ 79
8.4.2 SafetyPLCopen library................................................................................................................ 80
8.4.3 SafetyFSoEMaster library........................................................................................................... 81

3
SmartPLC SafeLine AC4S with fieldbus interfaces

8.5 Data exchange between standard PLC and fail-safe PLC ................................................82
8.5.1 Remarks about the use of exchange variables ........................................................................... 82
8.5.2 Use the factory-set replacement variables ................................................................................. 83
8.5.3 Create additional objects for data exchange .............................................................................. 85
8.5.4 Set interval of the data exchange ............................................................................................... 85
8.6 Safe cross communication .................................................................................................86
8.6.1 Note on the size of the exchange objects ................................................................................... 87
8.6.2 Set up fail-safe network variables............................................................................................... 88
8.6.3 Use fail-safe network variables in the application ....................................................................... 89
8.7 Safe fieldbus communication .............................................................................................90
8.7.1 Configure FSoE connection........................................................................................................ 91
8.7.2 Notes on the FSoEMaster .......................................................................................................... 92
8.8 Set process safety time ......................................................................................................93
8.8.1 Process safety time for the AC4S ............................................................................................... 93
8.8.2 Set variable components of the response time........................................................................... 99
8.9 Configure safety task .......................................................................................................100
8.9.1 Set cycle time of the fail-safe PLC............................................................................................ 100

9 Operation 101
9.1 Transfer CODESYS project to device ..............................................................................101
9.1.1 Download Standard application to AC4S ................................................................................. 102
9.1.2 Load safe application to AC4S ................................................................................................. 103
9.1.3 Note: Projects with network variables ....................................................................................... 104
9.1.4 Teach code sequences of the safe AS-i slaves ........................................................................ 104
9.1.5 Delete boot application via SD card ......................................................................................... 105
9.2 Operating states AC4S ....................................................................................................106
9.2.1 Standard PLC ........................................................................................................................... 106
9.2.2 Fail-safe PLC............................................................................................................................ 108
9.3 Reset ................................................................................................................................112
9.3.1 Standard PLC ........................................................................................................................... 112
9.3.2 Fail-safe PLC............................................................................................................................ 114
9.4 Display web visualisation .................................................................................................115

10 Appendix 116
10.1 Library ACnnnn_Utils.library ............................................................................................117
10.1.1 Overview: AS-i functions (FB_ASi) ........................................................................................... 118
10.1.2 Overview: System functions (FB_System) ............................................................................... 163
10.1.3 Enumeration types and complex variables ............................................................................... 170
10.2 Library ACnnnn_SYS_CMD.library ..................................................................................179
10.2.1 ACnnnn_SysCmd ..................................................................................................................... 179
10.3 Library SF_IO.library ........................................................................................................187
10.3.1 CtrlASi_InSlave ........................................................................................................................ 188
10.3.2 CtrlASi_OutSlave ..................................................................................................................... 190
10.3.3 CtrlASi_ResetAllSlaves ............................................................................................................ 193
10.3.4 CtrlLocalInputs ......................................................................................................................... 194
10.3.5 Ctrl_SetDiagInfo ....................................................................................................................... 196
10.3.6 GetLocalInput ........................................................................................................................... 198
10.3.7 SetLocalOutput......................................................................................................................... 199
10.4 Library SF_LogicalInterfaces.library ................................................................................200
10.4.1 Remarks about logical devices ................................................................................................. 201
10.4.2 Logical devices for safe AS-i slaves ......................................................................................... 205
10.4.3 Logical devices for the local I/O interface ................................................................................. 235
10.5 Error codes: Safe AS-i slaves ..........................................................................................267
10.6 Error codes: Local I/O interface .......................................................................................269

11 Index 270

4
SmartPLC SafeLine AC4S with fieldbus interfaces

1 Preliminary note
Content
Legal and copyright information ...............................................................................................................5
Purpose of the document .........................................................................................................................5
Explanation of Symbols ............................................................................................................................6
Overview: User documentation for AC4S .................................................................................................7
Overview: CODESYS documentation of 3S .............................................................................................8
Modification history ...................................................................................................................................8
33203
>

1.1 Legal and copyright information


33117

© 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™
• EtherCAT® is a registered trade mark and patented technology, licensed by Beckhoff Automation
GmbH, Germany
• IO-Link® is the property of the → PROFIBUS Nutzerorganisation e.V., Germany
(→ www.io-link.com)
• ISOBUS is the property of the AEF – Agricultural Industry Electronics Foundation e.V.,
Deutschland (→ www.aef-online.org)
• Microsoft® is the property of the Microsoft Corporation, USA (→ www.microsoft.com)
• Modbus® is the property of the Schneider Electric SE, France (→ www.schneider-electric.com)
• PROFINET® is the property of the → PROFIBUS Nutzerorganisation e.V., Germany
• Windows® is the property of the → Microsoft Corporation, USA
>

1.2 Purpose of the document


43024

This document applies to the following devices of the "SmartSPS SafeLine AC4S" product family:
• SmartPLC SafeLine AC4S with Profinet device interface (AC402S)
• SmartPLC SafeLine AC4S with EtherNet/IP device interface (AC422S)
• SmartPLC SafeLine AC4S with EtherCAT slave interface (AC432S)

This document is to complement the device manuals of the a.-m. devices.


These instructions describe the configuration and programming of the device-internal Standard PLC
and the fail-safe PLC of AC4S by means of the CODESYS programming system.
>

5
SmartPLC SafeLine AC4S with fieldbus interfaces

1.3 Explanation of Symbols


34171

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
SmartPLC SafeLine AC4S with fieldbus interfaces

>

1.4 Overview: User documentation for AC4S


42309

ifm electronic provides the following user documentation for the models of the device class "Fail-safe
SmartPLC AC4S":

Document Content / Description


Data sheet Technical data of AC4S as a table
Operating instructions * ▪ Notes on mounting and electrical installation of the AC4S
▪ Set-up, description of the operating and display elements, maintenance information, scale
drawing
Device manual ▪ Notes on operation of AC4S via GUI and web interface
▪ Description of the cyclic and acyclic data records, fieldbus parameters and command
interface
▪ Error description
Supplement device manual ▪ Description of the acyclic data sets and the command interface
Programming manual ▪ Creation of a project with the device using CODESYS
▪ Configuration of the device using CODESYS
▪ Programming of the Standard PLC of the device
▪ Programming of the fail-safe PLC of the device
▪ Description of the device-specific CODESYS function libraries
Legend:
*... The operating instructions are supplied with the device.

All documents can be downloaded from ifm's website.

7
SmartPLC SafeLine AC4S with fieldbus interfaces

>

1.5 Overview: CODESYS documentation of 3S


43063

3S GmbH provides the following user documentation for programming Standard PLC and the fail-safe
PLC of AC4S:

Document Content / Description


Online help ▪ Context-sensitive help
▪ Description of the CODESYS programming system and the safety extension
CODESYS installation and ▪ Remarks about the installing of the CODESYS programming system
first steps ▪ First steps for handling the CODESYS programming system
Safety user manual ▪ Remarks about the safety-related project development with CODESYS
▪ Remarks about safety-related programming of the fail-safe PLC with CODESYS

After the installation of the CODESYS 3.5 programming system all documents are stored on the hard
disk of the PC/laptop and can be accessed:
• Online help:
...\Program Files\3S CoDeSys\CoDeSys\Online-Help
• CODESYS installation and first steps:
...\Program Files\3S CoDeSys\CoDeSys\Documentation
• Safety user manual:
...\Program File\3S CoDeSys\CoDeSys\Documentation
>

1.6 Modification history


34492

Version Topic Date


00 New creation of document 12 / 2017
01 Added: Note on the size of exchange objects 09 / 2018
02 Corrected: Description of testpulse at local I/O interface 04 / 2019
03 Update to firmware 4.3.9 11 / 2019
04 Discontinuation of AC412S 12 / 2020

8
SmartPLC SafeLine AC4S with fieldbus interfaces

2 Safety instructions
Content
General safety instructions .......................................................................................................................9
Required background knowledge .............................................................................................................9
28333
>

2.1 General safety instructions


41415

Read this document before setting up the product and keep it during the entire service life.
Only use the product for its intended purpose.
If the operating instructions or the technical data are not adhered to, personal injury and/or damage to
property may occur.
Improper or non-intended use may lead to malfunctions of the device, to unwanted effects in the
application or to a loss of the warranty claims.
The manufacturer assumes no liability for any consequences caused by tampering with the device or
incorrect use by the operator.
► Observe these operating instructions.
► Adhere to the warning notes on the product.
>

2.2 Required background knowledge


43060

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.
To program AC4S, the people should also be familiar with the software CODESYS 3.5 and the
CODESYS Safety extension.
The people should also have knowledge of the following topics:
• Requirements on safety-relevant programming
• Standards DIN EN ISO 13849 and DIN EN 62061

9
SmartPLC SafeLine AC4S with fieldbus interfaces

3 System requirements
Content
Hardware ................................................................................................................................................10
Software..................................................................................................................................................10
Licensing.................................................................................................................................................10
38972
>

3.1 Hardware
42877

• Device of the SmartSPS SafeLine AC4S product family with firmware V4.3.9
• PC/laptop for CODESYS development system (→ system requirements CODESYS development
system V3.5)
• Ethernet connection between CODESYS-PC/laptop and configuration interface (X3) of the device
>

3.2 Software
43113

To program the device-internal Standard PLC and the fail-safe PLC of AC4S the following software
components are necessary:

Component Description Version


CODESYS Development System CODESYS programming software for PLC programming 3.5 SP9 Patch 7 Hotfix 3
complying with the standard IEC 61131-3
Package ""CODESYS für ifm SmartPLC ▪ Safety extension for the CODESYS programming 1.5.2.11
SafeLine"" software
▪ Device and interface description of AC4S
▪ Function libraries for programming of Standard PLC
▪ Certified function libraries for programming the
fail-safe PLC
▪ Certified libraries for the safety-relevant programming
(SafetyPLCopen, safety standard)

The features and functions warranted in this manual can only be obtained by using the
software components in the versions stated here.
On its website ifm electronic provides the required software components.

>

3.3 Licensing
43397

By buying a device of the SmartSPS SafeLine AC4S the buyer has also purchased a licence valid for
using the CODESYS 3.5 programming software.

10
SmartPLC SafeLine AC4S with fieldbus interfaces

4 Installation
Content
CODESYS Development System .........................................................................................................11
ifm CODESYS package..........................................................................................................................12
42637
>

4.1 CODESYS Development System


39481

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

4.1.1 Install CODESYS Development System


40432

To install the software "CODESYS Development System":


► Install the programming system CODESYS 3.5 SP9 Patch 7 Hotfix 3 (→ CODESYS installation and first steps).
> CODESYS 3.5 SP9 Patch 7 Hotfix 3 is installed on the programming PC/laptop.

11
SmartPLC SafeLine AC4S with fieldbus interfaces

>

4.2 ifm CODESYS package


Content
Components of the ifm package .............................................................................................................12
Install the ifm package ............................................................................................................................13
Uninstall ifm package .............................................................................................................................13
42604

► Familiarise yourself with the following CODESYS functions!


▪ Package Manager
→ Online help > CODESYS Development System > Manage packages and licences

>

4.2.1 Components of the ifm package


43264

ifm electronic provides the "CODESYS für ifm SmartPLC SafeLine"package (ifm package for short) for
the programming of the AC4S. The ifm package (file:
ifm_SmartPLC_SafeLine_V1_5_2_11.package) contains the following certified components:

Component Description
Plugins CODESYS plugins
Files Project templates, project examples, CODESYS safety user manual, CODESYS profiles

Online help files Online helps (CODESYS safety, safety network variables)
Online help merge files Online help system
Device description Description of the device modules, interfaces and additional devices
Library CODESYS libraries (SF_IO, SafetyPLCopen, SF_LogicalInterfaces, SafetyStandard,
SafetySystemIO, SafetyNetVar, SafetyFSoEMaster, ACnnn_Utils. ACnnnn_SYS_CMD,
IoStandard, SysSafetyIoBase_ifm, IoDrvEtherCAT, IoDrvEtherNetIP, IoDrvAL1020,
IoDrvAL1030 )

12
SmartPLC SafeLine AC4S with fieldbus interfaces

>

4.2.2 Install the ifm package


42997

To install the ifm AS-i package on the programming PC/laptop:


Requirements
> CODESYS 3.5 SP9 Patch 7 Hotfix 3 is installed on the programming PC/laptop.
1 Start CODESYS
► Start CODESYS.
> CODESYS user interface appears.
2 Install "CODESYS für ifm SmartPLC SafeLine"
► Select [Tools] > [Package Manager] to start the Package Manager.
> Window [Package Manager] appears.
► Click on [Install...] to start the installation dialogue.
► Select file ifm_SmartPLC_SafeLine_V1_5_2_11.package and carry out complete installation.
> Window [Package Manager] shows installed ifm package.
► Click on [Exit] to close the Package Manager.

► Note the remarks about the correct start of the programming system CODESYS Safety.
→Start CODESYS (→ S. 14)

>

4.2.3 Uninstall ifm package


42547

To uninstall the package "CODESYS für ifm SmartPLC SafeLine":


1 Start CODESYS
► Start CODESYS with administrator rights.
> CODESYS programming interface appears.
2 Uninstall the ifm package
► Select [Tools] > [Package Manager] to access the package manager.
> Window [Package Manager] shows the installed packages.
► Activate [Display version] checkbox.
> The window shows the version numbers of the installed packages.
► Select the package version to be uninstalled
► Click on [Uninstall...] to uninstall the selected package.
> The selected package version is uninstalled.
► Click on [Exit] to close the Package Manager.

13
SmartPLC SafeLine AC4S with fieldbus interfaces

5 Getting started
Content
Start CODESYS .....................................................................................................................................14
Create CODESYS project ......................................................................................................................15
Use CODESYS online help ....................................................................................................................19
Create user account ...............................................................................................................................19
Configure programming interface ...........................................................................................................20
39512
>

5.1 Start CODESYS


43112

ifm electronic provides a special profile for CODESYS. The CODESYS profile "ifm electronic
SmartPLC SafeLine V3.5.9.73" creates a preconfigured environment for the configuration and
programming of an AC4S automation system.
To start CODESYS with the profile "ifm electronic SmartPLC SafeLine V3.5.9.73":
Requirements
> Software components were correctly installed (→Install the ifm package (→ S. 13)
1 Create desktop shortcut
► Delete the desktop shortcut of CODESYS created during installation.
► Create desktop shortcut of the following application:
[Start] > [All Programs] > [3S CODESYS] > [CODESYS] > [CODESYS without Profile]
2 Start CODESYS with the ifm profile
► Double click on desktop shortcut [CODESYS without Profile]
> Selection window appears.
► Select [ifm electronic SmartPLC SafeLine V3.5.9.73] from the [Version profile] list.
► Press [Continue] to apply the selection and load the profile.
> The CODESYS programming system starts using the selected profile.

14
SmartPLC SafeLine AC4S with fieldbus interfaces

>

5.2 Create CODESYS project


Content
Create new project with AC4S ..............................................................................................................16
Overview: Project structure with AC4S ..................................................................................................17
42490

► Familiarise yourself with the following CODESYS functions!


▪ Create CODESYS project
→ Online help > CODESYS Development System > Create and configure project
▪ Objects of the user interface
→ Online help > CODESYS Development System > Reference user interface

15
SmartPLC SafeLine AC4S with fieldbus interfaces

>

5.2.1 Create new project with AC4S


43250

To avoid errors with a manual system configuration it is highly recommended to use the
project template of ifm electronic for the creation of an SmartSPS SafeLine AC4S project in
CODESYS.

Requirements:
> All required software components are correctly installed (→Install the ifm package (→ S. 13)).
> CODESYS was started (→Start CODESYS (→ S. 14)).
1 Create new AC4S project
► Select [File] > [New Project ...].
> The window for the configuration of the project properties appears.

► Set the following values:


1. [Templates]: Select [ifm_SmartPLC_SafeLine Project].
2. [Name]: Enter project name
3. [Location]: Select storage location for the project file.
► Click on [OK] to confirm the entered values.
> CODESYS creates a new project with an AC4S.
> The window [Devices] shows the device tree of the project (→Overview: Project structure with AC4S
(→ S. 17)).
2 Save project
► Select [File] > [Save Project].
> CODESYS saves the project.
>

16
SmartPLC SafeLine AC4S with fieldbus interfaces

5.2.2 Overview: Project structure with AC4S


43018

[ifm_SmartPLC_SafeLine (ifm SmartPLC SafeLine)] provides access to the settings of the Standard PLC of the AC4S
→Configure standard PLC (→ S. 22)
[PLC Logic] contains the Standard PLC applications of AC4S.
→Objects of a standard PLC application (→ S. 47)
[ASi_Master_1] contains the following objects:

• Process data images of the standard AS-i slaves at AS-i Master 1


→Access standard input and output data (→ S. 50)
• Configuration nodes for safe AS-i slaves at AS-i Master 1
→Configure safe AS-i slaves (→ S. 24)
[ASi_Master_2] contains the following objects:

• Process data images of the standard AS-i slaves at AS-i Master 2


→Access standard input and output data (→ S. 50)
• Configuration nodes for safe AS-i slaves at AS-i Master 2
→Configure safe AS-i slaves (→ S. 24)
[Fieldbus_Interface] provides access to the input and output data of the fieldbus interface.
→Access standard input and output data (→ S. 50)
[local_IO] is the configuration node for safe devices at the local I/O interface
→Configure safe devices at local I/O interface (→ S. 32)

[X3] provides access to the configuration options of the configuration interface 2 (X3)
→Extend fieldbus functionality (→ S. 42) and →Change IP settings (→ S. 40)
[X8] provides access to the configuration options of the configuration interface 2 (X8)
→Extend fieldbus functionality (→ S. 42) and →Change IP settings (→ S. 40)
[SmartPLC_Safety_Extension] provides access to the following objects:

• Settings of the fail-safe PLC of AC4S


→Configure fail-safe PLC (→ S. 23)
• Safe application
→Objects of a safe application (→ S. 71)

17
SmartPLC SafeLine AC4S with fieldbus interfaces

18
SmartPLC SafeLine AC4S with fieldbus interfaces

>

5.3 Use CODESYS online help


42557

This manual only describes the integration, configuration and the programming of the AC4S using the
CODESYS development system.
For the description of user actions and user interface elements the CODESYS terminology will be
used.
Standard functions and methods of CODESYS will not be described. At the beginning of each section
there will be a reference to the corresponding chapters of the CODESYS online help.
To access the online help of the CODESYS development system:
► Start CODESYS.
> The CODESYS user interface appears.
► Press [F1].
> Online help of the CODESYS development system appears.

► Familiarise yourself with the CODESYS development system! In particular with the
following topics:
▪ Names and functions of the user interface elements
▪ Basic menu functions
▪ Programming techniques and methods for data retention

>

5.4 Create user account


43243

► Familiarise yourself with the following CODESYS functions!


▪ Safety user administration and access control:
→ Online help > Add-Ons > CODESYS Safety > Safety user administration and
access control
▪ Safety user configuration:
→ Online help > Add-Ons > CODESYS Safety > Safety user configuration

Safety-relevant objects and functions of a project must only be carried out by a user who is a member
of the user groups "Safety" or "Safety.ExtendedLevel".
To create a user:
► Select [Project] > [Project settings]
► CODESYS user administration appears.
► Create user and add required user group.
► Create password.

19
SmartPLC SafeLine AC4S with fieldbus interfaces

>

5.5 Configure programming interface


43271

To transfer the created project to AC4S a valid communication path has to be configured between the
programming system CODESYS and AC4S.
Standard PLC and fail-safe PLC of AC4S use a separate hardware. Therefore it is necessary to set
the communication paths for both controllers separately.
>

5.5.1 Set communication path of Standard PLC


43042

The following interfaces can be configured as programming interface:


• Ethernet configuration interface 1 (X3)
• Ethernet configuration interface 2 (X8)

To configure the connection between CODESYS programming software and Standard PLC of the
AC4S:
1 Preparations
► Connect CODESYS PC/laptop and configuration interface 1 (X3) or 2 (X8) of the device.
► Optional: Adjust IP settings of the Ethernet interfaces.
2 Select communication settings
► In the device tree: Double click on the [ifm_SmartPLC_SafeLine] symbol
► In the editor window: Click on [Communication Settings].
> The editor window shows the communication settings of the PLC.
3 Select gateway
► Select the requested gateway in the [Gateway] list.
> List shows selected gateway.
4 Set communication path
► Click on [Scan Network...]
> Window [Select Device] appears.
► Select the gateway node and click on [Scan network] to start the scan process.
> CODESYS scans network for devices.
> Window shows network path and detected devices.

► Select node of the AC4S.


> Information field shows detailed information about selected node.
► Click on [OK] to set the communication path to Standard PLC.
> CODESYS can transfer data to the Standard PLC of the AC4S.

20
SmartPLC SafeLine AC4S with fieldbus interfaces

>

5.5.2 Set communication path of the fail-safe PLC


43038

To configure the connection between CODESYS programming software and the fail-safe PLC of
AC4S:
Requirements:
> Communication path to Standard PLC is correctly set (→Set communication path of Standard-SPS
(→ S. 20)).
1 Select communication settings
► In the project tree: Double click on the [SamrtPLC_Safety_Extension] symbol
> The editor window shows the tab [Communication Settings].
2 Set communication path
► Activate [Scan Network...]
> Window [Select Device] appears.
► Mark node [Gateway-1] and start scan process with [Scan network].
> Device scans network for devices.
> Window shows detected devices and network path.

► Select the sub-node of the SafeLine node in the network path.


> Information field shows detailed information about selected node.
► Click on [OK] to set the communication path to the fail-safe PLC.
3 Acknowledge connection to the fail-safe PLC
> Window [Connection to the Fail-safe PLC] appears.
► Enter the serial number of the device in the field [Instance identification].
► Click on [OK] to acknowledge the input.
> CODESYS verifies the connection to the fail-safe PLC.
> CODESYS can log in to the fail-safe PLC.

21
SmartPLC SafeLine AC4S with fieldbus interfaces

6 System configuration
Content
Configure Standard-SPS ........................................................................................................................22
Configure fail-safe PLC ..........................................................................................................................23
Configure safe AS-i slaves .....................................................................................................................24
Configure safe devices at local I/O interface ..........................................................................................32
Configure standard devices at local I/O interface ..................................................................................40
Change IP settings .................................................................................................................................40
Add additional device to the project .......................................................................................................41
Extend fieldbus functionality ...................................................................................................................42
43007

This chapter contains information about the configuration of the device-internal PLC, the inserted safe
AS-i slaves, the safe sensors/actuators at the local I/O interface and the Ethernet configuration
interface.
>

6.1 Configure Standard PLC


42478

► Familiarise yourself with the following CODESYS functions!


▪ Generic device editor
→ Online help > CODESYS Development System > Reference user interface >
Objects> object 'device' and generic device editor

The Standard PLC is configured via the "Generic Device Editor" of the CODESYS programming
system. The programmer can access the device editor of the Standard PLC via the following node in
the device tree:

To configure the device-internal Standard PLC:


► In the device tree: Double-click on [ifm_SmartPLC_SafeLine]
> The editor window shows device editor of the device-internal Standard PLC.
► Configure Standard PLC.
► Save the project to apply changes.

22
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.2 Configure fail-safe PLC


43275

► Familiarise yourself with the following CODESYS functions!


▪ Editor of the safety controller
→ Online help > Add-Ons > CODESYS Safety > Editors > Editor of the safety
controller

The fail-safe PLC of AC4S is configured via the "device editor of the safety controller" of the
CODESYS programming system. The programmer can access the device editor of the fail-safe PLC
via the following node in the device tree:

To configure the fail-safe PLC of AC4S:


► In the device tree: Double click on [SmartPLC_Safety_Extension (SmartPLC Safety Extension)]
> The editor window shows the device editor of the fail-safe PLC of AC4S.
► Configure fail-safe PLC as required.

The button [Firmware Update] in the tab [Sicherheitssteuerung] does not have any
functionality in connection with the AC4S.
► Do not activate the button.
An update of the firmware of the AC4S must only be made by an authorised employee of ifm
electronic gmbh.
► Contact your AS-i specialist for more information.
► After a firmware update the user must re-evaluate and compile the boot application and
load it to the device for safety reasons.

23
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.3 Configure safe AS-i slaves


Content
Remarks .................................................................................................................................................24
Add safe AS-i slaves to the project ........................................................................................................26
Remove safe AS-i slave from project .....................................................................................................31
43270

The safe inputs and outputs are configured via the "Device editor for logical I/Os" of the
programming system CODESYS Safety. In the following sections only the AC4S-specific
functions are described.
► Familiarise yourself with the following CODESYS functions!
▪ Device editor for logical I/Os
→ Online help > Add-Ons > CODESYS Safety > Editors > Device editor for logical
I/Os

>

6.3.1 Remarks
43071
>

Concept of the logical devices


43276

Safe AS-i slaves are inserted in a CODESYS project via logical devices. Depending on the type of the
safe AS-i slave the logical devices fulfil different functions.
>

Safe AS-i input slaves


43073

Mapped to the classical behaviour of a programmable logic controller the logical device assumes the
functions of signal detection and signal processing. The individual functions are:
• detect the code half-sequences generated by the safe AS-i input slave
• pre-process the code half sequences by means of the internal logic
• provide the result of the logical preprocessing as safe variable value

The programmer can configure the logical preprocessing via the parameter interface of the logical
device.
>

Safe AS-i output slaves


43083

Safe AS-i output slaves are indirectly controlled via a virtual AS-i control slave. The AS-i control slave
assumes following functions:
• generate a safe code sequence for unlocking a safe AS-i output slave

AC4S detects the AS-i control slave only after the download of the safety project to AC4S.
Then the respective AS-i master generates a configuration error (unknown slave).
► Carry out projection adaptation to eliminate the error (→ Device manual, Quick setup:
Project AS-i networks)

24
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Available logical devices for safe AS-i slaves


43269

Following logical devices are available for safe AS-i slaves:

Designation Type Reference


SF_IN_ASi_forced Input →SF_IN_ASi_forced (→ S. 206)
SF_IN_ASi_independent Input →SF_IN_ASi_independent (→ S. 210)
SF_IN_ASi_conditionally_dependent Input →SF_IN_ASi_conditionally_dependent (→ S. 214)
SF_IN_ASi_dependent Input →SF_IN_ASi_dependent (→ S. 218)
SF_IN_ASi_dependent_filter_w_testreq Input →SF_IN_ASi_dependent_filter_w_testreq (→ S. 222)
SF_IN_ASi_dependent_filter_ntestreq Input →SF_IN_ASi_dependent_filter_ntestreq (→ S. 226)
SF_IN_ASi_dependent_filter_nshutdown Input →SF_IN_ASi_dependent_filter_nshutdown (→ S. 230)
SF_OUTcontrol_ASi Output →SF_OUTcontrol_ASi (→ S. 234)

Detailed information about the logical devices:


→Remarks about logical devices (→ S. 201)

25
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.3.2 Add safe AS-i slaves to the project


43315

Safe AS-i slaves are added to a CODESYS project in 2 steps:


1. Add logical device of the safe AS-i slave to the project tree:
→Add logical device to the project tree (→ S. 26)
2. Configure logical device:
→Configure logical device (→ S. 29)

The user is responsible for the selection of the suitable logical devices. The user must ensure
that the selected logical devices provide the functionality required for the safety application to
be implemented.
► Observe the documentation of the logical devices (→Logical devices for safe AS-i
slaves (→ S. 205))!
A logical device with a defined AS-i address must only be added to a safety project once.

>

Add logical device to the project tree


43364

Safe AS-i slaves are added to a standard area of device tree into the CODESYS project via the nodes
[SF_ASi_Master_1] and [SF_ASi_Master_2]:

• Safe AS-i slaves connected to AS-i Master 1:

• Safe AS-i slaves connected to AS-i Master 2:

To add a safe AS-i input or output slave to the project:


Requirements:
> Safe AS-i slave is correctly installed and addressed.
> AS-i network is projected.
1 Select AS-i network
► In standard area of device tree: Mark safety nodes of the AS-i network in which the safe AS-i slave is installed:
– for AS-i 1: [ASi_Master_1] > [SF_ASi_Master_1]
– for AS-i 2: [ASi_Master_2] > [SF_ASi_Master_2]

26
SmartPLC SafeLine AC4S with fieldbus interfaces

2 Select logical device


► Select [Project] > [Add Device...].
> A dialogue window appears.

► Set the following values in the area [Device]:


1. [Vendor]: ifm electronic
2. Table: Select the required logical device (→ Remark at the end of the chapter)
3. [Name]: Enter unique name for the logical device
► Apply the set values with [Add Device].
> CODESYS adds the logical device to the following positions of the device tree:
– in the standard area as sub-element of the safety node of the selected AS-i network

– in the safety extension area as sub-element of the node [Logical I/Os]

► Close the dialoge window with [Close].


3 Assign AS-i address
► In standard area of device tree:
Double click on the added logical device
> Editor window shows the tab with configuration options of the logical device.
► Select tab [Safe ASi IO Configuration].
> Table shows parameters of the logical device.
► Enter the address of the safe AS-i slave in column [Value].
> Logical device is coupled to the safe AS-i slave.
> Symbol in the device tree shows assigned AS-i address.
4 Optional: Add more logical devices
► Repeat steps 1 to 3 to add additional logical devices to device tree.

27
SmartPLC SafeLine AC4S with fieldbus interfaces

Remarks about the configuration of the logical device: →Configure logical device (→ S. 29)
Remarks about removal of the logical device: →Remove safe AS-i slave from project (→ S. 31)

28
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Configure logical device


43277

Configuration is made via the node [Logical I/Os] in the safety extension area of the device tree. All
safe AS-i slaves inserted in the project are listed there as sub-nodes.
To configure the logical device of a safe AS-i slave:
► In the safety extension area of the device tree:
Double click on the symbol of the logical device at [Safety Logic] > [SafetyApp] > [Logical I/Os]
> Editor window shows following options:

Tab Description
[Safe configuration] Parameter interface of the logical device
(→Set the parameters of the logical device (→ S. 29))
[I/O mapping] Variable image for access from safety application
(→ Map safe process signal to variable (→ S. 30))
[Information] Information about the safe AS-i slave (→ Online help (CODESYS Safety)

>

Set the parameters of the logical device


43037

The [Safe configuration] tab enables access to the parameter interface of the logical device. Number
and type of available parameters depend on the selected logical device.

Improperly set parameters can lead to undesired behaviour of the system.


► Familiarise yourself with parameters of the logical device before the configuration
(→ Logical devices for safe AS-i slaves (→ S. 205))!

All time indications have an inaccuracy of +/- 1 PLC cycle time. The user can freely set the
cycle time of the device-internal fail-safe PLC within the defined limits.
► Note the set PLC cycle time for dimensioning the following parameters.
▪ Stabilising time (StabilisingTime)
▪ Synchronisation time (SynchronisingTime)
▪ Tolerance time (ToleranceTime)

To configure the logical preprocessing of the logical device:


> Select the tab [Safe configuration] in the device editor.
> Editor window shows table with available parameters of the logical device.
► Enter the required parameter values for all displayed parameters in column [Value].
> Entered values are applied.

29
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Map safe process signal to variable


43111

The logical device generates a safe process signal. To be able to use this signal in the safety
application it has to be mapped to a variable.
To map the created process signal of a logical device to a safe variable:
► Select the tab [I/O mapping] in the device editor.
> Editor window shows table with mapping settings.
► Enter the name of the variable in the variable field of bit 0 to which the safe process signal is to be mapped.
> CODESYS uses the entered designation to create a global variable of type SAFEBOOL.
> Safety application can access the safe process signal via the variable.

The created variable is stored in the global variable list (GVL) IoConfigRemote_Globals.
► Always choose an unambiguous name for the variable.

30
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.3.3 Remove safe AS-i slave from project


43062

To completely remove a safe AS-i slave from the project the 2 instances of the logical device must be
deleted separately in the project tree.
1 Remove logical device from the standard area
► Mark logical device in standard area of device tree.
► Select [Edit] > [Delete].
> CODESYS removes the logical device from the standard area.
2 Remove logical device from the safety area
► Mark logical device in the safety extension area of the device tree.
► Select [Edit] > [Delete].
> CODESYS removes the logical device from the safety extension area.

31
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.4 Configure safe devices at local I/O interface


Content
Remarks .................................................................................................................................................32
Add safe local device to project ............................................................................................................34
Create test signal at local output ............................................................................................................39
Remove safe local device from project ..................................................................................................39
43273

The safe inputs and outputs are configured via the "Device editor for logical I/Os" of
CODESYS safety. In the following sections only the AC4S-specific functions are described.
► Familiarise yourself with the following CODESYS functions!
▪ Device editor for logical I/Os
→ Online help > Add-Ons > CODESYS Safety > Editors > Device editor for logical
I/Os

>

6.4.1 Remarks
43071
>

Concept of the logical devices


43263

Safe devices at the local I/O interface are inserted in a CODESYS project via logical devices.
Depending on the type of the safe device the logical devices fulfil different functions.
>

Safe devices at local inputs


43084

Mapped to the classical IPO behaviour of a programmable logic controller the logical device assumes
the functions of signal detection and signal processing. The individual functions are:
• detect the signals generated by the safe devices
• pre-process the signals by means of the internal logic
• provide the result of the logical preprocessing as safe variable value

The programmer can configure the logical preprocessing via the parameter interface of the logical
device.
>

Safe devices at local outputs


43059

Safe devices at the local outputs can be controlled via logical devices. The logical device fulfils the
following functions:
• create a safe signal
• provide the safe signal at the selected output channels at the local I/O interface

32
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Available logical devices for safe inputs/outputs


43268

Following logical devices are available for safe devices at the local I/O interface:

Designation I/O type Reference


SF_IN_local_forced Input →SF_IN_local_forced (→ S. 236)
SF_IN_local_independent Input →SF_IN_local_independent (→ S. 240)
SF_IN_local_conditionally_dependent Input →SF_IN_local_conditionally_dependent (→ S. 244)
SF_IN_local_dependent Input →SF_IN_local_dependent (→ S. 248)
SF_IN_local_dependent_filter_testreq Input →SF_IN_local_dependent_filter_testreq (→ S. 252)
SF_IN_local_dependent_filter_ntestreq Input →SF_IN_local_dependent_filter_ntestreq (→ S. 256)
SF_IN_local_dependent_filter_nshutdown Input →SF_IN_local_dependent_filter_nshutdown (→ S. 260)
SF_OUT_local_single Output →SF_OUT_local_single (→ S. 264)
SF_OUT_local_dual Output →SF_OUT_local_dual (→ S. 265)
SF_OUT_local_testpulse Output →SF_OUT_local_testpulse (→ S. 266)

Detailed information about the logical devices:


→Remarks about logical devices (→ S. 201)

33
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.4.2 Add safe local device to project


43267

Safe devices at the local I/O interface are added to a CODESYS project in 2 steps:
1. Add logical device to the project tree:
→Add logical device to the project tree (→ S. 35)
2. Configure logical device:
→Configure logical device (→ S. 37)

The user is responsible for the selection of the suitable logical devices. The user must ensure
that the selected logical devices provide the functionality required for the safety application to
be implemented.
► Observe the documentation of the logical devices (→Logical devices for the local I/O
interface (→ S. 235))!
A logical device with defined input channels and/or output channels must only be added to a
safety project once.

34
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Add logical device to the project tree


43363

Safe devices at the local I/O interface are added to the project in standard area of device tree via the
node [local_IO_]:

The user is responsible for selecting the suitable logical devices. The user must ensure that
the selected logical devices provide the functionality required for the safety application to be
implemented.
► Observe the documentation of the logical devices (→Logical devices for the local I/O
interface (→ S. 235))!
A logical device of a type with 2 defined input channels (Input_Channel_A, Input_Channel_B)
must only be added to a safety project once.

Requirement:
> Devices are connected to the local I/O interface according to the required safety classification.
1 Add logical device
► In standard area of device tree: Select node [local_IO_]:

► Select [Project] > [Add Device...]


> Dialogue window appears:

35
SmartPLC SafeLine AC4S with fieldbus interfaces

► Set the following parameters in group [Device]:


1. [Vendor]: Select ifm electronic.
2. Table: Mark the required logical device (→ Remark at the end of the chapter).
3. [Name]: Enter unambiguous instance name.
► Apply the set values with [Add Device].
> CODESYS adds instances of the logical device to the following positions of the device tree:
– in the standard area as sub-element of the node [local_IO_]

– in the safety extension area as sub-element of the node [Logical I/Os]

► Close the dialogue window with [Close].


2 Assign input and/or output channels
► In standard area of device tree:
Double click on the added logical device.
> Editor window shows configuration options of the logical device.
► Select tab [Safe Local IO Configuration].
> Table shows the following parameters in dependence on the selected logical device:
Interface type Parameter Description
Input (2 channels) Input_Channel_A Local input which is connected to sensor channel A
Input_Channel_B Local input which is connected to sensor channel B
Output (1 channel) Output_Channel Local output which is connected to the actuator or at which the test
signal is to be provided.
Output (2 channels) Output_Channel_A Local output which is connected to actuator channel A.
Output_Channel_B Local output which is connected to actuator channel B.

► Enter the required value for each parameter in column [Value].


> Logical device is coupled with the set input and/or output channels.
> Symbol in the device tree shows assigned I/O channels.
3 Optional: Add more logical devices
► Repeat steps 1 to 2 to add additional logical devices to device tree.

Remarks about the configuration of the logical devices →Configure safe devices at local I/O
interface (→ S. 32)
Remarks about removal of the logical device: →Remove safe local device from project (→ S. 39)

36
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Configure logical device


43274

Configuration is made via the node [Logical I/Os] in the safety extension area of the device tree. All
safe local devices added to the project are listed there as sub-node.
To configure the logical device of a safe sensor at a local input channel:
► In the safety extension area of the device tree:
Double click on the symbol of the logical device at [Safety Logic] > [SafetyApp] > [Logical I/Os]
> Editor window shows following options:

Tab Description / Reference


[Safe configuration] Parameter interface of the logical device
(→Set the parameters of the logical device (→ S. 37))
[I/O mapping] Variable image for access from safety application
(→ Map safe process signal to variable (→ S. 38))
[Information] Information about the safe peripheral (→ CODESYS help)

>

Set the parameters of the logical device


43036

The [Safe configuration] tab enables access to the parameter interface of the logical device. Number
and type of available parameters depend on the selected logical device.

Incorrectly set parameters can lead to undesired behaviour of the system.


► Familiarise yourself with parameters of the logical device before the configuration
(→ Logical devices for the local I/O interface (→ S. 235))!

All time indications have an inaccuracy of +/- 1 PLC cycle time. The user can freely set the
cycle time of the device-internal fail-safe PLC within the defined limits.
► Note the set PLC cycle time for dimensioning the following parameters.
▪ Stabilising time (StabilisingTime)
▪ Synchronisation time (SynchronisingTime)
▪ Tolerance time (ToleranceTime)

To configure the logical device:


► Select the [Safe configuration] tab in the device editor.
> The editor window shows a table with available parameters of the logical device.
► Enter the required values for all displayed parameters in [Value] column.
> Entered values are applied.

37
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Map safe process signal to variable


43110

The logical device generates a safe process signal. To be able to use this signal in the safety
application it has to be mapped to a variable.
To map the created process signal of a logical device to a safe variable:
► Select the tab [I/O mapping] in the device editor.
> Editor window shows table with mapping settings.
► Enter the name of the variable in the variable field of bit 0 to which the safe process signal is to be mapped.
> CODESYS uses the entered designation to create a global variable of type SAFEBOOL.
> Safety application can access the safe process signal via the variable.

The created variable is stored in the global variable list (GVL) IoConfigRemote_Globals.
► Always choose an unambiguous name for the variable.

38
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.4.3 Create test signal at local output


43244

Certain device types require an input signal as test pulse to detect a cross fault of the two input
channels. By means of the logical device SF_OUT_local_testpulse the programmer can create a test
signal at a local output.
To create a test signal at a local output:
► Add logical device "SF_OUT_loal_testpulse" to the project tree
(→ Add logical device to the project tree (→ S. 35)
The parameters of the test pulse are firmly set; there are no additional configuration options
(→ SF_OUT_local_testpulse (→ S. 266)).
>

6.4.4 Remove safe local device from project


43061

To completely remove a safe device added to the local I/O interface the 2 instances of the logical
device must be deleted separately from the project tree.
1 Remove logical device from the standard area
► Mark logical device in standard area of device tree.
► Select [Edit] > [Delete].
> CODESYS removes the logical device from the standard area.
2 Remove logical device from the safety area
► Mark logical device in the safety extension area of the device tree.
► Select [Edit] > [Delete].
> CODESYS removes the logical device from the safety extension area.

39
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.5 Configure standard devices at local I/O interface


43249

Standard devices are added without logical device to the CODESYS project. When the device has
been properly connected to the local I/O interface, the programmer can access the process data
directly from the safe application via function blocks.

Access to non-safe inputs and outputs of the local I/O interface is made only via the fail-safe
PLC of AC4S.
• To access the input/output data of the non-safe devices at the local I/O interface:
→Local I/O interface: Access non-safe inputs/outputs (→ S. 78)
• To transfer process data between Standard PLC and fail-safe PLC of AC4S:
→Data exchange between standard PLC and fail-safe PLC (→ S. 82)

>

6.6 Change IP settings


43400

► Familiarise yourself with the following CODESYS functions!


• Ethernet adapter configurator
→ Online help > Fieldbus support > Ethernet adapter configurator
The Ethernet configuration interfaces 1 (X3) and 2 (X8) must not be participants of the same
EtherNet subnet. Non-compliance may result in connection problems between the CODESYS
programming system and the device.
► Configure IP settings so that interfaces X3 and X8 are part of different Ethernet subnets.

To change the IP settings of the Ethernet configuration interfaces 1 (X3) and 2 (X8):
1 Select Ethernet interface
► In the device tree: Double click on the requested Ethernet interface (X3 or X8)
> The editor window shows the Ethernet device editor.
2 Change IP settings
► Change IP settings of the Ethernet interface.
> Save the project to apply changes.

40
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.7 Add additional device to the project


43361

It is possible to manage several AC4S within one CODESYS project.


To add another device to a CODESYS project:
Requirements:
> CODESYS project was correctly created (→Create new project with AC4S (→ S. 16)).
1 Add device
► Right-click on [MyProject]
> Context menu appears.
► Select [Add device...]
> Window [Add Device] appears:

► Set the following values:


1. [Vendor]: Select [ifm electronic].
2: [Device]: Select [ifm SmartPLC SafeLine] from the list.
3. [Name]: Enter unique name for the device.
► Click on [Add Device] to add the device to the project.
► Click on [Close] to close the window.
> CODESYS adds device to the device tree.
2 Configure the device
► Configure the device as requested (→System configuration (→ S. 22)).
3 Save project
► Select [File] > [Save Project].
> CODESYS saves the project.

41
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.8 Extend fieldbus functionality


Content
Available fieldbus stacks ........................................................................................................................42
Use EtherCAT master ............................................................................................................................43
Add fieldbus stack ..................................................................................................................................46
43399
>

6.8.1 Available fieldbus stacks


43401

Besides the fieldbus functionality defined in the hardware the device can be operated as fieldbus
device by a software extension. In this respect the user has to assign a fieldbus stack to the Ethernet
configuration interfaces 1 (X3) or 2 (X8) in CODESYS and configure it. The device supports the
following fieldbus stacks:

Description Fieldbus Further information


EtherCAT master EtherCAT →Use EtherCAT master (→ S. 43)
Ethernet/IP scanner EtherNet/IP
Modbus TCP master Modbus TCP →Add fieldbus stack (→ S. 46)
Modbus TCP slave device Modbus TCP

42
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.8.2 Use EtherCAT master


Content
Add EtherCAT master ............................................................................................................................43
Configure EtherCAT master ...................................................................................................................44
Add and configure EtherCAT slave ........................................................................................................45
43415

The device can also be operated as EtherCAT master. In this respect ifm electronic provides an
EtherCAT master stack for the CODESYS programming system 3.5. The user has to assign one of the
two Ethernet configuration interfaces (X3 or X8) to the EtherCAT master.
>

Add EtherCAT master


43395

Only one EtherCAT master can be used per device.

To add the EtherCAT master stack to the project:


Requirements:
► Open or create project with AC4S.
1 Add EtherCAT master stack
► In the device tree: Right-click on [<CODESYS _Root>]
► In the context menu: select [Add device...]
> Window [Add Device] appears.
► Set the following values:
1. [Vendor]: Select [ifm electronic].
2. In table: Select [EtherCAT Master].
► Click on [Add Device] to add the selected device to the project.
► Click on [Close] to close the window.
> CODESYS adds EtherCAT master to the device tree.

CODESYS automatically adds an EtherCAT master call to the task with the shortest cycle
time.
For notes on the configuration of task processing: →Configure task processing (→ S. 69)

43
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Configure EtherCAT master


43402

► Familiarise yourself with the following CODESYS functions!


▪ EtherCAT master
→ Online help > Fieldbus support > EtherCAT configurator > EtherCAT master

The user has to assign the Ethernet configuration interface 1 (X3) or 2 (X8) to the added EtherCAT
master.
1 Requirements
> CODESYS laptop/PC is correctly connected to the device.
> Network path of Standard PLC is set (→Configure programming interface (→ S. 20)).
2 Assign Ethernet interface
► In the device tree: Double-click on [EtherCAT_Master (EtherCAT Master)]
► Click on the [General] tab.
> The editor window shows the configuration options of the EtherCAT master.
► Click on [Browse...]
> Window [Select Network Adapter] appears.
► Select requested Ethernet interface (eth0 = X3 or eth1 = X8).
► Click on [OK] to apply the selected Ethernet interface.
> Field [Source Address (MAC)] shows the MAC address of the selected Ethernet interface.
> Field [Network Name] shows the name of the Ethernet interface.
> EtherCAT master is coupled with selected Ethernet interface.
3 Configure EtherCAT master
► Set the parameters of the EtherCAT master as requested.
> EtherCAT master is configured.

Continue with: →Add and configure EtherCAT slave (→ S. 45)

44
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Add and configure EtherCAT slave


43394

► Familiarise yourself with the following CODESYS functions!


▪ EtherCAT slave
→ Online help > Fieldbus support > EtherCAT configurator > EtherCAT slave

To configure EtherCAT slaves for the operation with the EtherCAT master of the AC4S:
Requirements:
> EtherCAT master is added to the project and configured (→Add EtherCAT master (→ S. 43)).
> Device description file of the EtherCAT slave has been downloaded (→ manufacturer's website).
1 Optional: Add EtherCAT slave to the device repository
► Select [Tools] > [Device Repository...]
> Window [Device Repository] appears.
► Click on [Install...].
> Window [Install Device Description] appears.
► Select the device description of the EtherCAT slaves and click on [Open].
> CODESYS installs the device in the device repository.
2 Add EtherCAT slave
► In standard area of device tree: Right-click on [EtherCAT_Master (EtherCAT Master)]
► In the context menu: Select [Add device...]
> Window [Add Device] appears.
► Select the requested EtherCAT slave in the [Device] area.
► Click on [Add Device] to add the selected device to the project.
► Click on [Close] to close the window.
> CODESYS adds the EtherCAT slave to the project.
3 Configure EtherCAT slave
► In standard area of device tree: Double click on the added EtherCAT slave.
> The editor window shows the configuration options of the device.
► Configure EtherCAT slave as requested.

45
SmartPLC SafeLine AC4S with fieldbus interfaces

>

6.8.3 Add fieldbus stack


43392

► Familiarise yourself with the following CODESYS functions!


▪ Modbus configurator
→ Online help > Fieldbus support > Modbus configurator

To declare the Ethernet interface as a fieldbus interface:


1 Create/load CODESYS project
► Create or load CODESYS project with the AC4S.
2 Add fieldbus stack
► In the device tree: Right-click on [X3 (Ethernet)] or [X8 (Ethernet)].
► In the context menu: Select [Add device...].
> Window [Add Device] appears.
► Set the following values:
1. [Vendor]: Select [<All vendors>].
2. In table: Select the requested fieldbus stack in the [Name] column.
3. [Name]: Enter name of the fieldbus stack.
► Click on [Add Device] to add the requested fieldbus stack to the project.
> In the device tree: CODESYS adds the selected fieldbus stack as sub-element of the Ethernet interface.
3 Configure the fieldbus stack
► Configure added fieldbus device.
► Save the project to apply changes.

46
SmartPLC SafeLine AC4S with fieldbus interfaces

7 Programming
Content
Objects of a Standard-SPS application ..................................................................................................47
Create Standard-SPS application ..........................................................................................................48
Access standard input and output data ..................................................................................................50
Use functions of the ifm package ...........................................................................................................57
Use visualisations ...................................................................................................................................63
Cross communication .............................................................................................................................67
Configure task processing ......................................................................................................................69
42518

This chapter provides information about the programming of the Standard PLC of the device.

► Familiarise yourself with the programming according to the standard IEC 61131-3!

>

7.1 Objects of a Standard PLC application


43100

All objects of a Standard PLC application are listed as subelements of the node [Application] in the
standard area of device tree. In the basic configuration a Standard PLC application contains the
following objects:

[Application] is the container of the Standard PLC application

[SafetyApp_Mapping] is a helper application for the data exchange between Standard PLC and the fail-safe PLC
→Set interval of the data exchange (→ S. 85)
[Bibliotheksverwalter] provides access to the standard and device-specific function libraries

[DataFromSafe] and [DataToSafe] are global variable lists for the data exchange between the Standard PLC and the
fail-safe PLC.
→Data exchange between standard PLC and fail-safe PLC (→ S. 82)
[PLC_PRG (PRG)] provides access to the program editor of the standard application
→Create standard PLC application (→ S. 48)
[Taskkonfiguration] provides access to the settings of the task processing
→Configure main task (→ S. 69)

>

47
SmartPLC SafeLine AC4S with fieldbus interfaces

7.2 Create Standard PLC application


42488

► Familiarise yourself with the following CODESYS functions!


▪ Program application
→ Online help > CODESYS Development System > Program application
▪ Programming reference
→ Online help > CODESYS Development System > Reference programming

To create a Standard PLC application:


► In standard area of device tree: Double-click on [PLC_PRG (PRG)]
> The editor window shows the programming surface:

► Program the application in the editor.

48
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.2.1 Use remanent variables


42556

The Standard PLC of the device supports the use of remanent variables. Variables declared as 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 Standard PLC
application is reset (→Supported reset variants (→ S. 112)).

The memory area for RETAIN variables comprises 4072 bytes.


► Pay attention to the maximum size of the RETAIN memory area when declaring RETAIN
variables!

>

7.2.2 Supported programming languages


42571

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
Legend:
X ... is supported
– ... is not supported

>

7.2.3 Change system time of the device


42484

WARNING!
The use of the CODESYS function SysTimeRtcSet for setting the time may lead to
malfunction.
> Risk of undesired system behaviour
► To set the system time (date, time) of the device only use the following device-specific
commands:
▪ Function block Set_DateTime (→Set_TimeDate (→ S. 168)
▪ System command 0x1109 with function block ACnnnn_SysCmd
(→ACnnnn_SysCmd (→ S. 179))

49
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.3 Access standard input and output data


Content
Options to access input and output data ................................................................................................50
Validity of the interface data ...................................................................................................................51
Process data of the AS-i slaves .............................................................................................................52
Fieldbus data ..........................................................................................................................................54
Process data of the non-safe local devices ............................................................................................56
43362

► Familiarise yourself with the following CODESYS functions!


▪ Addresses according to IEC standard 61131-3:
→ Online help > CODESYS Development System > Programming Reference >
Operanden > Addresses
▪ Access to IEC address via AT declaration:
→ Online help > CODESYS Development System > Programming Reference >
Declaration > AT Declaration
▪ Definition of an ALIAS for an IEC address:
→ Online help > CODESYS Development System > Programming Reference > Data
Types > References
▪ Coupling of a program variable to an address (mapping):
→ Online help > CODESYS Development System > Configuring I/O Links

>

7.3.1 Options to access input and output data


43142

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 Standard PLC
application and thereby to access the input and outputs data of the device:
• Direct access to IEC address
• Access to IEC address via AT declaration
• Definition of an ALIAS for an IEC address
• Link a program variable to an IEC address (mapping)

The IEC addresses (%I, %Q) of the inputs and outputs change if additional safe AS-i slaves
are inserted in the CODESYS project.
► Always use symbolic programming for access to the inputs and outputs.

50
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.3.2 Validity of the interface data


42554

In order to facilitate the access to inputs and outputs of AS-i slaves, AC4S projects offer clearly
defined interfaces in the device tree (→Overview: Project structure with AC4S (→ S. 17)).
Depending on the active instance for accessing the outputs of the AS-i slaves (Manual, Gateway,
PLC), the CODESYS data mapper only updates certain address areas of the interfaces. The following
table shows which address areas of the i/o interfaces provide valid data values while in a certain
operating mode:

Output control I/O interfaces Updated address areas / channels


Manual [ASi_Master_1] AS-i 1 Input (%IB, %IW)
[ASi_Master_2]* AS-i 2 Input (%IB, %IW)
[Fieldbus_Interface] ▪ AS-i 1 Output (%IB, %IW)
▪ AS-i 2 Output (%IB, %IW)
Gateway [ASi_Master_1] ASi 1 Input (%IB, %IW)
[ASi_Master_2]* AS-i 2 Input (%IB, %IW)
[Fieldbus_Interface] ▪ AS-i 1 Output (%IB, %IW)
▪ AS-i 2 Output (%IB, %IW)
PLC [ASi_Master_1] ▪ AS-i 1 Input (%IB, %IW)
▪ AS-i 1 Output (%QB, %QW)
[ASi_Master_2]* ▪ AS-i 2 Input (%IB, %IW)
▪ AS-i 2 Output (%QB, %QW)
[Fieldbus_Interface] ▪ AS-i 1 Output (%IB, %IW)
▪ AS-i 2 Output (%IB, %IW)
* ... only available for devices with 2 AS-i masters

► When linking variables with inputs and outputs, only use interfaces in the project tree, that
are updated by the CODESYS data mapper!

51
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.3.3 Process data of the AS-i slaves


42517

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: →Digital input and output data (→ S. 53)

Analogue input and output data of the slaves at AS-i Master 1: →Analogue input and output data
(→ S. 53)
Digital input and output data of the slave at AS-i Master 2: →Digital input and output data (→ S. 53)

Analogue input and output data of the slaves at AS-i Master 2: →Analogue input and output data
(→ S. 53)

Consider validity of the interface data (→Validity of the interface data (→ S. 51))!

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) (→ S. 175))

52
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Digital input and output data


42438

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


► In the device tree: Double click on [ASi_1_binaryIO]
> The 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]

>

Analogue input and output data


42499

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]

53
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.3.4 Fieldbus data


42399

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.


→Input and output data of the fieldbus interface (→ S. 54)
Output data of the AS-i slaves at AS-i Master 1 and AS-i Master 2 that is transmitted by the higher-level fieldbus
PLC.
→Outputs data of the AS-i slaves (→ S. 54)

Consider validity of the interface data (→Validity of the interface data (→ S. 51))!

>

Input and output data of the fieldbus interface


42601

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.


>

Outputs data of the AS-i slaves


42540

The area contains all data, the higher-level Fieldbus controller cyclically sends to the outputs of the
AS-i slaves via the fieldbus network. The data is structure like an AS-i network. The programmer can
access this data with symbols (recommended) or via IEC addresses.

If the output access of the device is set to "PLC", the programmer can use the data bundled in
this area to process the target values sent by the higher-level fieldbus controller to the
CODESYS Standard PLC.

54
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Digital output data


42440

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_binaryIO]
> 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_binaryIO]

>

Analogue output data


42502

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]

55
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.3.5 Process data of the non-safe local devices


43003

Access to non-safe inputs and outputs of the local I/O interface is made only via the fail-safe PLC of
AC4S.
• To access the input/output data of the non-safe devices at the local I/O interface:
→Local I/O interface: Access non-safe inputs/outputs (→ S. 78)
• To transfer process data between Standard PLC and fail-safe PLC of AC4S:
→Data exchange between standard PLC and fail-safe PLC (→ S. 82)

The process data of the non-safe inputs and outputs of the local I/O interface are not
automatically updated on node [local_IO_].

56
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.4 Use functions of the ifm package


42559

The CODESYS package "CODESYS für ifm SmartPLC SafeLine" offers different functions for the
programming of the device-internal CODESYS controller. In the following sections, these functions will
be briefly described. To make orientation easier, the functions are grouped according to corresponding
subjects and provided with a cross-reference to a detailed explanation in the document's appendix.
>

7.4.1 Control interface of the ifm function blocks


42493

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


42400

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 Start FB execution
 TRUE
else no affection
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

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

57
SmartPLC SafeLine AC4S with fieldbus interfaces

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.

>

FB with cyclic execution


42401

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

>

7.4.2 Configure system


42492

To configure the system of the device, use the following function blocks:
Name Description Reference
QuickSetupASi_Master Execute quick setup routine on an AS-i master → QuickSetupASi_Master (→ S. 166)
Set_TimeDate Set system time (date, time) of the system → Set_TimeDate (→ S. 168)
Get_FieldbusInfo Read fieldbus type, the status of the field bus connection → Get_FieldbusInfo (→ S. 164)
and the parameters of the fieldbus interface

>

58
SmartPLC SafeLine AC4S with fieldbus interfaces

7.4.3 Configure AS-i master


42481

To configure the AS-i masters of the device, use the following function blocks:
Name Description Reference
Set_Mode Set operating mode of the AS-i master (projecting mode → Set_Mode (→ S. 150)
or protected operation)
Set_ASi_Config Set diagnostic functions of the AS-i master (double → Set_ASi_Config (→ S. 146)
address recognition, earth fault detection)
Set_AdressMode Set automatic addressing of the AS-i master → Set_AddressMode (→ S. 145)

>

7.4.4 Configure AS-i slaves


42480

To configure the AS-i slaves, that are connected to the device, use the following function blocks:
Name Description Reference
Set_SlaveAddress Change address of an AS-i slave → Set_SlaveAddress (→ S. 155)
Set_SlaveParameter Change I/O configuration and ID codes (IO, ID, ID1, ID2) → Set_SlaveParameter (→ S. 159)
of an AS-i slave
Set_SlaveExtendedID1 Extended ID1 of an AS-i slave → Set_SlaveExtendedID1 (→ S. 157)

59
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.4.5 Manage AS-i network


42636

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

Use complex variables


42558

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:
Name Description Reference
ASI_NET The complex variable contains the complete process →ASI_NET (STRUCT) (→ S. 175)
image (inputs and outputs) of an AS-i network.
ASI_DATA The complex variable contains the following components: →ASI_DATA (STRUCT) (→ S. 173)
▪ Slave lists (LPS, LDS, LAS, LPF, LCE, LCEMS, →Get_ASi_Data (→ S. 161)
LCEAS, LDAE)
▪ Parameter images (PI, PP)
▪ Configuration data of the AS-i slaves (CDI, PCD)

>

Change network settings


42482

Name Description Reference


Set_ProjectAll Execute projection adaptation on one AS-i master → Set_ProjectAll (→ S. 154)
Set_LPS Change list of the projected slaves (LDS) → Set_LPS (→ S. 148)
Set_PCD Change permanent projecting data (IO, ID, ID1, ID2) of → Set_PCD (→ S. 152)
all slaves on the AS-i master

>

Read network settings


42513

To read the network settings cyclically and offer them in the application:
Name Description Reference
Get_ASi_Data Read the following datasets for network management in → Get_ASi_Data (→ S. 161)
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)

60
SmartPLC SafeLine AC4S with fieldbus interfaces

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

Read parameter images


42514

Name Description Reference


Get_InputParameter Read parameters of the inputs of the slaves at the AS-i → Get_InputParameter (→ S. 141)
master (PI)
Get_OutputParameter Read parameters of the outputs of the slaves on the → Get_OutputParameter (→ S. 143)
AS-i master (PP)

>

read slave lists


42515

Name Description Reference


Get_LPS Read list of projected slaves (LPS) → Get_LPS (→ S. 125)
Get_LDS Read list of detected slaves (LDS) → Get_LDS (→ S. 123)
Get_LAS Read list of activated slaves (LAS) → Get_LAS (→ S. 121)
Get_LPF Read list of peripheral faults (LPF) → Get_LPF (→ S. 135)
Get_LCE Read list of configuration errors (LCE) → Get_LCE (→ S. 127)
Get_LCEMS List of configuration errors - read missing slaves → Get_LCEMS (→ S. 131)
(LCEMS)
Get_LCEAS Read of the configuration errors - read additional slave → Get_LCEAS (→ S. 129)
(LCEAS)
Get_LDAE Read list of double address errors (LDAE) → Get_LDAE (→ S. 133)

>

Read configuration data of the slaves


42516

Name Description Reference


Get_CDI Read configuration data image (IO, ID, ID1, ID2) of all → Get_CDI (→ S. 137)
slaves on the AS-i master
Get_PCD Read permanent configuration data of all slaves (IO, ID, → Get_PCD (→ S. 139)
ID1, ID2) on the AS-i master

>

Read status of the voltage supply


42520

Name Description Reference


Get_ASi_PHY_Dat Determine voltage supply status of the AS-i network → Get_ASi_PHY_Dat (→ S. 119)

61
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.4.6 Send commands to the system and the AS-i master


42522

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 (→ S. 179)).
• System command overview: →Table: System commands (→ S. 180)
• Overview AS-i master commands: →Table: AS-i master commands (→ S. 181)

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


► Highlight the required 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 required command.

62
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.5 Use visualisations


Content
Supported visualisation types .................................................................................................................63
Add visualisation to a project ..................................................................................................................64
Create a visualisation .............................................................................................................................65
Configure visualisation ...........................................................................................................................66
42553

► Familiarise yourself with the following CODESYS functions!


▪ Visualisations in CODESYS
→ Online help > CODESYS visualisation

>

7.5.1 Supported visualisation types


43027

The device supports the following CODESYS visualisation types:


• Web visualisation (WebVisu)
A WebVisu allows graphic representation of selected process and control data in a web browser
by means of an application-specific visualisation.

63
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.5.2 Add visualisation to a project


43266

To add a visualisation to a CODESYS project:


► open CODESYS project.
OR:
Create new CODESYS project. (→Create new project with AC4S (→ S. 16)
► In standard area of device tree: Select [Application].
► Select [Project] > [Add Object] > [Visualization...].
> Window [Add Visualization] appears.
► Enter a name for the visualisation in the field [Name] and click on [Add] to apply it.
> CODESYS adds the following elements to the standard area of device tree:

[VISU_TASK]: Set the visualisation task properties: →Set parameters for visualisation task (→ S. 69)

[Visualization Manager]: Set properties of the visualisations: →Change properties of the web
visualisation (→ S. 66)
[MyVisu]: Area for the creation of the visualisation objects: →Create a visualisation (→ S. 65)

64
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.5.3 Create a visualisation


42487

Create a seperate visualisation object for each target and web visualisation.

To create a visualisation for a Standard PLC application:


► In the standard area of device tree: double-click on [MyVisu]
> The visualisation editor with a tool box appears:

► Create the visualisation using the tools.


► Save the project to apply changes.

65
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.5.4 Configure visualisation


43248

To configure the characteristics of the created visualisation select one of the following options:
• Change properties of the web visualisation (→ S. 66)
>

Change properties of the web visualisation


42485

To change the attributes of the web visualisation:


► In standard area of device tree: Double click on [Web-Visualisierung]
> The 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 for HTML file (→ Note at the end of the chapter).
3. Area [Scaling options]: Enter fixed width and height as shown.
► Save the project to apply changes.

In the field [Name of .htm file] enter the name by which the web visualisation is to be accessible in the web
browser (→Display web visualisation (→ S. 115)).
► Use only lower case when entering the name!

66
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.6 Cross communication


Content
Use network variables ............................................................................................................................68
43246

► Familiarise yourself with the following CODESYS functions!


▪ → Online help > CODESYS Development System > Exchange data in the network >
Network variables

The device supports the CODESYS function "network variables". The user can use it to transmit data
between the Standard PLCs of a project.
Network variables are transmitted according to the broadcast principle. A transmitter can send data to
several receivers.

67
SmartPLC SafeLine AC4S with fieldbus interfaces

>

7.6.1 Use network variables


43006

► Observe the notes on the configuration of the Ethernet configuration interfaces 1 (X3) and
2 (X8). → Change IP settings (→ S. 40)
The network variables must only be transmitted in the subnet of the Ethernet interface via
which the device cross communicates. The programmer must change the broadcast address
of the network variable list accordingly.
Example:
• Ethernet interface: X3
• IP address of the Ethernet interface: 192.168.1.10
• Broadcast address to be set: 192.168.1.255

To create the cross communication between Standard PLCs:


Requirements:
> AC4S 1 and AC4S 2 are participants of the same CODESYS project (→Add additional device to the
project (→ S. 41)).
> The AC4S devices are coupled via the Ethernet network.
1 Set the network variable list of the transmitter
► In the standard area of device tree of the AC4S 1: Select [PLC Logic] > [Application].
► Select [Project] > [Add Object] > [Network Variable List (Sender)...]
> Dialogue window appears.
► Set the following parameters as requested
1. [Name]: Unique name of the variable list
2. [Network type]: UDP
3. [Settings...]: Broadcast address
4. [Task]: Requested task
► Click on [Add] to apply the selected values.
> CODESYS creates the network variable list of the transmitter.
> The network variable list appears in the device tree as sub-node of the standard application.
2 Declare network variables
► In standard area of device tree: Double click on the network variable list of the transmitter
> The editor window shows the variable declaration.
► Declare network variables.
3 Create network variable list of the receiver
► In the standard area of device tree of the AC4S 2: select [PLC Logic] > [Application].
► Select [Project] > [Add Object] > [Network Variable List (Receiver)...]
> Dialogue window appears.
► Set the following parameters as requested
1. [Name]: Unique name of the variable list
2. [Task]: Requested task
3. [Sender]: variable list of the transmitter
► Click on [Add] to apply the selected values.
> CODESYS creates the network variable list of the receiver.
> The network variable list appears in the device tree as sub-node of the standard application.
4 Optional: Create more receiver lists
► Repeat step 3 to connect additional devices to the variable list of the transmitter.
>

68
SmartPLC SafeLine AC4S with fieldbus interfaces

7.7 Configure task processing


42491

► Familiarise yourself with the following CODESYS functions!


▪ Task configuration
→ Online help > CODESYS Development System > Program application > task
configuration

The processing of the tasks is controlled by parameters. The user can set the parameters for each
task separately
CODESYS automatically creates the following tasks and visualisations during project creation:

Name Description Note


[MainTask] Configuration of the main task (e.g. for main program → Configure main task (→ S. 69)
[PLC_PRG (PRG)])
[VISU_TASK] Configuration of the task for processing visualisation → Set parameters for visualisation
task (→ S. 69)

>

7.7.1 Configure main task


42486

The basic settings of the task characteristics cover the requirements of many applications. In the event
of non-optimum device performance the user must determine and set the optimum task characteristics
himself.
To change parameters of a task:
► In standard area of device tree: Double click on [Task configuration] > [MainTask]
> The editor window shows the configuration of the main task.
► Set the parameters as requested.
> Selected value is applied.
>

7.7.2 Set parameters for visualisation task


42523

► 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 Standard PLC of the fieldbus network.

Each visualisation is executed separately from the program code in a separate task. To set the
properties of the visualisation task:
► In the standard area of device tree: Double-click on [Task configuration] > [VISU_TASK]
> Editor window shows parameters of the visualisation task.
► Set the parameters as required.
► Save the project to apply changes.

69
SmartPLC SafeLine AC4S with fieldbus interfaces

8 Programming of the fail-safe PLC


Content
Objects of a safe application ..................................................................................................................71
Create safe application ...........................................................................................................................72
Use safety functions of the ifm AS-i package .........................................................................................76
Use safety functions of CODESYS ........................................................................................................79
Data exchange between standard PLC and fail-safe PLC .....................................................................82
Safe cross communication .....................................................................................................................86
Safe fieldbus communication..................................................................................................................90
Set process safety time ..........................................................................................................................93
Configure safety task ............................................................................................................................100
43030

This chapter provides information about the programming of the fail-safe PLC of AC4S.

► Familiarise yourself with the following CODESYS functions!


▪ Safe applications
→ Online help > Add-Ons > CODESYS Safety > Device topology > Safety application
▪ Programming reference
→ Online help > Add-Ons > CODESYS Safety > Programming reference
▪ Concepts
→ Online help > Add-Ons > CODESYS Safety > Concepts

70
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.1 Objects of a safe application


43095

All objects of a safe application are listed as sub-elements of the node [SafetyApp] in the safety area
of the device tree. In the basic configuration the safety-relevant application contains the following
objects:

[SafetyApp] is the container for objects of a safe application and provides access to the editor of the safety application
object
→Pin safe project (→ S. 75)
[Library Manager] provides access to the certified safety libraries
→Use safety functions of CODESYS (→ S. 79)
→Use safety functions of the ifm AS-i package (→ S. 76)
[Logical I/Os] contains following objects:

• Logical exchange devices for the data exchange between Standard PLC and fail-safe PLC
→Data exchange between standard PLC and fail-safe PLC (→ S. 82)
• Logical Devices of the inserted safe AS-i slaves
→Configure safe AS-i slaves (→ S. 24)
• Logical devices of the safe devices at local I/O interface
→Configure safe devices at local I/O interface (→ S. 32)
[SafetyPOU] contains the program code of the safe application
→Create safe application (→ S. 72)
[Safety Task] provides access to the configuration options of the safety task
→Configure safety task (→ S. 100)

71
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.2 Create safe application


Content
Supported program organization units (POUs) ......................................................................................73
Available safety libraries .........................................................................................................................73
Supported programming languages .......................................................................................................73
Minimum number of AS-i slaves .............................................................................................................74
Variable declaration with data transfer between standard and safety area ...........................................75
Available memory space ........................................................................................................................75
Pin safe project .......................................................................................................................................75
43247

To create a safe application:


► In the safety extension area of the device tree:
Double click on [SafetyPOU]
> Editor window shows the programming surface (safety FB editor):

72
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.2.1 Supported program organization units (POUs)


42982

The programming code is entered in the POUs (program organization unit). CODESYS Safety
provides 2 POU types for safe programming. They differ in the scope of usable functions.

Usable elements Basic POU Extended POU


General elements Network, assignment, input Network, assignment, input, jump, return
Boolean operators AND, OR AND, OR, XOR, NOT
Other operators – SEL, MUX
Mathematical operators – ADD, SUB, MUL, DIV, EQ, NE LT, LE, GT,
GE
Safety standard functions SF_CTD, SF_CTUD, SF_CTU, SF_TOF, SF_RS, SF_SR, SF_CTD, SF_CTUD,
(safetystandard.lib) SF_TON, SF_TP SF_CTU, SF_TOF, SF_TON, SF_TP,
SF_F_TRIG, SF_R_TRIG
Safety PLCopen functions All All
(safetyplcopen.lib)

For using extended POUs the developer must be a member of the user group
"Safety.ExtendedLevel" (→ Create user account (→ S. 19)).
The use of extended POUs requires a more complex verification process due to the higher
complexity of the program code.
► If possible, only use basic POUs to create a safe application.

The "SafetyPOU" created during the creation of the safety project is of type Basic POU
(→ Objects of a safe application (→ S. 71)).

>

8.2.2 Available safety libraries


43262

To create safe applications the programmer can use the following libraries with certified safety
functions:

Library Description Reference


sf_io.library Device-specific safety function blocks →Use safety functions of the ifm AS-i
package (→ S. 76)
safetystandard.library Safe standard function blocks →SafetyStandard library (→ S. 79)
(bistable function blocks, counters, timers, triggers)
safetyplcopen.library Safety function blocks of PLCopen Safety →SafetyPLCopen library (→ S. 80)
safetyfsoemaster.library Function block for FSoE transmission →SafetyFSoEMaster library (→ S. 81)

>

8.2.3 Supported programming languages


43021

Following table shows which programming languages according to IEC 61131-3 are supported by
certified safety libraries:

73
SmartPLC SafeLine AC4S with fieldbus interfaces

Continuous function chart (CFC)


Sequential function chart (SFC)
Function block diagram (FBD)

Ladder diagram (LD)

Structured text (ST)


Instruction list (IL)
Library
sf_io.library X – – – – –
safetystandard.library X – – – – –
safetyplcopen.library X – – – – –
safetyfsoemaster.library X – – – – –
Legend:
X ... is supported
– ... is not supported

>

8.2.4 Minimum number of AS-i slaves


43101

WARNING!
Altogether 5 AS-i slaves min. have to be installed (standard or safety AS-i slaves) in each of
the AC4S-controlled AS-i network.
> Risk of data loss
► If fewer than 5 AS-i slaves are part of the configuration of an AS-i network, provide the
required number of AS-i slaves via virtual AS-i control slaves without function
(→ SF_OUTcontrol_ASi (→ S. 234)).

74
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.2.5 Variable declaration with data transfer between standard and safety
area
43020

To be able to use the variable value in an application from the other area the variable always has to be
declared as exchange variable. Then the developer can use such a variable directly in the program
code of the standard application or the safe application.

If the developer first of all creates a variable in the declaration part of the POU and then
defines an exchange variable of the same name, CODESYS will generate an error message
during compilation of the application.

Example:
Task:
A non-safe Boolean value from the standard application is to be used in the safe application.
How to proceed:
1. Declare exchange variable of type BOOL in the exchange device [DataFromNonsafe] and update
variable list in [DataToSafe] (→ Use the factory-set replacement variables (→ S. 83)).
2. Assign a value to the variable in the standard application.
3. Use the exchange variable as source for FB or assignment in the safe application.
>

8.2.6 Available memory space


43265

The following memory location is available to the user for programming safe applications on the
fail-safe PLC:
• IEC program code: 384 Kbytes
• IEC data: 128 Kbytes
>

8.2.7 Pin safe project


43087

► Familiarise yourself with the following CODESYS functions!


▪ Pin object
→ Online help > Add-Ons > CODESYS Safety > Pinning

When a safe application has been completed, the project must be pinned. The states of all objects of
the safe application are stored and saved against changes by means of a check sum.

75
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.3 Use safety functions of the ifm AS-i package


Content
Safe AS-i slaves: Reset logical device ...................................................................................................76
Safe AS-i slaves: Provide diagnostic information ...................................................................................77
Safe AS-i slaves: Transmit help signals HSI_1 and HSI_2 to safe AS-i output modules ......................77
Local I/O interface: Reset logical device ................................................................................................77
Local I/O interface: Provide diagnostic information ................................................................................78
Local I/O interface: Access non-safe inputs/outputs ..............................................................................78
PLCopen Safety: Provide diagnostic information ...................................................................................78
43025

ifm electronic provides the library SF_IO.lib. It contains certified function blocks by means of which
the programmer can create safe applications for the fail-safe PLC of AC4S. The library is automatically
loaded by means of the AC4S template during creation of a safety project. The user can access the
elements of the library via the library manager in the safety extension area of the device tree.

To add function blocks from the ifm library sf_io.lib to a network:


► Select network.
► Activate [Ctrl]+[B].
> The window [Input assistant] appears.
► Select the required FB at [SF_IO] and add it to the network with [OK].

>

8.3.1 Safe AS-i slaves: Reset logical device


43081

To reset the logical device of a safe AS-i input slave from the locked error state and to change into the
initialisation state the following function blocks are available:

Function block Description Reference


CtrlASi_InSlave Reset safe AS-i input slave that is in the locked error →CtrlASi_InSlave (→ S. 188)
state
CtrlASi_ResetAllSlaves Reset all safe AS-i slaves of an AS-i network that are in →CtrlASi_ResetAllSlaves (→ S. 193)
the locked error state.

The safe AS-i slave that is to be controlled by means of the FB CtrlASi_InSlave must be
inserted in the device tree.

76
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.3.2 Safe AS-i slaves: Provide diagnostic information


43082

To control the provision of the internal diagnostic information of a logical device the following function
blocks are available:

Function block Description Reference


CtrlASi_InSlave Provide diagnostic information of a safe AS-i input slave →CtrlASi_InSlave (→ S. 188)
CtrlASi_OutSlave Provide diagnostic information of an AS-i control slave for →CtrlASi_OutSlave (→ S. 190)
safe outputs

The safe AS-i slave that is to be controlled by means of the FB must be inserted in the device
tree.

>

8.3.3 Safe AS-i slaves: Transmit help signals HSI_1 and HSI_2 to safe AS-i
output modules
43086

To transmit help signals HSI_1 und HSI_2 to the logical device of a safe AS-i control slave the
following function block is available:

Function block Description Reference


CtrlASi_OutSlave Transmit help signals HS1 and HS2 to AS-i control slave →CtrlASi_OutSlave (→ S. 190)
for safe outputs

The safe AS-i control slave that is to be controlled by means of the FB must be inserted in the
device tree.
A transmission of the two help signals HSI_1 and HSI_2 once started cannot be interrupted.
Remarks about the status of the signal transmission are provided at the FB output DiagCode.

>

8.3.4 Local I/O interface: Reset logical device


43103

To reset a logical device of a safe sensor at the local I/O interface from the locked error state the
following function block is available:

Function block Description Reference


CtrlLocalInputs Reset 2-channel peripheral at the local I/O interface that →CtrlLocalInputs (→ S. 194)
is in the locked error state.

The safe device that is to be controlled by means of the FB must be inserted in the device
tree.

>

77
SmartPLC SafeLine AC4S with fieldbus interfaces

8.3.5 Local I/O interface: Provide diagnostic information


43107

To control the provision of the internal diagnostic information of the logical device of a safe sensor at
the local I/O interface the following function block is available:

Function block Description Reference


CtrlLocalInputs Provide diagnostic information of 2 safe inputs of the →CtrlLocalInputs (→ S. 194)
local I/O interface

The safe device that is to be controlled by means of the FB must be added to the device tree.

>

8.3.6 Local I/O interface: Access non-safe inputs/outputs


43106

To access the non-safe inputs and outputs of the local I/O interface the following function blocks are
available:

Function block Description Reference


GetLocalInput Read process data of a non-safe input of the local I/O →GetLocalInput (→ S. 198)
interface
SetLocalOutput Provide process data at a non-safe output of the local I/O →SetLocalOutput (→ S. 199)
interface

The process data of the local inputs detected by means of the FB GetLocalInput is not safe
(data type: BOOL).
► Do not implicitly use non-safe process data for a safe function.
To access non-safe process data of the local inputs and outputs with Standard PLC of AC4S:
► Use global exchange variables. (→Data exchange between standard PLC and fail-safe
PLC (→ S. 82))

>

8.3.7 PLCopen Safety: Provide diagnostic information


43125

The function blocks of the PLCopen Safety library SafetyPLCopen.lib provide information about
their internal state at the output DiagCode. To be able to use this diagnostic information in the safe
application the following function block is available:

Function block Description Reference


Ctrl_SetDiagInfo Provide diagnostic information of the function blocks of →Ctrl_SetDiagInfo (→ S. 196)
the safety PLCopen library SafetyPLCopen.lib in OSC

The FB generates a separate message for each change of state in the online support centre
(OSC). The ring memory of the OSC therefore reaches its capacity limits within a short time.
► Use FB Ctrl_SetDiagInfo only for debugging.

>

78
SmartPLC SafeLine AC4S with fieldbus interfaces

8.4 Use safety functions of CODESYS


43026

3S provide several libraries in the programming environment CODESYS Safety. They contain certified
function blocks (FB) by means of which the programmer can create safe applications for the fail-safe
PLC of AC4S. The libraries are automatically loaded during the creation of a safety project by means
of AC4S (→ Create new project with AC4S (→ S. 16)). The user can access the elements of the
libraries via the library manager in the safety extension area of the device tree.
Following libraries are available:
• SafetyStandard library (→ S. 79)
• SafetyPLCopen library (→ S. 80)
• SafetyFSoEMaster library (→ S. 81)
>

8.4.1 SafetyStandard library


43044

The library SafetyStandard.lib provides safe versions of standard functions (counters, timers,
triggers, bistable functions). The library contains the following functions:

Function block Description


SF_RS Safe bistable function block with dominant setting
SF_SR Safe bistable function block with dominant resetting
SF_CTD Safe counter (down)
SF_CTUD Safe counter (up)
SF_TOF Safe timer with switch-off delay
SF_TON Safe timer with switch-on delay
SF_TP Safe timer with clock generator
SF_F_TRIG Safe trigger with falling-edge detection
SF_R_TRIG Safe trigger with rising-edge detection

The developer is responsible for the use of the safety standard function blocks provided in
CODESYS.
► Observe availability of the FBs (→ Supported program organization units (POUs)
(→ S. 73))!
The complete documentation of the SafetyStandard.lib can be accessed via the online
help of CODESYS Safety:
→ Online help > Add-Ons > CODESYS Safety > Libraries > SafetyStandard

79
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.4.2 SafetyPLCopen library


43039

The library SafetyPLCopen.lib contains the following certified function blocks:


Function block Description
SF_Antivalent Logical AND operator of 2 complementary signals; monitoring the discrepancy time
SF_EDM Monitoring the basic status and the switching status of actuators that are controlled by
safe output devices
SF_EmergencyStop Monitoring an E-stop
SF_EnableSwitch Evaluation of the signals of a manually operated, three-stage enabling switch
SF_Equivalent Logical AND operator of 2 equivalent signals; monitoring the discrepancy time
SF_ESPE Monitoring electro-sensitive protective equipment
SF_GuardLocking Monitoring protective equipment with four-stage locking
SF_GuardMonitoring Monitoring protective equipment with two-stage locking
SF_ModeSelector Selection of an operating mode
SF_MutingPar Parallel muting with 4 muting sensors
SF_MutingPar_2Sensor Parallel muting with 2 muting sensors
SF_MutingSeq Sequential muting with 4 muting sensors
SF_OutControl Controlling a safe output with a non-safe signal and optional start disable
SF_SafetyRequest Interface between user program and system environment
SF_TestabelSafetySensor Periodic testing of a sensor / electro-sensitive protective equipment (ESPE) of type 2
SF_TwoHandControlTypeII Function for "type 2 two-hand control"
SF_TwoHandControlTypeIII Function for "type 3 two-hand control"

The developer is responsible for the use of the safety PLCopen function blocks provided in
CODESYS.
The complete documentation of the SafetyPLCopen.lib can be accessed via the online help
of CODESYS Safety:
→ Online help > Add-Ons > CODESYS Safety > Libraries > SafetyPLCopen
Detailed information about the specifications: → www.plcopen.org > PLCopen Safety

80
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.4.3 SafetyFSoEMaster library


43040

The library SafetyFSoEMaster.lib provides access to functions for the safe communication via
EtherCAT (Fail-Safe over EtherCAT - FSoE). The library contains the following certified function
blocks:
Function block Description
FSoEMaster Monitoring the safe transfer of data between EtherCAT master and EtherCAT slave
(transmission / reception)

The developer is responsible for the use of the SafetyFSoEMaster function blocks provided in
CODESYS.
The complete documentation of the library SafetyFSoEMaster.lib can be accessed via the
online help of CODESYS Safety:
→ Online help > Add-Ons > CODESYS Safety > field buses > FSoE

81
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.5 Data exchange between standard PLC and fail-safe PLC


43256

Standard PLC and fail-safe PLC of AC4S use a separate hardware. Data between the two areas is
therefore exchanged via a special memory area to which both PLCs can access independently from
each other.
The programmer can organise the data exchange between the areas via the CODESYS mechanism of
the logical exchange variables.

► Familiarise yourself with the following CODESYS functions!


▪ GVL for logical exchange of data
→ Online help > Add-Ons > CODESYS Safety > Device topology > Logical I/Os >
GVL for logical exchange
▪ Logical I/O for data exchange with the main controller
→ Online help > Add-Ons > CODESYS Safety > Device topology > Logical I/Os >
Logical I/O for data exchange with the main controller

>

8.5.1 Remarks about the use of exchange variables


43066

The variable values between Standard PLC and fail-safe PLC are transferred as non-safe
data.
► Do not implicitly use non-safe variable values for safe functions.
If Standard PLC is in STOP state, the declared exchange variables for the data transfer
towards the safety PLC are written with the replacement value "0".
► Always transfer safe information created in the fail-safe area to the standard area
unchanged.
The signal can then be further processed (e.g. negation) in the standard area

82
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.5.2 Use the factory-set replacement variables


43028

When an AC4S project is created by means of an AC4S template, CODESYS automatically creates
objects for the data exchange between Standard PLC and the fail-safe PLC. For each transfer
direction a coupled pair of global variable list (GVL) and logical exchange device each is generated.

GVL in the standard area: Logical exchange devices in the safety area:

With these exchange objects of data type BYTE it is possible to transfer 8 bundled Boolean values in
each direction.
To exclude access conflicts only one PLC has the write access to the logical exchange device for each
exchange direction.
Following table shows the relations:

Global variable list Logical exchange device Write access


(in standard area of device tree) (in the safety extension area of the device tree)
[DataToSafe] [DataFromNonsafe] Standard PLC
[DataFromSafe] [DataToNonsafe] fail-safe PLC

>

Data transfer standard area >>> safety area


43252

To transfer data from the standard area of the device to the safety area of the device:
1 Declare exchange variables in the safety area
► In the safety extension area of the device tree:
Double click on [DataFromNonsafe]
> Editor window shows table for declaration of the exchange variables.
► Enter the designations for the exchange variables of data type BOOL in the column [Variable].
2 Map replacement variables with the standard area
► In standard area of device tree:
Double click on [DataToSafe]
> Editor window shows declaration part of the global variable list.
► Click on [Update].
> CODESYS applies the declared exchange variable from [DataFromNonsafe] (step 1).
> Declaration part shows the declared exchange variables.

The logical exchange devices must only be defined in the safety area. A change in the
standard area is not permitted.
If variables are added or changed in the logical exchange device, it is mandatory for the
developer to update the respective variable list (step 2).

83
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Data transfer safety area >>> standard area


43253

To transfer data from the safety area of the device to the standard area of the device:
1 Declare exchange variables in the safety area
► In the safety extension area of the device tree:
Double click on [DataToNonsafe]
> Editor window shows table with currently declared variables.
► Enter the designations for the exchange variables of data type BOOL in the column [Variable].
Do not logically link non-safe with safe data to form a safe output signal
► In the standard area of the device tree:
Double click on [DataFromSafe]
> Editor window shows declaration part of the global variable list.
► Click on [Update].
> CODESYS applies the declared exchange variable from [DataToNonsafe] (step 1).
> Declaration part shows the declared exchange variables.

The logical exchange devices must only be defined in the safety area. A change in the
standard area is not permitted.
If variables are added or changed in the logical exchange device, it is mandatory for the
developer to update the respective variable list (step 2).

84
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.5.3 Create additional objects for data exchange


43251

If the capacities of the exchange variables created at the factory are not sufficient, the programmer
can create additional exchange variables.
► Note the remarks (→Data exchange between standard PLC and fail-safe PLC (→ S. 82))!

Only the following data types may be used for the data exchange between standard PLC and
safety PLC: BYTE, WORD, LONG
Several safe values of data type BOOL can be transferred as a bundle in a variable of data
type BYTE or WORD.
The transfer of arrays of exchange variables is not supported.
In each cycle of the safety PLC max. 256 bytes of data can be transferred in each direction
(standard PLC >>> safety PLC, safety PLC >>> standard PLC).
► When additional objects are created for the data exchange, observe the max. transferable
data volume.
► Include the following objects in the calculation of the transfer data:
▪ safe cross communication (Safety NetVars): →Set up fail-safe network variables
(→ S. 88)
▪ safe fieldbus communication (FSoE): →Safe fieldbus communication (→ S. 90)

>

8.5.4 Set interval of the data exchange


43033

The user can set the intervals at which the data can be transferred between fail-safe PLC and
standard PLC.
To set the interval of the variable mapping.
► In standard area of device tree:
Double-click on [PLC Logic] > [Application] > [SafetyApp_Mapping] > [Task configuration] > [MapTask]

> The editor window shows the configuration options for variable mapping.
► Select the value [Cyclic] in the [Type] list.
► Enter the requested interval in the [Interval] field.
► Save the project to apply changes.

85
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.6 Safe cross communication


Content
Note on the size of the exchange objects ..............................................................................................87
Set up fail-safe network variables ..........................................................................................................88
Use fail-safe network variables in the application ..................................................................................89
43085

► Familiarise yourself with the following CODESYS functions!


▪ Fail-safe network variables
→ Online help > Add-Ons > CODESYS Safety > CODESYS Safety NetVars

The SmartSPS SafeLine AC4S device family supports the Safety NetVars CODESYS function
(fail-safe network variables). Safety NetVars ensure transmission and reception of safe data between
2 fail-safe PLCs in a CODESYS project.
Safety NetVars work according to the transmitter-receiver principle. It is necessary to create a
transmitter-receiver pair for each requested transmission direction. A transmitter can have several
receivers.

86
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.6.1 Note on the size of the exchange objects


43008

The amount of data that can be transmitted with the failsafe network variables is limited. The following
restrictions apply:
• mamimum number of connections sender >>> receiver: 10
• maximum number of bytes per connection sender >>> receiver: 32
• maximum number of bytes in input and output area: 256 each

The required number of bytes for each AC4S is derived from the following equations:
• configured sender lists ([Safety network variable list (sender)])
▪ output area (data from failsafe PLC to standard PLC): number of receivers * (user data*2+3)
bytes
▪ input area (data from standard PLC to failsafe PLC): number of receivers * 7 bytes
• configured receiver lists ([Safety network variable list (receiver)])
▪ output area (data from failsafe PLC to standard PLC): 7 bytes
▪ input area (data from standard PLC to failsafe PLC): (user data*2+3) bytes

The size of the user data results from the number of created failsafe variables. Depending on the data
type used, failsafe variables require the following storage capacities:
Variable type Size
SAFEBOOL SAFEBOOL variables are bundled in DAFEWORD variables; in each SAFEWORD up to 16
SAFEBOOL variables can be transfer
▪ 1...16 variables = 2 bytes
▪ 17...32 variables = 4 bytes
▪ 33...48 variables = 6 bytes
SAFEINT 1 variable = 2 bytes
SAFEWORD 1 variable = 2 bytes

For broadcast / multicast of varaible lists the above mentioned rules also apply.

87
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.6.2 Set up fail-safe network variables


43035

► Observe the notes on the configuration of the Ethernet configuration interfaces 1 (X3) and
2 (X8). → Change IP settings (→ S. 40)
► Observe the max. data volume that can be transferred for dimensioning the safe network
variables (→ Note on the size of the exchange objects (→ S. 87)).
► Include the following objects in the calculation of the transfer data:
▪ logical exchange objects: →Data exchange between standard PLC and fail-safe
PLC (→ S. 82)
▪ safe fieldbus communication (FSoE): →Safe fieldbus communication (→ S. 90)

To transmit safe data from AC4S 1 to AC4S 2:


Requirements
> AC4S 1 and AC4S 2 are participants of the same CODESYS project (→Add additional device to the
project (→ S. 41)).
> The AC4S devices 1 and 2 are coupled via the Ethernet network.
1 Create network variable list in the transmitter
► In the safety extension of the device tree of AC4S 1: Select [Safety Logic] > [SafetyApp].
► Select [Project] > [Add Object] > [Safety network variable list (Sender)].
> Dialogue window appears.
► Enter a unique name for the list in the field [Name].
► Click on [Add].
> The editor window shows the configuration of the variable list of the sender.
2 Declare safe variables
► Right-click on the Editor window.
► Select [Insert Variable Declaration] in the context menu.
> Dialogue window appears
► Set the parameters of the safe variable as requested.
► Click on [OK] to add the safe variable to the network variable list.
> The editor window shows the declared variable.
► Optional: Repeat step 2 to add additional safe variables to the network variable list.
3 Create network variable list in the receiver
► In the safety extension of the device tree of AC4S 2: Select [Safety Logic] > [SafetyApp].
► Select [Project] > [Add Object] > [Safety network variable list (Receiver)].
> Dialogue window appears.
► Enter a unique name for the list in the field [Name].
► Click on [Add].
> The editor window shows the configuration of the variable list of the receiver.
4 Couple network variable lists
► Double click on created network variable list (receiver)
► The editor window shows the configuration of the variable list.
► Select the requested network variable list (sender) in the [Associated Sender] list.
► Click on [Refresh].
► CODESYS couples the network variable lists of the transmitter and the receiver.
> The editor window shows the safe variables of the coupled network variable list.
5 Optional: Set up other fail-safe cross communication

88
SmartPLC SafeLine AC4S with fieldbus interfaces

► Repeat steps 1 to 3 for the opposite transmission direction.


>

8.6.3 Use fail-safe network variables in the application


43015

WARNING!
Stopping a fail-safe PLC in the Debug mode does neither lead to an interruption of the safe
cross communication nor to a reset of the currently active signals, i.e. receiving fail-safe
PLCs do not react. This behaviour is intended and is used for testing of the system and for
trouble shooting.Art und Quelle der Gefahr.
> Risk of personal injuries and damage to property
► Make sure that there are never any people in the dangerous zone of the installation in
the Debug mode.Zu ergreifende Maßnahmen.

To use the set Safety NetVars they have to be activated in the safe application of the AC4S devices.
Requirements:
> Network variable lists were created in transmitter and receiver and correctly configured (→ Set up fail-safe
network variables (→ S. 88)).
1 Activate network variable list of the transmitter
► Open safe application of the AC4S (transmitter)
► Add NetVarSender function block
► Select the designation of the network variable list (transmitter) as instance name.
► Configure function block (→ CODESYS help)
2 Activate network variable list of the receiver
► Open safe application of the AC4S (receiver).
► Add NetVarReceiver function block.
► Select the designation of the network variable list (receiver) as instance name.
► Configure function block (→ CODESYS help)
3 Optional: Activate more network variable lists
► Repeat steps 1 and 2 to activate additional network variable lists.

89
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.7 Safe fieldbus communication


Content
Configure FSoE connection....................................................................................................................91
Notes on the FSoEMaster ......................................................................................................................92
43041

► Familiarise yourself with the following CODESYS functions!


▪ Fail Safe over EtherCAT
→ Online help > Add-Ons > CODESYS Safety > field buses > FSoE
► Observe the notes on the configuration of the Ethernet configuration interfaces 1 (X3) and
2 (X8). → Change IP settings (→ S. 40)

The device supports the following protocols for safe communication via fieldbuses:
• Fail Safe over EtherCAT (FSoE)

90
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.7.1 Configure FSoE connection


43278

► Use an instance of the function block FSoEMaster for each fail-safe FSoE input/output
module!
► Observe the notes on the function block FSoEMaster! (→ Notes on the FSoEMaster
(→ S. 92)
The FSoE addresses and the connection IDs in an FSoE network have to be unambiguous.
CODESYS does not see if an FSoE address or a connection ID is allotted several times.

To access the safe input/output data of the EtherCAT slave via an FSoE connection:
Requirements
> AC4S is connected to the EtherCAT slave via Ethernet network.
> AC4S is configured as EtherCAT master (→ Add EtherCAT master (→ S. 43)).
1 Add safe EtherCAT slave
► Add safe EtherCAT slave (→ Add and configure EtherCAT slave (→ S. 45)
> Safe module of the EtherCAT slave appears in the safe area of the device tree under [Logical I/Os].
2 Configure safe EtherCAT slave
► In the safe area of the device tree under [Logical I/Os]: Double click on safe module of the EtherCAT slave
► Select tab [Safe configuration].
> Device editor shows configuration of the safe module of the EtherCAT slave.
► Set the following parameters as required:
Parameter Description Possible values
[FSoE address] FSoE address of the safe EtherCAT slave 1...255 (depending on the FSoE slave)
[Connection ID] Number of the connection to the safe EtherCAT slave 1...65535
[Watchdog Time] Watchdog time

3 Map safe input/output signals of the EtherCAT slaves to variables


► In the safe area of the device tree under [Logical /I/Os]: Double click on safe module of the EtherCAT slave
► Select [I/O mapping] tab.
> Device editor shows variable mapping of the safe input/output signals.
► Map safe input/output signals of the EtherCAT slave to variables.
4 Access safe data of the EtherCAT slaves
► Open safe application of the AC4S.
► Add function block FSoEMaster.
► Configure function block FSoEMaster as requested.

91
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.7.2 Notes on the FSoEMaster


43099

► Familiarise yourself with the following CODESYS functions!


▪ Function block FSoEMaster
→ Online help > Add-Ons > CODESYS Safety > field buses > FSoE > FSoEMaster

The documentation of the function block FSoEMaster in the CODESYS online help is not correct.
► Observe the following when you use the function block FSoEMaster:
▪ The parameter S_ActivateIN always has to be set to TRUE regardless of whether it is an
EtherCAT input or output module.
▪ The diagnostic code 0x80nn indicates the current state of the FSoEMaster. The bits nn can
have the following values:
Value State Description
0x64 Reset The connections are reset (outputs in the safe state)
0x65 Session The session ID is transferred (outputs are in the safe state)
0x66 Connection The connection ID is transferred (outputs are in the safe state)
0x67 Parameter The parameters are transferred (outputs are in the safe state)
0x68 Data Process data or replacement values are being transmitted.
The output S_ReadyIN indicastes the data that are transferred:
FALSE Transfer of a replacement value owing to an error recognised in the IO module.
TRUE Process data transmission

92
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.8 Set process safety time


Content
Process safety time for the AC4S ..........................................................................................................93
Set variable components of the response time ......................................................................................99
43032
>

8.8.1 Process safety time for the AC4S


43005

Basic information: → "Process safety time" in the original device manual

For calculating the process safety time of the entire system the following scenarios have to be
distinguished:
• Without safe cross communication

• With safe cross communication

93
SmartPLC SafeLine AC4S with fieldbus interfaces

The following table shows the meaning of the individual components of the AC4S:
Component Description Possible values
T(sensor) Response time of the safety sensor → Operating instructions / data sheet
T(input) Response time of the safety input device → Operating instructions / data sheet
▪ with local input: 0 ms
T(comin) Response time of the input communication AS-i 30ms
channel (as from terminal)
Local IO 16ms
FSoE 32ms + 4*T(MapTask) +
4*T(MainTask)
Safety NetVars 32ms + 4*T(MapTask) +
4*T(MainTask)
T(splc) Processing time of the fail-safe PLC 2*T(SafetyTask)
T(comout) Response time of the output communication AS-i 15 ms
channel (up to terminal)
Local IO 8 ms
FSoE 32ms + 4*T(MapTask) +
4*T(MainTask)
Safety NetVars 32ms + 4*T(MapTask) +
4*T(MainTask)
T(output) Response time of the output variable unit → Operating instructions / data sheet
▪ with local output: 0 ms

T(actuator) Reaction time of the actuator → Operating instructions / data sheet

The process safety time is extended by 1 PLC cycle if the safe AS-i input slave or the safe
local input channels are configured in CODESYS by means of the following logical devices:
• SF_IN_ASi_dependent_filter_nshutdown (→ S. 230)
• SF_IN_local_dependent_filter_nshutdown (→ S. 260)

94
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Step 1: Calculate typical response times


43023

► Calculate typical response times of the safety functions of the device:


▪ Without safe cross communication
AS-i output Local output FSoE slave output

AS-i input 30 ms + 30 ms + 30 ms +
2*T(SafetyTask) + 2*T(SafetyTask) + 2*T(SafetyTask) +
15 ms 8 ms 4*T(MainTask) +
4*T(MapTask) + 32 ms

Local input 16 ms + 16 ms + 16 ms +
2*T(SafetyTask) + 2*T(SafetyTask) + 2*T(SafetyTask) +
15 ms 8 ms 4*T(MainTask) +
4*T(MapTask) + 32 ms

FSoE Slave 32 ms + 32 ms + 32 ms +
Eingang 4*T(MainTask) + 4*T(MainTask) + 4*T(MainTask) +
4*T(MapTask) + 4*T(MapTask) + 4*T(MapTask) +
2*T(SafetyTask) + 2*T(SafetyTask) + 2*T(SafetyTask) +
15 ms 8 ms 4*T(MainTask) +
4*T(MapTask) + 32 ms

▪ With safe cross communication (Safety NetVars)


To device 2

From device 1 AS-i output Local output FSoE slave output

AS-i input 30 ms + 30 ms + 30 ms +
2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) +
4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms +
4*T(MapTask_Dev2) + 4*T(MapTask_Dev2) + 4*T(MapTask_Dev2) +
4*T(MainTask_Dev2) + 32 ms + 4*T(MainTask_Dev2) + 32 ms + 4*T(MainTask_Dev2) + 32 ms +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms 8 ms 4*T(MapTask_Dev2) +
4*T(MainTask_Dev2) + 32 ms

Lokaler 16 ms + 16 ms 16 ms
Eingang 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) +
4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms +
4*T(MapTask_Dev2) + 4*T(MapTask_Dev2) + 4*T(MapTask_Dev2) +
4*T(MainTask_Dev2) + 32 ms + 4*T(MainTask_Dev2) + 32 ms + 4*(MainTask_Dev2) + 32 ms +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms 8 ms 4*T(MapTask_Dev2) +
4*T(MainTask_Dev2) + 32 ms

FSoE Slave 4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) +


Eingang 4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms +
2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) + 4*T(MapTask_Dev1) +
4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms + 4*T(MainTask_Dev1) + 32 ms +
4*T(MapTask_Dev2) + 4*T(MapTask_Dev2) + 4*T(MapTask_Dev2) +
4*T(MainTask_Dev2) + 32 ms + 4*T(MainTask_Dev2) + 32 ms + 4*T(MainTask_Dev2) + 32 ms +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms 8 ms 4*T(MapTask_Dev2) +
4*T(MainTask_Dev2) + 32 ms

The formula in the table determine only the typical response time of the device. For the
calculation of the typical process response time the delay times of the safety AS-i
sensors/actuators and the respective input/output devices have to be added additionally
(T(sensor) + T(input) and T(output) + T(aktuator)).

95
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Step 2: Calculate the response times of the safety function


43014

► Make measurements for a real system.


► Ensure sufficient dimensioning of the watchdog times and task monitoring.

► Measure the maximum response time in all sections of the signal propagation path with safe
fieldbus communication or safe cross communication.
▪ safe fieldbus communication (FSoE): output tMaxRespTimeMS of the function block
FSoEMaster
▪ safe cross communication (Safety NetVars): output tMaxRespTime MS of the function block
NetVarReceiver
► Calculate the response time of the safety function with the measured values:
▪ without safe cross communication:
AS-i output Local output FSoE slave output

AS-i input - - 30 ms +
2*T(SafetyTask) +
tMaxRespTimeMS(FSoE_out)

Local input - - 16 ms +
2*T(SafetyTask) +
tMaxRespTimeMS(FSoE_out)

FSoE slave tMaxRespTimeMS(FSoE_in) + tMaxRespTimeMS(FSoE_in) + tMaxRespTimeMS(FSoE_in) +


input 2*T(SafetyTask) + 2*T(SafetyTask) + 2*T(SafetyTask) +
15 ms 8 ms tMaxRespTimeMS(FSoE_out)

▪ with safe cross communication:


To device 2

From device 1 AS-i output Local output FSoE slave output

AS-i input 30 ms + 30 ms + 30 ms +
2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
tMaxRespTimeMS(SafeNetVars) + tMaxRespTimeMS(SafeNetVars) + tMaxRespTimeMS(SafeNetVars) +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms 8 ms tMaxRespTimeMS(FSoE_out)

Local input 16 ms + 16 ms + 16 ms +
2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
tMaxRespTimeMS(SafeNetVars) + tMaxRespTimeMS(SafeNetVars) + tMaxRespTimeMS(SafeNetVars) +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms 8 ms tMaxRespTimeMS(FSoE_out)

FSoE Slave tMaxRespTimeMS(FSoE_in) + tMaxRespTimeMS(FSoE_in) + tMaxRespTimeMS(FSoE_in) +


Eingang 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
tMaxRespTimeMS(SafeNetVars) + tMaxRespTimeMS(SafeNetVars) + tMaxRespTimeMS(SafeNetVars) +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms 8 ms tMaxRespTimeMS(FSoE_out)

The formula in the table determine only the maximum response time of the devices. For the
calculation of the maximum process response time the delay times of the safety AS-i
sensors/actuators and the respective input/output devices have to be added additionally
(T(sensor) + T(input) and T(output) + T(aktuator)).

96
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Step 3: Define watchdog times


43004

Safe cross communication and safe fieldbus communication are monitored by means of watchdogs.
Sufficiently long watchdog times have to be selected.
► Determine the watchdog times on the basis of the maximum response times of the safety function
measured ins step 2. ifm recommends the following formulas:
▪ safe cross communication: T(WD_SafetyNetVars) = 2*T(tMaxRespTimeMS)
▪ safe fieldbus communication: T(WD_FSoE) = 2*T(tMaxRespTimeMS)
► Set watchdog times (Set variable components of the response time (→ S. 99)).

97
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Step 4: Calculate the worst-case response time of the safety function


43029

The worst-case process safety time


► Calculate the worst case on the basis of the calculated and measured values.
▪ Without safe cross communication:
AS-i output Local output FSoE slave output

AS-i input - - T(WD_FSoE)

Local input - - T(WD_FSoE)

FSoE slave T(WD_FSoE) + T(WD_FSoE) + T(WD_FSoE_in) +


input 2*T(SafetyTask) + 2*T(SafetyTask) + 2*T(SafetyTask) +
15 ms 8 ms 2*tMaxRespTimeMS(FSoE_out)

▪ With safe cross communication:


To device 2

From device 1 AS-i output Local output FSoE slave output

AS-i input MAX( MAX( MAX(


30 ms + 30 ms + 30 ms +
2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
tMaxRespTimeMS(SafetyNetVars) tMaxRespTimeMS(SafetyNetVars) tMaxRespTimeMS(SafetyNetVars)
+ 2*T(SafetyTask_Dev2) + + 2*T(SafetyTask_Dev2) + + 2*T(SafetyTask_Dev2) +
15 ms; 8 ms; tMaxRespTimeMS(FSoE_out);
T(WD_SafetyNetVars) + T(WD_SafetyNetVars) + T(WD_SafetyNetVars) +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms) 8 ms) tMaxRespTimeMS(FSoE_out);
T(WD_FSoE_out))

Local input MAX( MAX( MAX(


16 ms + 16 ms + 16 ms +
2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
tMaxRespTimeMS(SafetyNetVars) tMaxRespTimeMS(SafetyNetVars) tMaxRespTimeMS(SafetyNetVars)
+ 2*T(SafetyTask_Dev2) + + 2*T(SafetyTask_Dev2) + + 2*T(SafetyTask_Dev2) +
15 ms; 8 ms; tMaxRespTimeMS(FSoE_out);
T(WD_SafetyNetVars) + T(WD_SafetyNetVars) + T(WD_SafetyNetVars) +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms) 8 ms) tMaxRespTimeMS(FSoE_out);
T(WD_FSoE_out))

FSoE slave MAX( MAX( MAX(


input T(WD_FSoE_in) + T(WD_FSoE_in) + T(WD_FSoE_in) +
2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) + 2*T(SafetyTask_Dev1) +
tMaxRespTimeMS(SafetyNetVars) tMaxRespTimeMS(SafetyNetVars) tMaxRespTimeMS(SafetyNetVars)
+ 2*T(SafetyTask_Dev2) + + 2*T(SafetyTask_Dev2) + + 2*T(SafetyTask_Dev2) +
15 ms; 8 ms; tMaxRespTimeMS(FSoE_out);
T(WD_SafetyNetVars) + T(WD_SafetyNetVars) + T(WD_SafetyNetVars) +
2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) + 2*T(SafetyTask_Dev2) +
15 ms) 8 ms) tMaxRespTimeMS(FSoE_out);
T(WD_FSoE_out))

The response times of the output side have to be added to the calculated worst-case times
(T(output) + T(actuator)).

98
SmartPLC SafeLine AC4S with fieldbus interfaces

>

8.8.2 Set variable components of the response time


43045

The variable components influencing the process safety time of the entire system can be set by the
user at the following nodes in the CODESYS project:
• T(MainTask):
• Location: standard area of device tree
• Node: [MainTask]
• Parameters: [Interval]

• *T(SafetyTask):
• Location: safety extension of the device tree
• Node: [Safety Task]
• Parameters: [Cycle time]

• T(MapTask):
• Location: standard area of device tree
• Node: [MapTask]
• Parameters: [Interval]

• T(WD_SafetyNetVars):
• Location: safety extension of the AS-i device tree
• Node: safety network variable (receiver)
• Parameters: [Watchdog Time]

• T(WD_FSoE):
• Location: safety extension of the AS-i device tree
• Node: [Logical I/Os] > safe EtherCAT module
• Parameters: [Watchdog Time]

>

99
SmartPLC SafeLine AC4S with fieldbus interfaces

8.9 Configure safety task


43272

The safety tasks of the safe application are configured via the "Safety Task Editor" of the
programming system CODESY safety.
► Familiarise yourself with the following CODESYS functions!
▪ Safety Task Editor
→ Online help > Add-Ons > CODESYS Safety > Editors >Safety Task Editor

>

8.9.1 Set cycle time of the fail-safe PLC


43034

The programmer can freely set the cycle time of the fail-safe PLC. Whole values from 10...100 ms are
valid.
To set the cycle time of the fail-safe PLC:
► In the safety extension area of the device tree:
Double-click on [Safety Logic] > [SafetyApp] > [Safety Task]
> Editor window shows the configuration options of the selected safety task.
► Enter the required cycle time in the field [Cycle time].
► Select the safety POUs from the list to which the set cycle time should apply.
> The set cycle time applies to all selected safety POUs.

100
SmartPLC SafeLine AC4S with fieldbus interfaces

9 Operation
Content
Transfer CODESYS project to device ..................................................................................................101
Operating states AC4S .........................................................................................................................106
Reset ....................................................................................................................................................112
Display web visualisation ......................................................................................................................115
42624
>

9.1 Transfer CODESYS project to device


43010

To save the CODESYS project on AC4S the following components must be transferred to the device
separately:
• standard application "Application" (→Download standard application to AC4S (→ S. 102)
• safe application "SafetyApp" (→Load safe application to AC4S (→ S. 103)

► Note the remarks about the operating modes of Standard PLC and the fail-safe PLC of
AC4S.
→Operating states AC4S (→ S. 106)
ifm system solutions and CODESYS applications created by the user must not be saved and
executed on the AC4S at the same time.
► Before loading a standard application to AC4S, delete all ifm system solutions saved on
the device (→ Device manual, Uninstall ifm apps)!
To be able to use an ifm system solution in a user project the functions must be inserted in the
project via libraries to be ordered separately.
► Contact the AS-i specialist of ifm electronic!

101
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.1.1 Download Standard application to AC4S


43292

If standard network variables and safety network variables are used simultaneously:
→ Note: Projects with network variables (→ S. 104)

To transfer standard application of the CODESYS project to AC4S:


Requirements:
> Communication path of Standard PLC is correctly set (→Configure programming interface (→ S. 20)).
> All ifm system solutions on the device were deleted (→ Device manual: ifm-Apps deinstallieren).
1 Download standard application to the device
► In standard area of device tree:
Mark standard application and activate with [Project] > [Set active application].
► Select [Online] > [Login].
> CODESYS changes to the online mode.
> CODESYS compiles standard application and transfers it to AC4S.
2 Start standard application
► Start [Application].
> [Application] is in the RUN mode.
3 Optional: Create boot application
► Select [Online] > [Create boot application].
> CODESYS stores standard application non-volatilely on AC4S.

If the parameter "Create implicit boot application on download" is activated in the features of
the application, step 3 is not necessary any more.
To check if the parameter is active:
► Mark [Application].
► Select [View] > [Properties...].
> Tab [Boot application] shows the current parameter value.

102
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.1.2 Load safe application to AC4S


43105

In the event of simultaneous use of network variables and safety network variables: →Note:
Projects with network variables (→ S. 104)
On first log-in to the fail-safe controller the programmer is asked to enter an instance
identification. The instance identification is the serial number of the device without the leading
zeros.
Example:
• Serial number: 000000569158
• Instance identification: 569158
To determine the serial number of the device:
→ Label underneath the Fieldbus interface (X6/X7) or
→ GUI/web interface:

► >

To transfer the safe application of the CODESYS project to AC4S:


Requirements:
> Communication path of the fail-safe PLC is correctly set (→Configure programming interface
(→ S. 20)).
1 Load safe application to AC4S
► In the safety extension area of the device tree:
Mark [SafetyApp] and activate with [Projekt] > [Aktive Applikation setzen].
► Select [Online] > [Login].
> CODESYS changes to the online mode.
> CODESYS compiles the safe application and transfers it to the AC4S.
► Observe the warnings and notes.
2 Start safe application
► Start [SafetyApp].
> [SafetyApp] is in the RUN state.
3 Optional: Teach code sequences
► Teach code sequences of the safe AS-i input slaves (→Process safety time for the AC4S (→ S. 93)).
4 Optional: Create safe boot application
► Pin safe application (→ CODESYS online help).
► Select [Online] > [Create boot application].
> CODESYS stores the safe application non-volatilely on AC4S.

When the safe boot application has been created on the AC4S, the fail-safe PLC remains in
the "Debug operation" operating status.
► Note remarks about changing the operating states (→Change between the states
(→ S. 111))

>

103
SmartPLC SafeLine AC4S with fieldbus interfaces

9.1.3 Note: Projects with network variables


43098

If network variables and safety network variables are used simultaneously, the user has to observe the
following sequence for the transmission of the applications to the device:
1 Create safety network variables
► Device 1: Create and configure safety network variable list (transmitter)
► Device 2: Create and configure safety network variable list (receiver)
► Optional: Create and configure more transmitter/receiver pairs
2 Transfer applications to devices
► On all devices: Log in to standard PLC and the fail-safe PLC.
► Transfer boot applications to both PLCs
► Check if safety NetVars function correctly.
3 Log out
► Log out from the standard PLC.
4 Create standard network variables
► Device 1: Create and configure network variable list (transmitter).
► Device 2: Create and configure network variable list (receiver).
► Optional: Create and configure more transmitter/receiver pairs.
5 Transfer application to devices
► On all devices: Log in to standard PLC.
► Transfer boot application to standard PLC.
► Check if network variables and safety network variables function correctly.
>

9.1.4 Teach code sequences of the safe AS-i slaves


43012

To teach the code sequence of a safe AS-i slave:

Requirements:
> Safe AS-i slave is connected to AC4S and addressed.
> Parameter "EnableStartupTest" for all safe AS-i input slaves is activated.
> All safe AS-i input slaves are enabled (e.g. E-stop: unlock).
> Safe application is stored on the device and has been started (→Load safe application to AC4S
(→ S. 103)).
> Code table is blank.
1 Teach code sequences of a safe AS-i slave
> AC4S requires testing for safe AS-i input slave (OSC message).
► Confirm safe AS-i input slave and unlock again (switching sequence: lock  unlock)
> Safe AS-i slave transmits code sequence to AC4S.
> AC4S fills code table with code sequence of the safe AS-i input slave.
> Code sequence of the safe AS-i input slave is taught.
2 Optional: Teach more code sequences
► Repeat step 1 for additional safe AS-i input slaves.

104
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.1.5 Delete boot application via SD card


42410

If after the start of a complex boot application the device is overloaded and does not respond any
more to user inputs or login attempts, the boot application on the device needs to be forcibly deleted.
To delete the boot application on the device:
► Disable the write protection of the SD card.
► Create a file named KillBootApp.txt in the root directory of the SD card.
► Insert the SD card into the SD card slot of the device.
► Restart the device.
> Boot application on the device-internal Standard PLC is deleted.
> The file KillBootApp.txt on the SD card is renamed in KillBootApp.rdy.

With this method the following data on the device-internal Standard PLC is removed:
• all files of the boot application
• all CRC files
• directory with web and/or target visualisations
• data in the memory area F-RAM

105
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.2 Operating states AC4S


43140

This chapter provides remarks about the operating modes and the states of the Standard PLC, the
fail-safe PLC of the device and the states of the applications.
>

9.2.1 Standard PLC


43365
>

Operating mode of the Standard PLC


42634

The Standard PLC of the device can be operated in the following modes:
• Offline mode
In the offline mode the user is logged out of the Standard PLC or there is no connection between
CODESYS and the Standard PLC (e.g. connection loss).
• Online mode
In the online mode the user is logged in to the Standard PLC.
>

States of the Standard PLC application


42569

The standard applications saved on the device are executed independently in separate tasks. A
standard application can have the following states:
• Unload
No application is saved on the Standard PLC.
• RUN
The standard application is executed (cyclically processed).
• STOP
The standard application is not executed.
>

Display operating state of the Standard application


42442

To display the current operating state of the Standard PLC choose one of the following options:
• CODESYS:
> In the device tree: Node of the standard application indicates the current state.
OR:
> In online mode the CODESYS status bar shows the current state of the standard application.
• GUI / web interface of the device:

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

106
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Switch operating states


42549

To switch between the operating states of the standard application choose one of the following
options:
>

Start Standard PLC application


42572

To start a Standard PLC application stored on the device:


• CODESYS:
► In the standard area of device tree: highlight standard application as active application.
► Use [Online] > [Login] to establish the connection with the CODESYS Standard PLC.
► Use [Debug] > [Start] to start the processing of the active application.
> Application goes to RUN state.
► Optional: repeat process for additional applications.
• GUI / web interface:

► > >
► Select the [Applications] tab.
► Use [] / [] to select the required application.
> Page shows the operating status of the selected application.
► Press [Start] function key to start the processing of the selected application.
> Application goes to RUN state.
► Optional: repeat process for additional applications.
>

Stop Standard PLC application


42570

To stop a Standard PLC application stored on the device:


• CODESYS:
► In the standard area of device tree: highlight standard application as active application.
► Use [Online] > [Login] to establish the connection with the CODESYS Standard PLC.
► Use [Debug] > [Stop] to stop the processing of the active application.
> Application goes to STOP state.
► Optional: repeat process for additional applications.
• GUI / web interface:

► > >
► Select [Applications] tab.
► Use [] / [] to select the required application.
> Page shows the operating status of the selected application.
► Press [Stop] function key to stop the processing of the selected application.
> Application goes to STOP state.
► Optional: repeat process for additional applications.

107
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.2.2 Fail-safe PLC


43291

Familiarise yourself with the following CODESYS functions!


• Introduction Safety Online
→ Online help > Add-Ons > CODESYS Safety > Online mode > Introduction: Safety
online
• States of the safety controller
→ Online help > Add-Ons > CODESYS Safety > Online mode > States of the safety
controller
• DEBUG mode
→ Online help > Add-Ons > CODESYS Safety > Online mode > Debug mode

The following features are of importance for the correct functioning of the fail-safe PLC of AC4S:
• Operation mode of the fail-safe PLC (→ S. 109)
• States of the fail-safe PLC (→ S. 109)
• States of the safe application (→ S. 110)

108
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Operation mode of the fail-safe PLC


43141

The fail-safe PLC of AC4S can be operated in the following modes:


• Offline mode
In the offline mode the user is logged out of the fail-safe PLC or there is no connection between
CODESYS and the fail-safe PLC (e.g. connection loss).
• Online mode
In the online mode the user is logged in to the fail-safe PLC.
>

States of the fail-safe PLC


42981

The fail-safe PLC of AC4S can take the following states:


• Unload
In the state "unload" no safe application is stored on AC4S.
• Unsafe operation (debug mode)
In the state "unsafe operation" a download application or a boot application is stored on AC4S
which is in the STOP state (→ States of the safe application (→ S. 110)).
The debug mode has the following sub-states:
▪ Unsafe (DL)
In the sub-state "unsafe" a safe application is stored on AC4S.
▪ Unsafe (BA)
In the sub-state "unsafe (BA)" a safe boot application is stored on AC4S.
• Safe operation
In the state "safe operation" a safe boot application is stored on AC4S which is in the RUN state
(→ States of the safe application (→ S. 110)).
The state "safe operation" has the following sub-states:
▪ SAFE + logged in
In the sub-state "SAFE + logged in" the fail-safe PLC is in the online mode (→ Operation
mode of the fail-safe PLC (→ S. 109)).
▪ Logged out
In the sub-state "logged out" the fail-safe PLC is in the offline mode (→ Operation mode of
the fail-safe PLC (→ S. 109)).

In the online mode the current operating status of the safe PLC is displayed in the CODESYS
status bar.

109
SmartPLC SafeLine AC4S with fieldbus interfaces

>

States of the safe application


43022

The safe application on the fail-safe PLC of AC4S can take the following states:
• RUN
The safe application is executed (cyclic processing).
• STOP
The safe application is not executed.
• TERMINATED
The safe application was terminated due to a runtime error.

In the online mode the current state of the safe application is displayed in the CODESYS
status bar.

110
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Change between the states


43261

Following status diagram shows the relations and possible transitions between the individual operating
modes and the states of the fail-safe PLC:

Log-in with download ([Online] > [Login])

Start boot application ([Debug] > [Start])

Start log-out again with boot application

Create boot application ([Online] > [Create boot application])

Log-out ([Online] > [Logout])

Log-in to boot application ([Online] > [Login])

Stop ([Debug] > [Stop])

Reset cold ([Online] > [Reset])

Write ([Debug] > [Write values])

Force ([Debug] > [Force values])

Connection loss between CODESYS and AC4S (automatic transition)

111
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.3 Reset
Content
Standard-SPS .......................................................................................................................................112
Fail-safe PLC ........................................................................................................................................114
39674
>

9.3.1 Standard PLC


43368

A set of Standard PLC simultaneously starts a reset of the fail-safe PLC of AC4S.
► Note remarks about the start-up behaviour of the controller (→Start-up behaviour of the
controller).

>

Supported reset variants


39592

The following table shows the reset variants supported by the device-internal CODESYS Standard
PLC and the resulting system behaviour:

Type of reset System behaviour Triggering actions


Reset (warm) ▪ standard application goes to STOP state. →Reset the standard application (warm)
▪ Standard variables (VAR) of the standard (→ S. 113)
application are initialised.
▪ Remanent variables (VAR RETAIN) of the
standard application keep their current values.
Reset (cold) ▪ standard application changes to the STOP state. →Reset the standard application (cold)
▪ All variables (VAR, VAR RETAIN) of the standard (→ S. 113)
application are initialised.
Reset (default) ▪ standard application goes to STOP state. →Reset the standard application (origin)
▪ The standard application on the Standard PLC is (→ S. 113)
deleted.
▪ All variables (VAR, VAR RETAIN) of the standard
application are initialised.
▪ Standard PLC is reset to the default state.

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

112
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Reset the standard application (warm)


42524

To reset the standard application on the Standard PLC, choose one of the following options:
• CODESYS: command [Reset (warm)]
► In the standard area of device tree:
Highlight the required standard application as active application.
► Select [Online] > [Login] to establish a connection to the CODESYS Standard PLC.
> CODESYS switches to online mode.
► Select [Online] > [Reset warm] to reset the standard application.
• GUI: command [Reset]

► >
► Select [All Applications] tab.
► Use [Reset] to reset all standard applications.
>

Reset the Standard application (cold)


42526

To reset the standard application on the Standard PLC, choose one of the following options:
• Download the standard application to the device
► →Download standard applciation to AC4S (→ S. 102)
• CODESYS: command "Reset (cold)"
► In the standard area of device tree:
Highlight the required standard application as active application.
► Select [Online] > [Login] to establish a connection to the CODESYS Standard PLC.
> CODESYS switches to online mode.
► Select [Online] > [Reset cold] to reset the standard application.
>

Reset the Standard application (origin)


42527

To reset the standard application on the Standard PLC:


• CODESYS: command "Reset (origin)"
► In the standard area of device tree:
Highlight the required standard application as active application.
► Select [Online] > [Login] to establish a connection to the CODESYS-Standard PLC.
> CODESYS switches to online mode.
► Select [Online] > [Reset origin] to reset the standard application.

113
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.3.2 Fail-safe PLC


43290
>

Supported types of reset


43031

The following table shows the types of reset supported by the device-internal fail-safe PLC and the
resulting system behaviour:

Type of reset System behaviour Triggering actions


Reset (cold) ▪ Safe application changes to the STOP state. →Reset safe application (cold) (→ S. 114)
▪ All variables (VAR, VAR RETAIN) of the safe
application are re-initialised.

>

Reset safe application (cold)


43064

To reset the safe application on the fail-safe PLC execute one of the following actions:
• Download new safe application to device
► →Transfer CODESYS project to device (→ S. 101)
• CODESYS: Execute command "Reset (cold)"
► Set [SafetyApp] as active application.
► Select [Online] > [Login].
> Fail-safe PLC changes to the online mode.
► Select [Online] > [Reset cold] to reset the safe application on the device.

114
SmartPLC SafeLine AC4S with fieldbus interfaces

>

9.4 Display web visualisation


42437

To display the created web visualisation:


Requirements:
> PC/laptop is connected to the configuration interface (X3) of the device (→ device manual: Configuration
interface: connection concepts)

CODESYS Standard PLC appliation


► Download Standard PLC application with web visualisation to the device and start it (→Download standard
application to AC4S (→ S. 102)).
► On PC/laptop: Start web browser.
► Enter the following in the address line and press [ENTER] to confirm:
http://<IP address-of-the-device>:<8080>/myvisu.htm

myvisu is the user-defined name of the visualisation (→Change properties of the web
visualisation (→ S. 66)).

> Web browser shows the web visualisation of the device.

ifm system solution


► Install the ifm system solution on the device and start it (→ device manual, Install single / basis app or
Install multi app).
► Display informationen about the installed ifm app (→ device manual, Display informationen about
installed ifm apps).
► Call hyperlink of the ifm app.
> Web browser shows the web visualisation of the ifm system solution.

115
SmartPLC SafeLine AC4S with fieldbus interfaces

10 Appendix
Content
Library ACnnnn_Utils.library .................................................................................................................117
Library ACnnnn_SYS_CMD.library ......................................................................................................179
Library SF_IO.library ............................................................................................................................187
Library SF_LogicalInterfaces.library .....................................................................................................200
Error codes: Safe AS-i slaves...............................................................................................................267
Error codes: Local I/O interface ............................................................................................................269
33879

116
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.1 Library ACnnnn_Utils.library


Content
Overview: AS-i functions (FB_ASi) .......................................................................................................118
Overview: System functions (FB_System) ...........................................................................................163
Enumeration types and complex variables ...........................................................................................170
42639

117
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.1.1 Overview: AS-i functions (FB_ASi)


Content
Get_ASi_PHY_Dat ...............................................................................................................................119
Get_LAS ...............................................................................................................................................121
Get_LDS ...............................................................................................................................................123
Get_LPS ...............................................................................................................................................125
Get_LCE ...............................................................................................................................................127
Get_LCEAS ..........................................................................................................................................129
Get_LCEMS .........................................................................................................................................131
Get_LDAE.............................................................................................................................................133
Get_LPF ...............................................................................................................................................135
Get_CDI ................................................................................................................................................137
Get_PCD ..............................................................................................................................................139
Get_InputParameter .............................................................................................................................141
Get_OutputParameter ..........................................................................................................................143
Set_AddressMode ................................................................................................................................145
Set_ASi_Config ....................................................................................................................................146
Set_LPS................................................................................................................................................148
Set_Mode .............................................................................................................................................150
Set_PCD ...............................................................................................................................................152
Set_ProjectAll .......................................................................................................................................154
Set_SlaveAddress ................................................................................................................................155
Set_SlaveExtendedID1 ........................................................................................................................157
Set_SlaveParameter ............................................................................................................................159
Get_ASi_Data .......................................................................................................................................161
42537

118
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_ASi_PHY_Dat
42416

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42417

The FB reads the physical data of the selected AS-i master and provides the values.
>

Input parameters
42582

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

119
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42610

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 whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set

120
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LAS
42598

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42415

The FB reads the list of activated slaves (LAS) of the selected AS-i master and provides the values.
>

Input parameters
42577

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

121
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42621

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
...
1 Single/A slave available
Bit 31 (MSB) = address 31/31A
dwLAS_B_Slaves DWORD List of the active B slaves. Each bit Per bit:
represents an AS-i address:
0 No B slave available
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 B slave available
...
Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing
>

122
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LDS
42595

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42436

The FB reads the list of detected slaves (LDS) of the selected AS-i master and provides the values.
>

Input parameters
42590

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

123
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42618

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
...
1 slave detected
▪ Bit 31 (MSB) = address 31/31A
dwLDS_B_Slaves DWORD List of detected B slaves. Each bit Per bit:
represents an AS-i address:
0 No slave detected
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 Slave detected
...
▪ Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing
>

124
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LPS
42605

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42431

The FB reads the list of projected slaves (LPS) at the selected AS-i master and provides the values.
>

Input parameters
42588

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

125
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42576

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
...
1 Slave projected
▪ Bit 31 (MSB) = address 31/31A
dwLPS_B_Slaves DWORD List of the projected B slaves. Each bit Per bit:
represents an AS-i address:
0 slave not projected
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 slave projected
...
▪ Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

126
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LCE
42599

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42405

The FB reads the list of configuration errors (LCE) of the selected AS-i master and provides the
values.
>

Input parameters
42578

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

127
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42622

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 whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

128
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LCEAS
42596

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42404

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
42579

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

129
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42623

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
... 1 Slave exists, but not projected
Bit 31 (MSB) = address 31/31A
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 -
additional slave
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 Slave exists, but not projected
...
Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

130
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LCEMS
42593

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42419

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
42584

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

131
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42620

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 -
▪ Bit 0 (LSB) = address 0 missing slave
...
1 Slave is projected but not
Bit 31 (MSB) = address 31/31A 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 slave
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 Slave is projected but not
available
...
Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

132
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LDAE
42594

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42435

The FB reads the double address errors (LDAE) of the selected AS-i master and provides the values
in a list.
>

Input parameters
42589

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

133
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42617

Parameter Data type Description Possible values


dwLDAE_SA_Slaves DWORD List of the double address errors. Per bit:
Each bit represents an AS-i address:
▪ Bit 0 (LSB) = address 0 0 No double address error
...
1 Double address error
Bit 31 (MSB) = address 31/31A
dwLDAE_B_Slaves DWORD List of double address errors. Each bit Per bit:
represents an AS-i address:
0 No double address error
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 Double address error
...
Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

134
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_LPF
42600

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42439

The FB reads the list of peripheral faults (LPF) of the selected AS-i master and provides the values.
>

Input parameters
42591

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

135
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42619

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
...
1 Peripheral fault detected
Bit 31 (MSB) = address 31/31A
dwLPF_B_Slaves DWORD List of peripheral faults on B slaves. Per bit:
Each bit represents an AS-i address:
0 No peripheral fault
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 Peripheral fault detected
...
Bit 31 (MSB) = address 31B
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

136
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_CDI
42406

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42418

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
42583

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

137
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42611

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 whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

138
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_PCD
42607

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42424

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
42586

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

139
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42534

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 whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

140
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_InputParameter
42597

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42414

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
42580

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

141
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42616

Parameter Data type Description Possible values


abList_SA_Slave ARRAY[0..31] List of output parameters of S/A Per byte:
OF BYTE slaves in the selected AS-i master.
Each byte contains the output Bits 0...3: P0-P3
parameters of 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 whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

142
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_OutputParameter
42606

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42409

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
42585

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

143
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42533

Parameter Data type Description Possible values


abList_SA_Slave ARRAY[0..31] List of output parameters of S/A Per byte:
OF BYTE slaves in the selected AS-i master.
Each byte contains the output Bits 0...3: P0-P3
parameters of 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 whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

144
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_AddressMode
42565

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42425

The FB activates/deactivates the parameter "Automatic addressing" for the selected AS-i master.
>

Input parameters
42587

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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_MODE Parameter Auto_address_disable Automatic
activates/deactivates the addressing inactive
automatic addressing mode.
Auto_address_enable Automatic
addressing active

>

Output parameters
42530

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
>

145
SmartPLC SafeLine AC4S with fieldbus interfaces

>
>

Set_ASi_Config
42566

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42430

The FB activates/deactivates the parameters "double address recognition" and "earth fault detection"
for the selected AS-i master.
>

Input parameters
42608

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

146
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42532

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0001 Wrong parameter transferred, setting was not adopted.

147
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_LPS
42567

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42426

The FB changes the list of projected slaves (LPS) in the selected AS-i master.
>

Input parameters
42629

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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
...
1 Slave projected
▪ Bit 31 (MSB) = address 31/31A
dwLPS_B_Slaves DWORD List of the projected B slaves. Each bit Per bit:
represents an AS-i address:
0 slave not projected
▪ Bit 0 (LSB) = not used
▪ Bit 1 = address 1B 1 slave projected
...
▪ Bit 31 (MSB) = address 31B

148
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42529

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0019 Master not in the projecting mode

149
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_Mode
42564

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42427

The FB changes the operating mode (protected operation, projection mode) of the selected AS-i
master.
>

Input parameters
42630

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

150
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42531

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0003 Slave with address 0 found (slave not detected)

151
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_PCD
42561

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42428

The FB changes the configuration file (Permanent Configuration Data = PCD) of the slaves at the
selected AS-i master.
>

Input parameters
42631

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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!

152
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42613

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0019 Master not in the projecting mode

153
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_ProjectAll
42562

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42429

The FB starts the projection adaptation on the selected AS-i master.


>

Input parameters
42591

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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
42536

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0003 Slave with address 0 found (slave not detected)
▪ 0x0019 Master not in the projecting mode

154
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_SlaveAddress
42563

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42421

The FB changes the address of the selected AS-i slaves.


>

Input parameters
42628

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

155
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42541

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 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.

156
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_SlaveExtendedID1
42568

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42420

The FB changes the Extended ID1 of the selected AS-i slave.


>

Input parameters
42625

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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)

157
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42535

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 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

158
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_SlaveParameter
42573

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42422

The FB changes the parameters of the selected AS-i slave.


>

Input parameters
42626

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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)

159
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42542

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0001 Slave does not respond or change to offline mode during FB execution
▪ 0x000A Sslave 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.

160
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_ASi_Data
42413

Function block type: Function block (FB)


Library: ACnnnn_Utils.library

Symbol in CODESYS:

>

Description
42412

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) (→ S. 173)):
• 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
• Outputs parameters of the AS-i slaves
>

Input parameters
42581

Parameter Data type Description Possible values


xEnable BOOL Control activiy of the FB TRUE FB is enabled
FALSE FB is disabled
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.

161
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42609

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 whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 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"

162
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.1.2 Overview: System functions (FB_System)


Content
Get_FieldbusInfo ..................................................................................................................................164
QuickSetupASi_Master ........................................................................................................................166
Set_TimeDate .......................................................................................................................................168
42528

163
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Get_FieldbusInfo
42512

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42423

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
42627

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
TRUE Start one-time FB execution

164
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42543

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
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0F01 Unknown error
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

165
SmartPLC SafeLine AC4S with fieldbus interfaces

>

QuickSetupASi_Master
42519

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42407

The FB executes the quick setup routine on the selected AS-i masters.
>

Input parameters
42603

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

166
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42615

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 0x0000 No specific error is set
▪ 0x0003 Slave with address 0 found (slave not detected)

167
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Set_TimeDate
42574

Function block type: Function block (FB)


Library: ACnnnn_Utils.library
Symbol in CODESYS:

>

Description
42408

The FB sets the system time (time and date) of the device using the transmitted input values.
>

Input parameters
42592

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
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

168
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42612

Parameter Data type Description Possible values


xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xBusy BOOL Signal indicates whether the FB is FALSE FB is deactivated or FB
being executed. execution is completed.
TRUE FB execution has started but is
not yet completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
wDiagnostic WORD Diagnostic information → List below (Diagnostic codes)

Diagnostic codes:
▪ 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.

169
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.1.3 Enumeration types and complex variables


Content
Enumeration types (ENUM)..................................................................................................................170
Complex variables (STRUCT) ..............................................................................................................172
42434

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)


42432

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


>

ASI_ADDRESS_MODE (ENUM)
42501

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)
42505

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)
42504

Designation Description Variable Data type Value


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

170
SmartPLC SafeLine AC4S with fieldbus interfaces

>

ASI_SLAVE (ENUM)
42506

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

>

ASI_SLAVE_TYP (ENUM)
42483

Designation Description Variable Data type Value


ASI_SLAVE_TYP Type of the AS-i slave ▪ SA_Slave INT 0
▪ B_Slave INT 1

>

171
SmartPLC SafeLine AC4S with fieldbus interfaces

Complex variables (STRUCT)


42479

The library ACnnnn_Utils.library provides complex variables of the data type STRUCT. They are
used by the FBs, but they can also be used by the programmer in CODESYS projects for the
device-internal Standard PLC.
>

172
SmartPLC SafeLine AC4S with fieldbus interfaces

ASI_DATA (STRUCT)
42510

Name Data type Description Possible values


▪ LDS_SA_Slave DWORD List of the active S/A slaves
Each bit represents an AS-i address:
0 = no slave active
1 = slave active
▪ LDS_B_Slave DWORD List of active B slaves → DS9 – Slave lists LAS, LDS, LPF,
LCE, 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, 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
→ DS9 – Slave lists LAS, LDS, LPF,
▪ LPF_B_Slave DWORD List of peripheral faults (B slaves) LCE, 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
→ DS9 – Slave lists LAS, LDS, LPF,
▪ LCE_B_Slave DWORD List with configuration errors (B LCE, words 12...15
slaves)

▪ 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

▪ 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 – AS-i master: Error lists
LCEMS, LCEAS, LDAE, 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 – AS-i master: Error lists
additional B slave LCEMS, LCEAS, LDAE, 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
→ DS17 – AS-i master: Error lists
▪ LDAE_B_Slave DWORD List of double address errors (B LCEMS, LCEAS, LDAE, words 8...11
slaves)

173
SmartPLC SafeLine AC4S with fieldbus interfaces

Name Data type Description Possible values


▪ 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 – Actual configuration data
(CDI)
▪ PCD ARRAY[0..63] Image of the projected Each word contains data of one slave:
OF WORD configuration data Bits 0...3 = IO
(PCD = Projected Configuration Bits 4...7 = ID
Data) Bits 8...11 = ID1
Bits 12...15 = ID2
→ DS12 – Projected configuration data
(PCD)
▪ 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 (PI), 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 (PI),
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 (PP), 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 (PP), words
16...31

174
SmartPLC SafeLine AC4S with fieldbus interfaces

>

ASI_NET (STRUCT)
42507

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

Name Data type Description Possible values


▪ binIO ASI_BIN_IO Binary input and output data → ASI_BIN_IO (STRUCT) (→ S. 175)
▪ anaIO ASI_ANA_IO Analogue input and output data → ASI_ANA_IO (STRUCT) (→ S. 176)
-
>

ASI_BIN_IO (STRUCT)
42508

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

Name Data type Description Possible values


▪ bin_IN_Slaves ASI_BIN_IN Input data of the digital AS-i slaves → ASI_BIN_IN (STRUCT) (→ S. 175)
▪ bin_OUT_Slaves ASI_BIN_OUT Output data of the digital AS-i →-ASI_BIN_OUT (STRUCT) (→ S. 175)
slaves

>

ASI_BIN_IN (STRUCT)
42509

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

Name Data type Description Possible values


▪ SA_Slave ARRAY[1...31] Input data of the digital S/A slaves, corresponds to the 1st to 15th word of the
OF BYTE 1 byte per S/A slave acyclic data record 2 (DS2)
→ DS2 – Digital inputs of the slaves and
master flags
▪ 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

>

ASI_BIN_OUT (STRUCT)
42511

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

Name 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
▪ 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

175
SmartPLC SafeLine AC4S with fieldbus interfaces

>

ASI_ANA_IO (STRUCT)
42496

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

Name Data type Description Possible values


▪ ana_IN_Slave ARRAY[1..31] OF Input data and status flags of the → ASI_ANALOG_IN (STRUCT)
ASI_ANALOG_ analogue AS-i slaves (→ S. 176)
IN
▪ ana_OUT_Slave ARRAY[1..31] OF Output data and status flags of the → ASI_ANALOG_OUT (STRUCT)
ASI_ANALOG_OUT analogue AS-i slaves (→ S. 177)

>

ASI_ANALOG_IN (STRUCT)
42495

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)
▪ chan_3 INT Analogue value channel 3: → DS4 – Analogue inputs of slaves
S or B input slave 16(A)...31(B)
▪ chan_4 INT Analogue value channel 4:
S or B input slave
▪ flags ASI_ANALOG_OUT_ Status flags → ASI_ANALOG_IN_FLAGS (STRUCT)
FLAGS (→ S. 177)

176
SmartPLC SafeLine AC4S with fieldbus interfaces

>

ASI_ANALOG_IN_FLAGS (STRUCT)
42498

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

Name 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)
▪ O1 BOOL Overflow bit, channel 2
→ DS4 – Analogue inputs of slaves
▪ V2 BOOL Valid bit channel 3 16(A)...31(B)

▪ 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)
42497

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
S or A output slave 1(A)...15(B)
→ DS7 – Analogue outputs of slaves
▪ chan_3 INT Analogue value channel 3: 16(A)...31(B)
S or B output slave
▪ chan_4 INT Analogue value channel 4:
S or B output slave
▪ flags ASI_ANALOG_OUT_ Status flags →-ASI_ANALOG_OUT_FLAGS
FLAGS (STRUCT) (→ S. 178)

177
SmartPLC SafeLine AC4S with fieldbus interfaces

>

ASI_ANALOG_OUT_FLAGS (STRUCT)
42503

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

Name Data type Description Possible values


▪ na1 BOOL -- corresponds to the acyclic data record 8
(DS8)
▪ na2 BOOL --
→ DS8 – Status flags of analogue output
▪ na3 BOOL -- data of the slaves 1...31

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

178
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.2 Library ACnnnn_SYS_CMD.library


Content
ACnnnn_SysCmd .................................................................................................................................179
42638
>

10.2.1 ACnnnn_SysCmd
42454

Function block type: Function block (FB)


Library: ACnnnn_SYS_CMD.library

Symbol in CODESYS:

>

Description
42411

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 (→ S. 184)
• Command response channel: → Example: Date / time / read NTP settings (→ S. 185)
• Acyclic data record (DSx): → Example: Read LCEMS, LCEAS and LDAE of AS-i Master 2
(→ S. 186)

179
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Input parameters
42602

Parameter Data type Description Possible values


xExecute BOOL Control execution of the FB FALSE Don't execute FB
TRUE Start one-time FB execution
uCommandID WORD ID of the command to be executed → Table: System commands (→ S. 180)
→ Table: AS-i master commands
(→ S. 181)
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)

>

Table: System commands


42548

uCommandID Description
0x0001 DS1 – System information
0x1101 Command 0x0101 – Quick set-up AS-i masters 1 + 2
0x1103 Command 0x0103 – Select user language
0x1104 Command 0x0104 – Change display settings
0x1105 Command 0x0105 – Set output control
0x1109 Command 0x0109 – Set date / time
0x110A Command 0x010A – Configure the NTP server settings
0x110B Command 0x010B – Read date / time / NTP settings
0x110C Command 0x010C – Reboot system
0x110D Command 0x010D – Read fieldbus info
0x1110 Command 0x0110 - Display target visualisation

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

Detailed information about the acyclic data sets and the command interface is given in the
supplement to the device manual of the SmartSPS SafeLine AC4S (→ Overview: User
documentation for AC4S (→ S. 7)).

>

180
SmartPLC SafeLine AC4S with fieldbus interfaces

Table: AS-i master commands


42551

uCommandID Description / corresponding command


0x0002 DS2 – Digital slave inputs and master flags
0x0003 DS3 – Analogue inputs of the slaves 1(A)...15(B)
0x0004 DS4 – Analogue inputs of the slaves 16(A)...31(B)
0x0005 DS5 – Digital slave outputs
0x0006 DS6 – Analogue outputs of the slaves 1(A)...15(B)
0x0007 DS7 – Analogue outputs of the slaves 16(A)...31(B)
0x0008 DS8 – Status flags of the analogue outputs of slaves 1...31
0x0009 DS9 – Slave lists LAS, LDS, LPF, LCE
0x000A DS10 – Slave list LPS
0x000B DS11 – Current configuration data (CDI)
0x000C DS12 – Projected configuration data (PCD)
0x000D DS13 – Image of the input parameters of the slaves (PI)
0x000E DS14 – Image of the outputs parameters of the slaves (PP)
0x000F DS15 – Slave error counter, configuration error counter, AS-i cycle counter
0x0011 DS17 – AS-i master: Error lists LCEMS, LCEAS, LDAE
0x1001 Command 0x0001 – Change AS-i slave parameters
0x1003 Command 0x0003 – Project current AS-i network
0x1004 Command 0x0004 – Change LPS
0x1005 Command 0x0005 – Change the operating mode of the AS-i master
0x1006 Command 0x0006 – Change AS-i slave address
0x1007 Command 0x0007 - Set auto address mode of the AS-i master
0x1009 Command 0x0009 – Change extended ID1 in the AS-i slave
0x100A Command 0x000A - Change PCD
0x100D Command 0x000D – AS-i master supply voltage, symmetry, earth fault
0x1015 Command 0x0015 – Read ID string of an AS-i profile (S-7.4)
0x101A Command 0x001A – Read AS-i master info
0x101C Command 0x001C – Deactivate slave reset when changing to the protected mode
0x1021 Command 0x0021 - Read diagnostics string of an AS-i slave (S-7.4)
0x1022 Command 0x0022 - Read parameter string of an AS-i slave (S-7.4)
0x1023 Command 0x0022 - Write parameter string of an AS-i slave (S-7.4)
0x1024 Command 0x0024 – CTT2 standard read
0x1025 Command 0x0025 – CTT2 standard write
0x1026 Command 0x0026 – CTT2 vendor specific read
0x1027 Command 0x0027 – CTT2 vendor specific selective write
0x1040 Command 0x0040 – CTT2 device group read
0x1041 Command 0x0041 – CTT2 device group write
0x1042 Command 0x0042 – CTT2 vendor specific selective read from buffer
0x1043 Command 0x0043 – CTT2 vendor specific selective write from buffer

181
SmartPLC SafeLine AC4S with fieldbus interfaces

uCommandID Description / corresponding command


0x1044 Command 0x0044 – CTT2 vendor specific selective read
0x1045 Command 0x0045 – CTT2 vendor specific selective write
0x1046 Command 0x0046 – CTT2 device group selective read
0x1047 Command 0x0047 – CTT2 device group selective write
0x1049 Command 0x0049 – CTT2 vendor specific exchange
0x104A Command 0x004A – CTT2 device group exchange
0x104B Command 0x004B – CTT2 device group selective read from buffer
0x104C Command 0x004C – CTT2 device group selective write from buffer
0x1050 Command 0x0050 – Set AS-i master settings
0x1051 Command 0x0051 – Reset error counter

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

Detailed information about the acyclic data sets and the command interface is given in the
supplement to the device manual of the SmartSPS SafeLine AC4S (→ Overview: User
documentation for AC4S (→ S. 7)).

182
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
42614

Parameter Data type Description Possible values


uCount WORD Number of valid bytes in pDataOut integer value in hexadecimal
(uCount <= uSizeOut) representation
xReady BOOL Signal indicates whether the execution FALSE FB is inactive or being
of the FB is completed. executed.
TRUE FB execution is completed.
xError BOOL Signal indicates whether errors FALSE FB is disabled or is being
occurred while the FB was executed. executed or FB was executed
without error.
TRUE An error occurred while the FB
was executed.
uErrorCode WORD Error code of the executed command Command error code of the corresponding
command channel
OR: → List below (Diagnostic codes)

Diagnostic codes:
▪ 0xnF01 Unknown error 1
▪ 0x0F02 Unknown/invalid target
▪ 0x0F03 Unknown command ID
▪ 0x0F04 Invalid parameters
▪ 0x0F05 Timeout during processing

183
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Example: Change language setting of the device


42398

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:
→ Kommando 0x0103 – Bediensprache umschalten (→ device manual supplement)
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 no. Contents Explanation
1 0x4553 Spanish

184
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Example: Date / time / read NTP settings


42403

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:
→ Kommando 0x010B – Datum / Uhrzeit / NTP-Einstellungen lesen (→ device manual
supplement)
uTarget 0 System command
pDataIn -- irrelevant, since command reply channel
uSizeIn -- 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 no. Content
1 Month Day
2 Year Year
3 Minutes Hours
4 reserved Seconds
5 NTP offset NTP status
6 ... 7 IP address NTP server

185
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Example: Read LCEMS, LCEAS and LDAE of AS-i Master 2


42402

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 – AS-i Master: Fehlerlisten LCEMS, LCEAS, LDAE (→ device manual
supplement)
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 no. Content
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)

186
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3 Library SF_IO.library


Content
CtrlASi_InSlave ....................................................................................................................................188
CtrlASi_OutSlave ..................................................................................................................................190
CtrlASi_ResetAllSlaves ........................................................................................................................193
CtrlLocalInputs ......................................................................................................................................194
Ctrl_SetDiagInfo ...................................................................................................................................196
GetLocalInput .......................................................................................................................................198
SetLocalOutput .....................................................................................................................................199
42988

The library SF_IO.library from ifm electronic provides function blocks (FB) for the programming of
safety-relevant PLC applications.

187
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3.1 CtrlASi_InSlave
43258

Function block type: Function block (FB)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43297

Function block (FB) to control the logical device of a safe AS-i input slave (ASi_SlaveAdr,
ASi_Master).
The programmer can carry out the following actions via CtrlASi_InSlave:
• Unlock the logical device and reset it from the locked error state S_ERROR to the initialisation
state S_INIT (RESET)
The FB provides the following state and diagnostic information as non-safe data:
• Logical values of the two safe code half-sequences of the AS-i input slave (Chan_A, Chan_B)
• State of the FB processing (ready)
• Error state of the function block (Error)
• Diagnostic information of the logical device (DiagCode)

The function block can be instanced as often as required within the limits of CODESYS.

>

Input parameters
42984

Parameter Data type Description Possible values


Enable BOOL FB activation FALSE FB is deactivated.
TRUE FB is activated.
ASi_SlaveAdr INT Address of the safe AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the safe 1 AS-i Master 1
AS-i slave is connected.
2 AS-i Master 2
Reset BOOL Control signal to reset the logical FALSE  Control signal is transmitted
device from the locked error state TRUE
(S_ERROR) to the initialisation
state (S_INIT). other No changes

The safe AS-i slave that is to be controlled by means of the FB must be inserted in the device
tree.

>

188
SmartPLC SafeLine AC4S with fieldbus interfaces

Output parameters
43077

Parameter Data type Description Possible values


Chan_A BOOL Logical state of the safe signal FALSE OFF
channel A
(= 1st code half-sequence) TRUE ON

Chan_B BOOL Logical state of the safe signal FALSE OFF


channel B
(= 2nd code half-sequence) TRUE ON

Ready BOOL Status of the FB processing FALSE FB not completely processed or


(validity of the output signals) deactivated; signals are invalid
TRUE FB completely processed; signals are
valid
Error BOOL Error indication FALSE No error
TRUE Logical device is in the locked error
state S_ERROR
DiagCode WORD Diagnostic code of the internal Scope of the diagnostic code depends on the
states of the controlled logical controlled logical device: Description of the
device selected logical device (→ Library
SF_LogicalInterfaces.library (→ S. 200))

189
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3.2 CtrlASi_OutSlave
43257

Function block type: Function block (FB)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43300

Function block (FB) to control the logical device of a safe AS-i control slave (ASi_SlaveAdr,
ASi_Master)
The programmer can carry out the following actions via CtrlASi_OutSlave:
• Transmit signal to unlock the safe AS-i slaves (auxiliary signal HSI_1)
• Transmit signal for automatic new start (auxiliary signal HSI_2)
The FB provides the following state and diagnostic information:
• State of the FB processing (ready)
• Error state of the function block (Error)
• Diagnostic information of the logical device (DiagCode)

The function block can be instanced as often as required within the limits of CODESYS.

190
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Input parameters
42975

Parameter Data type Description Possible values


Enable BOOL FB activation FALSE FB is deactivated.
TRUE FB is activated.
ASi_SlaveAdr INT Address of the safe AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the safe 1 AS-i Master 1
AS-i slave is connected.
2 AS-i Master 2
HSI_1 BOOL Auxiliary signal 1 (HSI_1) FALSE  Auxiliary signal is transmitted once
Reset signal to exit the locked TRUE
error state (S_Error)
else No action
HSI_2 BOOL Auxiliary signal 2 (HSI_2) FALSE  Auxiliary signal is transmitted once
Control of the start-up behaviour TRUE
of the controlled AS-i slave after
communication error else No action

The safe AS-i slave that is to be controlled by means of the FB must be inserted in the device
tree.
A triggered request of the two auxiliary signals must not be cancelled until the success or
interruption of the transmission has been displayed.
► Do not set the inputs HSI_1 and/or HSI_2 to FALSE if a value with HS_ACK = OK or
HS_ACK = nOK is provided at output DiagCode (→ Output parameters (→ S. 192)).

Detailed information about the auxiliary signals HSI_1 and HSI_2: → Operating instructions of
the safe AS-i control slave

191
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Output parameters
43078

Parameter Data type Description Possible values


Ready BOOL Status of the FB processing FALSE FB not completely processed or
(validity of the output signals) deactivated; signals are invalid
TRUE FB completely processed; signals are
valid
Error BOOL Error indication FALSE No error
TRUE Logical device is in the locked error
state S_ERROR
DiagCode WORD Diagnostic code of the internal Scope of the diagnostic code depends on the
states of the controlled logical controlled logical device: Description of the
device selected logical device (→ Library
SF_LogicalInterfaces.library (→ S. 200))

Diagnostic codes:
▪ 0x8000 Output = ON; HS_ACK = idle
▪ 0x8002 Output = OFF; HS_ACK = idle
▪ 0x8830 Output = ON; HS_ACK = OK
▪ 0x8832 Output = OFF; HS_ACK = OK
▪ 0x8840 Output = ON; HS_ACK = nOK
▪ 0x8842 Output = OFF; HS_ACK = nOK
▪ 0x8850 Output = ON; HS_ACK = RUN
▪ 0x8852 Output = OFF; HS_ACK = RUN
>

192
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3.3 CtrlASi_ResetAllSlaves
43260

Function block type: Function block (FB)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43299

Function block (FB) to control the logical device of several safe AS-i input slaves of an AS-i network
(ASi_Master).
The programmer can carry out the following actions via CtrlASi_ResetAllSlaves:
• Unlock the logical device of all safe AS-i slaves in the indicated network and reset it from the
locked error state S_ERROR to the initialisation state S_INIT (RESET)
The FB provides the following state and diagnostic information:
• State of the FB processing (ready)
• Error state of the function block (Error)
>

Input parameters
42976

Parameter Data type Description Possible values


Enable BOOL FB activation FALSE FB is deactivated.
TRUE FB is activated.
ASi_Master INT AS-i master to which the safe 1 AS-i Master 1
AS-i slave is connected.
2 AS-i Master 2
Reset BOOL Control signal to reset the logical FALSE  Control signal is transmitted
device from the locked error state TRUE
(S_ERROR) to the initialisation
state (S_INIT). other No changes

>

Output parameters
43079

Parameter Data type Description Possible values


Ready BOOL Status of the FB processing FALSE FB not completely processed or
(validity of the output signals) deactivated; signals are invalid
TRUE FB completely processed; signals are
valid
Error BOOL Error indication FALSE None of the logical devices is in the
locked error state S_ERROR
TRUE At least one of the logical devices is in
the locked error state S_ERROR
>

193
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3.4 CtrlLocalInputs
43259

Function block type: Function block (FB)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43311

Function block (FB) to control the logical device for two input channels of the local I/O interface
(IN_Channel_A, IN_Channel_B)
The programmer can carry out the following actions via CtrlLocalInputs:
• Unlock the logical device and reset it from the locked error state S_ERROR to the initialisation
state S_INIT (RESET)
The FB provides the following state and diagnostic information:
• Logical values of the two input channels (Chan_A, Chan_B)
• State of the FB processing (ready)
• Error state of the function block (Error)
• Diagnostic information of the logical device (DiagCode)

The FB can be instanced as often as required within the limits of CODESYS.

>

Input parameters
42978

Parameter Data type Description Possible values


Enable BOOL FB activation FALSE FB is deactivated.
TRUE FB is activated.
IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
Reset BOOL Control signal to reset the logical FALSE  Control signal is transmitted
device from the locked error state TRUE
(S_ERROR) to the initialisation
state (S_INIT). other No changes

>

194
SmartPLC SafeLine AC4S with fieldbus interfaces

Output parameters
43075

Parameter Data type Description Possible values


Chan_A BOOL Logic state of signal channel A FALSE = OFF
TRUE = ON
Chan_B BOOL Logical state of the safe signal FALSE = OFF
channel B
TRUE = ON
Ready BOOL Status of the FB processing FALSE FB not completely processed or
(validity of the output signals) deactivated; signals are invalid
TRUE FB completely processed; signals are
valid
Error BOOL Error indication FALSE No error
TRUE Logical device is in the locked error
state S_ERROR
DiagCode WORD Diagnostic code of the internal → Error codes: Local I/O interface (→ S. 269)
states of the controlled logical OR: → List below (Diagnostic codes)
device

Diagnostic codes:
▪ 0x0000 Initialisation

195
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3.5 Ctrl_SetDiagInfo
43245

Function block type: Function block (FB)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43312

Function block (FB) for processing the diagnostic information of a PLCopen function block.
The programmer can carry out the following actions via Ctrl_SetDiagInfo:
• Read diagnostic code (code) of a function block of the safety PLCopen library and transmit it to
the online support centre (OSC) of the AC4S user interface.
• The created error message is structured as follows:
Error PLCopen-FB (FB_Type), instance no. (FB_Number): DC=%s1, DC-1=%s2
▪ FB_Type = ID of the function block
▪ FB_Number = instance number of the function block
▪ DC = current diagnostic code (as hexadecimal value)
▪ DC-1 = last diagnostic code (as hexadecimal value)
The FB provides the following state and diagnostic information:
• State of the FB processing (ready)
• Display of an error during FB processing (Error)

The FB generates a separate message for each change of state in the online support centre
(OSC). The ring memory of the OSC therefore reaches its capacity limits within a short time.
► Use FB Ctrl_SetDiagInfo only for debugging.

196
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Input parameter
43017

Parameter Data type Description Possible values


Enable BOOL FB activation FALSE FB is deactivated.
TRUE FB is activated.
FB_Type INT ID of the function block (is 0x3D6B SF_Antivalent
assigned by the programmer)
0x5096 SF_EDM
0x50A9 SF_EmergencyStop
0x5151 SF_EnableSwitch
0x516E SF_Equivalent
0x56DD SF_ESPE
0x56E2 SF_GuardLocking
0x571A SF_GuardMonitoring
0x5725 SF_ModeSelector
0x5A03 SF_MutingPar
0x5A3C SF_MutingPar_2Sensor
0x5BC4 SF_MutingSeq
0x5BFB SF_OutControl
0x5C48 SF_SafetyRequest
0x5C77 SF_TestableSafetySensor
0x5D8F SF_TwoHandControlTypeII
0x5DB0 SF_TwoHandControlTypeIII
FB_Number INT Instance number of the function
block (is assigned by the
programmer)
DiagCode INT Diagnostic code of the safety → Operating instructions safety PLCopen library in
PLCopen function block CODESYS

The diagnostic code of the safety PLCopen FBs are of data type WORD.

>

Output parameters
43074

Parameter Data type Description Possible values


Ready BOOL Status of the transmission of the FALSE At present no transmission request
diagnostic code
TRUE Transmission of the diagnostic code
successfully completed
Error BOOL Error indication FALSE No error occurred during FB
processing
TRUE Error occurred during FB processing;
transmission of the diagnostic code
failed

197
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3.6 GetLocalInput
43013

Function block type: Function block (FB)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43286

Function block (FB) for access to a non-safe input channel of the local I/O interface (IN_Channel)
The programmer can carry out the following actions via GetLocalInput:
• Detect the non-safe, logical state of the selected input channel and provide the value (IN).
The FB provides the following state and diagnostic information:
• State of the FB processing (ready)
• Error state of the function block (Error)
>

Input parameters
42977

Parameter Data type Description Possible values


Enable BOOL FB activation FALSE FB is deactivated.
TRUE FB is activated.
IN_Channel INT Local input channel to which the 1 Local input IN1
sensor is connected. ... ...
8 Local input IN8

Output parameters
43076

Parameter Data type Description Possible values


IN BOOL Logic state of the selected input FALSE OFF
channel
TRUE ON
Ready BOOL Status of the FB processing FALSE FB not completely processed or
(validity of the output signals) deactivated; signals are invalid
TRUE FB completely processed; signals are
valid
Error BOOL Error indication FALSE No error
TRUE Error occurred during FB execution

198
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.3.7 SetLocalOutput
43136

Function block type: Function block (FB)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43283

Function block (FB) for access to a non-safe output channel of the local I/O interface (OUT_Channel)
The programmer can carry out the following actions via SetLocalOutput:
• Provide a non-safe Boolean value (OUT) at the selected output channel
The FB provides the following state and diagnostic information:
• State of the FB processing (ready)
• Error state of the function block (Error)
>

Input parameters
42974

Parameter Data type Description Possible values


Enable BOOL FB activation FALSE FB is deactivated.
TRUE FB is activated.
OUT_Channel INT Local output to which the 1 Local output OUT1
actuator is connected. ... ...
4 local output OUT4
OUT BOOL Required logical state of the local FALSE OFF
output channel
TRUE ON

The outputs of the local I/O interface can only implement a maximum switching frequency of
25 Hz.
► When digital signals are generated at the local outputs, observe the minimum switch-on or
switch-off time of 20 ms.

>

Output parameters
43080

Parameter Data type Description Possible values


Ready BOOL Status of the FB processing FALSE FB not completely processed or
(validity of the output signals) deactivated; signals are invalid
TRUE FB completely processed; signals are
valid
Error BOOL Error indication FALSE No error
TRUE Error occurred during FB execution
>

199
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.4 Library SF_LogicalInterfaces.library


Content
Remarks about logical devices .............................................................................................................201
Logical devices for safe AS-i slaves .....................................................................................................205
Logical devices for the local I/O interface .............................................................................................235
42993

The library SF_LogicalInterfaces.library provides logical devices.

200
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.4.1 Remarks about logical devices


Content
State machines for logical preprocessing ...........................................................................................201
States....................................................................................................................................................201
State transitions ....................................................................................................................................201
Diagnostic messages ...........................................................................................................................204
43070
>

State machines for logical preprocessing


42985

The safe input signals are preprocessed by means of state machines. Each logical device has its own
state machine which creates a safe process signal from the input signals and the set parameters.
A state machine consists of the following components:
• States (→States (→ S. 201)
• State transitions (→State transitions (→ S. 201)
>

States
42979

Number and type of state result from the scope of the logical evaluation function. The exact
description of the states is given in the documentation of the diagnostic messages of the individual
logical devices.
>

State transitions
42980

The state machine checks in each PLC cycle which conditions for a state transition are fulfilled.
State transitions can be triggered by the following conditions:
• Signal states of the input signals (→States of the input signals (→ S. 202)
• System events (→System events (→ S. 203)
• Timer events (→Timer events (→ S. 203)

201
SmartPLC SafeLine AC4S with fieldbus interfaces

>

States of the input signals


43002

Depending on the type of logical device the following definitions apply:


• AS-i slaves
Safe AS-i input slaves transmit their input data as unambiguous code sequences. A code
sequence consists of 2 half-sequences with each half sequence representing a signal channel.
• Local I/O interface
At the local I/O interface each input represents a signal channel.

The combination of the two signal channels results in the following states and the respective state
events:

State State / Description Transition event


NoChan The signal channels A and B are in the logical state FALSE E_NoChan
ChanA_only Signal channel A is in the logical state TRUE. E_ChanA_Only
Signal channel B is in the logical state FALSE.
ChanB_only Signal channel A is in the logical state FALSE. E_ChanB_only
Signal channel B is in the logical state TRUE.
ChanAB The signal channels A and B are in the logical state TRUE. E_ChanAB
ChanInvalid* The logical value of the signal channels is invalid (e.g. code sequence is incomplete, E_ChanInvalid
code sequence invalid)
* ... Only available for logical devices for AS-i input slaves

>

Sequence of the signal changes


43043

The combination of the input signals "ChanA_only" and "ChanB_only" and the state of the parameter
"P_Chan_B_first" allows to define state transitions which consider the sequence of the signal change
at the input channels:

State / Description Transition event


ChanA = TRUE UND ChanB = FALSE UND Chan_B_first = TRUE E_ChanA; P_ChanB_first = TRUE
ChanA = TRUE UND ChanB = FALSE UND Chan_B_first = FALSE E_ChanA; P_ChanB_first = FALSE
ChanB = TRUE UND ChanA = FALSE UND Chan_B_first = TRUE E_ChanB; P_ChanB_first = TRUE
ChanB = TRUE UND ChanA = FALSE UND Chan_B_first = FALSE E_ChanB; P_ChanB_first = FALSE

202
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Start-up test
43102

If with activated start-up test in the start state both input signals "ChanA" = TRUE and "ChanB" =
TRUE, the state machine first goes through a state cycle until both input signals simultaneously take
the value FALSE.

State / Description Transition event


ChanA = TRUE UND ChanB = TRUE UND StartupTest = FALSE E_ChanAB_without Startup Test
ChanA = TRUE UND ChanB = TRUE UND StartupTest = TRUE E_ChanAB_with Startup Test

>

System events
43016

Following system events start processing of the state machine of the logical device:
• Start event after successful initialisation of the state machine (E_Start)
Following system events change the state machine of the logical device to the initialisation state
(S_INIT):
• A reset signal generated in the safe application (E_ErrorReset)
• AS-i input slaves: Communication and configuration errors (→Error codes: Safe AS-i slaves
(→ S. 267)
• Local inputs/outputs: Configuration and system errors (→Error codes: Local I/O interface
(→ S. 269)
>

Timer events
43011

Timers are started when a state is exited. When the timer has elapsed, a respective event is created.
This timer event is used by the event machine as condition for the transition to the next state. If one or
several timer events occur simultaneously, the event with the highest priority is processed.
The logical devices can evaluate the following times when the safe process signal is generated:

Designation Description Timer event Priority


InvalidTime ▪ Time span within which the signal channels may have an invalid state E_InvalTimeout 1
without the device changing into the locked error state.
▪ Firmly set
SynchTime ▪ Time span within which the signal channels have to take the same E_SynchTimeout 2
logical state.
▪ Programmable by programmer
StabilisingTime ▪ Time span within which the states of the signal channels have to be E_StabTimeout 3
stable to trigger a state change in the evaluation logic.
▪ Programmable by programmer
ToleranceTime ▪ Time span within which the state FALSE is tolerated at one of the two E_TolTimeout 4
signal channels without switching-off or changing to the test state.
▪ Programmable by programmer

203
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Diagnostic messages
43295

By means of the parameter "DisableLogging" the programmer can control the routing of state
messages of the logical devices to the online support centre (OSC). If the parameter is deactivated, all
state changes and error events are transmitted to the OSC. If the parameter is activated, only error
events are transmitted to the OSC.

Message type States Description


Error message S_Test_e State for going through the start-up test
S_Error_e Locked error state
S_Init_e Initialisation state
Status message S_OFF_e Safe OFF
S_ON_e Safe OFF

204
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.4.2 Logical devices for safe AS-i slaves


Content
SF_IN_ASi_forced ................................................................................................................................206
SF_IN_ASi_independent ......................................................................................................................210
SF_IN_ASi_conditionally_dependent ...................................................................................................214
SF_IN_ASi_dependent .........................................................................................................................218
SF_IN_ASi_dependent_filter_w_testreq ..............................................................................................222
SF_IN_ASi_dependent_filter_ntestreq .................................................................................................226
SF_IN_ASi_dependent_filter_nshutdown ............................................................................................230
SF_OUTcontrol_ASi .............................................................................................................................234
43104

205
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_ASi_forced
43133

Device type: AS-i slave (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43255

Logical device for the evaluation of a safe AS-i input slave with 2 positively-driven contacts/channels
SF_IN_ASi_forced detects switching states of the two signal channels of the AS-i slaves
(ASi_SlaveAdr, ASi_Master). The logical device forms the logical AND connector from the two values
and provides the result as safe control signal. The following additional conditions apply for the logical
signal evaluation:
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on and
switch-off. If both signal channels do not take the same switching status during the fixed time, the
logical device changes to the locked error state. (InvalidTime = const. = 100ms)
The programmer can activate the following functions as option:
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

To reset the logical device from the locked error state: → CtrlASi_InSlave (→ S. 188)

206
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43069

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
* ... Default value

>

Process data
43124

Parameter Data type Description Possible values


S_IN_forced SAFEBOOL Safe process signal FALSE Safe OFF
TRUE Safe ON

>

207
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


43000

The state diagram shows the logical signal evaluation of the logical device:

>

208
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43280

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0xC800 S_Error Locked error state OFF

209
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_ASi_independent
43115

Device type: AS-i slave (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43302

Logical device for a safe sensor with 2 contacts/channels acting independently of each other
SF_IN_ASi_independent detects switching states of the two signal channels/contacts of a safe AS-i
slave (ASi_SlaveAdr, ASi_Master). The logical device forms the logical AND connector from the two
values and provides the result as safe control signal. The following additional conditions apply for the
logical signal evaluation:
• The simultaneity of the signal change is not monitored.
• If the signal state of the two channels is invalid longer than the firmly set time, both signal
channels have to take the state FALSE simultaneously before switch-on is possible again.
(InvalidTime = const. = 2000ms)
The programmer can activate the following functions as option:
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlASi_InSlave (→ S. 188)

210
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43072

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
* ... Default value

Process data
43127

Parameter Data type Description Possible values


S_IN_indep SAFEBOOL Safe process signal FALSE safety function OFF

TRUE safety function ON

>

211
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42999

The state diagram shows the logical signal evaluation of the logical device:

>

212
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43279

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8822 S_Half 1 channel = TRUE OFF

213
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_ASi_conditionally_dependent
43132

Device type: AS-i slave (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43303

Logical device for a safe sensor with 2 conditionally interdependently acting contacts/channels
SF_IN_ASi_conditionally_dependent detects the switching states of the two signal channels of the
AS-i slave (ASi_SlaveAdr, ASi_Master). The logical device forms the logical AND connector from the
two values and provides the result as safe control signal. The following additional conditions apply for
the logical signal evaluation:
• The sequence of the signal changes of the two contacts/channels is monitored during switch-on
and switch-off. If the sequence of the signal change deviates from the set sequence, the logical
device changes to the locked error state. (Chan_B_first)
• If the signal state of the two signal channels is invalid longer than the firmly set time, the logical
device changes to the locked error state. (InvalidTime = const. = 140ms)
The programmer can activate the following functions as option:
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlASi_InSlave (→ S. 188)

214
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43067

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
Chan_B_first BOOL Required sequence of the signal FALSE Channel A = TRUE before
state changes channel B = TRUE
TRUE Channel B = TRUE before
channel B = TRUE
* ... Default value

>

Process data
43128

Parameter Data type Description Possible values


S_IN_cond_dep SAFEBOOL Safe process signal FALSE Safe OFF
TRUE Safe ON

>

215
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42994

The state diagram shows the logical signal evaluation of the logical device:

>

216
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43281

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8813 S_Transit Transition state OFF
0x8814 S_Transit Transition state OFF
0x8824 S_ChanAllow 1 channel = TRUE, signal sequence OK OFF
0xC800 S_Error Locked error state OFF

217
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_ASi_dependent
43131

Device type: AS-i slave (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43254

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_ASi_dependent detects the switching states of the two signal channels/contacts of the AS-i
slave (ASi_SlaveAdr, ASi_Master). The logical device forms the logical AND connector from the two
values and provides the result as safe control signal. The following additional conditions apply for the
logical signal evaluation:
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• If the signal state of the two signal channels is invalid longer than the firmly set time, the logical
device changes to the locked error state. (InvalidTime = const. = 140ms)
The programmer can activate the following functions as option:
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlASi_InSlave (→ S. 188)

218
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43068

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
* ... Default value

>

Process data
43123

Parameter Data type Description Possible values


S_IN_dependent SAFEBOOL Safe process signal FALSE Safe OFF
TRUE Safe ON

219
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42992

The state diagram shows the logical signal evaluation of the logical device:

>

220
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43282

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0xC800 S_Error Locked error state OFF

221
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_ASi_dependent_filter_w_testreq
43134

Device type: AS-i slave (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43305

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_dependent_filter_w_testreq detects the switching states of the two contacts/channels of the
AS-i slave (ASi_SlaveAdr, ASi_Master). The logical device forms the logical AND connector from the
two values and provides the result as safe control signal. The following additional conditions apply for
the logical signal evaluation:
• The contacts/channels are debounced during switch-on: Signal changes that are applied shorter
than the set stabilisation time do not lead to a change in state. (StabilisingTime).
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• Before the two contacts/channels are switched on again, they have to be FALSE simultaneously.
• If after the start the two contacts/channels do not take a valid signal state within a firmly set time,
the logical device changes to the locked error state. (InvalidTime = const. = 140 ms)
• If during switching both signals are longer invalid than the set stabilisation time, the logical device
changes to the locked error state. (StabilisingTime)
The programmer can activate the following functions as option:
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlASi_InSlave (→ S. 188)

222
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43065

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
StabilisingTime WORD Max. bounce time 250 250 milliseconds *
... ...
10000 10000 milliseconds
* ... Default value

Process data
43126

Parameter Data type Description Possible values


S_IN_dep_filter_testreq SAFEBOOL Safe process signal FALSE Safety function OFF

TRUE Safety function ON

>

223
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42991

The state diagram shows the logical signal evaluation of the logical device:

>

224
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43294

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188)
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8802 S_ON_C Both channels = TRUE, check the set timer OFF
0x8803 S_OFF_C Both channels = FALSE, check the set timer OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0xC800 S_Error Locked error state OFF

225
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_ASi_dependent_filter_ntestreq
43135

Device type: AS-i slave (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43304

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_dependent_filter_ntestreq detects the switching states of the two signals/channels of the AS-i
slave (ASi_SlaveAdr, ASi_Master). The logical device forms the logical AND connector from the two
values and provides the result as safe control signal. The following additional conditions apply for the
logical signal evaluation:
• The contacts/channels are debounced during switch-on: Signal changes that are applied shorter
than the set stabilisation time do not lead to a change in state. (StabilisingTime)
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• If both contacts/channels take the value TRUE again during the switch-off process, switch-on
occurs at once. When the tolerance time has elapsed, the two contacts/channels have to take the
value FALSE again simultaneously before switch-on is possible again. (ToleranceTime)
• If after the start the two contacts/channels do not take a valid signal state within a firmly set time,
the logical device changes to the locked error state. (InvalidTime = const. = 140 ms)
• If during switching both signals are longer invalid than the set stabilisation time, the logical device
changes to the locked error state. (StabilisingTime)
The programmer can activate the following functions as option:
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlASi_InSlave (→ S. 188)

226
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43055

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
StabilisingTime WORD Max. bounce time 250 250 milliseconds *
... ...
10000 10000 milliseconds
ToleranceTime WORD Tolerance time for switch-off 250 250 milliseconds *
... ...
1000 1000 milliseconds
* ... Default value

>

Process data
43122

Parameter Data type Description Possible values


S_IN_dep_filter_ntest SAFEBOOL Safe process signal FALSE safety function OFF
TRUE safety function ON

>

227
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42989

The state diagram shows the logical signal evaluation of the logical device:

>

228
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43293

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8802 S_ON_C Both channels = TRUE, check the set timer OFF
0x8803 S_OFF_C Both channels = FALSE, check the set timer OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0xC800 S_Error Locked error state OFF

229
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_ASi_dependent_filter_nshutdown
43130

Device type: AS-i slave (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43301

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_dependent_filter_nshutdown detects the switching states of the two contacts/channels of the
AS-i slave (ASi_SlaveAdr, ASi_Master). The logical device forms the logical AND connector from the
two values and provides the result as safe control signal. The following additional conditions apply for
the logical signal evaluation:
• The contacts/channels are debounced during switch-on: Signal changes that are applied shorter
than the set stabilisation time do not lead to a change in state. (StabilisingTime)
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• If both contacts/channels take the value TRUE again during the switch-off process, switch-on
occurs at once. When the tolerance time has elapsed, the two contacts/channels have to take the
value FALSE again simultaneously before switch-on is possible again. (ToleranceTime)
• If after the start the two contacts/channels do not take a valid signal state within a firmly set time,
the logical device changes to the locked error state. (InvalidTime = const. = 140 ms)
• If during switching both signals are longer invalid than the set stabilisation time, the logical device
changes to the locked error state. (StabilisingTime)
The programmer can activate the following functions as option:
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlASi_InSlave (→ S. 188).

When this logical device is used, the process safety time (PST) of the system is extended by
one cycle time of the fail-safe PLC.
► Note the remarks about process safety time (→ Device manual, Process safety time)!
► Observe the set cycle time of the fail-safe PLC (→ Set cycle time of the fail-safe PLC
(→ S. 100))!

>

230
SmartPLC SafeLine AC4S with fieldbus interfaces

Parameter data
43054

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
StabilisingTime WORD Max. bounce time 250 250 milliseconds *
... ...
10000 10000 milliseconds
ToleranceTime WORD Tolerance time for switch-off 250 250 milliseconds *
... ...
1000 1000 milliseconds
* ... Default value

>

Process data
43118

Parameter Data type Description Possible values


S_IN_dep_nshutdown SAFEBOOL Safe process signal FALSE safety function OFF
TRUE safety function ON

>

231
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42990

The state diagram shows the logical signal evaluation of the logical device:

>

232
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43296

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8802 S_ON_C Both channels = TRUE, check the set timer OFF
0x8803 S_OFF_C Both channels = FALSE, check the set timer OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8815 S_Transit Transition state ON
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0x8825 S_ONE_CHAN_V 1 channel = TRUE; tolerance time not yet elapsed ON
0xC800 S_Error Locked error state OFF

233
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_OUTcontrol_ASi
43114

Device type: AS-i slave (output)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43298

Logical device for a safe AS-i control slave (ASi_SlaveAdr, ASi_Master)


SF_OUTControl_ASi generates a safe output signal (S_OUT) from the configured process data value.
The safe output signal controls the AS-i control slave that generates a safe code sequence with which
one or several safe AS-i output slaves can be enabled.
The programmer can activate the following functions:
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.
>

Parameter data
43053

Parameter Data type Description Possible values


ASi_SlaveAdr INT Address of the AS-i slave 1 Slave address 1
... ...
31 slave address 31
ASi_Master INT AS-i master to which the AS-i 1 AS-i Master 1
slave is connected
2 AS-i Master 2
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
* ... Default value

>

Process data
43117

Parameter Data type Description Possible values


S_OUT SAFEBOOL Release of the safe AS-i output FALSE safety function OFF
slave
TRUE safety function ON

234
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.4.3 Logical devices for the local I/O interface


Content
SF_IN_local_forced ..............................................................................................................................236
SF_IN_local_independent ....................................................................................................................240
SF_IN_local_conditionally_dependent .................................................................................................244
SF_IN_local_dependent .......................................................................................................................248
SF_IN_local_dependent_filter_testreq .................................................................................................252
SF_IN_local_dependent_filter_ntestreq ...............................................................................................256
SF_IN_local_dependent_filter_nshutdown...........................................................................................260
SF_OUT_local_single ...........................................................................................................................264
SF_OUT_local_dual .............................................................................................................................265
SF_OUT_local_testpulse ......................................................................................................................266
43108

235
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_local_forced
43088

Interface type: Local I/O interface (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43314

Logical device for safe sensors with 2 positively-driven contacts/channels


SF_IN_local_forced detects the two signals of a safe sensor at the local I/O interface (IN_Channel_A,
IN_Channel_B). The logical device forms the logical AND connector from the two values and provides
the result as safe control signal. The following additional conditions apply for the logical signal
evaluation:
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on and
switch-off. If both signal channels do not take the same switching status during the fixed time, the
logical device changes to the locked error state. (InvalidTime = const. = 100 ms)
The programmer can activate the following functions as option:
• EnableIN_Test:
A test signal for cross-fault monitoring generated at a local output channel at the local I/O interface
is evaluated.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

If cross-fault detection is activated for 2-channel safe devices at the local I/O interface
(EnableIN_Test = TRUE), the following applies:
Signal change at the inputs (IN_Channel_A, IN_Channel_B) must be applied longer than the
cycle time of the test pulses (3 PLC cycles). Otherwise the logical device changes to the
locked error state.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlLocalInputs (→ S. 194).

236
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43058

Parameter Data type Description Possible values


IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
EnableIN_Test BOOL Evaluation of a test signal which FALSE Test signal is ignored *
was created by a local output
TRUE Test signal is evaluated
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
* ... Default value

>

Process data
43116

Parameter Data type Description Possible values


S_IN_forced SAFEBOOL Safe process signal FALSE SAFE OFF
TRUE Safe ON

>

237
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


43001

The state diagram shows the logical signal evaluation of the logical device:

>

238
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43280

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0xC800 S_Error Locked error state OFF

239
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_local_independent
43093

Interface type: Local I/O interface (input)


Library: sf_io.library
Symbol in CODESYS:

>

Description
43307

Logical device for a safe sensor with 2 contacts/channels acting independently of each other
SF_IN_local_independent detects switching states of 2 input channels of the local I/O interface
(IN_Channel_A, IN_Channel_B). The logical device forms the logical AND connector from the two
values and provides the result as safe control signal. The following additional conditions apply for the
logical signal evaluation:
• The simultaneity of the signal change is not monitored.
• If the signal state of the two channels is invalid longer than the firmly set time, both signal
channels have to take the state FALSE simultaneously before switch-on is possible again.
(InvalidTime = const. = 140ms)
The programmer can activate the following functions as option:
• EnableIN_Test:
A test signal for cross-fault monitoring generated at a local output channel at the local I/O interface
is evaluated.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

If cross-fault detection is activated for 2-channel safe devices at the local I/O interface
(EnableIN_Test = TRUE), the following applies:
Signal change at the inputs (IN_Channel_A, IN_Channel_B) must be applied longer than the
cycle time of the test pulses (3 PLC cycles). Otherwise the logical device changes to the
locked error state.

To read the diagnostic information of the logical device: → CtrlLocalInputs (→ S. 194).

240
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43052

Parameter Data type Description Possible values


IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
EnableIN_Test BOOL Evaluation of a test signal which FALSE Test signal is ignored *
was created by a local output
TRUE Test signal is evaluated
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
* ... Default value

>

Process data
43119

Parameter Data type Description Possible values


S_IN_indep SAFEBOOL Status of the safety function FALSE Safe OFF or error
TRUE Safe ON and no error

>

241
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42998

The state diagram shows the logical signal evaluation of the logical device:

>

242
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43279

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8822 S_Half 1 channel = TRUE OFF

243
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_local_conditionally_dependent
43097

Interface type: Local I/O interface (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43310

Logical device for a safe sensor with 2 conditionally interdependently acting contacts/channels
SF_IN_local_conditionally_dependent detects the switching states of the two input channels of the
local I/O interface (IN_Channel_A, IN_Channel_B). The logical device forms the logical AND
connector from the two values and provides the result as safe control signal. The following additional
conditions apply for the logical signal evaluation:
• The sequence of the signal changes of the two contacts/channels is monitored during switch-on
and switch-off. If the sequence of the signal change deviates from the set sequence, the logical
device changes to the locked error state. (Chan_B_first)
• If both signal channels do not take the same switching status during the fixed time, the logical
device changes to the locked error state. (InvalidTime = const. = 140ms)
The programmer can activate the following functions as option:
• EnableIN_Test:
A test signal for cross-fault monitoring generated at a local output channel at the local I/O interface
is evaluated.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

If cross-fault detection is activated for 2-channel safe devices at the local I/O interface
(EnableIN_Test = TRUE), the following applies:
Signal change at the inputs (IN_Channel_A, IN_Channel_B) must be applied longer than the
cycle time of the test pulses (3 PLC cycles). Otherwise the logical device changes to the
locked error state.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlLocalInputs (→ S. 194).

Parameter data
43056

Parameter Data type Description Possible values


IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
EnableIN_Test BOOL Evaluation of a test signal which FALSE Test signal is ignored *

244
SmartPLC SafeLine AC4S with fieldbus interfaces

was created by a local output TRUE Test signal is evaluated


DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
Chan_B_first BOOL Required sequence of the signal FALSE Channel A = TRUE before
state changes channel B = TRUE
TRUE Channel B = TRUE before
channel B = TRUE
* ... Default value

>

Process data
43120

Parameter Data type Description Possible values


S_IN_cond_dep SAFEBOOL Safe process signal FALSE Safe OFF or error state

TRUE Safe ON and no error state

>

245
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42986

The state diagram shows the logical signal evaluation of the logical device:

>

246
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43281

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8813 S_Transit Transition state OFF
0x8814 S_Transit Transition state OFF
0x8824 S_ChanAllow 1 channel = TRUE, signal sequence OK OFF
0xC800 S_Error Locked error state OFF

247
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_local_dependent
43096

Interface type: Local I/O interface (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43313

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_local_dependent detects the switching states of the two input channels (IN_Channel_A,
IN_Channel_B). The logical device forms the logical AND connector from the two values and provides
the result as safe control signal. The following additional conditions apply for the logical signal
evaluation:
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• If the signal state of the two signal channels is invalid longer than the firmly set time, the logical
device changes to the locked error state. (InvalidTime = const. = 140ms)
The programmer can activate the following functions as option:
• EnableIN_Test:
A test signal for cross-fault monitoring generated at a local output channel at the local I/O interface
is evaluated.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

If cross-fault detection is activated for 2-channel safe devices at the local I/O interface
(EnableIN_Test = TRUE), the following applies:
Signal change at the inputs (IN_Channel_A, IN_Channel_B) must be applied longer than the
cycle time of the test pulses (3 PLC cycles). Otherwise the logical device changes to the
locked error state.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlLocalInputs (→ S. 194).

248
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43057

Parameter Data type Description Possible values


IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
EnableIN_Test BOOL Evaluation of a test signal which FALSE Test signal is ignored *
was created by a local output
TRUE Test signal is evaluated
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
* ... Default value

Process data
43121

Parameter Data type Description Possible values


S_IN_dep SAFEBOOL Safe process signal FALSE SAFE OFF
TRUE Safe ON

>

249
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42995

The state diagram shows the logical signal evaluation of the logical device:

>

250
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43282

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0xC800 S_Error Locked error state OFF

251
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_local_dependent_filter_testreq
43089

Interface type: Local I/O interface (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43306

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_local_dependent_filter_w_testreq detects the switching states of the two input channels
(IN_Channel_A, IN_Channel_B). The logical device forms the logical AND connector from the two
values and provides the result as safe control signal. The following additional conditions apply for the
logical signal evaluation:
• The contacts/channels are debounced during switch-on: Signal changes that are applied shorter
than the set stabilisation time do not lead to a change in state. (StabilisingTime)
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• Before the two contacts/channels are switched on again, they have to be FALSE simultaneously.
• If after the start the two contacts/channels do not take a valid signal state within a firmly set time,
the logical device changes to the locked error state. (InvalidTime = const. = 140 ms)
• If during switching both signals are longer invalid than the set stabilisation time, the logical device
changes to the locked error state. (StabilisingTime)
The programmer can activate the following functions as option:
• EnableIN_Test:
A test signal for cross-fault monitoring generated at a local output channel at the local I/O interface
is evaluated.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

If cross-fault detection is activated for 2-channel safe devices at the local I/O interface
(EnableIN_Test = TRUE), the following applies:
Signal change at the inputs (IN_Channel_A, IN_Channel_B) must be applied longer than the
cycle time of the test pulses (3 PLC cycles). Otherwise the logical device changes to the
locked error state.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlLocalInputs (→ S. 194).

>

252
SmartPLC SafeLine AC4S with fieldbus interfaces

Parameter data
43048

Parameter Data type Description Possible values


IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
EnableIN_Test BOOL Evaluation of a test signal which FALSE Test signal is ignored *
was created by a local output
TRUE Test signal is evaluated
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
StabilisingTime WORD Max. bounce time 250 250 milliseconds *
... ...
10000 10000 milliseconds
* ... Default value

>

Process data
43129

Parameter Data type Description Possible values


S_IN_dep_filter_testreq SAFEBOOL Safe process signal FALSE SAFE OFF
TRUE Safe ON

>

253
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42996

The state diagram shows the logical signal evaluation of the logical device:

>

254
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43294

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188)
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8802 S_ON_C Both channels = TRUE, check the set timer OFF
0x8803 S_OFF_C Both channels = FALSE, check the set timer OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0xC800 S_Error Locked error state OFF

255
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_local_dependent_filter_ntestreq
43090

Interface type: Local I/O interface (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43309

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_local_dependent_filter_w_testreq detects the switching states of the two input channels
(IN_Channel_A, IN_Channel_B). The logical device forms the logical AND connector from the two
values and provides the result as safe control signal. The following additional conditions apply for the
logical signal evaluation:
• The contacts/channels are debounced during switch-on: Signal changes that are applied shorter
than the set stabilisation time do not lead to a change in state. (StabilisingTime)
• If the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
both contacts/channels take the value TRUE again during the switch-off process, switch-on occurs
at once. When the tolerance time has elapsed, the two contacts/channels have to take the value
FALSE again simultaneously before switch-on is possible again. (ToleranceTime)
• If after the start the two contacts/channels do not take a valid signal state within a firmly set time,
the logical device changes to the locked error state. (InvalidTime = const. = 140 ms)
• If during switching both signals are longer invalid than the set stabilisation time, the logical device
changes to the locked error state. (StabilisingTime)
The programmer can activate the following functions as option:
• EnableIN_Test:
A test signal for cross-fault monitoring generated at a local output channel at the local I/O interface
is evaluated.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

If cross-fault detection is activated for 2-channel safe devices at the local I/O interface
(EnableIN_Test = TRUE), the following applies:
Signal change at the inputs (IN_Channel_A, IN_Channel_B) must be applied longer than the
cycle time of the test pulses (3 PLC cycles). Otherwise the logical device changes to the
locked error state.

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlLocalInputs (→ S. 194).

>

256
SmartPLC SafeLine AC4S with fieldbus interfaces

Parameter data
43047

Parameter Data type Description Possible values


IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
EnableIN_Test BOOL Evaluation of a test signal which FALSE Test signal is ignored *
was created by a local output
TRUE Test signal is evaluated
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
StabilisingTime WORD Max. bounce time 250 250 milliseconds *
... ...
10000 10000 milliseconds
ToleranceTime WORD Tolerance time for switch-off 250 250 milliseconds *
... ...
1000 1000 milliseconds
* ... Default value

Process data
43139

Parameter Data type Description Possible values


S_IN_dep_filter_no_testreq SAFEBOOL Safe process signal FALSE SAFE OFF
TRUE Safe ON

>

257
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42987

The state diagram shows the logical signal evaluation of the logical device:

>

258
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43293

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8802 S_ON_C Both channels = TRUE, check the set timer OFF
0x8803 S_OFF_C Both channels = FALSE, check the set timer OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0xC800 S_Error Locked error state OFF

259
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_IN_local_dependent_filter_nshutdown
43094

Device type: Local I/O interface (input)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43308

Logical device for a safe sensor with 2 interdependently acting contacts/channels


SF_IN_local_dependent_filter_nshutdown detects the switching states of the two input channels of the
local I/O interface (IN_Channel_A, IN_Channel_B). The logical device forms the logical AND
connector from the two values and provides the result as safe control signal. The following additional
conditions apply for the logical signal evaluation:
• The contacts/channels are debounced during switch-on: Signal changes that are applied shorter
than the set stabilisation time do not lead to a change in state. (StabilisingTime)
• Simultaneity of the signal change of the two contacts/channels is monitored during switch-on: If
the signal states are not equal for a longer time than the set synchronisation time, both
contacts/channels have to take the value FALSE simultaneously before switch-on is possible
again. (SynchTime)
• If both contacts/channels take the value TRUE again during the switch-off process, switch-on
occurs at once. When the tolerance time has elapsed, the two contacts/channels have to take the
value FALSE again simultaneously before switch-on is possible again. (ToleranceTime)
• If after the start the two contacts/channels do not take a valid signal state within a firmly set time,
the logical device changes to the locked error state. (InvalidTime = const. = 140ms)
The programmer can activate the following functions as option:
• EnableIN_Test:
A test signal for cross-fault monitoring generated at a local output channel at the local I/O interface
is evaluated.
• StartupTest:
Both signal channels must take the state FALSE simultaneously before the logical device can start
with the signal evaluation.
• DisableLogging:
Only error events are transmitted to the online support centre (OSC) of the AC4S user interface.

If cross-fault detection is activated for 2-channel safe devices at the local I/O interface
(EnableIN_Test = TRUE), the following applies:
Signal change at the inputs (IN_Channel_A, IN_Channel_B) must be applied longer than the
cycle time of the test pulses (3 PLC cycles). Otherwise the logical device changes to the
locked error state.

When this logical device is used, the process safety time (PST) of the system is extended by
one cycle time of the fail-safe PLC.
► Note the remarks about process safety time (→ Device manual, Process safety time)!
► Observe the set cycle time of the fail-safe PLC (→ Set cycle time of the fail-safe PLC
(→ S. 100))!

To reset the logical device from the locked error state and to read diagnostic information of the
logical device: → CtrlLocalInputs (→ S. 194).

260
SmartPLC SafeLine AC4S with fieldbus interfaces

>

Parameter data
43046

Parameter Data type Description Possible values


IN_Channel_A INT Local input to which sensor 1 Local input IN1
channel A is connected. ... ...
8 local input IN8
IN_Channel_B INT Local input to which sensor 1 Local input IN1
channel B is connected. ... ...
8 local input IN8
EnableIN_Test BOOL Evaluation of a test signal which FALSE Test signal is ignored *
was created by a local output
TRUE Test signal is evaluated
DisableLogging BOOL Transmission of the event FALSE Following states of the state diagram
messages to OSC of the device are transmitted to the OSC: *
▪ S_ON
▪ S_OFF
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
TRUE Following states of the state diagram
are transmitted to the OSC:
▪ S_Test
▪ S_Error
▪ S_Init (HW-Error)
EnableStartupTest BOOL Control execution of the start-up FALSE No start-up test *
test
TRUE Start-up test is executed; slave waiting
for start-up sequence OFF  ON
SynchTime WORD Synchronisation time 0 Infinite
250 250 milliseconds
... ...
500 500 milliseconds *
... ...
60000 60000 milliseconds
StabilisingTime WORD Max. bounce time 250 250 milliseconds *
... ...
10000 10000 milliseconds
ToleranceTime WORD Tolerance time for switch-off 250 250 milliseconds *
... ...
1000 1000 milliseconds
* ... Default value

>

Process data
43138

Parameter Data type Description Possible values


S_IN_dep_ntshutdown SAFEBOOL Safe process signal FALSE Safe OFF or error
TRUE Safe ON and no error

>

261
SmartPLC SafeLine AC4S with fieldbus interfaces

State diagram (state machine)


42983

The state diagram shows the logical signal evaluation of the logical device:

>

262
SmartPLC SafeLine AC4S with fieldbus interfaces

Diagnostic information
43296

The logical device creates diagnostic codes. They reflect the active internal state of the evaluation
logic (state machine). The diagnostic codes can be read with the following FB: → CtrlASi_InSlave
(→ S. 188).
Following diagnostic codes exist:

DiagCode Name Description Output


0x0000 S_Init Initialisation state OFF
0x8001 S_Startup Start state OFF
0x8002 S_OFF Safe OFF OFF
0x8000 S_ON Safe ON ON
0x8801 S_Test State for going through the start-up test OFF
0x8802 S_ON_C Both channels = TRUE, check the set timer OFF
0x8803 S_OFF_C Both channels = FALSE, check the set timer OFF
0x8810 S_Transit Transition state OFF
0x8811 S_Transit Transition state OFF
0x8815 S_Transit Transition state ON
0x8820 S_ONE_CHAN_C 1 channel = TRUE, test of the synchronisation time OFF
0x8821 S_ONE_CHAN_O 1 channel = TRUE, synchronisation time elapsed OFF
0x8825 S_ONE_CHAN_V 1 channel = TRUE; tolerance time not yet elapsed ON
0xC800 S_Error Locked error state OFF

263
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_OUT_local_single
43091

Interface type: Local I/O interface (output)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43285

Logical device for a 1-channel safe actuator at the local I/O interface
SF_OUT_local_single detects the Boolean value at the process data signal (OUT_). The logical device
generates a safe Boolean signal and provides the value at the configured output channel of the local
I/O interface (OUT_Channel).
>

Parameter data
43051

Parameter Data type Description Possible values


OUT_Channel INT Local output to which the 1 Local output OUT1
actuator is connected. ... ...
4 local output OUT4
DisableLogging Reserved - settings have no influence on function of the logical device

Process data
43137

Parameter Data type Description Possible values


OUT_ SAFEBOOL Target status of the output / the FALSE SAFE OFF
outputs
TRUE Safe ON

264
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_OUT_local_dual
43092

Device type: Local I/O interface (output)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43287

Logical device to control a 2-channel safe actuator at the local I/O interface
SF_OUT_local_dual detects the Boolean value at the process data signal (OUT_). The logical device
generates a safe Boolean signal and provides the value at the configured output channels of the local
I/O interface (OUT_Channel_A, OUT_Channel_B).
>

Parameter data
43049

Parameter Data type Description Possible values


OUT_Channel_A INT Local output to which actuator 1 Local output OUT1
channel A is connected. ... ...
4 Local output OUT4
OUT_Channel_B INT Local output to which actuator 1= Local output OUT1
channel B is connected. ... ...
4= Local output OUT4
DisableLogging Reserved - settings have no influence on function of the logical device

>

Process data
43009

Parameter Data type Description Possible values


OUT_ SAFEBOOL Target status of the output / the FALSE SAFE OFF
outputs
TRUE Safe ON

265
SmartPLC SafeLine AC4S with fieldbus interfaces

>

SF_OUT_local_testpulse
43109

Device type: Local I/O interface (output)


Library: sf_logicalinterfaces.library
Symbol in CODESYS:

>

Description
43284

Logical device to generate a test pulse at an output channel of the local I/O interface
SF_OUT_local_testpulse generates a test pulse and provides it at the configured output channel of
the local I/O interface (OUT_Channel). Pulse duration and frequency are firmly set:

Test pulse characteristics


Pulse duration: 2 PLC cycles
Pulse frequency: 8000 PLC cycles
Phase shift: OUT1  OUT2  OUT3  OUT4 = 6 PLC cycles

Figure: Signal characteristics and phase shift of the test pulse


>

Parameter data
43050

Parameter Data type Description Possible values


OUT_Channel INT Local output at which the test 1 Local output OUT1
pulse is to be provided ... ...
4 Local output OUT4

266
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.5 Error codes: Safe AS-i slaves


43288

Communication and configuration errors change the logical device to the initialisation state (S_INIT).
Simultaneously a diagnostic code is provided to the control function block (→ CtrlASi_InSlave , →
CtrlASi_OutSlave) which describes the error cause.
Following diagnostic codes are available:

DiagCode Error name (FB) Error description

Error message (OSC)


0x4001 ASi_SYS_ERROR_CFG_MASTERID_INVALID Wrong master in control FB or logical
device
Wrong Master-Id in ASi-Control-FUB
0x4002 ASi_SYS_ERROR_CFG_SLAVEADDR_INVALID Wrong slave in the control FB or
logical device (address 0 in the
Wrong Slave Address in ASi-Control-FUB device tree CODESYS provokes an
error during download)
0x4003 ASi_SYS_ERROR_CFG_MULTIPLE_SLAVE Incorrect configuration by two slaves
with same address
Try to config multiple Input Slaves with same Master-Id and Slave-Address
0x4004 ASi_SYS_ERROR_CFG_MISMATCH_SLAVE Incorrect configuration by input and
output slaves with same address
Try to config a Input and Output Slave at the same Master-Id and
Slave-Address
0x4005 ASi_SYS_ERROR_CFG_CANTADD_SLAVE New AS-i input slave could not be
added to the project.
Can't add a new ASi-Input-Slave in case of a error return from AS-i-Control
0x4009 ASi_SYS_ERROR_DIAGCFG_NOTCONFIGUED Logical device not configured
Try to monitor a not configured ASi-Slave in a AS-i-Control-FUB
0x400A ASi_SYS_ERROR_DIAGCFG_HSI_REQUEST Help signals HSI1 and HSI2 were
activated simultaneously.
At CtrlASiOut-FUB : HSI1 and HSI2 Request at the same Time. Don't
activate HSI1 and HSI2 together.
0x4010 ASi_SYS_OUTPUT_CANTADD ▪ Incorrect configuration by too
many output control slaves in the
Can't add a new ASi-Output-Contol-Slave (ex. Max. count of ControlSlaves project.
reached)
▪ This error can be masked by
error 0x4009.
0x5800 ASi_HW_SUB_STATE_SLAVE_MISSING_TESTREQUEST Test request detected.
Forced Testrequest from AS-i-SlaveCheck; Waiting for manual Test of
related AS-i-Input-Slave
0x5820 ASi_HW_CONFIG_SLAVE_TEACH_ERROR_TIMEOUT Error code received from AS-i control
slave
Errorcode received from AS-i-Control
0x5821 ASi_HW_CONFIG_SLAVE_TEACH_ERROR_A_B_CHANNEL_OPEN Error code received from AS-i control
slave
Errorcode received from AS-i-Control
0x5822 ASi_HW_CONFIG_SLAVE_TEACH_ERROR_A_CHANNEL_OPEN Error code received from AS-i control
slave
Errorcode received from AS-i-Control

0x5823 ASi_HW_CONFIG_SLAVE_TEACH_ERROR_B_CHANNEL_OPEN Error code received from AS-i control


slave
Errorcode received from AS-i-Control
0x5824 ASi_HW_CONFIG_SLAVE_ERROR_CODESEQUENCE_INVALID Error code received from AS-i control
slave
Errorcode received from AS-i-Control
0x5825 ASi_HW_CONFIG_SLAVE_TEACH_ERROR_CODESEQUENCE_DOUBLY ▪ 2 slaves with the same code

267
SmartPLC SafeLine AC4S with fieldbus interfaces

DiagCode Error name (FB) Error description


Errorcode received from AS-i-Control sequence in the AS-i network
▪ Errors 0x5825 and 0x5826 can
occur simultaneously
0x5826 ASi_HW_CONFIG_SLAVE_TEACH_ERROR_CODESEQUENCE_RULES ▪ Error when the code sequence is
taught
Errorcode received from AS-i-Control ▪ Errors 0x5825 and 0x5826 can
occur simultaneously
0x5827 ASi_HW_CONFIG_SLAVE_TEACH_ERROR_NO_CODESEQUENCE ▪ Error when the code sequence is
taught
Errorcode received from AS-i-Control
▪ This error is masked on the
control FB by error 0x5840.
0x5830 ASi_HW_GLOBAL_COM_MISSING_BUS_CYCLE_EVENT All bus errors can cover local errors.
Errorcode received from AS-i-Control
0x5831 ASi_HW_GLOBAL_COM_ADDRESS SEQUENCE ERROR All bus errors can mask local errors.
Errorcode received from AS-i-Control
0x5832 ASi_HW_GLOBAL_COM_FAILURE_TO_LESS_SLAVES Too few AS-i slaves at the bus
Errorcode received from AS-i-Control
0x5840 ASi_HW_ERROR_STATE_INIT ▪ No AS-i slave at the bus
AS-i slave is missing ▪ All bus errors can mask local
errors.
▪ This error can be masked by
error 0x5820.

268
SmartPLC SafeLine AC4S with fieldbus interfaces

>

10.6 Error codes: Local I/O interface


43289

Communication and configuration errors change the logical device to the initialisation state (S_INIT).
Simultaneously a diagnostic code is provided to the control function block that describes the error
cause (→CtrlLocalInputs (→ S. 194)).
Following diagnostic codes are available:

DiagCode Error name (FB) Error description

Error message (OSC)


0x4020 LIO_SYS_ERROR_CFG_CHANNEL_A_INVALID Wrong ID for channel A (channel A = 0 or >8)
Wrong Id for Channel A in LIO-CtrlFUB
0x4021 LIO_SYS_ERROR_CFG_CHANNEL_B_INVALID Wrong ID for channel B (channel A = 0 or >8)
Wrong Id for Channel B in LIO-CtrlFUB
0x4022 LIO_SYS_ERROR_CFG_MULTIPLE_CHANNEL Several logical devices with same channel assignment
Try to config multiple Local IOs with same Channel
0x4023 LIO_SYS_ERROR_CFG_DOUBLE_CHANNEL Same ID used for both channels of a two-channel
logical device
Try to configure both channels of a dual channel IO
with the same channel number (Channel A equal
Channel B)
0x4024 LIO_SYS_ERROR_CFG_NOT_SUPPORTED Non-supported output device
Actually not supported output device (e.g. a
DEV_SF_OUT_Local_dual)
0x4025 LIO_SYS_ERROR_CFG_EXHAUSTED Maximum number of configurable inputs reached
Max. count of configurable Inputs reached
0x4026 LIO_SYS_ERROR_INPUT_CANTADD Adding a local input failed
Can't add a new Local Input in case of a error return
from Local-IO-Control
0x4031 LIO_SYS_ERROR_DIAGCFG_NOTCONFIGURED ▪ Non-configured local input
Try to monitor a not configured Local Input in a ▪ This error can be masked by error 0x4031
LIO-Control-FUB
0x4032 LIO_SYS_ERROR_DIAGCFG_CONFIGMISMATCH Wrong assignment of the input channels in a control FB
OR
Try to config the same Input at single and dual An input configured as fail-safe is polled with FB
GetLocalInput
0xE100 LIO_HW_ERROR_WRONG_TESTSIGNAL_e Cross fault monitoring
Detect unexpected Testsignal in a local Input channel
(a reason could be a short cut)
0xE101 LIO_HW_ERROR_NO_TESTSIGNAL_e Cross fault monitoring
Can't detect a expected Testsignal (no connection)
0xE102 LIO_HW_INPUT_TEST_IN_PROCESS_e Cross fault monitoring
Wait for Test after both input signals switched ON.

269
SmartPLC SafeLine AC4S with fieldbus interfaces

Configure Standard PLC .......................................................................22


11 Index Configure system ...................................................................................58
Configure task processing .....................................................................69
A Configure visualisation ..........................................................................66
Access standard input and output data .................................................50 Control interface of the ifm function blocks ...........................................57
ACnnnn_SysCmd ................................................................................179 Create a visualisation ............................................................................65
Add additional device to the project ......................................................41 Create additional objects for data exchange .........................................85
Add and configure EtherCAT slave .......................................................45 Create CODESYS project .....................................................................15
Add EtherCAT master ...........................................................................43 Create new project with AC4S...............................................................16
Add fieldbus stack..................................................................................46 Create safe application ..........................................................................72
Add logical device to the project tree ..............................................26, 35 Create Standard PLC application ..........................................................48
Add safe AS-i slaves to the project .......................................................26 Create test signal at local output ...........................................................39
Add safe local device to project.............................................................34 Create user account ..............................................................................19
Add visualisation to a project .................................................................64 Cross communication ............................................................................67
Analogue input and output data ............................................................53 Ctrl_SetDiagInfo ..................................................................................196
Analogue output data ............................................................................55 CtrlASi_InSlave....................................................................................188
Appendix ..............................................................................................116 CtrlASi_OutSlave .................................................................................190
ASI_ADDRESS_MODE (ENUM) ........................................................170 CtrlASi_ResetAllSlaves .......................................................................193
ASI_ANA_IO (STRUCT)......................................................................176 CtrlLocalInputs .....................................................................................194
ASI_ANALOG_IN (STRUCT) ..............................................................176
D
ASI_ANALOG_IN_FLAGS (STRUCT) ................................................177
ASI_ANALOG_OUT (STRUCT) ..........................................................177 Data exchange between standard PLC and fail-safe PLC....................82
ASI_ANALOG_OUT_FLAGS (STRUCT) ............................................178 Data transfer safety area >>> standard area ........................................84
ASI_BIN_IN (STRUCT) .......................................................................175 Data transfer standard area >>> safety area ........................................83
ASI_BIN_IO (STRUCT) .......................................................................175 Delete boot application via SD card ....................................................105
ASI_BIN_OUT (STRUCT) ...................................................................175 Description 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 141,
143, 145, 146, 148, 150, 152, 154, 155, 157, 159, 161, 164, 166, 168,
ASI_DATA (STRUCT) .........................................................................173
179, 188, 190, 193, 194, 196, 198, 199, 206, 210, 214, 218, 222, 226,
ASI_MASTER (ENUM) ........................................................................170 230, 234, 236, 240, 244, 248, 252, 256, 260, 264, 265, 266
ASI_MASTER_MODE (ENUM) ...........................................................170 Diagnostic information .......209, 213, 217, 221, 225, 229, 233, 239, 243,
ASI_NET (STRUCT) ............................................................................175 247, 251, 255, 259, 263
ASI_SLAVE (ENUM) ...........................................................................171 Diagnostic messages ..........................................................................204
ASI_SLAVE_TYP (ENUM) ..................................................................171 Digital input and output data ..................................................................53
Available fieldbus stacks .......................................................................42 Digital output data ..................................................................................55
Available logical devices for safe AS-i slaves .......................................25 Display operating state of the Standard application ............................106
Available logical devices for safe inputs/outputs ...................................33 Display web visualisation.....................................................................115
Available memory space .......................................................................75 Download Standard application to AC4S ............................................102
Available safety libraries ........................................................................73
E
C Enumeration types (ENUM).................................................................170
Change between the states .................................................................111 Enumeration types and complex variables .........................................170
Change IP settings ................................................................................40 Error codes
Change network settings .......................................................................60 Local I/O interface ....................................................................................... 269
Change properties of the web visualisation ..........................................66 Safe AS-i slaves .......................................................................................... 267
Change system time of the device ........................................................49 Example
CODESYS Development System..........................................................11 Change language setting of the device ...................................................... 184
Complex variables (STRUCT) .............................................................172 Date / time / read NTP settings ................................................................... 185
Read LCEMS, LCEAS and LDAE of AS-i Master 2 ................................... 186
Components of the ifm package............................................................12
Explanation of Symbols ...........................................................................6
Concept of the logical devices .........................................................24, 32
Extend fieldbus functionality ..................................................................42
Configure AS-i master ...........................................................................59
Configure AS-i slaves ............................................................................59 F
Configure EtherCAT master ..................................................................44
Configure fail-safe PLC .........................................................................23 Fail-safe PLC .............................................................................. 108, 114
Configure FSoE connection...................................................................91 FB with cyclic execution ........................................................................58
Configure logical device ..................................................................29, 37 FB with one-time execution ...................................................................57
Configure main task ...............................................................................69 Fieldbus data .........................................................................................54
Configure programming interface ..........................................................20
G
Configure safe AS-i slaves ....................................................................24
Configure safe devices at local I/O interface.........................................32 General safety instructions ......................................................................9
Configure safety task ...........................................................................100 Get_ASi_Data ......................................................................................161
Configure standard devices at local I/O interface .................................40 Get_ASi_PHY_Dat ..............................................................................119

270
SmartPLC SafeLine AC4S with fieldbus interfaces

Get_CDI ...............................................................................................137 Operating states AC4S ........................................................................106


Get_FieldbusInfo .................................................................................164 Operation .............................................................................................101
Get_InputParameter ............................................................................141 Operation mode of the fail-safe PLC ...................................................109
Get_LAS ..............................................................................................121 Options to access input and output data ...............................................50
Get_LCE ..............................................................................................127 Output parameters .....120, 122, 124, 126, 128, 130, 132, 134, 136, 138,
Get_LCEAS .........................................................................................129 140, 142, 144, 145, 147, 149, 151, 153, 154, 156, 158, 160, 162, 165,
167, 169, 183, 189, 192, 193, 195, 197, 198, 199
Get_LCEMS.........................................................................................131
Outputs data of the AS-i slaves .............................................................54
Get_LDAE ............................................................................................133
Get_LDS ..............................................................................................123 Overview
AS-i functions (FB_ASi) .............................................................................. 118
Get_LPF...............................................................................................135
CODESYS documentation of 3S .................................................................... 8
Get_LPS ..............................................................................................125
Project structure with AC4S .......................................................................... 17
Get_OutputParameter .........................................................................143 System functions (FB_System)................................................................... 163
Get_PCD..............................................................................................139 User documentation for AC4S ........................................................................ 7
GetLocalInput ......................................................................................198
Getting started .......................................................................................14 P
Parameter data . 207, 211, 215, 219, 223, 227, 231, 234, 237, 241, 244,
H 249, 253, 257, 261, 264, 265, 266
Hardware ...............................................................................................10 Pin safe project ......................................................................................75
PLCopen Safety
I Provide diagnostic information ...................................................................... 78

ifm CODESYS package.........................................................................12 Preliminary note .......................................................................................5


Input and output data of the fieldbus interface ......................................54 Process data ..... 207, 211, 215, 219, 223, 227, 231, 234, 237, 241, 245,
249, 253, 257, 261, 264, 265
Input parameter ...................................................................................197
Process data of the AS-i slaves ............................................................52
Input parameters119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139,
141, 143, 145, 146, 148, 150, 152, 154, 155, 157, 159, 161, 164, 166, Process data of the non-safe local devices ...........................................56
168, 180, 188, 191, 193, 194, 198, 199 Process safety time for the AC4S .........................................................93
Install CODESYS Development System ...............................................11 Programming .........................................................................................47
Install the ifm package ...........................................................................13 Programming of the fail-safe PLC .........................................................70
Installation ..............................................................................................11 Purpose of the document ........................................................................5

L Q
Legal and copyright information ..............................................................5 QuickSetupASi_Master .......................................................................166
Library ACnnnn_SYS_CMD.library .....................................................179
Library ACnnnn_Utils.library ................................................................117
R
Library SF_IO.library............................................................................187 Read configuration data of the slaves ...................................................61
Library SF_LogicalInterfaces.library ....................................................200 Read network settings ...........................................................................60
Licensing ................................................................................................10 Read parameter images ........................................................................61
Load safe application to AC4S ............................................................103 read slave lists .......................................................................................61
Local I/O interface Read status of the voltage supply .........................................................61
Access non-safe inputs/outputs .................................................................... 78 Remarks...........................................................................................24, 32
Provide diagnostic information ...................................................................... 78 Remarks about logical devices ............................................................201
Reset logical device ...................................................................................... 77
Remarks about the use of exchange variables .....................................82
Logical devices for safe AS-i slaves ....................................................205 Remove safe AS-i slave from project ....................................................31
Logical devices for the local I/O interface ...........................................235 Remove safe local device from project .................................................39
Required background knowledge ............................................................9
M
Reset....................................................................................................112
Manage AS-i network ............................................................................60 Reset safe application (cold) ...............................................................114
Map safe process signal to variable ................................................30, 38 Reset the Standard application (cold) .................................................113
Minimum number of AS-i slaves............................................................74 Reset the Standard application (origin) ...............................................113
Modification history ..................................................................................8 Reset the standard application (warm)................................................113

N S
Note Safe AS-i input slaves ...........................................................................24
Projects with network variables .................................................................. 104 Safe AS-i output slaves .........................................................................24
Note on the size of the exchange objects .............................................87 Safe AS-i slaves
Notes on the FSoEMaster .....................................................................92 Provide diagnostic information ...................................................................... 77
Reset logical device ...................................................................................... 76
O Transmit help signals HSI_1 and HSI_2 to safe AS-i output modules ........ 77
Objects of a safe application .................................................................71 Safe cross communication ....................................................................86
Objects of a Standard PLC application .................................................47 Safe devices at local inputs ...................................................................32
Operating mode of the Standard PLC .................................................106 Safe devices at local outputs .................................................................32

271
SmartPLC SafeLine AC4S with fieldbus interfaces

Safe fieldbus communication.................................................................90 Step 2


Safety instructions ...................................................................................9 Calculate the response times of the safety function ..................................... 96
SafetyFSoEMaster library......................................................................81 Step 3
SafetyPLCopen library...........................................................................80 Define watchdog times .................................................................................. 97
SafetyStandard library ...........................................................................79 Step 4
Send commands to the system and the AS-i master ............................62 Calculate the worst-case response time of the safety function .................... 98

Sequence of the signal changes .........................................................202 Stop Standard PLC application ...........................................................107
Set communication path of Standard PLC ............................................20 Supported program organization units (POUs) .....................................73
Set communication path of the fail-safe PLC ........................................21 Supported programming languages ................................................49, 73
Set cycle time of the fail-safe PLC ......................................................100 Supported reset variants .....................................................................112
Set interval of the data exchange ..........................................................85 Supported types of reset .....................................................................114
Set parameters for visualisation task ....................................................69 Supported visualisation types ................................................................63
Set process safety time .........................................................................93 Switch operating states .......................................................................107
Set the parameters of the logical device .........................................29, 37 System configuration .............................................................................22
Set up fail-safe network variables .........................................................88 System events .....................................................................................203
Set variable components of the response time .....................................99 System requirements.............................................................................10
Set_AddressMode ...............................................................................145
T
Set_ASi_Config ...................................................................................146
Set_LPS ...............................................................................................148 Table
Set_Mode.............................................................................................150 AS-i master commands ............................................................................... 181
System commands ...................................................................................... 180
Set_PCD ..............................................................................................152
Teach code sequences of the safe AS-i slaves ..................................104
Set_ProjectAll ......................................................................................154
Timer events ........................................................................................203
Set_SlaveAddress ...............................................................................155
Transfer CODESYS project to device .................................................101
Set_SlaveExtendedID1 .......................................................................157
Set_SlaveParameter............................................................................159 U
Set_TimeDate ......................................................................................168
SetLocalOutput ....................................................................................199 Uninstall ifm package ............................................................................13
SF_IN_ASi_conditionally_dependent ..................................................214 Use CODESYS online help ...................................................................19
SF_IN_ASi_dependent ........................................................................218 Use complex variables ..........................................................................60
SF_IN_ASi_dependent_filter_nshutdown ...........................................230 Use EtherCAT master ...........................................................................43
SF_IN_ASi_dependent_filter_ntestreq ................................................226 Use fail-safe network variables in the application .................................89
SF_IN_ASi_dependent_filter_w_testreq .............................................222 Use functions of the ifm package ..........................................................57
SF_IN_ASi_forced ...............................................................................206 Use network variables ...........................................................................68
SF_IN_ASi_independent .....................................................................210 Use remanent variables.........................................................................49
SF_IN_local_conditionally_dependent ................................................244 Use safety functions of CODESYS .......................................................79
SF_IN_local_dependent ......................................................................248 Use safety functions of the ifm AS-i package........................................76
SF_IN_local_dependent_filter_nshutdown .........................................260 Use the factory-set replacement variables ............................................83
SF_IN_local_dependent_filter_ntestreq ..............................................256 Use visualisations ..................................................................................63
SF_IN_local_dependent_filter_testreq ................................................252
V
SF_IN_local_forced .............................................................................236
SF_IN_local_independent ...................................................................240 Validity of the interface data ..................................................................51
SF_OUT_local_dual ............................................................................265 Variable declaration with data transfer between standard and safety
SF_OUT_local_single..........................................................................264 area ........................................................................................................75
SF_OUT_local_testpulse.....................................................................266
SF_OUTcontrol_ASi ............................................................................234
Software .................................................................................................10
Standard PLC ............................................................................. 106, 112
Start CODESYS.....................................................................................14
Start Standard PLC application ...........................................................107
Start-up test .........................................................................................203
State diagram (state machine) .. 208, 212, 216, 220, 224, 228, 232, 238,
242, 246, 250, 254, 258, 262
State machines for logical preprocessing ...........................................201
State transitions ...................................................................................201
States ...................................................................................................201
States of the fail-safe PLC ...................................................................109
States of the input signals ...................................................................202
States of the safe application ..............................................................110
States of the Standard PLC application ..............................................106
Step 1
Calculate typical response times .................................................................. 95

272

You might also like