programming manual codesys for ifm sdk extension 1.0.0

41
Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 CP9031 CODESYS 3.5 SP9 Patch 4 ifm firmware: 3.2.x English 7391179_00_UK 10 / 2017

Upload: others

Post on 23-May-2022

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Programming Manual CODESYS for ifm SDK Extension 1.0.0

Programming Manual

CODESYS for ifm SDK Extension

1.0.0.0

CP9031

CODESYS 3.5 SP9 Patch 4

ifm firmware: 3.2.x

English

7391

179

_00

_U

K

1

0 / 2

017

Page 2: Programming Manual CODESYS for ifm SDK Extension 1.0.0

2

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Content

Contents

1 Preliminary note 4

1.1 Legal and copyright information ........................................................................................... 4 1.2 Symbols and styles used ..................................................................................................... 4 1.3 Modification history .............................................................................................................. 5

2 Safety instructions 6

2.1 Required background knowledge ........................................................................................ 6 2.2 Warnings used ..................................................................................................................... 6

3 System requirements 7

3.1 Hardware .............................................................................................................................. 7 3.2 Software ............................................................................................................................... 7 3.3 Licensing .............................................................................................................................. 7

4 Installation 8

4.1 Install package ..................................................................................................................... 8 4.2 Update package ................................................................................................................... 9 4.3 Uninstall package ................................................................................................................. 9

5 Programming 10

5.1 Notes ..................................................................................................................................10 5.2 Add function library to the project ......................................................................................10 5.3 Use library functions ..........................................................................................................11

6 Appendix 12

6.1 Bibliothek ifmSDKutil.library ...............................................................................................13 6.1.1 Command ................................................................................................................................... 14 6.1.2 GetSegmentListFromFile............................................................................................................ 17 6.1.3 GetSysInfo .................................................................................................................................. 19 6.1.4 PingDevice ................................................................................................................................. 22 6.1.5 ReadFromController ................................................................................................................... 24 6.1.6 SelectSegmentFromList ............................................................................................................. 27 6.1.7 WriteToController ....................................................................................................................... 29 6.1.8 eCMD_LIST (ENUM) .................................................................................................................. 32 6.1.9 eDEVICES (ENUM) .................................................................................................................... 32 6.1.10 stSEGMENT_LIST (STRUCT) ................................................................................................... 33 6.1.11 stSEGMENT_LIST_WR (STRUCT) ........................................................................................... 34 6.1.12 stSYS_INFO (STRUCT) ............................................................................................................. 34 6.1.13 stSEGM_NAME (STRUCT) ........................................................................................................ 35 6.1.14 stSEGM_TYPE_NAME (STRUCT) ............................................................................................ 35 6.1.15 stLAST_EVNT_RESP (STRUCT) .............................................................................................. 35 6.1.16 gc_AllSegments (GC) ................................................................................................................. 36 6.1.17 gv_EvntCallBack (GV) ................................................................................................................ 36

6.2 ifm behaviour models for function blocks ...........................................................................37 6.2.1 General....................................................................................................................................... 37 6.2.2 Behaviour model ENABLE ......................................................................................................... 38 6.2.3 Behaviour model EXECUTE ....................................................................................................... 38

Page 3: Programming Manual CODESYS for ifm SDK Extension 1.0.0

3

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Content

7 Index 39

8 ifm weltweit • ifm worldwide • ifm à l’échelle internationale 41

Page 4: Programming Manual CODESYS for ifm SDK Extension 1.0.0

4

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Preliminary note Legal and copyright information

1 Preliminary note

Legal and copyright information ............................................................................................................... 4 Symbols and styles used .......................................................................................................................... 4 Modification history ................................................................................................................................... 5

18082 >

1.1 Legal and copyright information 1631

© 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® (→ www.io-link.com) is the property of the →PROFIBUS Nutzerorganisation e.V., Germany

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)

PROFIBUS® is the property of the PROFIBUS Nutzerorganisation e.V., Germany (→ www.profibus.com)

PROFINET® is the property of the →PROFIBUS Nutzerorganisation e.V., Germany

Windows® is the property of the →Microsoft Corporation, USA >

1.2 Symbols and styles used 13839

► ... Instructions

> ... Reaction, result

→ ... Cross-reference or internet link

123 0x123 0b010

Decimal number Hexadecimal number Binary number

[...] Designation of pushbuttons, buttons or indications

Page 5: Programming Manual CODESYS for ifm SDK Extension 1.0.0

5

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Preliminary note Modification history

>

1.3 Modification history 21676

Version Topic Date

00 New creation of document 11 / 2017

Page 6: Programming Manual CODESYS for ifm SDK Extension 1.0.0

6

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Safety instructions Required background knowledge

2 Safety instructions

Required background knowledge ............................................................................................................. 6 Warnings used .......................................................................................................................................... 6

213 >

2.1 Required background knowledge 6919

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.

For programming these people should also have knowledge of control technology experience in PLC programming to IEC 61131-3.

The document contains information about the correct handling of the product. >

2.2 Warnings used 13685

WARNING

Death or serious irreversible injuries may result.

CAUTION

Slight reversible injuries may result.

NOTICE

Property damage is to be expected or may result.

Important note Non-compliance may result in malfunction or interference.

Information Supplementary note.

Page 7: Programming Manual CODESYS for ifm SDK Extension 1.0.0

7

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

System requirements Hardware

3 System requirements

Hardware .................................................................................................................................................. 7 Software.................................................................................................................................................... 7 Licensing................................................................................................................................................... 7

16903 >

3.1 Hardware 24405

Device of the product family "dialogue unit PDM360 NG"

Part number: CR1080/84, CR1081/85, CR1082, CR1083/87, CR1200, CR1201

Runtime system: 3.2.x or higher

PC/laptop for the programming system CODESYS (→ system requirements CODESYS Development System V3.5)

>

3.2 Software 24406

CODESYS Development System

Version: 3.5 SP9 patch 4 or higher

Package "CODESYS for PDM360NG Products"

Version: 1.8.0.0 or higher

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 software components for download: → www.ifm.com > Service > Download > [Mobile machines]

>

3.3 Licensing 24407

By purchasing the CR9031, the user also acquires a valid licence to use the CODESYS for ifm SDK Extension.

Licence information: → Installation routine or product page of the article on the ifm website.

Page 8: Programming Manual CODESYS for ifm SDK Extension 1.0.0

8

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Installation Install package

4 Installation

Install package .......................................................................................................................................... 8 Update package ....................................................................................................................................... 9 Uninstall package ..................................................................................................................................... 9

17146 >

4.1 Install package 7341

To install the ifm package CODESYS for ifm SDK Extension:

Prerequisites

> CODESYS 3.5 SP9 patch 4 is correctly installed.

> ifm package CODESYS for ifm SDK Extension is stored on the PC/laptop.

1 Start CODESYS

► Start CODESYS with administrator rights.

> CODESYS starts.

> CODESYS user interface appears.

2 Start package manager

► Select [Tools] > [Package Manager].

> Window [Package Manager] appears.

3 Install package

► Click on [Install...].

> The file explorer appears.

► Select file ifm_SDKutilities_V1_0_0_0.package.

► Click on [Open] and carry out a complete installation.

> CODESYS for ifm SDK Extension is installed.

> After successful installation: Window [Package Manager] shows installed ifm package.

> The functions of the package can be used.

► Click on [Close] to exit the Package Manager.

Page 9: Programming Manual CODESYS for ifm SDK Extension 1.0.0

9

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Installation Update package

>

4.2 Update package 15219

To update the ifm package CODESYS for ifm SDK Extension:

1 Uninstall the old version of the ifm package

► Uninstall ifm package (→ p. 9)

2 Install the new version of the ifm package

► Install ifm package (→ p. 8)

3 Update device

► Open project.

► In the device tree: Select the device node.

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

> Dialogue window appears.

► Click on [Update Device] to start the updating process.

> CODESYS loads new device libraries.

> Device tree view is updated.

► Click on [Close] to exit the dialogue window.

► Save the project. >

4.3 Uninstall package 15022

To uninstall the ifm package CODESYS for ifm SDK Extension:

1 Start package manager

► Select [Tools] > [Package Manager].

> Window [Package Manager] shows installed packages.

2 Uninstall package

► Select the package to be uninstalled.

► Click on [Uninstall...].

> The selected package is uninstalled.

► Click on [Close] to exit the Package Manager.

Page 10: Programming Manual CODESYS for ifm SDK Extension 1.0.0

10

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Programming Notes

5 Programming

Notes ......................................................................................................................................................10 Add function library to the project ...........................................................................................................10 Use library functions ...............................................................................................................................11

14603 >

5.1 Notes 23373

Using the functions of the library "ifmSDKutil.library", the user can access controllers of the device families "R360 System" and "Basic System" from a CODESYS application.

The dialogue unit PDM360 NG and the PLCs to be controlled must be participants of the same CAN/CANopen network.

>

5.2 Add function library to the project 22930

In order to be able to access the functions of the packages CODESYS for ifm SDK Extension in a CODESYS project, the user must integrate the corresponding function library in the application.

Qualifications

> Package CODESYS for ifm SDK Extension is correctly installed.

1 Start the library manager

► Create a new project with PDM360 NG. OR open an existing project with PDM360 NG.

► In the device tree: Double-click on [Application] > [Library Manager]

> The editor window shows the library manager of the application.

> The library manager shows the installed libraries.

2 Integrate the library

► In the library manager: Click on [Add library].

> Dialogue window appears.

► In the tree view: Select [Target] > [ifm_CRnnnn] > [ifmSDKutil].

► Click on [OK] to confirm the selection.

> CODESYS integrates the selected library in the application.

> Functions of the library can be used for the programming.

Page 11: Programming Manual CODESYS for ifm SDK Extension 1.0.0

11

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Programming Use library functions

>

5.3 Use library functions 8031

The following function elements are available:

Name Description Reference

Command Control the operating mode of the device → Command (→ p. 14)

GetSysInfo Read the system information of a device → GetSysInfo (→ p. 19)

ReadFromController Read firmware, application and data of a device and save them in a file

→ ReadFromController (→ p. 24)

WriteToController Read firmware, application and data from a file and save them on the device

→ WriteToController (→ p. 29)

GetSegmentListFromFile Read the list of available software segments from a file

→ GetSegmentListFromFile (→ p. 17)

SelectSegmentFromList Select a software segment from a read list → SelectSegmentFromList

PingDevice Test the connection between PDM360 NG and a controller

→ PingDevice (→ p. 22)

Page 12: Programming Manual CODESYS for ifm SDK Extension 1.0.0

12

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Use library functions

6 Appendix

Bibliothek ifmSDKutil.library ...................................................................................................................13 ifm behaviour models for function blocks ...............................................................................................37

10354

Page 13: Programming Manual CODESYS for ifm SDK Extension 1.0.0

13

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1 Bibliothek ifmSDKutil.library

Command ...............................................................................................................................................14 GetSegmentListFromFile ........................................................................................................................17 GetSysInfo ..............................................................................................................................................19 PingDevice .............................................................................................................................................22 ReadFromController ...............................................................................................................................24 SelectSegmentFromList .........................................................................................................................27 WriteToController ...................................................................................................................................29 eCMD_LIST (ENUM) ..............................................................................................................................32 eDEVICES (ENUM) ................................................................................................................................32 stSEGMENT_LIST (STRUCT) ...............................................................................................................33 stSEGMENT_LIST_WR (STRUCT) .......................................................................................................34 stSYS_INFO (STRUCT) .........................................................................................................................34 stSEGM_NAME (STRUCT) ....................................................................................................................35 stSEGM_TYPE_NAME (STRUCT) ........................................................................................................35 stLAST_EVNT_RESP (STRUCT) ..........................................................................................................35 gc_AllSegments (GC) .............................................................................................................................36 gv_EvntCallBack (GV) ............................................................................................................................36

1445

Page 14: Programming Manual CODESYS for ifm SDK Extension 1.0.0

14

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.1 Command 21212

Function block type: Function block (FB)

Behaviour model: EXECUTE

Library: ifmSDKutil.library

Symbol in CODESYS:

>

Description 8035

The FB adjusts the operating mode of the PLC of the target device (eChannel, usiDownloadId, eDevice). The user can select the required operating mode from an enumeration list (eCommand). >

Input parameter 8036

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE TRUE

FB is executed once

Other No impact on FB processing

eChannel CAN_ CHANNEL

Identifier of the CAN Interface → CAN_CHANNEL (ENUM)

usiDownloadId USINT CANopen node ID of the target device 1...127

eDevice eDEVICES Device / device type → eDEVICES (ENUM) (→ p. 32)

eCommand eCMD_LIST required operating mode → eCMD_LIST (ENUM) (→ p. 32)

Page 15: Programming Manual CODESYS for ifm SDK Extension 1.0.0

15

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

Output parameter 8037

Parameter Data type Description Possible values

xDone BOOL Indication of whether execution of the FB has been successfully completed

FALSE FB is executed

TRUE FB successfully executed

FB can be called again

xError BOOL Indication if an error occurred during the FB execution

FALSE No error occurred or the FB is still being executed

TRUE Error occurred

Action could not be executed

Note diagnostic information

eDiagInfo DIAG_INFO Diagnostic information → List below (diagnostic codes:)

Page 16: Programming Manual CODESYS for ifm SDK Extension 1.0.0

16

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

Diagnostic codes:

STAT_INACTIVE State: FB/Function is inactive.

STAT_BUSY State: FB/Function is currently executed.

STAT_DONE State: FB/Function has been successfully executed and completed. There are valid results on the outputs.

STAT_ABORT Status: FB/function was aborted; Abort operations are executed.

ERR_INTERNAL Error: Internal system error

► Contact the ifm Service Center!

ERR_INVALID_CHANNEL Error: Internal parameter setting fault

► Contact the ifm Service Center!

ERR_INVALID_VALUE Error: at least 1 invalid input parameter or invalid combination of input parameters; Function call has been stopped.

ERR_COMMUNICATION Error: no Connection to the network node or network node not available

ERR_CAN_INIT Error: CAN channel is not initialised.

ERR_DYNAMIC_MEMORY Error: Memory reservation failed during creation of the internal FB instance.

ERR_EVNT_CLOS Error: occurred when an event was closed

ERR_EVNT_OPEN Error: occurred when an SDK-API event was opened

ERR_EVNT_REGI Error: occurred when the call-back function was registered

ERR_EVNT_UNREGI Error: occurred when the call-back function was unregistered.

STAT_EVNT_CLOS State: SDK-API event is closed.

STAT_EVNT_CLOS_DONE State: SDK-API event closed.

STAT_EVNT_OPEN_DONE State: SDK-API event open.

STAT_EVNT_REGI_DONE State: SDK-API event registered.

STAT_EVNT_UNREGI State: SDK-API event will be unregistered.

STAT_EVNT_UNREGI_DONE State: SDK-API event unregistered.

ERR_CMND_NOT_SUPPORT Error: At least one command option is not supported by the device.

ERR_NO_SOFTWARE Error: Software is not available in the device.

ERR_PROTOCOL Error: Error in the maintenance command protocol

► Repeat the execution of the command!

ERR_INVALID_TARGED_ID Error: Wrong target ID

ERR_INVALID_DEVICE Error: Wrong or unknown device

Page 17: Programming Manual CODESYS for ifm SDK Extension 1.0.0

17

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.2 GetSegmentListFromFile 17393

Function block type: Function block (FB)

Behaviour model: EXECUTE

Library: ifmSDKutil.library

Symbol in CODESYS:

>

Description 23943

The FB reads all available software segments, their name and data types from one file (sFileName, sMd5Filename). It stores the results in a data structure (iq_aSegmTypeNameList). The data structure can store information of up to 16 software segments. The selection of a software segment from the list is done by means of the dotted notation (iq_aSegmTypeNameList[n].xSele).

Supported file formats: RESX, BIN, H86

If the file is a BIN or H86 type file, the input sMd5FileName will not be evaluated.

>

Input parameter 23944

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE TRUE

FB is executed once

Other No impact on FB processing

iq_aSegmTypeNameList aSEGM_TYPE_NAME Data structure for information about software segments

→ stSEGM_TYPE_NAME (STRUCT) (→ p. 35)

sFileName STRING (255)

Directory path and name of the BIN file e.g. \data\MyData.bin

sMd5FileName STRING (255)

Directory path and name of the MD5 file e.g.. \data\MyData.md5

Page 18: Programming Manual CODESYS for ifm SDK Extension 1.0.0

18

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

Output parameter 23945

Parameter Data type Description Possible values

xDone BOOL Indication of whether execution of the FB has been successfully completed

FALSE FB is executed

TRUE FB successfully executed

FB can be called again

xError BOOL Indication if an error occurred during the FB execution

FALSE No error occurred or the FB is still being executed

TRUE Error occurred

Action could not be executed

Note diagnostic information

eDiagInfo DIAG_INFO Diagnostic information → List below (diagnostic codes:)

Diagnostic codes:

STAT_INACTIVE State: FB/Function is inactive.

STAT_BUSY State: FB/Function is currently executed.

STAT_DONE State: FB/Function has been successfully executed and completed. There are valid results on the outputs.

STAT_ABORT Status: FB/function was aborted; Abort operations are executed.

ERR_INTERNAL Error: Internal system error

► Contact the ifm Service Center!

ERR_INVALID_VALUE Error: at least 1 invalid input parameter or invalid combination of input parameters; Function call has been stopped.

ERR_FILE_OPEN Error: SDK-API reports an error when the file is opened.

ERR_EVNT_CLOS Error: occurred when an event was closed

ERR_EVNT_OPEN Error: occurred when an SDK-API event was opened

ERR_EVNT_REGI Error: occurred when the call-back function was registered

ERR_EVNT_UNREGI Error: occurred when the call-back function was unregistered.

STAT_EVNT_CLOS State: SDK-API event is closed.

STAT_EVNT_CLOS_DONE State: SDK-API event closed.

STAT_EVNT_OPEN_DONE State: SDK-API event open.

STAT_EVNT_REGI_DONE State: SDK-API event registered.

STAT_EVNT_UNREGI State: SDK-API event will be unregistered.

STAT_EVNT_UNREGI_DONE State: SDK-API event unregistered.

ERR_BAD_CRC Error: CRC error

ERR_FILE_ACCESS Error: unauthorised file access.

ERR_SEGM_COUNT_LIM Error: The file contains more software segments than permitted or the file contains more than 2 versions of the same segment type.

Page 19: Programming Manual CODESYS for ifm SDK Extension 1.0.0

19

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.3 GetSysInfo 21201

Function block type: Function block (FB)

Behaviour model: EXECUTE

Library: ifmSDKutil.library

Symbol in CODESYS:

>

Description 21202

The FB reads the system information of the device (eChannel, usiDownloadId, eDevice). As an option, the user can hand over the password for password-protected IEC applications (sPassword). The read information are saved in a structure variable of the type stSYS_INFO (STRUCT) (→ p. 34). >

Input parameter 8045

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE TRUE

FB is executed once

Other No impact on FB processing

eChannel CAN_ CHANNEL

Identifier of the CAN Interface → CAN_CHANNEL (ENUM)

usiDownloadId USINT CANopen node ID of the target device 1...127

eDevice eDEVICES Device / device type → eDEVICES (ENUM) (→ p. 32)

sPassword STRING Optional: password for protected IEC applications

Page 20: Programming Manual CODESYS for ifm SDK Extension 1.0.0

20

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

Output parameter 21204

Parameter Data type Description Possible values

xDone BOOL Indication of whether execution of the FB has been successfully completed

FALSE FB is executed

TRUE FB successfully executed

FB can be called again

xError BOOL Indication if an error occurred during the FB execution

FALSE No error occurred or the FB is still being executed

TRUE Error occurred

Action could not be executed

Note diagnostic information

eDiagInfo DIAG_INFO Diagnostic information → List below (diagnostic codes:)

stSysInfo SYS_INFO Structure variable in which the read information is stored

→ stSYS_INFO (STRUCT) (→ p. 34)

Some devices only support certain elements of the data structure stSYS_INFO (STRUCT). The value "not available" is assigned to the elements that are not available.

Page 21: Programming Manual CODESYS for ifm SDK Extension 1.0.0

21

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

Diagnostic codes:

STAT_INACTIVE State: FB/Function is inactive.

STAT_BUSY State: FB/Function is currently executed.

STAT_DONE State: FB/Function has been successfully executed and completed. There are valid results on the outputs.

STAT_ABORT Status: FB/function was aborted; Abort operations are executed.

ERR_INTERNAL Error: Internal system error

► Contact the ifm Service Center!

ERR_INVALID_CHANNEL Error: Internal parameter setting fault

► Contact the ifm Service Center!

ERR_INVALID_VALUE Error: at least 1 invalid input parameter or invalid combination of input parameters; Function call has been stopped.

ERR_COMMUNICATION Error: no Connection to the network node or network node not available

ERR_CAN_INIT Error: CAN channel is not initialised.

ERR_DYNAMIC_MEMORY Error: Memory reservation failed during creation of the internal FB instance.

ERR_EVNT_CLOS Error: occurred when an event was closed

ERR_EVNT_OPEN Error: occurred when an SDK-API event was opened

ERR_EVNT_REGI Error: occurred when the call-back function was registered

ERR_EVNT_UNREGI Error: occurred when the call-back function was unregistered.

STAT_EVNT_CLOS State: SDK-API event is closed.

STAT_EVNT_CLOS_DONE State: SDK-API event closed.

STAT_EVNT_OPEN_DONE State: SDK-API event open.

STAT_EVNT_REGI_DONE State: SDK-API event registered.

STAT_EVNT_UNREGI State: SDK-API event will be unregistered.

STAT_EVNT_UNREGI_DONE State: SDK-API event unregistered.

ERR_INVALID_DEVICE Error: Wrong or unknown device

ERR_INVALID_TARGED_ID Error: Wrong target ID

ERR_CMND_NOT_SUPPORT Error: At least one command option is not supported by the device.

ERR_PROTOCOL Error: Error in the maintenance command protocol

► Repeat the execution of the command!

ERR_INVALID_PASSWORD Error: Wrong password

Page 22: Programming Manual CODESYS for ifm SDK Extension 1.0.0

22

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.4 PingDevice 7375

Function block type: Function block (FB)

Behaviour model: EXECUTE

Library: ifmSDKutil.library

Symbol in CODESYS:

>

Description 21113

The FB verifies whether a connection between the SDK on the device and another device in a CAN network can be established. The FB sends a PING signal to a specific device in the CAN network (usiDownloadID, eDevice, eChannel).

For the parameters eDevice and usiDownloadID, correct values must be entered in order to receive a successful PING response.

>

Input parameter 21114

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE TRUE

FB is executed once

Other No impact on FB processing

eChannel CAN_ CHANNEL

Identifier of the CAN Interface → CAN_CHANNEL (ENUM)

usiDownloadId USINT CANopen node ID of the target device 1...127

eDevice eDEVICES Device / device type → eDEVICES (ENUM) (→ p. 32)

Page 23: Programming Manual CODESYS for ifm SDK Extension 1.0.0

23

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

Output parameter 21115

Parameter Data type Description Possible values

xDone BOOL Indication of whether execution of the FB has been successfully completed

FALSE FB is executed

TRUE FB successfully executed

FB can be called again

xError BOOL Indication if an error occurred during the FB execution

FALSE No error occurred or the FB is still being executed

TRUE Error occurred

Action could not be executed

Note diagnostic information

eDiagInfo DIAG_INFO Diagnostic information → List below (diagnostic codes:)

sArticle STRING(80) Ping return (article number of the device)

Diagnostic codes:

STAT_INACTIVE State: FB/Function is inactive.

STAT_BUSY State: FB/Function is currently executed.

STAT_DONE State: FB/Function has been successfully executed and completed. There are valid results on the outputs.

STAT_ABORT Status: FB/function was aborted; Abort operations are executed.

ERR_INTERNAL Error: Internal system error

► Contact the ifm Service Center!

ERR_INVALID_VALUE Error: at least 1 invalid input parameter or invalid combination of input parameters; Function call has been stopped.

ERR_COMMUNICATION Error: no Connection to the network node or network node not available

ERR_CAN_INIT Error: CAN channel is not initialised.

ERR_DYNAMIC_MEMORY Error: Memory reservation failed during creation of the internal FB instance.

ERR_EVNT_CLOS Error: occurred when an event was closed

ERR_EVNT_OPEN Error: occurred when an SDK-API event was opened

ERR_EVNT_REGI Error: occurred when the call-back function was registered

ERR_EVNT_UNREGI Error: occurred when the call-back function was unregistered.

STAT_EVNT_CLOS State: SDK-API event is closed.

STAT_EVNT_CLOS_DONE State: SDK-API event closed.

STAT_EVNT_OPEN_DONE State: SDK-API event open.

STAT_EVNT_REGI_DONE State: SDK-API event registered.

STAT_EVNT_UNREGI State: SDK-API event will be unregistered.

STAT_EVNT_UNREGI_DONE State: SDK-API event unregistered.

ERR_INVALID_DEVICE Error: Wrong or unknown device

ERR_INVALID_TARGED_ID Error: Wrong target ID

ERR_PROTOCOL Error: Error in the maintenance command protocol

► Repeat the execution of the command!

Page 24: Programming Manual CODESYS for ifm SDK Extension 1.0.0

24

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.5 ReadFromController 8029

Function block type: Function block (FB)

Behaviour model: EXECUTE

Library: ifmSDKutil.library

Symbol in CODESYS:

>

Description 8038

The FB reads the data of a target device (eChannel, usiDownloadId, eDevice). The user can determine which memory areas of the target device are to be read (stSegmList). For access-protected CODESYS applications, the user can enter the corresponding password (sPassword). The unread data is saved in a file (sFileName).

Supported file formats: RESX, BIN, H86

>

Input parameter 8043

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE TRUE

FB is executed once

Other No impact on FB processing

eChannel CAN_ CHANNEL

Identifier of the CAN Interface → CAN_CHANNEL (ENUM)

usiDownloadId USINT CANopen node ID of the target device 1...127

eDevice eDEVICES Device / device type → eDEVICES (ENUM) (→ p. 32)

sFileName STRING (255)

Directory path and name of the BIN file e.g. /data/MyData.binary

stSegmList stSEGMENT_LIST required memory segments → stSEGMENT_LIST (STRUCT) (→ p. 33)

sPassword STRING Optional: password for protected IEC applications

Page 25: Programming Manual CODESYS for ifm SDK Extension 1.0.0

25

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

Output parameters 8042

Parameter Data type Description Possible values

xDone BOOL Indication of whether execution of the FB has been successfully completed

FALSE FB is executed

TRUE FB successfully executed

FB can be called again

xError BOOL Indication if an error occurred during the FB execution

FALSE No error occurred or the FB is still being executed

TRUE Error occurred

Action could not be executed

Note diagnostic information

eDiagInfo DIAG_INFO Diagnostic information → List below (diagnostic codes:)

Page 26: Programming Manual CODESYS for ifm SDK Extension 1.0.0

26

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

Diagnostic codes:

STAT_INACTIVE State: FB/Function is inactive.

STAT_BUSY State: FB/Function is currently executed.

STAT_DONE State: FB/Function has been successfully executed and completed. There are valid results on the outputs.

STAT_ABORT Status: FB/function was aborted; Abort operations are executed.

ERR_INTERNAL Error: Internal system error

► Contact the ifm Service Center!

ERR_INVALID_CHANNEL Error: Internal parameter setting fault

► Contact the ifm Service Center!

ERR_INVALID_VALUE Error: at least 1 invalid input parameter or invalid combination of input parameters; Function call has been stopped.

ERR_COMMUNICATION Error: no Connection to the network node or network node not available

ERR_CAN_INIT Error: CAN channel is not initialised.

ERR_BAD_CRC Error: CRC error

ERR_MEM_SEGMENT Error: The selected memory area is not available or access was denied.

ERR_FILE_OPEN Error: SDK-API reports an error when the file is opened.

ERR_INVALID_PASSWORD Error: Wrong password

ERR_DYNAMIC_MEMORY Error: Memory reservation failed during creation of the internal FB instance.

ERR_EVNT_CLOS Error: occurred when an event was closed

ERR_EVNT_OPEN Error: occurred when an SDK-API event was opened

ERR_EVNT_REGI Error: occurred when the call-back function was registered

ERR_EVNT_UNREGI Error: occurred when the call-back function was unregistered.

STAT_EVNT_CLOS State: SDK-API event is closed.

STAT_EVNT_CLOS_DONE State: SDK-API event closed.

STAT_EVNT_OPEN_DONE State: SDK-API event open.

STAT_EVNT_REGI_DONE State: SDK-API event registered.

STAT_EVNT_UNREGI State: SDK-API event will be unregistered.

STAT_EVNT_UNREGI_DONE State: SDK-API event unregistered.

STAT_SELE_SEGM State: Software segment is currently being selected.

STAT_READ_SEGM Status: Software segment is currently being read.

STAT_WRIT_SEGM Status: Software segment is currently being written.

ERR_CMND_NOT_SUPPORT Error: At least one command option is not supported by the device.

ERR_NO_SOFTWARE Error: Software is not available in the device.

ERR_PROTOCOL Error: Error in the maintenance command protocol

► Repeat the execution of the command!

ERR_INVALID_TARGED_ID Error: Wrong target ID

ERR_INVALID_DEVICE Error: Wrong or unknown device

ERR_SEGM_DUPLICATION Error: Software segment already exists in file.

ERR_FILE_ACCESS Error: unauthorised file access.

Page 27: Programming Manual CODESYS for ifm SDK Extension 1.0.0

27

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.6 SelectSegmentFromList 12897

Function block type: Function block (FB)

Behaviour model: EXECUTE

Library: ifmSDKutil.library

Symbol in CODESYS:

>

Description 23940

The FB reads a data structure (aSegmTypeNameList). It creates a list of the software segments (stSegmList) from the read data. At the same time, all data sets with xSele = TRUE are added to the list. The list can be handed over to the FB WriteToController in order to write data to a controller.

The list from which the software segments are selected can be previously created with the FB GetSegmentListFromFile.

If the fields sType and sName of a dataset are empty, the dataset is not added to the list.

>

Input parameter 06.11.2017 07:25:19

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE TRUE

FB is executed once

Other No impact on FB processing

aSegmTypeNameList ARRAY[0..15] OF stSEGM_TYPE_NAME

Array with memory segments → stSEGM_TYPE_NAME (STRUCT) (→ p. 35)

Page 28: Programming Manual CODESYS for ifm SDK Extension 1.0.0

28

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

Output parameter 23942

Parameter Data type Description Possible values

xDone BOOL Indication of whether execution of the FB has been successfully completed

FALSE FB is executed

TRUE FB successfully executed

FB can be called again

xError BOOL Indication if an error occurred during the FB execution

FALSE No error occurred or the FB is still being executed

TRUE Error occurred

Action could not be executed

Note diagnostic information

eDiagInfo DIAG_INFO Diagnostic information → List below (diagnostic codes:)

stSegmList stSEGMENT_LIST_WR List of memory segments → stSEGMENT_LIST_WR (STRUCT) (→ p. 34)

Diagnostic codes:

STAT_INACTIVE State: FB/Function is inactive.

STAT_BUSY State: FB/Function is currently executed.

STAT_DONE State: FB/Function has been successfully executed and completed. There are valid results on the outputs.

STAT_ABORT Status: FB/function was aborted; Abort operations are executed.

ERR_INVALID_VALUE Error: at least 1 invalid input parameter or invalid combination of input parameters; Function call has been stopped.

Page 29: Programming Manual CODESYS for ifm SDK Extension 1.0.0

29

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.7 WriteToController 8028

Function block type: Function block (FB)

Behaviour model: EXECUTE

Library: ifmSDKutil.library

Symbol in CODESYS:

>

Description 21211

The FB writes firmware, applications or data on a target device (eChannel, usiDownloadId, eDevice). The data to be written is read from a file with checksum (sFileName, sMd5FileName). The user can select one or several memory areas to be used for writing (stSegmentList).

The file must contain all the adequate data about the memory areas. Supported file formats: RESX, BIN, H86

>

Input parameter 8044

Parameter Data type Description Possible values

xExecute BOOL Control execution of the FB FALSE TRUE

FB is executed once

Other No impact on FB processing

eChannel CAN_ CHANNEL

Identifier of the CAN Interface → CAN_CHANNEL (ENUM)

usiDownloadId USINT CANopen node ID of the target device 1...127

eDevice eDEVICES Device / device type → eDEVICES (ENUM) (→ p. 32)

sFileName STRING (255)

Directory path and name of the BIN file e.g. \data\MyData.bin

sMd5FileName STRING (255)

Directory path and name of the MD5 file e.g.. \data\MyData.md5

stSegmList stSEGMENT_LIST_WR List of memory segments → stSEGMENT_LIST_WR (STRUCT) (→ p. 34)

Page 30: Programming Manual CODESYS for ifm SDK Extension 1.0.0

30

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

Output parameters 8041

Parameter Data type Description Possible values

xDone BOOL Indication of whether execution of the FB has been successfully completed

FALSE FB is executed

TRUE FB successfully executed

FB can be called again

xError BOOL Indication if an error occurred during the FB execution

FALSE No error occurred or the FB is still being executed

TRUE Error occurred

Action could not be executed

Note diagnostic information

eDiagInfo DIAG_INFO Diagnostic information → List below (diagnostic codes:)

Page 31: Programming Manual CODESYS for ifm SDK Extension 1.0.0

31

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

Diagnostic codes:

STAT_INACTIVE State: FB/Function is inactive.

STAT_BUSY State: FB/Function is currently executed.

STAT_DONE State: FB/Function has been successfully executed and completed. There are valid results on the outputs.

STAT_ABORT Status: FB/function was aborted; Abort operations are executed.

ERR_INTERNAL Error: Internal system error

► Contact the ifm Service Center!

ERR_INVALID_CHANNEL Error: Internal parameter setting fault

► Contact the ifm Service Center!

ERR_INVALID_VALUE Error: at least 1 invalid input parameter or invalid combination of input parameters; Function call has been stopped.

ERR_COMMUNICATION Error: no Connection to the network node or network node not available

ERR_CAN_INIT Error: CAN channel is not initialised.

ERR_BAD_CRC Error: CRC error

ERR_MEM_SEGMENT Error: The selected memory area is not available or access was denied.

ERR_FILE_OPEN Error: SDK-API reports an error when the file is opened.

ERR_DYNAMIC_MEMORY Error: Memory reservation failed during creation of the internal FB instance.

ERR_EVNT_CLOS Error: occurred when an event was closed

ERR_EVNT_OPEN Error: occurred when an SDK-API event was opened

ERR_EVNT_REGI Error: occurred when the call-back function was registered

ERR_EVNT_UNREGI Error: occurred when the call-back function was unregistered.

STAT_EVNT_CLOS State: SDK-API event is closed.

STAT_EVNT_CLOS_DONE State: SDK-API event closed.

STAT_EVNT_OPEN_DONE State: SDK-API event open.

STAT_EVNT_REGI_DONE State: SDK-API event registered.

STAT_EVNT_UNREGI State: SDK-API event will be unregistered.

STAT_EVNT_UNREGI_DONE State: SDK-API event unregistered.

STAT_SELE_SEGM State: Software segment is currently being selected.

STAT_READ_SEGM Status: Software segment is currently being read.

STAT_WRIT_SEGM Status: Software segment is currently being written.

ERR_CMND_NOT_SUPPORT Error: At least one command option is not supported by the device.

ERR_NO_SOFTWARE Error: Software is not available in the device.

ERR_PROTOCOL Error: Error in the maintenance command protocol

► Repeat the execution of the command!

ERR_INVALID_TARGED_ID Error: Wrong target ID

ERR_INVALID_DEVICE Error: Wrong or unknown device

ERR_FILE_ACCESS Error: unauthorised file access.

Page 32: Programming Manual CODESYS for ifm SDK Extension 1.0.0

32

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.8 eCMD_LIST (ENUM) 8051

Symbol Description Value

None selection invalid 0

START_APP Start IEC application 1

STOP_APP Stop IEC application 2

RESET_WARM Execute CODESYS reset (warm) 3

RESET_COLD Execute CODESYS reset (cold) 4

RESET_ORIGIN Execute CODESYS reset (origin) 5

REBOOT_BASIC_SYSTEM Reboot the device 6

>

6.1.9 eDEVICES (ENUM) 1864

Symbol Description Value

None selection invalid 0

BASIC_SYSTEM All devices of the BasicSystem family (includes CR0401, CR0403, CR0411, CR0451, CR0452, CR2530, CR2532)

1

CR0020 R360 System Controller CR0020 2

CR0200 R360 System Controller CR0200 3

CR0032 R360 System Controller CR0032 4

CR0033 R360 System Controller CR0033 5

CR0232 R360 System Controller CR0232 6

CR0233 R360 System Controller CR0233 7

CR0303 R360 System Controller CR0303 8

CR0505 R360 System Controller CR0505 9

CR2500 R360 System Controller CR2500 10

CR0234 R360 System Controller CR0234 11

CR0235 R360 System Controller CR0235 12

Page 33: Programming Manual CODESYS for ifm SDK Extension 1.0.0

33

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.10 stSEGMENT_LIST (STRUCT) 8073

Element Data type Description Possible values

xIECApp BOOL IEC application FALSE do not select

TRUE Select

xIECAppCfg BOOL IEC Application Configuration FALSE do not select

TRUE Select

xFirmware BOOL Firmware FALSE do not select

TRUE Select

xRetaData BOOL IEC User Retain FALSE do not select

TRUE Select

xUserFlash BOOL UserFlash FALSE do not select

TRUE Select

xDataFlash BOOL Data Flash FALSE do not select

TRUE Select

xFileFlash BOOL Symbol configuration FALSE do not select

TRUE Select

xMemoReta BOOL Memory Retain FALSE do not select

TRUE Select

xEEPROM BOOL EEPROM FALSE do not select

TRUE Select

Page 34: Programming Manual CODESYS for ifm SDK Extension 1.0.0

34

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.11 stSEGMENT_LIST_WR (STRUCT) 22879

Element Data type Description Possible values

stFirmware → stSEGM_NAME (STRUCT) (→ p. 35)

"Firmware" segment

stIECApp → stSEGM_NAME (STRUCT) (→ p. 35)

"IEC Application" segment

stIECAppCfg → stSEGM_NAME (STRUCT) (→ p. 35)

"IEC Application Configuration" segment

stFileFlash → stSEGM_NAME (STRUCT) (→ p. 35)

"Symbol configuration" segment

stUserFlash → stSEGM_NAME (STRUCT) (→ p. 35)

"User Flash" segment

stDataFlash → stSEGM_NAME (STRUCT) (→ p. 35)

"Data Flash" segment

stRetaData → stSEGM_NAME (STRUCT) (→ p. 35)

Segment IEC User Retain"

stMemoReta → stSEGM_NAME (STRUCT) (→ p. 35)

"Memory Retain" segment

stEEPROM → stSEGM_NAME (STRUCT) (→ p. 35)

"EEPROM" segment

>

6.1.12 stSYS_INFO (STRUCT) 8074

Element Data type Description Possible values

sArticle STRING(80) Article number of the device e.g. CR0401

sHardVers STRING(80) Hardware version of the device

sSoftVers STRING(80) Firmware version of the device

sAppName STRING(80) Name of the current application* e.g. MyApp

xBootLodrMode BOOL Status of the bootloader mode FALSE inactive, e. g. in the runtime mode

TRUE active

sAppState STRING(80) Status of the application notavailable no application loaded

notrunning Application is loaded and in the STOP mode

running Application is loaded and in the RUN mode

unknown Status of the application not identified

diAppCRC DINT CRC checksum of the application

Page 35: Programming Manual CODESYS for ifm SDK Extension 1.0.0

35

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.13 stSEGM_NAME (STRUCT) 18100

Element Data type Description Possible values

xSele BOOL Select memory segment FALSE do not select

TRUE Select

sName STRING (255)

Name of the memory segment (depends on the type of the container file)

>

6.1.14 stSEGM_TYPE_NAME (STRUCT) 18099

Element Data type Description Possible values

xSele BOOL Select software segment FALSE do not select

TRUE Select

sType STRING(20) Data type of the software segment

sName STRING(255) Name of the memory segment (depends on the type of the container file)

>

6.1.15 stLAST_EVNT_RESP (STRUCT) 22878

Element Data type Description Possible values

diErrorCode DINT Return value of the SDK API < 0 error

= 0 Processing finished

> 0 is being executed

sRespDesc STRING (251)

Description of the error code

Page 36: Programming Manual CODESYS for ifm SDK Extension 1.0.0

36

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix Bibliothek ifmSDKutil.library

>

6.1.16 gc_AllSegments (GC) 12895

Element Data type Description Default values

stBasic → stSEGMENT_LIST (STRUCT) (→ p. 33)

Memory segments Basic Controller xFirmware = TRUE; xIECApp = TRUE; xIECAppCfg = TRUE; xFileFlash = FALSE; xUserFlash = TRUE; xDataFlash = FALSE; xRetaData = FALSE; xMemoData = FALSE; xEEPROM = FALSE

stR360_32bit → stSEGMENT_LIST (STRUCT) (→ p. 33)

Memory segments R360 Controller (32 bit)

xFirmware = TRUE; xIECApp = TRUE; xIECAppCfg = FALSE; xFileFlash = TRUE; xUserFlash = TRUE; xDataFlash = TRUE; xRetaData = TRUE; xMemoData = TRUE; xEEPROM = TRUE

stR360_16bit → stSEGMENT_LIST (STRUCT) (→ p. 33)

Memory segments R360 Controller (16 bit)

xFirmware = TRUE; xIECApp = TRUE; xIECAppCfg = FALSE; xFileFlash = TRUE; xUserFlash = TRUE; xDataFlash = TRUE; xRetaData = TRUE; xMemoData = FALSE; xEEPROM = TRUE

>

6.1.17 gv_EvntCallBack (GV) 12896

Element Data type Description Initial values

stLastEvnt → stLAST_EVNT_RESP (STRUCT) (→ p. 35)

Last received diagnostic message of the SDK API

Page 37: Programming Manual CODESYS for ifm SDK Extension 1.0.0

37

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix ifm behaviour models for function blocks

>

6.2 ifm behaviour models for function blocks

General ...................................................................................................................................................37 Behaviour model ENABLE .....................................................................................................................38 Behaviour model EXECUTE ..................................................................................................................38

23705

This chapter describes the ifm behaviour models for function blocks. >

6.2.1 General 23801

ifm function blocks feature the following outputs to return status and error information:

Output Description

xError TRUE An error has occurred.

FALSE No error has occurred.

eDiagInfo Diagnostic/error information → Notifications

All inputs and outputs in the function block that belong to the ifm behaviour model are featured at the top.

Page 38: Programming Manual CODESYS for ifm SDK Extension 1.0.0

38

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Appendix ifm behaviour models for function blocks

>

6.2.2 Behaviour model ENABLE 23705

Function blocks that use the behaviour model ENABLE are cyclically processed as long as the status at the input is xEnable = TRUE.

If xEnable = FALSE, the function block will not be executed. All function block outputs are reset to their preset default values and will not be updated. In this case the following applies: xError = FALSE and eDiagInfo = STAT_INACTIVE.

Function blocks that have no xEnable input are processed cyclically when the application is started. The processing is only terminated when the application is stopped. The behaviour corresponds with the behaviour of a function block with a permanent TRUE at the xEnable input. >

Response to errors 23815

In case of an error, xError is set to TRUE and eDiagInfo indicates the diagnostic code as long as xEnable is = TRUE.

Irrespective of the data type, all other outputs of the function block will be reset to the following values:

Data type Value

numerical 0 / 0.0

String Empty string

BOOL/Bit FALSE

>

6.2.3 Behaviour model EXECUTE 23800

Function blocks that have the EXECUTE behaviour model are processed once after a rising edge at the xExecute input.

If the function block has executed its function successfully, the output is set xDone = TRUE. >

Response to errors 23827

In case of an error, xError is set to TRUE and eDiagInfo indicates the error status as long as xExecute is = TRUE.

The output xDone is set to FALSE since the execution could not be finished successfully.

Irrespective of the data type, all other outputs of the function block will be reset to the following values:

Data type Value

numerical 0 / 0.0

String Empty string

BOOL/Bit FALSE

Page 39: Programming Manual CODESYS for ifm SDK Extension 1.0.0

39

ifm Programming Manual CODESYS for ifm SDK Extension 1.0.0.0 2017-11-22

Index

7 Index

A

Add function library to the project .......................................................... 10

Appendix ................................................................................................ 12

B

Behaviour model ENABLE .................................................................... 38

Behaviour model EXECUTE.................................................................. 38

Bibliothek ifmSDKutil.library .................................................................. 13

C

Command .............................................................................................. 14

D

Description ........................................................ 14, 17, 19, 22, 24, 27, 29

Diagnosis messages.............................................................................. 13

E

eCMD_LIST (ENUM) ............................................................................. 32

eDEVICES (ENUM) ............................................................................... 32

G

gc_AllSegments (GC) ............................................................................ 36

General .................................................................................................. 37

GetSegmentListFromFile ....................................................................... 17

GetSysInfo ............................................................................................. 19

gv_EvntCallBack (GV) ........................................................................... 36

H

Hardware ................................................................................................. 7

I

ifm behaviour models for function blocks .............................................. 37

ifm weltweit • ifm worldwide • ifm à l’échelle internationale ................... 41

Input parameter ................................................ 14, 17, 19, 22, 24, 27, 29

Install ifm package ................................................................................... 8

Installation ................................................................................................ 8

L

Legal and copyright information .............................................................. 4

Licensing .................................................................................................. 7

M

Modification history .................................................................................. 5

N

Notes ...................................................................................................... 10

O

Output parameter.......................................................... 15, 18, 20, 23, 28

Output parameters ...........................................................................25, 30

P

PI controller .............................................................................................. 4

PingDevice ............................................................................................. 22

Preliminary note ....................................................................................... 4

Programming ......................................................................................... 10

R

ReadFromController .............................................................................. 24

Required background knowledge ............................................................ 6

Response to errors ................................................................................ 38

S

Safety instructions ................................................................................... 6

SelectSegmentFromList ........................................................................ 27

Software ................................................................................................... 7

stLAST_EVNT_RESP (STRUCT) ......................................................... 35

stSEGM_NAME (STRUCT) ................................................................... 35

stSEGM_TYPE_NAME (STRUCT) ....................................................... 35

stSEGMENT_LIST (STRUCT) .............................................................. 33

stSEGMENT_LIST_WR (STRUCT) ...................................................... 34

stSYS_INFO (STRUCT) ........................................................................ 34

Symbols and styles used ......................................................................... 4

System requirements ............................................................................... 7

U

Uninstall ifm package .............................................................................. 9

Update ifm package ................................................................................. 9

Use library functions .............................................................................. 11

W

Warnings used ......................................................................................... 6

WriteToController ................................................................................... 29

Page 40: Programming Manual CODESYS for ifm SDK Extension 1.0.0
Page 41: Programming Manual CODESYS for ifm SDK Extension 1.0.0

8 ifm weltweit • ifm worldwide • ifm à l’échelle internationale

Version: 2016-11-29 8310

ifm electronic gmbh • Friedrichstraße 1 • 45128 Essen

www.ifm.com • Email: [email protected]

Service hotline: 0800 / 16 16 16 (only Germany, Mo-Fr 07.00...18.00 h)

ifm Niederlassungen • Sales offices • Agences

D Niederlassung Nord • 31135 Hildesheim • Tel. 0 51 21 / 76 67-0

Niederlassung West • 45128 Essen • Tel. 02 01 / 3 64 75 -0

Niederlassung Mitte-West • 58511 Lüdenscheid • Tel. 0 23 51 / 43 01-0

Niederlassung Süd-West • 64646 Heppenheim • Tel. 0 62 52 / 79 05-0

Niederlassung Baden-Württemberg • 73230 Kirchheim • Tel. 0 70 21 / 80 86-0

Niederlassung Bayern • 82178 Puchheim • Tel. 0 89 / 8 00 91-0

Niederlassung Ost • 07639 Tautenhain • Tel. 0 36 601 / 771-0

A, SL

AUS

B, L

BG

BR

CH

CL

CN

CND

CZ

DK

E

F

FIN

GB, IRL

GR

H

I

IL

IND

J

MAL

MEX

N

NA

NL

NZ

P

PL

RA, ROU

RO

ROK

RUS

S

SGP

SK

THA

TR

UA

USA

VN

ZA

ifm electronic gmbh • 1120 Wien • Tel. +43 16 17 45 00

ifm efector pty ltd. • Mulgrave Vic 3170 • Tel. +61 3 00 365 088

ifm electronic N.V. • 1731 Zellik • Tel. +32 2 / 4 81 02 20

ifm electronic eood • 1202 Sofia • Tel. +359 2 807 59 69

ifm electronic Ltda. • 03337-000, Sao Paulo SP • Tel. +55 11 / 2672-1730

ifm electronic ag • 4 624 Härkingen • Tel. +41 62 / 388 80 30

ifm electronic SpA • Oficina 5032 Comuna de Conchalí • Tel. +55 11 / 2672-1730

ifm electronic (Shanghai) Co. Ltd. • 201203 Shanghai • Tel. +86 21 / 3813 4800

ifm efector Canada inc. • Oakville, Ontario L6K 3V3 • Tel. +1 800-441-8246

ifm electronic spol. s.r.o. • 25243 Průhonice • Tel. +420 267 990 211

ifm electronic a/s • 2605 BROENDBY • Tel. +45 70 20 11 08

ifm electronic s.a. • 08820 El Prat de Llobregat • Tel. +34 93 479 30 80

ifm electronic s.a. • 93192 Noisy-le-Grand Cedex • Tél. +33 0820 22 30 01

ifm electronic oy • 00440 Helsinki • Tel . +358 75 329 5000

ifm electronic Ltd. • Hampton, Middlesex TW12 2HD • Tel. +44 208 / 213-0000

ifm electronic Monoprosopi E.P.E. • 15125 Amaroussio • Tel. +30 210 / 6180090

ifm electronic kft. • 9028 Györ • Tel. +36 96 / 518-397

ifm electronic s.a. • 20041 Agrate-Brianza (MI) • Tel. +39 039 / 68.99.982

Astragal Ltd. • Azur 58001 • Tel. +972 3 -559 1660

ifm electronic India Branch Office • Kolhapur, 416234 • Tel. +91 231-267 27 70

efector co., ltd. • Chiba-shi, Chiba 261-7118 • Tel. +81 043-299-2070

ifm electronic Pte. Ltd • 47100 Puchong Selangor • Tel. +603 8063 9522

ifm efector S. de R. L. de C. V. • Monterrey, N. L. 64630 • Tel. +52 81 8040-3535

Sivilingeniør J. F. Knudtzen A/S • 1396 Billingstad • Tel. +47 66 / 98 33 50

ifm elctronic (pty) Ltd • 25 Dr. W. Kulz Street Windhoek • Tel. +264 61 300984

ifm electronic b.v. • 3843 GA Harderwijk • Tel. +31 341 / 438 438

ifm efector pty ltd • 930 Great South Road Penrose, Auckland • Tel. +64 95 79 69 91

ifm electronic s.a. • 4410-136 São Félix da Marinha • Tel. +351 223 / 71 71 08

ifm electronic Sp. z o.o. • 40-106 Katowice • Tel. +48 32-608 74 54

ifm electronic s.r.l. • 1107 Buenos Aires • Tel. +54 11 / 5353 3436

ifm electronic s.r.l • Sibiu 557260 • Tel. +40 269 224550

ifm electronic Ltd. • 140-884 Seoul • Tel. +82 2 / 790 5610

ifm electronic • 105318 Moscow • Tel. +7 495 921-44-14

ifm electronic a b • 41250 Göteborg • Tel. +46 31 / 750 23 00

ifm electronic Pte. Ltd. • Singapore 609 916 • Tel. +65 6562 8661/2/3

ifm electronic s.r.o. • 835 54 Bratislava • Tel. +421 2 / 44 87 23 29

SCM Allianze Co., Ltd. • Bangkok 10 400 • Tel. +66 02 615 4888

ifm electronic Ltd. Sti. • 34381 Sisli/Istanbul • Tel. +90 212 / 210 50 80

TOV ifm electronic • 02660 Kiev • Tel. +380 44 501 8543

ifm efector inc. • Exton, PA 19341 • Tel. +1 610 / 5 24-2000

ifm electronic • Ho Chi Minh city 700000 • Tel. +84-8-35125177

ifm electronic (Pty) Ltd. • 0157 Pretoria • Tel. +27 12 345 44 49

Technische Änderungen behalten wir uns ohne vorherige Ankündigung vor. We reserve the right to make technical alterations without prior notice.

Nous nous réservons le droit de modifier les données techniques sans préavis.