You are on page 1of 385

Original programming manual

PDM360 NG 12" / Touch

CR1201

Runtime system V02.03.xx


CODESYS® V2.3

English
2015-08-27
7391029_00_UK
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Contents

Contents

1 About this manual 5


1.1 Copyright ..............................................................................................................................6
1.2 Overview: documentation modules for ecomatmobile devices ............................................6
1.3 CODESYS programming manual ........................................................................................7
1.4 What do the symbols and formats mean? ...........................................................................7
1.5 How is this documentation structured? ................................................................................8
1.6 History of the instructions .....................................................................................................8

2 Safety instructions 9
2.1 What previous knowledge is required? ..............................................................................10
2.2 Note! ...................................................................................................................................10
2.3 Start-up behaviour of the controller....................................................................................11

3 System description 12
3.1 Information concering the device .......................................................................................12
3.2 Hardware ............................................................................................................................13
3.2.1 Display elements ........................................................................................................................ 14
3.2.2 Operating elements .................................................................................................................... 15
3.2.3 Operating principle of the delayed switch-off.............................................................................. 16
3.2.4 Limitations for program and data memories ............................................................................... 16
3.2.5 Real-time clock (RTC) ................................................................................................................ 17
3.2.6 Camera visualisation .................................................................................................................. 17
3.3 Interfaces ...........................................................................................................................18
3.3.1 Inputs (technology) ..................................................................................................................... 19
3.3.2 Outputs (technology) .................................................................................................................. 22
3.3.3 CAN ............................................................................................................................................ 22
3.3.4 USB ............................................................................................................................................ 23
3.3.5 Ethernet ...................................................................................................................................... 23
3.3.6 Analogue video input .................................................................................................................. 23
3.4 Software description ..........................................................................................................24
3.4.1 Software components ................................................................................................................. 25
3.4.2 Programming system CODESYS 2.3 ......................................................................................... 26
3.4.3 ifm target package for CODESYS .............................................................................................. 26
3.4.4 Operating states ......................................................................................................................... 26

4 Installation 27
4.1 Install the CODESYS programming system ......................................................................28
4.2 Install the device-specific target package ..........................................................................28
4.3 Update the runtime system of the device ..........................................................................29
4.3.1 Notes .......................................................................................................................................... 30
4.3.2 Enter the recovery mode ............................................................................................................ 31
4.3.3 Update the runtime system......................................................................................................... 31
4.3.4 Configure IP parameter of ethernet interface ............................................................................. 34
4.3.5 Quit the recovery mode .............................................................................................................. 37

5 Device configuration 38
5.1 Enter the setup mode .........................................................................................................39
5.2 Operating instructions ........................................................................................................40
5.2.1 Key functionality ......................................................................................................................... 41
5.2.2 Navigation key ............................................................................................................................ 46
5.2.3 Touchscreen............................................................................................................................... 46

2
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Contents

5.2.4 Setup: Working with enabled password protection ..................................................................... 47


5.3 Setup: start screen .............................................................................................................49
5.3.1 Setup: System settings ............................................................................................................... 50
5.3.2 Setup: Display system information ............................................................................................. 59
5.3.3 Setup: More functions ................................................................................................................ 60
5.4 PDF file viewer ...................................................................................................................76
5.4.1 PDF: Navigating in the PDF file .................................................................................................. 77
5.4.2 PDF-Viewer: Display PDF file in full-screen mode ..................................................................... 78
5.4.3 PDF-Viewer: Display extended menu ......................................................................................... 79
5.4.4 PDF-Viewer: Display the tabel of content of the PDF file ........................................................... 80
5.5 Setup: Start the application ................................................................................................81
5.6 Automatically restore system files......................................................................................82
5.7 Exit setup, reboot device ....................................................................................................82

6 Programming 83
6.1 Set the target system .........................................................................................................84
6.1.1 Create CODESYS project manually ........................................................................................... 85
6.1.2 Configure the controller .............................................................................................................. 86
6.1.3 Configure CAN interfaces ........................................................................................................... 87
6.1.4 Use access protection ................................................................................................................ 89
6.2 First steps ...........................................................................................................................91
6.2.1 Programming notes for CODESYS projects ............................................................................... 92
6.2.2 Create PLC program ................................................................................................................ 113
6.2.3 Add additional libraries ............................................................................................................. 114
6.2.4 Programming interfaces ........................................................................................................... 115
6.2.5 Save project in the device ........................................................................................................ 121
6.3 Configuration of the inputs and outputs ...........................................................................122
6.3.1 Notes ........................................................................................................................................ 123
6.3.2 Configure input ......................................................................................................................... 123
6.3.3 Configure output ....................................................................................................................... 123
6.4 Use visualisations ............................................................................................................124
6.4.1 Notes on visualisations ............................................................................................................. 125
6.4.2 Create visualisation .................................................................................................................. 131
6.4.3 Configuring functions of operating elements ............................................................................ 132
6.4.4 Use of optical and acustical feedback ...................................................................................... 135
6.4.5 Install fonts (true type fonts) ..................................................................................................... 136
6.5 Use of touch screen functions ..........................................................................................138
6.5.1 General notes ........................................................................................................................... 138
6.5.2 Process touch screen inputs .................................................................................................... 138
6.5.3 Use visual feedback ................................................................................................................. 140
6.5.4 Calibration of the touch screen ................................................................................................. 141
6.6 Install and set up mobile camera .....................................................................................142
6.6.1 Setup and operate Ethernet cameras ....................................................................................... 143
6.6.2 Setup and operate analogue cameras ..................................................................................... 147

7 ifm function elements 154


7.1 ifm libraries for the device CR1201 ..................................................................................155
7.1.1 Library ifm_CR1201_Vxxyyzz.LIB ............................................................................................ 156
7.1.2 Library ifm_PDMng_util_Vxxyyzz.LIB ....................................................................................... 157
7.1.3 Library ifm_PDM360NG_special_V02yyzz.LIB ........................................................................ 157
7.1.4 Library ifm_PDM360NG_linux_syscall_asynch_V02yyzz.LIB .................................................. 158
7.1.5 Library ifm_PDM360NG_USB_Vxxyyzz.lib .............................................................................. 158
7.1.6 Library ifm_PDM360NG_USB_LL_V02yyzz.LIB ...................................................................... 159
7.1.7 Library ifm_PDM_input_V01yyzz.LIB ....................................................................................... 159
7.1.8 Library ifm_RAWCan_NT_Vxxyyzz.LIB.................................................................................... 160
7.1.9 Library ifm_CANopen_NT_Vxxyyzz.LIB ................................................................................... 161
7.1.10 Library ifm_J1939_NT_Vxxyyzz.LIB ......................................................................................... 162
7.1.11 Library ifm_NetVarLib_NT_Vxxyyzz.LIB................................................................................... 163
7.2 ifm function elements for the device CR1201 ..................................................................164
7.2.1 POUs: Setup the device ........................................................................................................... 165

3
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Contents

7.2.2 POUs: Read device information ............................................................................................... 175


7.2.3 POUs: Adjust analouge and digital values................................................................................ 181
7.2.4 POUs: Manage, read and write the USB memory device ......................................................... 185
7.2.5 Function elements: Control LED + buzzer ................................................................................ 193
7.2.6 POUs: Manage visualisation .................................................................................................... 198
7.2.7 POUs: Use touch screen functions ........................................................................................... 224
7.2.8 POUs: Help functions ............................................................................................................... 226
7.2.9 Function elements: RAW-CAN (Layer 2) .................................................................................. 230
7.2.10 Function elements: CANopen................................................................................................... 258
7.2.11 Function elements: SAE J1939 ................................................................................................ 306

8 Diagnosis and error handling 342


8.1 Diagnosis .........................................................................................................................343
8.2 Fault .................................................................................................................................343
8.3 Response to system errors ..............................................................................................343
8.3.1 Example process for response to an error message ................................................................ 343
8.4 CAN / CANopen: errors and error handling .....................................................................343

9 Annex 344
9.1 Address assignment in Ethernet networks ......................................................................345
9.2 System flags.....................................................................................................................346
9.2.1 System flags: system ............................................................................................................... 347
9.2.2 System flags: Inputs and Outputs ............................................................................................. 348
9.2.3 System flags: Status LED ......................................................................................................... 348
9.2.4 System flags: function keys ...................................................................................................... 349
9.2.5 System flags: navigation keys .................................................................................................. 350
9.2.6 System flags: error flags ........................................................................................................... 351
9.3 Possible operating modes inputs/outputs ........................................................................352
9.4 CANopen tables ...............................................................................................................353
9.4.1 Structure of CANopen messages ............................................................................................. 354
9.4.2 Boot-up message ..................................................................................................................... 359
9.4.3 Network management (NMT) ................................................................................................... 360
9.4.4 CANopen error code ................................................................................................................ 365

10 Glossary of Terms 369

11 Index 378

12 Notizen • Notes • Notes 383

13 ifm weltweit • ifm worldwide • ifm à l’échelle internationale 384

4
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
About this manual Copyright

1 About this manual

Copyright ..................................................................................................................................................6
Overview: documentation modules for ecomatmobile devices ................................................................6
CODESYS programming manual .............................................................................................................7
What do the symbols and formats mean? ................................................................................................7
How is this documentation structured? ....................................................................................................8
History of the instructions .........................................................................................................................8
202

5
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
About this manual Copyright

>

1.1 Copyright
6088

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

1.2 Overview: documentation modules for ecomatmobile devices


17405

The documentation for ecomatmobile devices consists of the following modules:


1. Data sheet
Contents Technical data in a table
Source → www.ifm.com > select your country > [Data sheet search] > CR1201 > [Technical data in PDF format]

2. Installation instructions / operating instructions


Contents Instructions for installation, electrical installation, (commissioning*), technical data
Source The instructions are supplied with the device
They are also found on ifm's homepage:
→ www.ifm.com > select your country > [Data sheet search] > CR1201 > [Operating instructions]

3. Programming manual + online help


Contents Description of the configuration and the functions of the device software
Source → www.ifm.com > select your country > [Data sheet search] > CR1201 > [Operating instructions]

4. System manual "Know-how ecomatmobile"


Contents Know-how about the following topics:
• Overview Templates and demo programs
• CAN, CANopen
• Control outputs
• User flash memory
• Visualisations
• Overview of the files and libraries used
Source → www.ifm.com > select your country > [Data sheet search] > CR1201 > [Operating instructions]
*) The descriptions in brackets are only included in the instructions of certain devices.

6
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
About this manual CODESYS programming manual

>

1.3 CODESYS programming manual


17542

In the additional "Programming Manual for CODESYS V2.3" you obtain more details about the use of
the programming system.
This manual can be downloaded free of charge from ifm's website:
→ www.ifm.com > Select your country > [Service] > [Download] > [Systems for mobile machines]
You also find manuals and online help for ecomatmobile at:
→ ecomatmobile DVD "Software, tools and documentation"
>

1.4 What do the symbols and formats mean?


203

The following symbols or pictograms illustrate the notes in our instructions:

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 notes concerning malfunctions or disturbances


Other remarks
► ... Request for action
> ... Reaction, result
→ ... "see"
abc Cross-reference
123 Decimal number
0x123 Hexadecimal number
0b010 Binary number
[...] Designation of pushbuttons, buttons or indications

7
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
About this manual How is this documentation structured?

>

1.5 How is this documentation structured?


204
1508

This documentation is a combination of different types of manuals. It is for beginners and also a
reference for advanced users. This document is addressed to the programmers of the applications.
How to use this manual:
 Refer to the table of contents to select a specific subject.
 Using the index you can also quickly find a term you are looking for.
 At the beginning of a chapter we will give you a brief overview of its contents.
 Abbreviations and technical terms → Annex.
In case of malfunctions or uncertainties please contact the manufacturer at:
→ www.ifm.com > Select your country > [Contact].
We want to become even better! Each separate section has an identification number in the top right
corner. If you want to inform us about any inconsistencies, indicate this number with the title and the
language of this documentation. Thank you very much for your support!
We reserve the right to make alterations which can result in a change of contents of the
documentation. You can find the current version on ifm's website at:
→ www.ifm.com > Select country > [Data sheet search] > (Article no.) > [Operating instructions]
>

1.6 History of the instructions


18148

Date Theme Change


2015-04-08 New creation of the document

8
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Safety instructions History of the instructions

2 Safety instructions

What previous knowledge is required? ..................................................................................................10


Note! .......................................................................................................................................................10
Start-up behaviour of the controller ........................................................................................................11
213

9
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Safety instructions What previous knowledge is required?

>

2.1 What previous knowledge is required?


215

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

2.2 Note!
7328
11212

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

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

NOTE
To ensure the protection rating:
- Cover the unused M12 sockets using the protective caps E73004!
- Permissible tightening torque of the protective caps = 0.6...0.8 Nm.

10
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Safety instructions Start-up behaviour of the controller

NOTICE
Danger of burn-in effects!
If the device is operated with the same visualisation for many hours, the image may be burned into the
screen.
► Operate the device with changing visualisations!

>

2.3 Start-up behaviour of the controller


6827
15233
11575

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

A restart can, for example, be caused by:


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

11
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Information concering the device

3 System description

Information concering the device ...........................................................................................................12


Hardware ................................................................................................................................................13
Interfaces ................................................................................................................................................18
Software description ...............................................................................................................................24
975

3.1 Information concering the device


19337

These instructions describe the following models of the device familiy 'PDM360' from ifm electronic
gmbh:
 PDM360 NG -12": CR1201
Software release:
Runtime system: V02.03.xx

12
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Hardware

>

3.2 Hardware

Display elements ....................................................................................................................................14


Operating elements ................................................................................................................................15
Limitations for program and data memories ...........................................................................................16
Real-time clock (RTC) ............................................................................................................................17
Camera visualisation ..............................................................................................................................17
17371

13
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Hardware

>

3.2.1 Display elements


19388

The device has the following display elements.


>

Display
1166

Designation Data

Technology TFT
Screen diagonal 12" (30,5 cm)
Aspect ratio 15:9
Resolution 1024 x 768 pixels
Colour depth 6 bits per colour channel = 18 bits = 262 144 representable colours
(Create the image as "True Color" with 24 bits)

Background illumination LED


Photoelectric sensor Measures the brightness of the environment at the installation location of the device.
Can be used to dim the background illumination and/or the key LEDs.

>

Status-LED
7372

The intergrated status LED indicates the operating states of the device. By default the following colour
codes and flashing frequencies apply:

LED colour Flashing frequency Description


Black Permanently off no supply voltage
Green 5 Hz Boot process application programm
2 Hz Application program running (RUN) or: device in Setup mode
Permanently on Application programm stopped (STOP) or: no project available
Red 2 Hz Anwendungsprogramm läuft mit Fehler, z.B.:
- ERROR_TEMPERATURE: Device temperature too high / loo low
- ERROR_POWER: Supply voltage too high / too low
5 Hz System stopped, i.e. Linux watchdog has been triggered
Permanently on System error (fatal error); device is in RESET mode
Red / orange 2 Hz (alternating) Error: Temperature too high or too low; Device is in RESET mode until
temperature is back again in normal range
Orange 5 Hz Boot process Recovery mode
2 Hz Device is in Recovery mode
Permanently on System reset

Colour and flashing frequency of the status LED can be programmed in the CODESYS
application.

>

14
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Hardware

Key LEDs
19468

All keys are seperately backlit by LEDs. The LEDs can be programmed in the CODESYS application.
Behaviour in Setup mode: → Key functionality (→ page 41)
>

Audio signalling device (buzzer)


7367

The audio signalling device integrated into the device can be programmed in the CODESYS
application.
 Tone duration (off, permanent tone, key click
 Tone pitch (500...5000 Hz)
>

3.2.2 Operating elements


19328

The device has the following operating elements:

Function keys
 with pressure point
 backlit with programmable LEDs
Navigation key
 as a combination of 5 independent keys
 backlit with programmable LEDs
Touch screen
 Resistive technology,
i.e. display reacts to pressure by fingers (can be also operated when wearing gloves) and
pens
 direct selection and activation of GUI elements

15
>

3.2.3 Operating principle of the delayed switch-off


28591

If the ecomatmobile controllers are disconnected from the supply voltage (ignition off), all outputs are
normally switched off at once, input signals are no longer read and processing of the controller
software (runtime system and application program) is interrupted. This happens irrespective of the
current program step of the controller.
If this is not requested, the controller must be switched off via the program. After switch-off of the
ignition this enables, for example, saving of memory states.
The ClassicControllers can be switched off via the program by means of a corresponding connection
of the supply voltage inputs and the evaluation of the related system flags. The block diagram in the
chapter Hardware structure shows the context of the individual current paths.
>

Connect terminal VBB15 to the ignition switch


2418

The internal PLC electronics is initialised via the terminal VBB15 if at terminal VBBs supply voltage is
applied.
These terminals VBB15 and VBBs are monitored internally. The applied terminal voltage VBB15 can
be monitored via the system flag CLAMP_15_VOLTAGE. The applied terminal voltage VBBs can be
monitored via the system flag SUPPLY_VOLTAGE.
>

Latching
2419

Power-on of the controller:


• voltage is applied to VBB15 (clamp 15*) by means of the ignition switch.
• The system flag CLAMP_15_VOLTAGE recognises the voltage that has been applied and
activates the system flag SUPPLY_SWITCH.
• SUPPLY_SWITCH activates the connection to the potential VBBs.
> The ignition switch is bypassed. Latching of the control voltage is established.
Power-off of the controller via clamp 15:
• The system flag CLAMP_15_VOLTAGE recognises the switching off of the supply voltage on
terminal VBB15.
► Reset the system flag SUPPLY_SWITCH in the application program.
> Latching via VBBs is removed and the controller switches off completely.
*) In vehicles clamp 15 is the plus cable switched by the ignition lock.

16
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Hardware

>

3.2.4 Limitations for program and data memories


7360

Memory area Size


128/256 Mbytes RAM
Total memory space 1
128 Mbytes Flash

 For program code 8 Mbytes

Data memory /data 1 024 Mbytes

Memory for retain data ² 32 kbytes

Memory in the directory /tmp Not defined

Memory for bitmap files (80 x 100 pixels each, 24-bit colour depth)
45 Mbytes
Memory for font files
System need 75 Mbytes
legend:
1 ... Memory size: → data sheet
2 ... Retain data → Retain variables (→ page 94)

 The CR1201 does not support online change!


(= option to change the program code online without having to delete the original
program first)
 The data memory /data is NOT initialised during the start process any more as
from firmeware V01.05 on. To use the data memory it must be mounted to the file
system of the device in the CODESYS application program by means of the
function block → INIT_DATA_MEMORY.
 The memory can be extended optionally at the USB interface. The USB memory
device is only for momentary use (e.g. to back up files)!
The USB connectors are not suitable for permanent operation in mobile
applications.

16
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Hardware

>

3.2.5 Real-time clock (RTC)


7371

The device contains a real-time clock. During the system start the device synchronises the
(secondary) system clock with the (primary) real-time clock. The system clock can be used as follows:
• read the current clock time in the application program
• time stamp in (automatically generated) event protocols
• registration of operating times
Features of the real-time clock:
• is battery backed and continues to run in the switched-off device
• can be set to different UTC based time zones
• device monitors the charging status of the backup battery
The functions from the following libraries control the real-time clock or retrieve the values:
 SysLibRtc.lib (3S)
This library offers functions to access the real-time clock of the device:
• reading and setting the real-time clock
• reading the current display mode
• checking the status of the battery
The processing is done synchronously.
 SysLibTime.lib (3S)
This library is required for representing the task time evaluation in the task editor of CODESYS.
• reading the real-time clock of the device with the function blocks from this library
The processing is done synchronously.
>

3.2.6 Camera visualisation


7366

Interface Type of signal Characteristics


Ethernet Digital  Up to 4 camera images representable at the same time
 Colour: 24 bits / greyscale: 8 bits

More than 4 cameras connected to the network can have a strong


impact on the data traffic in the network.
The device supports ifm Ethernet cameras with the firmware
version 5.1001 or higher.
Analogue video input Analogue  2 analogue connections
(FBAS)  Automatic NTSC / PAL recognition
 Only 1 camera image representable at the same time
 Switching between 2 cameras possible

17
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Interfaces

Supported analogue cameras


Recommended reference cameras:
 ifm electronic: O2M200, O2M201, O2M202, O2M203
Tested cameras from third-party manufacturers:
 Motec: MC3100-3R
 Vision Techniques: VT70
Use of other cameras without warranty from ifm electronic gmbh

The following applies to all camera interfaces:


 Brightness of the camera image 0...100 % adjustable in 1% steps.
 Visualisation and camera image representable at the same time (overlaid).
 Failure of a camera is signalled.
 Cameras can be activated / deactivated separately.
 Rotation of the camera image by 0° / 90° / 180° / 270°
 Scaling of the camera image 0...400 % with unchanged proportion.
>

3.3 Interfaces
14332

The device has the following interfaces.

For location of the connections an and specifications: → installation instruction, data


sheetDaten

18
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Interfaces

>

3.3.1 Inputs (technology)

Operating modes ....................................................................................................................................20


Safety instructions about Reed relays ....................................................................................................21
14090

19
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Interfaces

>

Operating modes
19930

The device offers 1 input channel (IN00). It can be operated as:


 Binary input (→ Binary inputs (→ page 20))
 Analogue input (→ Analogue inputs (→ page 21))

For parameter of the input channel: → installation instruction, data sheet

>

Binary inputs
7345

The binary input can be operated in following modes:


• binary input plus switching (BL) for positive sensor signal
• binary input minus switching (BH) for negative sensor signal
Depending on the device the binary inputs can configured differently. In addition to the protective
mechanisms against interference, the binary inputs are internally evaluated via an analogue stage.
This enables diagnosis of the input signals. But in the application software the switching signal is
directly available as bit information

In = pin binary-input n
(CR) = device
(1) = input filter
(2a) = input minus switching
(2b) = input plus switching
(3) = voltage

Figure: basic circuit of binary input minus switching / plus switching for negative and positive sensor signals

In = pin binary input n In = pin binary input n


(S) = sensor (S) = sensor

Basic circuit of binary input plus switching (BL) Basic circuit of binary input minus switching (BH)
for positive sensor signal: for negative sensor signal:
Input = open  signal = low (GND) Input = open  signal = high (supply)

20
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Interfaces

>

Analogue inputs
7346

The analogue inputs can be configured via the application program. The measuring range can be set
as follows:
• current input 0...20 mA
• voltage input 0...10 V
• voltage input 0...32 V
If in the operating mode "0...32 V" the supply voltage is read back, the measurement can also be
performed ratiometrically. This means potentiometers or joysticks can be evaluated without additional
reference voltage. A fluctuation of the supply voltage then has no influence on this measured value.

In case of ratiometric measurement the connected sensors should be supplied with VBBS of the
device. So, faulty measurements caused by offset voltage are avoided.
8971

In = pin multifunction input n


(CR) = device
(1) = input filter
(2) = analogue current measuring
(3a) = binary-input plus switching
(3b) = binary-input minus switching
(4a) = analogue voltage measuring 0...10 V
(4b) = analogue voltage measuring 0...32 V
(5) = voltage
(6) = reference voltage

Figure: principle block diagram multifunction input

>

Safety instructions about Reed relays


7348

For use of non-electronic switches please note the following:

Contacts of Reed relays may be clogged (reversibly) if connected to the device inputs without
series resistor.

► Remedy: Install a series resistor for the Reed relay:


Series resistor = max. input voltage / permissible current in the Reed relay
Example: 32 V / 500 mA = 64 Ohm
► The series resistor must not exceed 5 % of the input resistance RE of the device input→ data
sheet). Otherwise, the signal will not be detected as TRUE.
Example:
RE = 3 000 Ohm
 max. series resistor = 150 Ohm

21
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Interfaces

>

3.3.2 Outputs (technology)


14093
>

Binary output
19931

The device offers 1 output channel (OUT00). It can be operated as a binary, high side output.

Qn = pin binary output n


(L) = Load

Block diagram high side output for positive output signal

For parameter of the output: → installation instruction, data sheet

>

3.3.3 CAN
The device has 4 CAN interfaces. They can be used to realize the following functions:
 configurable as CAN Layer 2, CANopen Master/Slave, SAE J1939

Available protocols:
CAN interface CAN 1 CAN 2 CAN 3 CAN 4

Download ID (default) ID 127 ID 126 ID 125 ID 124


CAN protocols CAN Layer 2 CAN Layer 2 CAN Layer 2 CAN Layer 2
CANopen CANopen CANopen CANopen
SAE J1939 SAE J1939 SAE J1939 SAE J1939

22
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Interfaces

>

3.3.4 USB
14326

The device offers 2 USB interfaces. They can be used to realize the following functions:
 Connect USB memory to the device (supported file systems: FAT16, FAT32, VFAT, EXT2, EXT3)
 Connect external devices to the device (keyboard, mouse)
>

3.3.5 Ethernet
14325

The device offers 1 Ethernet interface. It can be used to realize the following functions:
 Download a application program from CODESYS to the device (programing interface)
 Connect ethernet camera systems to the device
 External access to the device:
– Telnet/FTP (unencrypted)
– SSH/SCP (encrypted)

3.3.6 Analogue video input


11197

The device offers 2 analogue video inputs. They can be used to realize the following functions:
 Connect analogue video camera systems to the device
 Input signal: S-Video (FBAS); supported signals: PAL, NTSC

23
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Software description

>

3.4 Software description

Software components .............................................................................................................................25


Programming system CODESYS 2.3 .....................................................................................................26
Operating states .....................................................................................................................................26
14107

24
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Software description

>

3.4.1 Software components


19091

The device has the following software componentscommunicates with the hardware as below:

Software component Can user change the component? By means of what tool?
1
Operating system (Linux derivate) No ---
Upgrade yes
Runtime system (RTS) 2 Image file
Downgrade no
Application program
Yes CODESYS
with libraries
Legend:
1 ... The operating system will be changed partially while updating the runtime system of the device. Therefore, an
downgrade of the runtime system is not possible.
2 ... The runtime system version number must correspond to the target version number in the CODESYS target system
setting.

>

Runtime system
19093

Basic program in the device, establishes the connection between the hardware of the device and the
application program.
Normally it is necessary to download the runtime system only once. Then, the application program can
be loaded into the controller (also repeatedly) without affecting the runtime system.
ifm electronic maintains the runtime system and releases update packages. The user can download
the current release from the website of ifm electronic gmbh:
→ www.ifm.com > Select your country > [Service] > [Download]
>

Application program
15274
14118

Software specific to the application, implemented by the machine manufacturer, generally containing
logic sequences, limits and expressions that control the appropriate inputs, outputs, calculations and
decisions.
8340

WARNING
The user is responsible for the reliable function of the application programs he designed. If necessary,
he must additionally carry out an approval test by corresponding supervisory and test organisations
according to the national regulations.

The visualisati→ pages and embedded graphics are part of the CODESYS application program.

25
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
System description Software description

>

3.4.2 Programming system CODESYS 2.3


17365

The user can create application programs for the CR1201 by using the programming system
CODESYS 2.3. In this manual we refer to the CODESYS version 2.3.9.25.

In the "programming manual CODESYS 2.3" you will find more details about how to use
the programming system "CODESYS for Automation Alliance". This manual can be
downloaded free of charge from ifm's website at:
→ (www.ifm.com) > Select your country > [Service] > [Download]
→ ecomatmobile DVD "Software, tools and documentation"

3.4.3 ifm target package for CODESYS


7979

ifm electronic provides a device-specific target package for the programming system CODESYS 2.3.
By using the components included in the package the user can easily access the device functions.
The target package contains the following components:
 device-specific target file (*.trg)
 device configuration (*.cfg)
 function libraries for programming according to IEC 61131-3
 ifm-specific error messages
 ifm-specific task configuration
>

3.4.4 Operating states


7370

For this device we distinguish the following operating states:


 Power on
- booting
 Normal operation
 Power off
- shutoff
- restart
- shutdown
- clamp 15 switch-off
- delayed switch-off
 Recovery / update system

26
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Software description

4 Installation

Install the CODESYS programming system ...........................................................................................28


Install the device-specific target package ...............................................................................................28
Update the runtime system of the device ...............................................................................................29
19339

27
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Install the CODESYS programming system

>

4.1 Install the CODESYS programming system


19360

► Download the installation file for CODESYS 2.3 from the ifm website.
→ www.ifm.com > Select your country > [Service] > [Download] > [Systems for mobile machines]
► Install the CODESYS 2.3 programming system on the PC/laptop (→ CODESYS software manual).
>

4.2 Install the device-specific target package


19360

Detailed information on the device-specific target package: → ifm target package for
CODESYS (→ page 26)

To install the device-specific target package for the CR1201:


► Download the "CR1201 target package" with version V02.03.xx.
→ www.ifm.com > Select your country > [Service] > [Download] > [Systems for mobile machines]
► Open the ZIP file and unzip the contents of the folder CR1201_V02 into the subdirectory
..\Targets\ifm in the CODESYS programm directory.
> Components of the target file can be used in CODESYS 2.3.

28
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

4.3 Update the runtime system of the device

Notes ......................................................................................................................................................30
Enter the recovery mode ........................................................................................................................31
Update the runtime system.....................................................................................................................31
Configure IP parameter of ethernet interface .........................................................................................34
Quit the recovery mode ..........................................................................................................................37
18159

29
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

4.3.1 Notes
18162

To update the runtime system the device needs to be in recovery mode.

>

Download the update file


18165

The user can download the current version of the runtime system from the ifm website.
► Access the download from the ifm website.
(→ www.ifm.com > Select your country > [Service] > [Download] > [Systems for mobile machines])
► Download the ZIP archive with the update file and unzip (e.g. V020301_NoWD_PDM360NG.zip).
> The update file is stored on the PC/laptop (e.g. V020301_NoWD_PDM360NG.ifm).
>

Key assignment in recovery mode


18163

In the recovery mode, the following key assignment applies:

>

Components of the runtime system


11649

During the update process the following software compknents of the device will be updated:
1. System software (Linux)
2. Firmware of the keys
3. Firmware of the I/O co-processor
4. Firmware of the watchdog co-processor

30
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

4.3.2 Enter the recovery mode


19325

► Switch off the device (disconnect device from the mains).


► Simultaneously process the following actions:
 Press and keep pressed any 3 keys on the device simultaneously.
 Switch on the device.
To do so, pin 15 and pin 30 must be connected with plus.
> The device is booting.
► Keep the keys pressed until the splash screen appears.
> The ifm recovery screen appears and displays IP configuration of the device's ethernet interface
(IP address, subnet mask and gateway address).
> The device is in recovery mode.
>

4.3.3 Update the runtime system


18161

NOTICE
Risk of data loss!
Interrupting the update process can result in a loss of the user data stored in the device.
► Do not interrupt the update process!

The runtime system of the device can only be updated in the recovery mode.
The current version of the runtime system can be downloaded from the ifm electronic website
(→ Download the update file (→ page 30)).

► Select one of the following options:


 Runtime system update via USB memory device (→ page 32)
 Runtime system update via web browser (→ page 33)

31
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

Runtime system update via USB memory device


9382

1 Download current release of runtime system


► Download new release of runtime system from the ifm website (→ Download the update file
(→ page 30)).
► Unzip the archive and copy the update file into the root directory of the USB memory.

Only ONE update file is allowed in root directory.

2 Connect the USB memory with the device


► Connect the USB memory with the device (→ installation instructions).
3 Enter the recovery mode
► Enter the recovery mode (→ page 31)
4 Install the runtime system
► Use [] / [] to select the [Install from USB] button.
► Press [ENTER] to start the update process.
> Software components of the device are updated (→ Notes (→ page 30)).
Display shows stIf successful:
> Status message appears: Software update successful.atus messages.

The upgrade process may take a few minutes. Do not press any key on the device during the
upgrade process!

5 Reboot the device neu starten


► Use [] / [] to select the [Reboot] button.
► Press [ENTER] to reboot the device.
> The device reboots.

32
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

Runtime system update via web browser


9379

1 Neues Laufzeitsystem herunterladen


► Download new release of runtime system from the ifm website (→ Download the update file
(→ page 30)).
2 Enter the recovery mode
► Enter the recovery mode (→ page 31)
3 Connect the device with the PC/laptop
► Establish an Ethernet network connection between the device and the PC/laptop
(→ installation instructions).
► Optional: Set the IP configuration of the ethernet interface of the PC/laptop to match the IP
configuration of the device.
4 Acitvate the web interface of the device
► Start the web browser on the PC/laptop.
► Enter the IP address of the device in the address line of the browser and press [ENTER] to
activate the web interface (IP-Adresse: → Schritt 2).
> Browser shows web interface of the device.
> Web interface shows content of [Software Upgrade] tab.
5 Install the runtime system
► Press the [Select...] button.
> Windows explorer appears.
► Select update file (Vxx.yy.zz_PDM360NG.ifm) and press [Open] to proceed.
> [Select image to upload] field shows directory path and file name of the selected update file.
► Press [Send] button to start the update process.
> Software components of the device are updated (→ Notes (→ page 30)).
> Web interface and device display show status messages.
If successful:
> Status message appears: Software update successful.

The upgrade process may take a few minutes. Do not press any key on the device during the
upgrade process!

6 Reboot the device neu starten


► Use [] / [] to select the [Reboot] button.
► Press [ENTER] to reboot the device.
> The device reboots.

33
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

4.3.4 Configure IP parameter of ethernet interface


11915

In order to update the runtime system of the CR1201 via a network infrastructure, the device's
ethernet interface needs to be configured. The device provides the following options for configuration
of the ethernet interface:
 Manual The operator sets the interface parameters (IP address, subnet mask,
gateway address) manually.

 Automatic The interface parameters are set automatically by the network's DHCP
server (DHCP = Dynamic Host Configuration Protocol).

To configure the IP parameter of the ethernet interface:


► Select one of the following options:
 Synchronize the IP parameters with DHCP sever (→ page 35)
 Configure the IP parameter manually (→ page 36)

34
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

Synchronize the IP parameters with DHCP sever


13375

1 Connect device with IP network


► Connect ethernet interface of the device with the IP network.
2 Select menu page
► Enter the Recovery mode (→ Enter the recovery mode (→ page 31)).
► Use [] / [] to select the [Network Setup] menu and press [ENTER].
> Menu page displays available configuration options and current values of the IP parameters
([IP-address], [netmask], [gateway])
3 Set IP parameters
► Use [] / [] to select the [DHCP] menu item and press [ENTER].
> Device tries to obtain the IP parameters of the ethernet interface from the DHCP server of the
network.

If successful:
> [Network Setup] menu page appears.
> Information bar shows active values of the IP parameters [IP-address], [netmask] und
[gateway].
> Device can be accessed via the IP network by using the shown parameters.
If not successful:
> Error message is displayed.
► Press [ESC] to return to the [Network Setup] menu page.
► Remove the error cause and repeat the procedure.

35
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

Configure the IP parameter manually


8906

Detailed information about the assignment of IP addresses in Ethernet networks: → Address


assignment in Ethernet networks (→ page 345).

1 Select menu page


► Enter the Recovery mode (→ Enter the recovery mode (→ page 31)).
► Use [] / [] to select the [Network Setup] menu and press [ENTER].
> Menu page displays available configuration options and current values of the IP parameters
([IP-address], [netmask], [gateway])
► Use [] / [] to select the [Manual Setup] menu item and press [ENTER].
► Menu page displays options for manually setting of the IP parameters of the ethernet interface.
2 Set IP address
► Use [] / [] to select the [IP Address] menu item and press [ENTER].
> Menu page displays [IP address] input boxes.
> Right input box is in edit mode (dark-grey background).
► Use [] / [] to increment /decrement the number in the input box until the required value is
set.
> Input box displays the new value.
► Use [] / [] to select the next input box and use [] / [] to enter the required number.
► Repeat the procedure until the required IP adress is set.
► Press [OK] to apply the new values and to return to the previous menu page.
OR
Press [ESC] to cancel to input procedure, to keep the old values and to return to the previous
menu page.
3 Set subnetmask and gateway addess
► Repeat step 1 to set [Network Mask] and [Default Gateway].
4 Apply new values
► Use [] / [] to select [Apply] menu item and press [ENTER].
> New values are applied.
► Press [ESC] to return to the [Network Setup] menu page.
> Information bar displays current values of the interface parameters [IP-address], [netmask] und
[gateway].

36
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Installation Update the runtime system of the device

>

4.3.5 Quit the recovery mode


082

► Select ifm recovery screen.


► Use [] / [] to select the menu item [Reboot] and press [ENTER] to activate it.
► The device reboots.

If there is a valid project stored on the device, this project will be startet automatically
after completing the reboot process.
If there is no valid project stored on the device, the CR1201 automatically enters the
setup mode after completing the reboot process.

37
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Update the runtime system of the device

5 Device configuration

Enter the setup mode .............................................................................................................................39


Operating instructions .............................................................................................................................40
Setup: start screen .................................................................................................................................49
PDF file viewer .......................................................................................................................................76
Setup: Start the application ....................................................................................................................81
Automatically restore system files ..........................................................................................................82
Exit setup, reboot device ........................................................................................................................82
19278

This chapter describes the configuration of the device in the setup mode.

38
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Enter the setup mode

>

5.1 Enter the setup mode


18152

If no valid application is stored in the device, the device passes automatically in the setup
mode after power on.

► Disconnect the device from power supply.


► Perform the following actions simultaneously:
 Press any 2 keys simultaneously and keep them pressed.
 Switch on the device.
► Keep both keys pressed until the setup menu appears.
> Device boots and passes into the setup mode.
> The start screen of the setup mode appears.

► Select one of the following submenus:

Submenu Description
[SETUP] Start setup menu
(→ Setup: start screen (→ page 49))
[PDF-VIEWER] Start the PDF file viewer
(→ PDF file viewer (→ page 76))
[LOAD APPLICATION] Load and start the PLC application
(→ Setup: Start the application (→ page 81))

39
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

5.2 Operating instructions

Key functionality .....................................................................................................................................41


Navigation key ........................................................................................................................................46
Touchscreen ...........................................................................................................................................46
Setup: Working with enabled password protection ................................................................................47
18108

In setup mode, the following rules apply:

40
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

5.2.1 Key functionality


18155

The assignment of the function keys is context sensitive. The function of a key is described by the text
label of the corresponding button on the screen.
Only active function keys have a labeled button.
Only active function keys are backlit by the key LED.
The following table provides an overview of the available key functions:

Button Description Example


[SELECT] Select next GUI element Select next menu item
[BACKSEL] Select previous GUI element Select previous menu item
[ENTER] Activate function of the selected GUI element Change to selected menu
Show content of the selected directory
[EXIT] Change to upper menu level Leave current menu page and change to upper
menu level
[LOAD] Load selected GUI element Load font file in the device memory
[RELOAD] Update Update view of current directory
[SAVE] Save selected file or configuration Save IP address
[START] Start process Start receiving CAN frames
[STOP] Stop process Stop receiving CAN frames

[], [],  move to direction Select character of on-screen keyboard


[], []  Increment/decrement value in selected number
field

41
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

Operation: Navigate in the setup menu


14674

To navigate in the setup menu:

► Use [SELECT] to select the next menu item (forward).


OR:
Use [BACKSEL] tot select the previous menu item (backward).
> The selected menu item has a black frame.
► Use [ENTER] to change to the selected menu page.
OR:
Use [EXIT] to change to the higher-level menu.
> The information field shows information about the current menu page (i.e. System settings).

42
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

Operation: Navigate within a menu screen


14675

To navigate within a menu page:

► Use [SELECT] or [BACKSEL] to select the requested GUI element (i.e. number field, option field).
> The selected GUI element has a black frame.
> The selected GUI element is activated and can be changed.
► Use [ENTER] to activate / deactivate the selected GUI element (i.e. option field)
OR:
Use []/[] to increment/decrement the value of the selected GUI element (i.e. number field).
> The changes are displayed.
► Use [SAVE] to confirm and apply the changes.
► Use [EXIT] to change to the higher-level menu.

43
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

Operation: Navigate in the file directory


14673

To navigate in the file directory:

► Use [SELECT] to select a specific window (i.e. [Name], [Places], [Favorites] and [UP])
> The selected window is focused (black frame or dark-grey header).
► Use []/[] to select an specific item within the selected window (i.e. file, directory).
> The selected item has a light-grey background.
► Use [ENTER] to change into the selected directory.
OR
Start action according to key label (i.e. Use [RESTORE] to restore the data saved in the selected
backup file).
> Selected action is proceeded.
> Use [EXIT] to change to the higher-level menu.

44
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

Operation: Enter a text using the on-screen keyboard


11763

The user interface of the runtime system has an on-screen keyboard. It appears automatically as soon
as the user is expected to enter characters.

The on-screen keyboard shows the German character set (QWERTZ keyboard layout).
To protect sensitive information only the character entered last appears in plain text. All other
characters are replaced by an *.

To enter a text:

► Use [] / [] and [] / [] to select the button of the requested character.
> The selected button is highlighted (black frame).
► Use [ENTER] to activate the selected button.
> The entered character appears in the input box.
► Repeat the process for all requested characters.
► Use [CONFIRM PASSWD] to confirm the entry
OR:
Use [EXIT] to cancel and return to the previous setup screen .

45
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

5.2.2 Navigation key


18158

The navigation key consists of the following single keys:


 4 direction keys (, , , )
 1 function key (center key)

The keys of the navigation key can be used as an alternative as well as an equivalent to function keys.
The following table shows operating elements with the same function:

Navigation key Function key Function

[] Move up

[] Move left


[BACKSEL] Select previous menu item

[] Move right


[SELECT] Select next menu item

[] Move down

[ENTER] Activate menu item / button

>

5.2.3 Touchscreen
18156

In setup mode the touchscreen of the device is enabled.


The operator can execute the functions of the following GUI elements by touching them on the
touchscreen:
 Buttons (i.e. [SELECT], [ENTER])
 Menu items (i.e. [SYSTEM SETTINGS])
 Keys of the on-screen keyboard
 Symbols in the file directory and the PDF viewer
 Input field (i.e. IP address)
As optical feedback the display shows a red circle at the point of contact.

46
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

5.2.4 Setup: Working with enabled password protection


11758

If the password protection is enabled, the operator has only accress to the following menu functions:
 [SETUP] > [System Information]
 [SETUP] > [ACTIONS] > [Keyboard Test]
 [SETUP] > [ACTIONS] > [Calibrate Touchscreen]

All other menu functions are disabled.


Additionally, after changing to the setup menu the display shows the following setup start screen:

Select one of the following options:


 Setup: Setup menu with restricted access rights (→ page 48)
 Setup: Enter the password for full access to the setup menu (→ page 48)

47
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Operating instructions

>

Setup: Setup menu with restricted access rights


11729

Protected setup functions have the following characteristics:


 They are disabled in all setup submenus (greyed out).
 They cannot be selected with [SELECT] / [BACKSEL].

To call the setup menu with restricted access rights:


1 Select menu page
► Navigation path: [SETUP] > [ENTER SETUP [RESTRICTED ACCESS]]
> The setup menu appears
> Disabled functions are greyed out.
2 Select menu item
► Use [SELECT] / [BACKSEL] to select the requested menu item .
> The selected menu item has a black frame.
► Use [ENTER] to change to the selected setup screen.
OR:
Use [EXIT] return to the previous setup screen.
>

Setup: Enter the password for full access to the setup menu
11759

To enter the password to have full access to the setup menu:


1 Select menu page
► Navigation path: [SETUP] > [ENTER PASSWORD FOR FULL ACCESS]
> Display shows on-screen keyboard for entering the password.
2 Enter passwort
► Enter the correct password (→ Operation: Enter a text using the on-screen keyboard (→ page 45)).
► Use [CONFIRM PASSWD] to confirm the entry
OR:
Use [EXIT] to cancel and return to the previous setup screen .
> The setup menu appears.
> Information bar displays a confirmation message.
> All setup functions can be selected without any restriction.

Full access to all setup function is only valid until the user exits the setup menu.
► When the setup menu is called, enter the password again!

48
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

5.3 Setup: start screen


14556

► Select [SETUP] and press [ENTER].


> [SETUP] menu appears:

► Select one of the following menu items:


Name Description

[SYSTEM SETTINGS] Access system settings


(→ Setup: System settings (→ page 50))
[SYSTEM INFORMATION]: Display system information:
(→ Setup: Display system information (→ page 59))
[ACTIONS] Access additional functions
(→ Setup: More functions (→ page 60))

Consider notes regarding the work with enabled password protection!


→ Setup: Working with enabled password protection (→ page 47)

49
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

5.3.1 Setup: System settings


9603

The menu [SETUP] > [SYSTEM SETTINGS] provides access to the following functions:

Menu item Function

[ETHERNET] → Setup: Configure the IP parameters manually (→ page 51)


[CAN] → Setup: Set the CAN interfaces (→ page 53)
[RTC] → Setup: Set the real-time clock (RTC) (→ page 54)
[BACKLIGHT] → Setup: Set the display brightness (→ page 55)
[NETWORK SERVICES] → Setup: Set the network services (→ page 56)
[PASSWORD SETTINGS] → Download the update file (→ page 30)

50
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Configure the Ethernet interface


13857

The device provides the following options for configuration of the Ethernet interface:
 Manual The operator sets the interface parameters (IP address, subnet mask,
gateway address) manually.

 Automatic The interface parameters are set automatically by the network's DHCP
server (DHCP = Dynamic Host Configuration Protocol).

To configure the IP parameter of the ethernet interface:


► Select one of the following options:
 Synchronize the IP parameters with DHCP sever (→ page 35)
 Configure the IP parameter manually (→ page 36)
>

Setup: Configure the IP parameters manually


7408

 IP address (factory settings) = 192.168.82.247


 Login data to access the device via Telnet/SSH and FTP/SCP:
USERNAME = root
PASSWORD = pdm360ng
 Further information regarding the address assignment in Ethernet networks:
→ Address assignment in Ethernet networks (→ page 345).

To set the IP parameters of the Ethernet interface manually:


1 Select menu page
► Navigation path: [SETUP] > [SYSTEM SETTINGS] > [ETHERNET] > [MANUAL]
> Menu page displays the following information:
Name Description Possible values
[IP Address] IP address of the Ethernet interaface of the device i.e. 192.68.82.247

[Netmask] Subnetmask of the network segment i.e. 255.255.255.0

[Gateway] IP address of the network gateway i.e. 192.168.82.1

2 Set IP parameters
► Use [SELECT] / [BACKSEL] to select the required number field.
► Use [] / [] to increment / decrement the number in the selected number field until the
requested value has been reached.
> Number field shows the required value.
► Optional: Repeat the procedure until the values in all number fields are correctly set.
3 Save changed values
► Press [SAVE] to confirm and save the changed values.

51
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Configure the IP parameters automatically


13791

To use DHCP, the device must be connected to a DHCP server via the Ethernet interface.

To set the IP parameters of the Ethernet interface by means of the Dynamic Host Configuration
Protocol (DHCP).
1 Select menu page
► Navigation path: [SETUP] > [SYSTEM SETTINGS] > [ETHERNET] > [DHCP]
> Menu page displays the following information:
Bezeichung Bedeutung Mögliche Werte
[DHCP Client] Status of DHCP client of the device DHCP client disabled

DHCP client enabled

[IP Address] IP address of the Ethernet interface of the device i.e. 192.68.82.247

[Netmask] Subnetmask of the network segment i.e. 255.255.255.0

[Gateway] IP address of the network gateway i.e. 192.68.82.1

2 Enable DHCP client of the device


► Press [ENTER] to enable the [DHCP Client] checkbox.
> The DHCP client tries to obtain valid IP parameters from the DHCP server.
> Status message appears: Trying to get DHCP lease...

If successful:
> [IP Address], [Netmask] and [Gateway] show valid values assigned by the DHCP server.
> Status message appears: DHCP configured successfully
If not successful:
> Status message appears: Failed to get DHCP lease!
► Use [EXIT] to stop the configuration process.
► Check the connection to the DHCP server!
► Repeat the configuration process (s.a.).

52
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Set the CAN interfaces


7413

To set the parameters of the CAN interfaces:


1 Select menu page
► Navigation path: [SETUP] > [SYSTEM SETTINGS] > [CAN]
> Menu page displays the following informations:
Name Description
[CAN Bus 1] Settings of of CAN interace 1

[CAN Bus 2] Settings of of CAN interface 2


[CAN Bus 3] Settings of of CAN interface 3
[CAN Bus 4] * Settings of of CAN interface 4
* ... only available at devices with 4 CAN interfaces

2 Select CAN interface


► Use [SELECT] / [BACKSEL] to select the requested CAN interface.
► Press [ENTER] to change to the selected menu page.
> Menu page displays the following informations:
Name Description Possible values
[Baudrate CAN Bus x] * Baudrate of the selected CAN interface 0 kBit/s
20 kBit/s
50 kBit/s
100 kBit/s
125 kBit/s
250 kBit/s
500 kBit/s
800 kBit/s
1 MBit/s
* ... x = ID of the selected CAN interface

3 Change baudrate of the CAN interface


► Press [ENTER] to change to the selected menu page.
> Menu page displays the current baudrate of the selected CAN interface.
► Use [] / [] to set the required value.
► Press [SAVE] to confirm and save the changed values.
► Press [EXIT ] to return to the upper next menu level.
> Optional: Repeat steps 2 and 3 to set the values of additional CAN interfaces.

53
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Set the real-time clock (RTC)


7414

To set the real-time clock.


1 Select menu page
► Navigation path: [SETUP] > [SYSTEM SETTINGS] > [RTC]
> Menu page displays the following informations:
Name Description Possible values
[YYYY] Year 2000 ... 2100
[MM] Month 1 ... 12
[DD] Day 1 ... 31
[hh] Hour 0 ... 23
[mm] Minute 0 ... 59
[ss] Second 0 ... 59

2 Change date and time of the real-time clock (RTC)


► Use [SELECT] / [BACKSEL] to select the required number field.
> Selected number field has focus (black frame).
► Use [] / [] to set the required value.
► Optional: Repeat step 2 to set the values of additional number fields.
3 Save changed values
► Press [SAVE] to confirm and save the changed values.
> Information bar displays acknowledge message.
► Press [EXIT ] to return to the upper next menu level.

54
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Set the display brightness


7405

The setup menu is always displayed with a 100 % brightness. The changed brightness
will only become effective outside the setup menu.

So set the display brightness:


1 Select menu page
► Navigationspfad: [SETUP] > [SYSTEM SETTINGS] > [BACKLIGHT]
> Men u page displays the following informations:
Name Description Possible values
[Brightness in %] Relative brightness of the display 0 minimal brightness
(values at %) ...
100 maximal brightness

2 Set brightness level of display


► Use [] / [] to set the required value.
► Press and keep pressed the [TEST] button to test the set value.
3 Save the new value
► Press [SAVE] to confirm and save the changed values.
> Information bar displays acknowledge message.
► Press [EXIT ] to return to the upper next menu level.

55
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Set the network services


11719

The secure network services Secure Shell (SSH) and Secure Copy (SCP) are always
available. The user can therefore access the device via SSH and SCP if the network
services Telnet and FTP are inactive.
(→ Access the device with SSH (→ page 119), → Copy the files with SCP (→ page 120)).

To set the Telnet and FTP network services.


1 Select menu page
► Navigation path: [SETUP] > [SYSTEM SETTINGS] > [NETWORK SERVICES]
► Menu page displays the following informations:
Name Description Possible values
[Telnet] Enable / Disable the Telnet service of the device Telnet enabled

Telnet disabled

[FTP] Enable / Disable the FTP service of the device FTP enabled

FTP disabled

2 Enable / Disable Telnet service


► Use [SELECT] / [BACKSEL] to select the [Telnet] check box.
► Press [ENTER] to enable / disable the the Telnet service.
> Information bar displays status of the service:
[running] = Telnet service is enabled
[not running] = Telnet service is disabled
3 Enable / Disabled FTP service
► Use [SELECT] / [BACKSEL] to select the [FTP] check box.
► Press [ENTER] to enable / disable the the FTP service.
> Information bar displays status of the service:
[running] = FTP service is enabled
[not running] = FTP service is disabled
> Press [EXIT ] to return to the upper next menu level.

56
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Set the password protection


11720

The menu page [SETUP] > [SYSTEM SETTINGS] > [PASSWORD SETTINGS] provides access to the
following options:
 Setup: Change the system password (→ page 57)
 Setup: Enable / Disable password protection (→ page 58)
>

Setup: Change the system password


11722

In case of a password loss a recovery update has to be processed.


► Update the runtime system of the device (→ Update the runtime system of the device (→ page
29))
► If necessary, restore the saved data (→ Restore: Restore the system files (→ page 70))

Notes on operation of the on-screen keyboard: → Operation: Enter a text using the on-screen
keyboard (→ page 45)

To change the system password.


1 Select menu page
► Navigationspfad: [SETUP] > [SYSTEM SETTINGS] > [PASSWORD SETTINGS] > [Change
System Password]
> Menu page displays on-screen keyboard.
2 Enter the old password
► Enter the old password.
► Use [CONFIRM] to confirm the input.
Gibt der Anwender das falsche Passwort ein, erscheint folgende Fehlermeldung: PASSWORD
INCORRECT. PLEASE TRY AGAIN.
► Eingabe des Passwort wiederholen!

3 Enter new password


► Enter new password.
► Use [CONFIRM] to confirm the entered password.
► Re-enter the new password and use [CONFIRM] to confirm the entered password.
> Information bar displays acknowledge message: PASSWORD CHANGED.
> New password is applied.
If the operator enters 2 different passwords the following error message appears: PASSWORDS
DON'T MATCH. PLEASE TRY AGAIN!
► Re-enter the passwords correctly!

► Press [EXIT ] to return to the upper next menu level.

57
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Enable / Disable password protection


11418

On delivery the password protection for the setup menu is deactivated.


If the password protection is activated after the first setup, the password set at the factory is
valid: pdm360ng
► To ensure effective protection, change the default system password!
The programming software CODESYS can access the IEC project saved on the device even
with activated password protection.
► To prevent reading of the IEC project on the device, activate the password protection with
the PLC browser (→ Activate the access protection for an IEC project (→ page 90)).

If the password protection is enabled the operator has restricted access to the functions of the
setup menu (→ Setup: Working with enabled password protection (→ page 47)).

To enable / disable the password protection of the device:


1 Select menu page
► Navigation path: [SETUP] > [SYSTEM SETTINGS] > [PASSWORD SETTINGS]
> Information bar displays status of the password protection:
[Setup Password is now enabled] = Password protection is enabled
[Setup Password is now disabled] = password protection is disabled
2 Set password protection
► Use [SELECT] / [BACKSEL] to select the [Enable Setup Password] / [Disable Setup
Password] button.
► Use [ENTER] to press the button.
> Password protection is enabled / disabled.
> Infomation bar displays status of the password protection (→ step 1).
► Press [EXIT ] to return to the upper next menu level.

The password protection does not become active before the next call of the setup menu.
► Use [EXIT] repeatedly to change to the startscreen of the setup mode.
► Use [ENTER] to enter the setup menu.

58
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

5.3.2 Setup: Display system information


7407

To display the system information:


1 Select menu page
► Navigation path: [SETUP] > [SYSTEM INFORMATION]
> Menu page displays the following information:
Bezeichnung Bedeutung

[Serial Number] Serial number of the device


[SW Version] Software version
[FW Version WD] Firmware version of the watch-dog component
[FW Version IO] Firmware version of the I/O interface
[FW Version Keyboard1] Firmware version of the keyboard 1
[FW Version Keyboard2] Firmware version of the keyboard 2
[FW Version Keyboard3] Firmware version of the keyboard 3
[MAC Address] MAC address of the Ethernet interface
[Supply Voltage] Value of the supply voltage
[Internal Voltages] Internal voltage values
[System Temperatures] Temperatures in the system
[Memory Alloc Sitze/Used] Memory size / memory used

59
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

5.3.3 Setup: More functions


13863

The submenu [SETUP] > [ACTIONS] provides access to the following functions:

Menu item Function


[REBOOT] → Setup: Reboot the device (→ page 61)
[CAN TEST] → Setup: Test the CAN interfaces (→ page 62)
[SPLASH SCREEN] → Setup: Define the splash screen (→ page 64)
[KEYBOARD TEST] → Setup: Test input elements (→ page 65)
[BACKUP/RESTORE] → Setup: Backup / Restore software components (→ page 66)
[USB REMOVE] → Setup: Safely remove the USB device (→ page 71)
[FONTS] → Setup: Manage fonts (→ page 72)
[FORMAT STORAGE] → Setup: Format the internal storage (→ page 74)
[Calibrate Touchscreen] → Setup: Calibrate the touchscreen (→ page 75)

60
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Reboot the device


7410

To reboot the device:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [REBOOT]
> [Reboot] menu page appears.
2 Reboot the device
► Press [ENTER] to reboot the device.
> Device reboots.

If a valid project is loaded, this project is started after a reboot.


If no valid project is saved, the setup splash menu appears again after rebooting.

61
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Test the CAN interfaces


7411

To test the CAN interfaces of the device, process one of the following functiions:
 CAN test: Transmit data (→ page 62)
 CAN test: Receive data (→ page 63)
>

CAN test: Transmit data


9625

To test transmitting CAN messages:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [CAN TEST]
> Menu page [CAN Bus Selection] appears.
2 Select CAN interface
► Use [SELECT] / [BACKSEL] to select the requested CAN interface and press [ENTER] to
confirm.
> Menu page [CAN Test Selection] appears.
3 Set test message and sender ID
► Use [SELECT] / [BACKSEL] to select the [CAN Transmit Test, Bus x] button and press
[ENTER] to confirm.
> Menu page displays the following information.
Name Description Possible values

[Tx Bytes (hex)] CAN test message (8 bytes) byte:


Every byte can be set seperatly (hexadecimal 00 = 0
number). ...
FF = 255
[CAN Tx-ID (hex)] CAN-ID of the sender (hexadecimal number) 00000000
...
FFFFFFFF
[Tx Frame Counter] Number of transmitted messages

► Set the test CAN message to be sent in hex format in [Tx Bytes (hex)].
► Set the test CAN message to be sent in hex format in [Tx Bytes (hex)].
4 Transmit test message
► Press [START] to start the transmission.
> Device tries to send the test message on the selected CAN interface.
> The number of the CAN messages sent since the beginning of the transfer appears in [Tx
Frame Counter].
If successful:
> Information bar displays confirmation message.
► Press [STOP] to finish the cyclic transmission of the test message.
If not successful:
> Information bar displays error message.
► Press [STOP] to finish the cyclic transmission of the test message.
► Check the CAN interface connection.
► Repeat the procedure.

62
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

If no baudrate of the CAN interface was set the test will be processed with 125 Kbits/s.

>

CAN test: Receive data


9627

To test receiving CAN messages:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [CAN TEST]
> [CAN Bus Selection] menu page appears.
2 Select CAN interface
► Use [SELECT] / [BACKSEL] to select the requested CAN interface and press [ENTER] to
confirm.
> [CAN Test Selection] menu page appears.
3 Receive CAN message
► Use [SELECT] / [BACKSEL] to select the [CAN Receive Test, Bus x] button and press
[ENTER] to confirm.
> Menu page displays the following informations:
Name Description Possible values
[Rx Bytes (hex)] Received CAN message (8 bytes); byte:
Each byte containes a hexadecimal value. 00 = 0
...
FF = 255
[CAN Rx-ID (hex)] CAN-ID of the receiver (hexadecimal value) 00000000
...
FFFFFFFF
[Rx Frame Counter] Number of received messages

► Press [START] to start receiving messages on the selected CAN interface. (→ note)
> [Rx Bytes (hex)] displays the content of the received messages (hexadecimal value).
> [CAN Rx-Id (hex)] displays CAN ID related to the revceived message (hexadecimal value).
> [Rx Frame Counter] displays the number of messages received sicne the start of the
transmission.

If successful:
> [Rx Frame Counter] displays value > 0.
► Press [STOP] to finish receiving CAN messages.
If not successful:
> [Rx Frame Counter] displays value 0.
► Pres [STOP] to finish receiving CAN messages.
► Check the CAN interface connection.
► Repeat the procedure.

If no baudrate of the CAN interface was set the test will be processed with 125 Kbits/s.

63
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Define the splash screen


9629

Specifications for the image file, which is used as splash screen → Visualisation limits (→ page
127)

To change the splash screen of the device:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [SPLASH SCREEN]
2 Select source of image file
> Menu page displays the following options:
Name Description

[Load from USB device] Load the image file from a USB device
[Load from /tmp] Load the image file from the directory /tmp of the device

[Load from ...] Load the image file from a selectable directory

► Use [SELECT] / [BACKSEL] to select the requested menu item and press [ENTER] to confirm.
> Menu page displays the selected image source.
3 Set splash screen
► Select the requested image file.
> Selected image file has focus.
► Use [LOAD] to save the file in the device and to use the image as splash screen.
>

Specifications of the splash screen image


11643

The user can define a user-defined splash screen. The image file has the following restricitions:

Parameter Restriction

File type Bitmap (*.bmp) RLE compressed


File name Naming convention = 8.3, only small characters
Resolution 1024 x 768 Pixel
Colours 262.144 (18 Bit)
File size  512 kByte

64
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Test input elements


13871

To test the function of the keys, the key LEDs and the navigation switch:
1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [KEYBOARD TEST]
> [Keyboard Test] menu page appears.
2 Test function keys
► Press any function key and keep it pressed.
> The key-related area on the screen is displayed brighter.
> The key LED is off.
3 Test navigation switch
► Use [OK] or [] / [] to switch between the two input fields of the group [Navigation Switch
Test].
> Selected field gets a black frame.
► Use [] / [] to increment / decrement the value displayed in the selected field.

65
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

Setup: Backup / Restore software components


7412

To backup data stored on the device as well as to restore data to the device, the following options are
available:

Name Description
[BACKUP SYSTEM INFORMATION] Save the system information
(→ Backup: Save the system information (→ page 67))
[BACKUP SYSTEM] Save the system software
(→ Backup: Save the system files (→ page 68))
[RESTORE SYSTEM] Restore the system software
(→ Restore: Restore the system files (→ page 70))

66
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Backup: Save the system information


9648

Contents of the file → Setup: Display system information (→ page 59).

To save the system information:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [BACKUP/RESTORE]
> [System Backup & Restore] menu page appears.
► Select [BACKUP SYSTEM INFORMATION] and press [ENTER] to confirm.
2 Select memory location
> Menu page displays the following options:
Bezeichnung Bedeutung
[Save to USB device] Save data to a USB device
[Save to /tmp] Save data to the device directory /tmp

[Save to ...] Save data to a selectable directory of the device

► Use [SELECT] / [BACKSEL] to select the requested menu item and press [ENTER] to confirm.
> Menu page displays the content of the selected memory location.
3 Save the system information
► Select requested directory.
► Press [SAVE] to save the system information.
> Devices saves the file containing the system information in the selected directory.

67
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Backup: Save the system files


9637

WARNING
If the backup and the restore device have different runtime versions, the restoration of a backup file
can lead to an undefinable system behaviour of the PDM360 NG!
The runtime versions on the backup and restore devices must be identical.
► Ensure that the runtime systems on the backup and restore device are of the same version!
(→ Update the runtime system of the device (→ page 29))

To save the system files to a selectable location:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [BACKUP/RESTORE]
> [System Backup & Restore] menu page appears.
► Select [BACKUP SYSTEM] and press [ENTER] to confirm.
2 Select software components
> Menu page displays the following options:
Name Description
[Select All] Enable all software components
[Backup Ethernet Settings] Settings of the Ethernet network adapter
[Backup Backlight Settings] Settings of the background illumination
[Backup Splash Screen] Splash screen
[Backup Retain Data] Retain data
[Backup User Filesystem (/home)] User file system

[Backup Internal Mass Storage (/data)] Mass storage contents

► Use [SELECT] / [BACKSEL] to select the required components and press [ENTER] zu enable /
disable.
= Exclude software component from backup file
= Include software component in backup file
► Optional: Repeat procedure for additional software components.

Check [Select All] to include all software components in the backup file.

► Press [CONFIRM] to confirm the selection.


3 Select memory location for backup file
> Menu page displays the following options:
Name Description
[Save to USB device] Save data to a USB device
[Save to /tmp] Save data to directory /tmp

[Save to ...] Save data to a selectable directory

► Use [SELECT] / [BACKSEL] to select the requested menu item and press [ENTER] to confirm.

68
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

> Menu page displays content of the selected memory location.


4 Save backup file
► Optional: Select required target directory.
► Press [SAVE] to save the selected system files in a backup file (.bup).
> Device saves backup file in selected directory.
► If required,press [ABORT] to cancel the backup process.

69
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Restore: Restore the system files


9636

WARNING
If the backup and the restore device have different runtime versions, the restoration of a backup file
can lead to an undefinable system behaviour of the PDM360 NG!
The runtime versions on the backup and restore devices must be identical.
► Ensure that the runtime systems on the backup and restore device are of the same version!
(→ Update the runtime system of the device (→ page 29))

► Use the option "Auto Restore" for the automatic restoration of system files from a backup
file (→ Automatically restore system files (→ page 82)).

To restore the system files from a backup file (*.bup):


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [BACKUP/RESTORE]
> [System Backup & Restore] menu page appears.
► Select [RESTORE SYSTEM] and press [ENTER] to confirm.
2 Select backup file
► Menu page displays the following options:
Name Description
[Restore from USB device] Restore data from USB device
[Restore from /tmp] Restore data from directory /tmp

[Restore from ...] Restore data from a selectable directory

► Use [SELECT] / [BACKSEL] to select the memory location of the backup file and press
[ENTER] to confirm.
> Menu page displays content of selected memory location.
► Select backup file.
► Press [RESTORE] to load the selected backup file.
3 Select software components
> Menu page displays list of software components included in the backup file.

Software components not included in the backup file are geyed out!

► Use [SELECT] / [BACKSEL] to select the software components to be restored and press
[ENTER] to check / uncheck the option field:
= Exclude software component from restoring process
= Include software component in restoring process
► Optional: Repeat procedure for additional software components.
► Press [CONFIRM] to confirm the selection.
> Device restores the selected software components.
> Status bar displays progess of restoring process.
► If required, press [EXIT] to cancel the restoring process.
>

70
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

Setup: Safely remove the USB device


9631

NOTICE
Risk of data loss on the USB device!
► Unmount USB devices before removing them from the runtime system!
► Do not remove the USB device before unmounting has been confirmed!

To safely remove a USB device:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [USB REMOVE]
2 Remove the USB device from runtime system
> Menu page displays directory /media containing all mounted USB devices (grey background).
► Use [] / [] to select the requested USB device.
► Press [REMOVE] to unmount the selected USB device from the file system.
> USB device is unmounted.
> Informaation bar displays confirmation message.
> Operator can safetly disconnect the USB device from the system.

71
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Manage fonts


14372

To manage font files (True Type Fonts) on the device, the following options are available:

Name Description
[LOAD FONT] Install font files on the device
(→ Fonts: Load the font (→ page 73))
[REMOVE FONT] Remove font files stored on the device
(→ Fonts: Remove the font (→ page 73))

72
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Fonts: Load the font


13866

To install a font file (true type fonts) on the device:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [FONTS] > [LOAD FONT]
2 Select source of the font file
> Menu page displays the following options:
Name Description

[Load from USB device] Load font file from USB device
[Load from /tmp] Load font file from /tmp-directory

[Load from ...] Load font file from a selectable directory

► Use [SELECT] / [BACKSEL] to select the requested menu item and press [ENTER] to confirm.
> Menu page displays selected source.
3 Install font file
► Select the requested font file.
> Selected font file has focus.
► Press [LOAD] to save the selected font file on the device.
> After rebooting the device the installed font file can be used in CODESYS projects.
► Optional: Repeat steps 2 and 3 to install additional font file on the device.
>

Fonts: Remove the font


14372

To remove font file installed on the device:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [FONTS] > [REMOVE FONT]
> Men page displays installed font files saved in the directory /home/fonts.
2 Remove font files
► Use [] / [] to select the requested font file (.ttf).
► Press [REMOVE] to remove the selected font file from the device.
> Font file is removed from the device.
► Optional: Repeat step 2 to remove additional font files from the device.

73
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Format the internal storage


9643

NOTICE
Risk of data loss!
> When this action is confirmed, all user data in the directory /data of the storage medium is
irretrievably deleted!
► Save files that you will need to an external medium prior to formatting!

To format the user data of the device:


To format the device-internal storage:
1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [FORMAT STORAGE]
> [Format internal Mass storage] menu page appears.
2 Speicher formatieren
► Press [ENTER] to start the formating process.
> The device-internal user data in directory /data is formated.
> Information bar displays a confirmation message.

74
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: start screen

>

Setup: Calibrate the touchscreen


13867

To calibrate the touchscreen of the device:


1 Select menu page
► Navigation path: [SETUP] > [ACTIONS] > [CALIBRATE TOUCHSCREEN]
> Menu page for toruch screen calibration appears.
2 Calibrate touchscreen
> Calibration process starts.
► Touch the black cross displayed on the touchscreen.
> Next calibration step appears.
► Repeat step until the calibration process is completed.
> If successful, the information bar displays a confirmation message.

Use the backlit function key above the navigation keys to cancel calibration process.

75
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration PDF file viewer

>

5.4 PDF file viewer

PDF: Navigating in the PDF file ..............................................................................................................77


PDF-Viewer: Display PDF file in full-screen mode .................................................................................78
PDF-Viewer: Display extended menu ....................................................................................................79
PDF-Viewer: Display the tabel of content of the PDF file .......................................................................80
11416

The setup menu uitlises a PDF file viewer. The operator can use it to display PDF files stored in the
directories /home/pdf and /media.
To display a PDF file:
► Enter the setup mode (→ Enter the setup mode (→ page 39))
► Select [PDF-Viewer] menu item.
► Use [ENTER] to change to the PDF file viewer.
► Choose one of the following options:

76
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration PDF file viewer

>

5.4.1 PDF: Navigating in the PDF file


11420

► Select requested PDF file and press [ENTER] to open the file (→ Operation: Navigate in the file
directory (→ page 44)).
> PDF file is loaded.
> Display shows the content of the PDF file:

► Use [] / [] to scroll up / down in the document.


► Use [ZOOM+] / [ZOOM-] to enlarge / reduce the document view.
► Use [PAGE+] / [PAGE-] to select the next / previous page of the PDF file.
► Use [] / [] to shift the document view to the right / left.
► Use [FULL] to change to the full-screen mode (→ PDF-Viewer: Display PDF file in full-screen mode
(→ page 78)).
► Use [EXIT] to change to the extended menu (→ PDF-Viewer: Display extended menu (→ page 79)).

77
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration PDF file viewer

>

5.4.2 PDF-Viewer: Display PDF file in full-screen mode


11422

► Load PDF file (→ PDF file viewer (→ page 76)).


► Use [FULL] to change to the full-screen mode.
> Display shows content of PDF file in full-screen mode:

> Use [] / [] to scroll up / down in the document.


► Use [+] / [–] to enlarge / reduce the document view.
► Use / to select the next / previous page of the PDF file.
► Use [>] / [<] to shift the document view to the right / left.
► Use to return to the standard view (→ PDF: Navigating in the PDF file (→ page 77)).
► Use [] to change to the extended menu (→ PDF-Viewer: Display extended menu (→ page 79)).

78
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration PDF file viewer

>

5.4.3 PDF-Viewer: Display extended menu


11424

► Start the PDF viewer (→ PDF file viewer (→ page 76))


► Use [EXIT] to change to the extended menu.
> Menu page displays the extended menu:

► Use [SELECT] / [BACKSEL] to select one of the following menu items and press [ENTER]:
 [OPEN NEW PDF FILE] Open new PDF file
→ PDF file viewer (→ page 76)
 [SHOW PDF FILE: Open the selected PDF file
/Verzeichnis/Dateiname] → PDF: Navigating in the PDF file (→ page 77)
 [SHOW INDEX OF: Open index of the selected PDF file
/Verzeichnis/Dateiname] → PDF-Viewer: Display the tabel of content of the PDF file (→ page 80)

79
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration PDF file viewer

>

5.4.4 PDF-Viewer: Display the tabel of content of the PDF file


11431

► Display PDF file in full-screen mode (→ PDF-Viewer: Display PDF file in full-screen mode (→ page 78)).
► Change to extended menu (→ PDF-Viewer: Display extended menu (→ page 79)).
► Select [SHOW INDEX OF: /Verzeichnis/Dateiname] menu item and press [ENTER].
> Menu page displays the tabel of contents of PDF file:

► Use [] / [] to select an item in the table of contents.


► Use [UNFOLD] to to expand the view of the item.
► Use [FOLD] to hide the view of the item.
► Use [ENTER] to display the content of the selected item.
► Use [EXIT] to return to the extended menu (→ PDF-Viewer: Display extended menu (→ page 79)).

80
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Setup: Start the application

>

5.5 Setup: Start the application


11438

► Enter the setup mode (→ Enter the setup mode (→ page 39))
► Select [LOAD APPLICATION] button.
► Use [ENTER] to start the application.

If a valid application program is saved:


> The application starts.
> The LED flashes green at 2 Hz (→ Status-LED (→ page 14)).

If no valid application program is saved:


> A white blank screen appears.
> The LED lights green.
► Transfer a valid application to the device via CODESYS
► Reboot the device (supply voltage OFF > ON)

81
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Device configuration Automatically restore system files

>

5.6 Automatically restore system files


14065

The function "Auto Restore" automatically identifies backup files saved in the root directory of a USB
memory device (*.bup) and restores their contents. Several devices can be easily and time-savingly
provided with the same software configuration (e.g. install a backup on controllers of the same type in
several vehicles).
1 Create a backup file
► Enter the setup modus (→ Enter the setup mode (→ page 39))
► Create backup of device configuration of the master device and store the backup file on an
USB memory device (→ Backup: Save the system files (→ page 68)).

The device only recognises backup files in the root directory of the USB memory device.
► Save the master backup file in the root directory of the USB memory device!

2 Automatically install the system files on the device

Only one backup file may be in the root directory of the USB memory device. If there
are several backup files in the root directory, the automatic restore process will be
stopped. An error message appears.
► Delete unneeded backup files in the root directory of the USB memory device!

► Connect the USB memory device with the master backup file with the target device
► Enter the setup mode (→ Enter the setup mode (→ page 39))
► Select [SETUP] and press [ENTER] to change in the setup menu.
> The setup automatically recognises the structure and contents of the backup file.
> The menu screen shows the system components contained in the backup file.
► Press [START] to start the restore process.
> The selected system components are transferred to the device.
If successful:
> The menu screen shows the completion message.
3 Reboot the device
► Press [REBOOT] to reboot the device.
> Device reboots.
> If a valid project is loaded, this project is started after rebooting.
If no valid project is loaded, the device enters the setup mode after rebooting.
>

5.7 Exit setup, reboot device


7416

→ Setup: Reboot the device (→ page 61)

82
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Exit setup, reboot device

6 Programming

Set the target system ..............................................................................................................................84


First steps ...............................................................................................................................................91
Configuration of the inputs and outputs ................................................................................................122
Use visualisations .................................................................................................................................124
Use of touch screen functions ..............................................................................................................138
Install and set up mobile camera ..........................................................................................................142
19324

This chapter describes the programming of the device with CODESYS 2.3.

83
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Set the target system

>

6.1 Set the target system

Create CODESYS project manually .......................................................................................................85


Configure the controller ..........................................................................................................................86
Configure CAN interfaces .......................................................................................................................87
Use access protection ............................................................................................................................89
19340

84
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Set the target system

>

6.1.1 Create CODESYS project manually


19341

When installing the ecomatmobile DVD "Software, tools and documentation", projects with
templates have been stored in the program directory of your PC:
...\ifm electronic\CoDeSys V2.3\Projects\Template_DVD_Vx.y
► Open the requested template in CODESYS via:
[Datei] > [Neu aus Vorlage…]
> CODESYS creates a new project which shows the basic program structure. It is strongly
recommended to follow the shown procedure.

1 Start CODESYS
► Double click on the program symbol "CoDeSys V2.3" on the Windows desktop
OR:
Activate [Start] > [All Programs] > [ifm electronic] > [CoDeSys V2.3] > [CoDeSys V2.3].
> The CODESYS programming environment appears.
2 Create a new project with CR1201
► Select [File] > [New].
> The window [Target Settings] appears.
► In the list [Configuration] select CR1201 and press [OK] to apply the selection.

When selecting the target system make sure that the target version matches the
version of the runtime system installed on the device!

> The window with the configuration options of the target system appears.
► Press [OK] to apply the basic settings.
3 Select the programming language
> The window [New POU] appears.
► Select type and programming language of the POU PLC_PRG and press [OK] to confirm.
> From the target file, CODESYS loads the description of the device hardware, the default
configuration of the device and the standard libraries with important basic functions.
> The program editor appears with the opened POU PLC_PRG.
4 Save the project
► Save the project with [File] > [Save as ...].

85
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Set the target system

>

6.1.2 Configure the controller


19897

In the PLC configuration the programmer can configure the target system.
To access the PLC configuration:
► In the project organizer select the tab [Ressourcen]:

► In the resources tree: double click on [PLC Configuration]


> The editor window shows the current PLC configuration of the device.
Via the PLC configuration the programmer has easy access to the following components:
 System and error flags
Depending on the application and the application program, these flags must be processed and
evaluated. Access is made via their symbolic names.
 Structure of the inputs and outputs
These can directly be designated symbolically (highly recommended!) in the nodes [Inputs Binary]
and [Outputs Binary] and are available in the whole project as global variables.

The programmer configures the input of the device directly in the PLC application!
(→ Configuration of the inputs and outputs (→ page 122))

86
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Set the target system

>

6.1.3 Configure CAN interfaces


19898

The CR1201 is designed as a display for representing process data. It is thus conditionally
real-time capable. Computationally intensive processes can cause long cycle times!
► Avoid computationally intensive functions (controller, encoder, control of diesel engines,
operation as CANopen master)!
► Monitor the cycle time during the runtime of the PLC program! Cycle times in the range
from 5 ... 10 ms are no problem.

The device can be configured either as CANopen master or CanSlave. The configuration is carried out
in the PLC configuration (→. Configure the controller (→ page 86)).
>

Configure the device as CANopen master


19899

To operate the device as CANopen master:


1 Open the system configuration
► In the object organizer select the tab [Ressources].
► Double click on the node [PLC Configuration]
> The editor window shows the PLC configuration of the device
2 Attach CANopen master
► Select [CR1201 Configuration V2] > [Local CAN Communication[FIX]].
> The editor window shows the available CAN interfaces.
► Select the requested CAN interface.
► Right mouse click on [CANopen Interface[FIX]]
> Context menu appears
► In the context menu select [Append subelement] > [CANopen Master ...].
> CANopen master is integrated into the PLC configuration.
> The editor window shows the tab [CAN parameters].
3 Configure the CANopen master
► In the tab [CAN parameters] set the parameters of the CANopen master.

Information on the configuration options: → System manual, chapter Using CAN – description

87
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Set the target system

>

Configure the device as CanSlave


19900

To operate the device as CanSlave in a CAN network:


1 Open the system configuration
► In the object organizer select the tab [Ressources].
► Double click on the node [PLC Configuration]
> The editor window shows the PLC configuration of the device
2 Attach the CANopen slave
► Select [CR1201 Configuration V02] > [Local CAN Communication[FIX]].
> The editor window shows the available CAN interfaces.
► Select the requested CAN interface.
► Right mouse click on [CANopen Interface[FIX]]
> Context menu appears
► In the context menu select [Append subelement] > [CanSlave ...].
> The CANopen slave is integrated into the PLC configuration.
> The editor window shows the tab [CAN parameters].
3 Configure the CANopen slave
► In the tab [CAN parameters] set the parameters of the CANopen slave.

Information on the configuration options: → System manual, chapter Using CAN – description

88
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Set the target system

>

6.1.4 Use access protection


14490

The device has a 3-step access protection.


Target of the protective measure Characteristics
Linux runtime system  Method: Password protection
 protects against unauthorised access to the Linux runtime system via
Telnet/SSH and FTP/SCP
 cannot be deactivated
Setup menu  Method: Password protection
 Restricts the access to functions of the setup menu
 Can be activated/deactivated via the setup menu
(→ Download the update file (→ page 30))
The passwords to protect the setup menu and the Linux runtime system are
identical!
IEC project  Method: Password protection
 Prevents reading/copying and unintentional overwritnig of the IEC project on
the device with CODESYS
 Can be activated/deactivated via the PLC browser in CODESYS
(→ Activate the access protection for an IEC project (→ page 90))

89
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Set the target system

>

Activate the access protection for an IEC project


14491

The access protection for the IEC project is set/changed in CODESYS via the PLC browser.

The password to protect the IEC project does not have to be identical with the password to
protect the Linux runtime system.
Additional information about the command setpwd and to delete the password for the
protection of the IEC project: → CODESYS help function.

1 Load CODESYS project


► Open the project to be protected in CODESYS.
> Project window appears.
2 Set password
► In the project window, select the [Resources] tab.
► Double click on [PLC-Browser].
> The PLC browser appears

► Enter the following command in the window [PLC browser]:


setpwd <passwort> 1
(e.g. setpwd pwCR1082 1)
► Use [ENTER] to confirm.
3 Download password protected project to the device
► Save the project and download it to the device.
> The IEC project cannot be read.

90
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

6.2 First steps

Programming notes for CODESYS projects ...........................................................................................92


Create PLC program ............................................................................................................................113
Add additional libraries .........................................................................................................................114
Programming interfaces .......................................................................................................................115
Save project in the device ....................................................................................................................121
3044

► Setup the device configuration ( Device configuration (→ page 38)).


► Activate the programming system ( Set the target system (→ page 84)).

91
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

6.2.1 Programming notes for CODESYS projects

FB, FUN, PRG in CODESYS .................................................................................................................93


Variables .................................................................................................................................................94
Libraries ................................................................................................................................................110
Note the cycle time! ..............................................................................................................................110
Watchdog behaviour .............................................................................................................................111
Operating sequence .............................................................................................................................111
Creating application program ...............................................................................................................112
7426

Here you receive tips how to program the device.


► See the notes in the CODESYS programming manual
→ www.ifm.com > select your country > [Data sheet search] > CR1201 > [Operating instructions]
→ ecomatmobile DVD "Software, tools and documentation".

92
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

FB, FUN, PRG in CODESYS


8473

In CODESYS we differentiate between the following types of function elements:


FB = function block
• An FB can have several inputs and several outputs.
• An FB may be called several times in a project.
• An instance must be declared for each call.
• Permitted: Call FB and FUN in FB.
FUN = function
• A function can have several inputs but only one output.
• The output is of the same data type as the function itself.
PRG = program
• A PRG can have several inputs and several outputs.
• A PRG may only be called once in a project.
• Permitted: Call PRG, FB and FUN in PRG.

NOTE
Function blocks must NOT be called in functions!
Otherwise: During execution the application program will crash.
All function elements must NOT be called recursively, nor indirectly!
An IEC application must contain max. 8,000 function elements!

Background:
All variables of functions...
• are initialised when called and
• become invalid after return to the caller.
Function blocks have 2 calls:
• an initialisation call and
• the actual call to do something.
Consequently that means for the FB call in a function:
• every time there is an additional initialisation call and
• the data of the last call gets lost.

93
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Variables
11739
>

Supported types of variables


14486

The device supports the following types of variables:

Variable Declaration place Validity area Memory behaviour


local in the declaration part of the function Only valid in the function element volatile
local retain element (POU) (POU) where it was configured. nonvolatile
global In [Resources] > [Global Variables] > Valid in all function elements of this volatile
global retain [Globale_Variables]: CODESYS project. nonvolatile

Network Values are available to all CODESYS volatile


In [Resources] > [Global Variables] > projects in the whole network if the
declaration list variable is contained in its declaration
Network retain lists. nonvolatile

→ CODESYS programming manual


→ ecomatmobile DVD "Software, tools and documentation"
>

Retain variables
3131

Variables declared as RETAIN generate remanent data. Retain variables keep the values saved in
them when the device is switched on/off or when an online reset is made.
14166

Typical applications for retain variables are for example:


• operating hours which are counted up and retained while the machine is in operation,
• position values of incremental encoders,
• preset values entered in the monitor,
• machine parameters,
i.e. all variables whose values must not get lost when the device is switched off.
All variable types, also complex structures (e.g. timers), can be declared as retain.
► To do so, activate the control field [RETAIN] in the variable declaration (→ window).

94
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Network variables via UDP


3139

Global network variables are used for data exchange between controllers in the network. The values
of global network variables are available to all CoDeSys projects in the whole network if the variables
are contained in their declaration lists.
A distinction is made between export and import variables:
 Export variables originate from the local project.
Their values can be influenced locally.
It is also to be possible to use the variables in one or more other projects, but only with read
access. To do so, these variables must be exported (provided) from the local project.
 Import variables do not originate from the local project but from another project.
Their values cannot be influenced locally.
The variables are used with read access in the local project (and possibly also in several other
projects). To do so, these variables must be imported into the corresponding local project.
► To export or import, the global network variables must be combined in lists. You can assign an
EXP file to every global variable list.
In this example each project has 3 lists of global network variables:
- 1 list with export variables (with local data for reading in other controllers) and
- 2 lists with import variables (with data of the other controllers for local reading).
► When you create a global variable list please note:
 By selecting [Export before compile] in the window [Properties] CoDeSys updates the
corresponding EXP file (e.g. ExportProj1.exp) when the project is compiled.
 By selecting [Import before compile] in the window [Properties], CoDeSys refers to the
corresponding EXP file (e.g. ExportProj1.exp) when the project is compiled, and updates
the list.
UDP (User Datagram Protocol) is a minimal connectionless network protocol belonging to the
transport layer of the internet protocol family. The task of UDP is to pass data which is transmitted via
the internet to the right application.
Example:
Information is to be exchanged between 3 devices (controller/PDM) and 1 PC. This is done by means
of the "global network variables" ( figure below). The example only shows the variables x1, x2 and
x3 in the global network variable lists of the corresponding projects.

95
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

The project "DemoProj1" contains the global network variable list "Global_Variables_Export_Proj1".
► In the properties of this list enter the file ExportProj1.exp.
► Activate [Export before compile].
> When this project is compiled, ExportProj1.exp is updated.
The project "DemoProj2" contains the global network variable list "Global_Variables_Import_Proj1".
► In the properties of this list enter the file ExportProj1.exp.
► Activate [Import before compile].
> When compilation of this project starts, the list "Globale_Variablen_Import_Proj1" is updated by
means of the file ExportProj.exp and then used for the compilation.

NOTE
If a project with variables to be exported is changed, all projects which import these global network
variable lists must then be rebuilt to update the lists:
► Menu [Project] > [Rebuild all]
► Menu [Online] > [Create boot project]
> The boot project is saved in the controller/PDM.

96
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

To work with network variables the following steps are required:


Step 1 ► Connect devices via Ethernet
Step 2 ► Set IP addresses and subnet mask
Step 3 ► Select first target system and create project (→ page 98)
Step 4 ► Set communication parameters (→ page 99)
Step 5 ► Activate network variable support (→ page 100)
Step 6 ► Integrate libraries (→ page 101)
Step 7 ► Complete and transmit the project (global network variables) (→ page 101)
Step 8 ► Write projects for more devices (→ page 105)
Step 9 ► Transmit projects (→ page 107)
Step 10 ► Test transmission of the global network variables (→ page 108)

97
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Select first target system and create project


3620

When a new project is created in CoDeSys the target file corresponding to the controller must be
loaded. It is selected in the dialogue window for every hardware and acts as an interface to the
hardware for the programming system.

Graphics: target system settings

► Select a suitable target and confirm with [OK].


► Confirm the following window with [OK].
> The window [New POU] appears:

► Setting: language of the POU = FBD.


► Confirm with [OK].
> The following window appears:

► Add the entries shown on the following screenshot to the program POU PLC_PRG:

98
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► With [File] > [Save as ...] save the project in the requested directory.
Here: filename = "DemoProj1" (for the first device in the network)
>

Set communication parameters


3625

The same communication parameters must be set for the PC, the device (controller/PDM) and the
project.
► Open the following dialogue with [Online] > [Communication Parameters...].
> The following window appears:

► Click [New…]
> The following window appears:

► Select the entry "Tcp/Ip(Level 2 Route)".

99
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► Confirm with [OK].


> The following window appears:

► Enter the corresponding IP address of the controller (compare with step 2).
► applies only to the following devices:
- PDM360: CR1050, CR1051
- PDM360compact: CR1052, CR1053, CR1055, CR1056:
Set [Motorola byteorder] = YES.
► Confirm with [OK].
>

Activate network variable support


3630

► Click on the tab [Resources] in CoDeSys.


► Double-click on [Target Settings].
> The following window appears:

► Click on the tab [Network functionality].


► Activate the field [Support network variables].
► [Names of supported network interfaces] = UDP ( window).
► Confirm with [OK].
> The data can now be exchanged via global network variables.

100
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Integrate libraries
3633

► Menu [Window] > [Library Manager]


> Display of the libraries already loaded:

► Menu [Insert] > [Additional Library... Ins] or: Key [Ins]


► Insert the following libraries:
- SysLibSockets.lib (3S library)
- SysLibCallback.lib (3S library)
> The library manager should look like this or similar (the sequence is not relevant):

>

Complete and transmit the project (global network variables)


3637

To demonstrate the exchange of data via global network variables, write one project each for all three
devices. These projects are suitable for this purpose mainly because of the contained global variable
lists.
The example shows the project for device 1.

101
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► Click on the tab [Resources] in CoDeSys.


► Select (= click) the entry [Global Variables]:

► Menu [Project] > [Object] > [Add…] ( screenshot):

> Display of the window "Properties":

► Enter the name of the global variable list as shown above.


► Confirm with [OK].
► Enter the variable x1 in the window that appears ( screenshot):

102
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► Right-click on the resource element [Global_Variablen_Export_Proj1].


► Click on [Object Properties...] ( screenshot):

> The following window appears:

► Click on [Add network].


> The window becomes larger ( window):

► Adopt the properties of the list similarly as shown here, but:

103
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

 For export list: Activate [Export before compile] and [Write]!


For import list: Activate [Import before compile] and [Read]!
 The entered [Minimum gap] or the [Interval] depends on the application.

NOTE
In the field [Link to file] > [Filename] it is expected to indicate an EXP file. (After [Project] > [Rebuild
all]) this external file contains the list of global network variables of this project to be exported, but is
NOT saved together with the project. ( CoDeSys online help).
We recommend another method which integrates the lists of global network variables in the project:
 Write projects for more devices (→ page 105) > create import lists.

Excursus: variable list identification (COB ID)


Here we work with variable lists which are exported from one device and imported to one or more
devices. This assignment of the variable lists is identified by a COB ID. The relationship is shown in
the following figure:

Here you see that the COB ID = 51 was assigned to the export variables of DemoProj1 in device 1
and that these variables can be found again with the COB ID = 51 in DemoProj2 and DemoProj3 in
device 2 and device 3. In this example we have used this procedure for the definition of the COB IDs.

NOTE
For the selection of the COB IDs observe the following:
 The export list and its corresponding import lists must be assigned to the same COB ID.
 In the whole network each COB ID may only be assigned to one export list.

End of excursus: variable list identification (COB ID)

104
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

Continuation "Complete project"


► In the window [Properties] of the global variable list click on the button [Settings...] beside
[Network type].
> The following window appears:

► As broadcast address enter the IP address of device 1, but:


In the last group replace the value by "255".
► Confirm with [OK].
► Do not forget: Menu [File] > [Save as...] > indicate directory and filename.
► Confirm with [OK].
>

Write projects for more devices


3647

Also create export lists for the projects DemoProj2 and DemoProj3.
► Now create corresponding projects with export lists for the two other devices: DemoProj2.pro and
DemoProj3.pro. These files are necessary for the following steps.
Filenames and entries  following table:
Device Project filename Global variable list to be exported COB ID Global variable

1 DemoProj1.pro Globale_Variablen_Export_Proj1 51 x1:INT

2 DemoProj2.pro Globale_Variablen_Export_Proj2 52 x2:INT

3 DemoProj3.pro Globale_Variablen_Export_Proj3 53 x3:INT

> Export lists must now be created for all 3 devices.


Create import lists for the project DemoProj1.
For the project DemoProj1.pro in device 1 we have so far only created the "global network variables"
to be exported.
We now create two lists of global network variables to be imported which are imported from
DemoProj1.pro. Requirement: all 3 projects are available locally or in the LAN.
► Open the project DemoProj1.pro in CoDeSys.
► Click the tab [Resources].
► Select (click) the entry [Global Variables].
► Menu [Project] > [Merge…].
► Select the project DemoProj2.pro.

105
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► Confirm with [OK].


> The following window appears:

► Reduce the selection to the requested list:

► Confirm with [OK].

106
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► From the menu "[Project] > [Merge…]" repeat the process with DemoProj3.pro and its export list.
> The resources in DemoProj1.pro are now as follows:

Adapt PLC_PRG in all projects.


So far we have "only" organised the data management. Now the executable parts of the projects will
be dealt with.
For each project only one function element is written which increases the contents of the
corresponding variables (x1, x2 or x3,  table at the top) by 1 in each PLC cycle. In our example the
function element PLC_PRG for DemoProj1.pro is shown ( screenshot):

► Create this program for each of the 3 devices:


DemoProj1.pro: global variable x1,
DemoProj2.pro: global variable x2,
DemoProj3.pro: global variable x3.
>

Transmit projects
3654

► Check whether all 3 devices together with the PC are available with their corresponding IP
addresses in the LAN.

107
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► Transmit the 3 created projects DemoProj1...3 to the corresponding devices.


► Start these projects there.
>

Test transmission of the global network variables


3656

► Check the behaviour of the data transmission by looking at the corresponding global variable lists.
If, for example, in the project DemoProj1.pro you open the variable list
"Globale_Variablen_Import_Proj2", you should note that the value of x2 is increasing.
► Also check the other projects and make sure that the transmission of the global variables in the
network functions.

108
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

System flags
18107

System flags are factory set global variables. System flags are mapped to IEC addresses (%Ixx,
%Qxx). The programmer can access the following elemnts by using symbol names in the program
code:
 Inputs and outputs
 Functions of the input elements
 Functions of the display elements
 States of system components and characteristic values

Further infomration about system flags of the device: → System flags (→ page 346)

109
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Libraries
7425

ifm electronic provides the following device-specific function libraries for programming the CR1201
using CODESYS 2.3:

Library Description

ifm_CR1201_Vxxyyzz.lib Device-specific functions


ifm_PDMng_util_Vxxyyzz.lib Help functions
ifm_PDM360NG_USB_Vxxyyzz.lib Maintain devices connected to the USB interface

ifm_PDM360NG_USB_LL_Vxxyyzz.lib Help library for ifm_PDM360NG_USB_Vxxyyzz.lib


ifm_PDM360NG_linux_syscall_asynch_Vxxyyzz.lib Send Linux commands to the system
ifm_RAWCan_NT_Vxxyyzz.lib Functions for CAN layer 2

ifm_CANopen_NT_Vxxyyzz.lib Functions for CANopen


ifm_J1939_NT_Vxxyyzz.lib CAN functions for drive control
ifm_NetVarLib_NT_Vxxyyzz.lib Maintain network variables for CANopen

Further information about the ifm function libraries: → ifm libraries for the device CR1201 (→ page
155)
To add additional libraries to a CODESYS project: → Add additional libraries (→ page 114)

>

Note the cycle time!


8006

For the programmable devices from the controller family ecomatmobile numerous functions are
available which enable use of the devices in a wide range of applications.
As these units use more or fewer system resources depending on their complexity it is not always
possible to use all units at the same time and several times.

NOTICE
Risk that the device acts too slowly!
Cycle time must not become too long!
► When designing the application program the above-mentioned recommendations must be
complied with and tested.
► If necessary, the cycle time must be optimised by restructuring the software and the system
set-up.

110
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Watchdog behaviour
11789

In this device a watchdog monitors the runtime of system processes, including the process of the
CODESYS application. Each process has to call the wathcdog monitor within a defined time intervall.
If the maximum watchdog time is exceeded:
> all processes are stopped (reset)
> all outputs are switched off
> the screen goes black
> the status LED flashes red at 5 Hz
A process needs a certain time to proceed reset and initialisation routines (watchdog reset).
The following tabel shows the watchdog times for each process:

Prozess Chain-ID Watchdog-Timeout [ms] Watchdog-Reset [ms]

ppc-plclinux 10 1 000 500


eplc main 20 10 000 500
eplc overlay 21 10 000 500
keyboard-service 40 2 000 500
io-coproc-service 50 2 000 500
wd-coproc-service 60 2 000 500

Eliminate the fault:


► Reboot the device via voltage on/off plus.
>

Operating sequence
7427

In principle, there are two options to create a project for display devices:

Sequence Advantages Disadvantages


Visualisation first, then the  In the program it is possible to The PLC parameters and variables required in the
PLC program. cross-reference to the finished images. images have not yet been defined.
 When the PLC program is tested the
images already exist.
PLC program first, then the All parameters and variables are defined in  The parameters from the images (image
visualisation the PLC program before they are referred number, key, LED, etc.) must be found
to in the visualisations. elsewhere.
 The PLC program can only be tested after
creation of the visualisation.

In both cases we urgently recommend to design a precise structure of the visualisation and its
contents before starting.

111
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Creating application program


8007

The application program is generated by the CODESYS programming system and loaded in the
controller several times during the program development for testing:
In CODESYS: [Online] > [Login] > load the new program.
For each such download via CODESYS the source code is translated again. The result is that each
time a new checksum is formed in the controller memory. This process is also permissible for safety
controllers until the release of the software.

Graphics: Creation and distribution of the software

112
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

6.2.2 Create PLC program


7351

Only some networks are necessary for an executable program. You do not need any special function
block to be able to use important device functions. All monitor functions you can control via system
variables in the PLC configuration ( System flags (→ page 346)).

Familiarise yourself with the programming system CODESYS 2.3!


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

To create a PLC application.


► In the Object Organizer, select the [POUs] tab:

► Double click on [PLC_PRG].


> Editor window displays input mask of teh selected programming language.
► Enter program code.

113
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

6.2.3 Add additional libraries


7432

For the CR1201, ifm electronic provides additional CODESYS libraries, that contain device-specific
functions. The libraries will be installed together with the target package of the device (→ ifm libraries
for the device CR1201 (→ page 155)).

The following libraries needs to be installed in order to program the device:


– LinuxSystemLib.Lib
– Standard library Standard.Lib from \CoDeSys\Library\
– Device library CR1201_Vxxyyzz.Lib aus
\CoDeSys\Targets\ifm\Library\ifm_CR1201\
► If not already installed, add the libraries one by one to the project!

The release numbers of the libraries and the target package must be equal.
V version
xx: 00...99 target version number
yy: 00...99 release number
zz: 00...99 patch number

The basic file name (e.g. "CR1201") and the software version number "xx" (e.g. "04") must
always have the same value! Otherwise the device goes to the STOP mode.
The values for "yy" (release number) and "zz" (patch number) do not have to match.

To add additional libraries to the project:


1 Start library manager
► Click on the [Resources] tab in CODESYS:

► Double-click on [Library Manager] in the left column.


> The window [Library Manager] appears listing the installed libraries.
2 Add additional libraries
► Select [Insert] > [Additional library...].
> File explorer appears displaying the CODESYS library directory.
► Select the requested library and press [Open] to load it.
► Optional: repeat step 2 to install additional libraries.

The functions libraries are stored in the following directories:


– Device library: Targets\ifm\Library\ifm_CR1201
– Help library: Targets\ifm\Library
– CANopen library: Targets\ifm\Library\ifm_CANopen
– RAWCan library: Targets\ifm\Library\ifm_RAWCan
– J1939 library: Targets\ifm\Library\ifm_J1939

3 Save CODESYS project


► Use [File] > [Save] to save the changes in the project.

114
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

6.2.4 Programming interfaces

Setting-up the programming interface ..................................................................................................116


Access to the Linux runtime system .....................................................................................................118
7310

For programming of the device only the following interface is available:


 Ethernet interface

115
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Setting-up the programming interface


7417

The device can be programmed over the Ethernet interface (Position of the connectors: → Installation
instrcution).

Device and CODESYS pc/laptop can be connected directly oder via a ethernet network.
► Only use recommended accessories! (→ Installation instruction)
► For the connection in the network an experienced user or system administrator should set
up the network addresses and do the configuration.

To configure the programming interface:


1 Connect device and CODESYS pc /laptop
► Connect the Ethernet interface of the device with Ethernet interface of the CODESYS
pc/laptop (→ Installation instruction)
2 Set the IP parameters of the Ethernet interfaces
► Set the IP parameters of the Ethernet interface of the device (→ Setup: Configure the Ethernet
interface (→ page 51))
► Set the TCP/IP settings of the Ethernet interface of the CODESYS pc/laptop.

The device and the pc/laptop need to belong to the same ip address space.
► Note the settings of the IP address and the subnet mask! (→ Address assignment in Ethernet
networks (→ page 345))

3 Test Ethernet connection


► Check the correct cable connection between both devices.
> OK if the orange LED beside the network connector lights or flickers.
► Test Ethernet connection (i.e. using PING command at the Windows command line).
4 Set parameters of communication path between CODESYS and the device
► In CODESYS click on [Online] > [Communication Parameters...].
► Click on [New...]
> The window "Communication Parameters: New Channel" appears.

116
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

► Enter a self-explanatory name, e.g. "PDM_TCP/IP".


► Select the entry "Tcp/Ip (Level 2 Route)" ( screenshot):

► Use [OK] to adopt new parameters.


► Enter the following communication parameters for the new channel ( screenshot below):
- [Address] = e.g. 192.168.82.247 (enter here the actual IP address of the device)
- [Motorola byteorder] = yes
(Double-click to change the value step by step)

► Use [OK] to adopt communication parameters.


> CODESYS and the device should now be able to communicate via the Ethernet interface.

117
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Access to the Linux runtime system

Access the device with Telnet ..............................................................................................................119


Access the device with SSH .................................................................................................................119
Copy files with FTP ...............................................................................................................................120
Copy the files with SCP ........................................................................................................................120
14529

To access the Linux runtime system of the device directly via the Ethernet inerface, use one of the
following options.

118
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Access the device with Telnet


7424

► Download the Telnet client and install it on the PC (e.g. PuTTY → the operating system of the
Telnet client
► Start the Telnet client
> The program window appears
► Use the following parameters to create a new connection profile:
- PC name/IP address: 192.168.82.247
- Port: 23
- Transfer protocol: Telnet
► Establish a connection to the device with the created connection profile
> The program window with a prompt appears.
► Enter the following details and confirm with [ENTER]
- User name/login: root
- Password: pdm360ng
> The prompt of the root directory # appears
► Enter the requested command
► When done, enter exit in the prompt and confirm with [ENTER]
> The program window is closed
>

Access the device with SSH


12101

To establish a secure terminal connection between the PC and the device, proceed as follows:
► Download the SSH client and install it on the PC (e.g. PuTTY (→ www.putty.org))
► Establish an Ethernet connection between the PC and the device.
► If necessary, adapt the IP network settings of the PC and/or the device.
→ Help function of the PC operating system
→ Setup: Configure the IP parameters manually (→ page 51)
► Start the SSH client
► Use the following parameters to create a new connection profile:
- IP address = 192.168.82.247
- Connection type = SSH
- Port number = 22
► Save the connection profile
► Establish a secure connection between the PC and the device with the saved connection profile
> A safety note appears
► Confirm the safety note
> The terminal window appears
► Enter the following details and confirm with [Enter]:
- login as: = root
- root@192.168.82.247' password: pdm360ng
> The success message Welcome using SSH/SCP on IFM PDM360NG ! appears
► Execute the requested commands in the command line
→ Help function of the SSH client
► When done, separate the secure connection with [Shift]+[Strg]+[D]

119
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

>

Copy files with FTP


9763

For some purposes an FTP connection between the PC and the device can be useful:
- Quick data transmission
- Connection also possible via the internet
- If no access to the USB port is possible
In case of doubt or problems please contact your system administrator.
► Establish an Ethernet connection between the PC and the device.
► The PC and the device must have compatible IP addresses and the same subnet mask.
→ Setup: Configure the IP parameters manually (→ page 51).
► Start the file manager on the PC.
► Enter the IP address of the device and, if needed, the requested directory as target address
following "ftp://", e.g.
ftp://192.168.82.247/home (default IP address in the device)
► After a right-click in the right space of the file manager click [Login as...] in the context menu.
> The dialogue [Login as...] opens.
► Enter the following:
- User name = root
- Password = pdm360ng
► Connect with the device with mouse click on [Login]
► Copy the requested files
► Close the file manager to disconnect the FTP connection.
>

Copy the files with SCP


7319

To transfer files via a secure SCP connection (Secure CoPy) between the device and the PC, proceed
as follows:
► Download the SCP client and install it on the PC (e.g. WinSCP (→ www.winscp.net))
► Establish an Ethernet connection between the PC and the device.
► If necessary, adapt the IP network settings of the PC and/or the device.
→ Help function of the PC operating system
→ Setup: Configure the IP parameters manually (→ page 51)
► Start the SCP client
► Use the following parameters to create a new connection profile:
- IP address = 192.168.82.247
- Connection type = SCP
- Port number = 22
- User name/Login = root
- Password = pdm360ng
► Save the connection profile
► Establish a secure connection between the PC and the device with the saved connection profile
> The program windows with the file systems of the PC and the device appear
► Copy the requested files
→ Help function of the SCP client
► When done, separate the secure connection
► End the SCP client
>

120
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming First steps

6.2.5 Save project in the device


14427

Requirements:
 Device and CODESYS pc/laptop are connected via ethernet interfaces.
 Programming interface is set.
1 Compile project
► Use [Project] > [Rebuild All] to compile the program code for the device.
> After all libraries and variables have been inserted and parameterised as described, no error
messages should appear.

If a project was changed (or a new one created) it must be cleaned before transferring it to the
device. Without cleaning, the program can become unstable due to memory overflow.
► Use [Project] > [Clean all] to clean the project.
> During cleaning, all program elements are reorganised and combined thus reducing the
volume.

► Use [Project] > [Save] to save the project.


2 Download the project to the device
► Use [Online] > [Login] to set up a logic connection to the device.
> Confimation message appears:
"The program has changed. Download the new program?"
► Press [Yes] to confirm.
> The compiled project (including the visualisation) is transferred to the device.

The program code is saved on the device in the directory /home/projects. With another
download project files already on the device are not loaded again.
► To delete the project files in the directory /home/projects, use [Online] > [Reset
(source)].

3 Create boot project


► Use [Online] > [Create boot project] to create a boot project in the device.
> The project ist stored in the remanent memory of the device.
> After rebooting the device the project starts automatically.

121
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Configuration of the inputs and outputs

>

6.3 Configuration of the inputs and outputs

Notes ....................................................................................................................................................123
Configure input .....................................................................................................................................123
Configure output ...................................................................................................................................123
7308
1394

For some devices of the ecomatmobile controller family, additional diagnostic functions can be
activated for the inputs and outputs. So, the corresponding input and output signal can be monitored
and the application program can react in case of a fault.
Depending on the input and output, certain marginal conditions must be taken into account when
using the diagnosis:
► It must be checked by means of the data sheet if the device used has the described input and
output groups (→ data sheet).
 Constants are predefined (e.g. IN_DIGITAL_H) in the device libraries (ifm_CR1201_Vxxyyzz.LIB
) for the configuration of the inputs and outputs.
For details → Possible operating modes inputs/outputs (→ page 352).

122
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Configuration of the inputs and outputs

>

6.3.1 Notes
19934
>

Presets
13348

 All inputs and outputs are factory set to binary, plus switching (BH).
 The diagnostics function is disabled.
 The overload protection is enabled.
>

Display the I/O configuration


7353

The active configuration of the inputs and outputs can be displayed via the system flags IN00 and
OUT00.

Detailed information on the system flags: → System flags: Inputs and Outputs (→ page 348)

>

6.3.2 Configure input


7350

The inputs are configured usign teh function block INPUT in the application program.

Detailed information on the function block: → INPUT (→ page 166)


Possible operating mode: → Possible operating modes inputs/outputs (→ page 352)

>

6.3.3 Configure output


7347

The operting mode of the output is fixed (binary, plus switching (BH)).

123
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

6.4 Use visualisations

Notes on visualisations .........................................................................................................................125


Create visualisation ..............................................................................................................................131
Configuring functions of operating elements ........................................................................................132
Use of optical and acustical feedback ..................................................................................................135
Install fonts (true type fonts) .................................................................................................................136
19911

124
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

6.4.1 Notes on visualisations


19914

 Familiarize yourself with the CODESYS visualisation editor!


► → CODESYS-Online-Hilfe!
 ifm electronic provides various components for CODESYS 2.3 supporting the
praogramming of visualisations.
► → POUs: Manage visualisation (→ page 198)

>

Drawing area
YS_OBJECTID>

 The drawing area is equal to the resolution of the display.


 The left upper corner marks the home position (0,0) of the virtual and physical drawing area.
 Virtual drawing area = 2560 x 1536 pixels
(enlarges the physical drawing area)
 All elements in and outside the virtual drawing area are calculated.

The images used in the project can be larger than the given drawing area. In this case only a
selectable part of the image will be displayed.

>

Resample / scale image


3117

If an image is loaded in the device which does not meet the requirements for size or colour, it is
resized before it is displayed and the colours used are "checked".
Each time the image is opened, it must be resampled. This often leads to much longer times to
change from one image to the other. Corrective measures:
► First carry out all transformations of the bitmap or the image in an image processing program on
your computer.
Only for BasicDisplay: The colour palette is adapted when the image is integrated into the project
by CODESYS. On the device itself no adaptations will be made (size, scaling, colour).
► Only save the suitably transformed images in the visualisation of the device.
>

Texts
7428

 The smallest font size which is clearly visible on the device is 8 points.
 Permissible fonts (true type fonts):
- Arial (standard)
- Courier New
- Times New Roman
- ifm ISO symbols
- Loadable fonts
Install all required fonts on the PC!
 Permissible font size:
- Standard = 10 pixels
- Max. = 72 Pixels
- Permissible nuances = 1 pixel

125
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

 Permissible font weights:


- Normal (standard)
- Italic
- Bold
- Bold cursive
 Permissible effects:
- None (standard)
- Underlined
- Crossed out
 The following text scripts are accepted:
- Western (standard)
- Other scripts on request

126
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

Visualisation limits

Limitations for visualisations .................................................................................................................128


CODESYS visualisation elements ........................................................................................................129
Movement of elements .........................................................................................................................130
7382

When using visualisations the following estrictions apply:

127
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

Limitations for visualisations


19100

Designation Limitation

Length of character strings < 255 Zeichen

Length of path names < 255 Zeichen


Number of graphical objects per visualisati→ page < 2000
Number of bitmapst1 per project No indication possible. These
elements uses the same memmory
Number of character sets per project area.
Number of POUs2 per project 8000
Legend:
1
... Specifications of the splash screen: → Setup: Define the splash screen (→ page 64)
2
... POU (Program Organization Unit) = function, function block or program

128
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

CODESYS visualisation elements


7388

Visualisation element Functional safety for the PDM


Polyline o A polyline is to consist of maximum 99 anchor points.
A polyline is not to enclose any area.
Curve o A curve is to consist of maximum 99 anchor points.
A curve is not to enclose any area.
Rectangle + No problems known
Rounded rectangle o Only for very restricted use, slows down the system very much
Circle, ellipse o Only for very restricted use, slows down the system very much
Polygon o A polygon is to consist of maximum 100 anchor points.
Pie chart o Only for very restricted use, slows down the system very much
Visualisation o Possible but too many elements on one page slow down the system
Button + No problems known
Table o dynamically indexed variables are not supported
Trend curve + Supported from firmware V01.05 on; not all CODESYS functions are
available on embedded devices
Alarm table – Not supported
Scales o Possible but too many elements on one page slow down the system
® the following note.
Pointer instrument + Permissible pointer type
- normal arrow
- thin arrow
- wide arrow
- thin needle
Permissible angle indication:
Start and end angle in [degrees]
Bargraph + Can be represented using the following diagram types:
- scale at the bar
- scale in the bar
- bar in the scale
Permissible orientation:
- horizontal
- vertical
Histogram + No problems known
Graphic file + - BMP
- BMP RLE compressed
- WMF (not recommended)
- JPG
Graphics scaling mode + No problems known:
The mode can be executed as follows:
- isotropic (uniform scaling of height / width)
- anisotropic (non-uniform scaling of height / width)
- fixed (without scaling)
ActiveX element – Not supported

Legend:
+ ... can be used without problem
o ... can be used with restrictions
– .... cannot be used

129
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

To avoid too long image loading times please note:


 It is allowed to save colour bitmaps with a colour depth of 18 bits (max. 24 bits).
 Some visualisations with the CODESYS options are not very satisfactory, e.g. round scales.
Solution:
Integrate the requested elements as (an externally generated) BMP graphic. It is then sufficient to
turn an arrow in the visualisation depending on values which could change its colour if limit values
are exceeded.
>

Movement of elements
7392

Image and text elements can be moved on the display in a defined manner.

Element movement Description


Rotate Rotate the element around a defined pivot point
Indicate the angle of rotation
 angle of rotation in [degree]
 positive value = rotation clockwise
 negative value = rotation anticlockwise
Shift Shifting of the element:
 horizontal
 vertical
 only within the drawing area
 max. until leaving the drawing area
Relative shifting of Each edge of the element can be shifted by a specified number of pixels via an
• rectangle INT type variable:
• ellipse / circle  basic position of the 4 edges = zero
 new value shifts this edge by the specified value
Shift direction for value > 0:
 horizontal edge down
 vertical edge to the right
Shift direction for value < 0:
 horizontal edge up
 vertical edge to the left

130
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

6.4.2 Create visualisation


3100

1 Select visualisation directory


► In the Object Organizer, select the [Visualizations] tab.
> Object Organizer displays visualisation objects of the project.
2 Create visualisation object
► Right-click on [Visualizations] symbol
> Context menu appears

► Select [Add object ...]


> The [New Visualization] window appears.
► After [Name of the new Visualization] enter the name of the first visualisation object and press
[OK] to confirm.
> CODESYS creates visualisation object in the visualisation directory.
> Visualisation editor appears.
3 Create visualisation element
► Create requested visualisation elements in the drawing area of the visualisation editor:

:: The drawing field corresponds to the size of the LCD display.

Notes on use of visualisations → Notes on visualisations (→ page 125)

► Use [File] > [Save] to save the created visualisation.

131
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

6.4.3 Configuring functions of operating elements


10160

The signals of the navigation key are evaluated independently of the signals of the
function keys and the touch screen.
The device detects several simultaneously pressed function keys and evaluates them.
When the function key is permanently activated, the device generates a key pulse
sequence (after an adjustable waiting time).

>

Processing user input


14485

The following tasks have to be solved in the visualisations of the application program:
• jump to the visualisati→ pages,
• change parameter values in the input fields,
• confirm messages.
To do so, the ecomatmobile PDM devices provide a number of operating elements.
For the devices of the PDM families you can assign functions to certain operating elements or signals.
There are several ways to do so which can also be combined in some cases:
 System variables in the PLC configuration
→ Use edit controls (→ page 133)
 Library ifm_PDM_INPUT_Vxxyyzz.lib (contains FBs to manage input fields)
→ POUs: Manage visualisation (→ page 198)
 CODESYS dialogue [Elements configuration]
→ CODESYS user manual
 Functions and function elements created by the user
>

Numbering of the operating elements


7338

The operating elements of the device are systematically numbered internally. In order to read or to
change the states of the input elements, the user can easily use symbol names in the programming
code of CODESYS.
The following figure shows the assignment of the individual operating elements with system flags:

Function keys: Navigation key:

>

132
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

Numbering of the operating elements


14297

For each key of the device the system detects the following events. Using the results of this detection,
the system generates signals and maps them to system flags:

Event type Events Reference


State  key pressed → System flags: function keys (→ page 349)
 key released → System flags: navigation keys (→ page 350)
 key hold down (continuous operation)

Change of state  pressing key (positive edge)


 releasing key (negative edge)

>

Use edit controls


10158

ifm provides the programmer with "edit controls". You can link functions to operating elements using
system variables in the PLC configuration.
For normal mode:
MD_KEYx_y Assignment of key y in the group of keys x (preset)

For the edit mode:


ME_KEYx_y Assignment of key y in the group of keys x (Edit mode)

As STRING a key must be assigned a keyword (→ next chapter).

Key groups → Numbering of the operating elements (→ page 132)


System variable → System flags (→ page 346)

>

Keywords for edit controls


10163

Keyword Meaning in MAPPING Meaning in EDIT MODE


DOWN --- Decrement the value
ESC Quit the EDIT MODE Quit the EDIT MODE
ESCAPE
LEFT --- Cursor by 1 position to the left
RIGHT --- Cursor by 1 position to the right
SHIFT_TAB Jump to the previous element ---
SPACE Change the element to the EDIT MODE Confirm the value
TAB Jump to the next element ---
UP --- Increment the value
>

133
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

Example: edit controls in CR1081


10165

IF Init =TRUE
THEN
(* Default Mapping ( MD ) *)
MD_KEY3_right:= 'TAB'; (* jump to next element foreward *)
MD_KEY3_left:='SHIFT_TAB'; (* jump to next element backwards *)
MD_KEY3_push:='SPACE'; (* select the element *)
(* Edit Mapping/ Edit mode ( ME )*)
ME_KEY3_UP:='UP'; (* Increment value *)
ME_KEY3_DOWN:='DOWN'; (* Decrement value *)
ME_KEY3_LEFT:='LEFT'; (* Move left on the value position *)
ME_KEY3_RIGHT:='RIGHT'; (* Move right on the value position *)
ME_KEY3_PUSH:='SPACE'; (* Take over value *)
ME_KEY1_5:= 'ESCAPE'; (* Exit edit mode *)
END_IF

134
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

6.4.4 Use of optical and acustical feedback


4300

 All operating elements are backlit withLEDs. The LEDs can be controlledin the application
program.
► Only switch those key LEDs in the program which can be sensibly actuated in the
current screen.
 For all keys currently without function:
► Switch off keys LEDs in the program.
 Request to press a certain key:
► Programm the key LED so that it flashes.
 Night design of the operating elements:
 The LEDs for alle operating elements are dimmable.
 For operating at night the LEDs have ONE adjustable basic brightness for all operating
elements. So the operating elements are also backlit if the key LEDs were not switched
on.

>

Control status LED and key LEDs


19917

To generate an optical feedback indicating, which key can be used for user input, the programmer can
use the key LEDs. The following options are available:

Option Functions Reference


System flags  seperately enable/disable key LEDs → System flags: function keys (→ page 349)
 set night mode for key LEDs → System flags: navigation keys (→ page 350)
 set brightness of key LEDs in night mode → System flags: Status LED (→ page 348)
 set colour of status LED
 set flashing frequency of status LED

>

Control buzzer
11543

To generate an acoustical feedback indicating user inputs, the programmer can use the
device-internal buzzer. The following options are available:

Option Functions Reference


ifm POUs  set tone pitch of the buzzer signal → Function elements: Control LED + buzzer
 genrate continuous tone (→ page 193)
 generate click on key contact

135
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

6.4.5 Install fonts (true type fonts)


10072

The character sets supplied by the factory (fonts) are not sufficient for all applications. Here we show
you the example "Cyrillic" to learn how to add more character sets.

NOTICE
If after the installation of large fonts (e.g. Chinese fonts) a device with a CODESYS application is
restarted, the watchdog may be activated!
Reason: It takes some seconds until the new font is initialised.
► Start the device once in the setup mode (→ Enter the setup mode (→ page 39)).

The CR1201 only supports true type fonts!

► Install new font on the PC/laptop (→ Operating instructions operating system).


► Install new font on the device (→ Fonts: Load the font (→ page 73)).
► All font files must have the file attribute "executable". This can normally be carried out with the
FTP programs.
► Reboot the device to activate a new font
► In CODESYS use the corresponding font as shown below:

136
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use visualisations

>

Symbol files
14522

The unit is factory preset with the ISO symbols. An overview and explanations of the installed symbols
is given in the file ifm_iso-documentation.pdf (→ ecomatmobile DVD "Software, tools and
documentation" or on your hard disk in the CODESYS installation directory
Targets\ifm\Library\Fonts\ifm_ISO.
Example: ifm_iso_f.ttf

137
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use of touch screen functions

>

6.5 Use of touch screen functions


14046
>

6.5.1 General notes


14047

Note the following for the programming of touch screen functions.

 The sensitivity of the touch screen is reduced towards the edges.


► Position the graphical operating elements as central as possible on the touch screen!
 The device has no multitouch function!
 The use of touch operating elements is not suitable for the control of critical functions
(e.g. motor start/stop).
► Use the mechanical keys for the implementation of critical functions!
 The touch screen provides no mechanical feedback when a graphical operating element
has been activated (e.g. button). Therefore, the operator might not know if his input has
been successful.
► Use visual feedback for graphical operating elements (→ Use visual feedback (→ page
140))!
 Unfavourable light incidence and soiling of the screen surface might affect the
perceptibility of the graphical operating elements.
► Touch operating elements must be sufficiently dimensioned!
► Use a clearly readable font in a sufficient font size for labelling the touch operating
elements.

>

6.5.2 Process touch screen inputs


14050

Operation of the touch screen can be programmed in CODESYS with standard input functions or via
PLC code.
The following table compares the two methods.

Criterion Control of the touch screen operation via

CODESYS standard input function PLC code

Flexibility Programmer is bound to defined functions Flexible interaction between user interface and
application program possible

Response time to input Fast reaction of the visualisation because Response time bound to PLC cycle
event-based processing irrespective of the PLC
cycle
Programming Low; simple creation of user interfaces Increased programming complexity
complexity
suitable for All groups of users Experienced programmers

138
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use of touch screen functions

>

Input functions for touch screens


14054

CODESYS offers different input functions to define how elements of the graphical user interface (e.g.
buttons) react to actuation of the touch screen.
To access the input functions in CODESYS:
1 Preperations
► Create/open CODESYS project.
► Create new visualisation and create a new object (→ Create visualisation (→ page 131))
2 Configure input function
► Selelct created object.
► Select [Extras] > [Configure].
> The [Regular Element Configuration] window appears.
► Select the [Input] item in the [Category] field.
> [Input] group shows options for input configuration:
Option Description Possible values
[Toggle variable] The state of the Boolean variable is = function disabled
changed when the visualisation object is
touched (= switch mode) = function enabled

[Tap variable] The state of the Boolean variable is = function disabled


changed when the visualisation object is
touched. When releasing the = function enabled
visualisation object, the variable changes
to it's former state (= momentary switch
mode)
 [Tap FALSE] Define value of the boolean variable = positive edge (FALSE  TRUE)
when object is touched
= negative edge (TRUE  FALSE)

[Zoom to vis.] The application changes to the indicated = function disabled


visualisation when the visualisation
object is touched. = function enabled

[Execute program] An indicated command / indicated = function disabled


command sequence is carried out when
the visualisation object is touched = function enabled

[Text input of variable The element activated in the list box = function disabled
'Textdisplay'] appears when the visualisation object is
touched. The value will be written into the = function enabled
varibale defined in the category
[Variables] > [Textdisplay]
List Selection of input element [Text] = input field
[Numpad] = Number pad
[Keypad] = On-screen keyboard (German key
assignment)

Detailed information about configuration options: → CODESYS documentation

► Enable reuqested functions.


► Use [OK] to confirm the input and close the window.
>

139
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use of touch screen functions

Characteristics of the pressure point


14431

To get an feedback from the system in case the display is getting touched, the programmer can use
the global data structure PointOfContact. It provides the following functions:

Variable Funktion
PointOfContact.AfterGlow Show/hide pressure point

PointOfContact.X Show X coordinate of the current pressure point


PointOfContact.Y Show Y coordinate of the current pressure point

PointOfContact.ImagePath Link pressure point to an image file

PointOfContact.Overlap Set the behaviour of pressure point and mouse pointer

Detailed information: → PointOfContact (→ page 225)

>

6.5.3 Use visual feedback


14051

CODESYS offers the following options to create visual feedback for graphical operating elements:

Option Description
Input element "button" The appearance of the button automatically changes when the button is activated or
deactivated. The programmer does not have to make additional settings.
Change between two bitmaps 2 different bitmaps exist for each condition (activated, deactivated) of an input element.
Both graphics are positioned congruently on 2 visualisation levels. When the operating
element is activated, the bitmap graphics is switched to invisible for the inactive
condition.
Touch event on bitmap A touch event triggers a reaction when the input element is activated.
Change of the frame colour The input element has a frame. When deactivated, the frame is colourless or in neutral
colours. The frame colour changes when the frame is activated.

140
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Use of touch screen functions

>

6.5.4 Calibration of the touch screen


14432

To be able to calibrate the touch screen from a PLC application, carry out the following changes in the
CODESYS project:
1 Create visualisati→ page
► Open / Create a project.
► Create an empty visualisati→ page with the designation TOUCHCALIBRATION (→ Create
visualisation (→ page 131))
2 Insert control code in PLC application
► Define a condition for access to the visualisati→ page TOUCHCALIBRATION.
► Define the visualisati→ page which will be opened after successful calibration.
► Define the condition for the cancellation of the calibration process (e.g. change to the
visualisati→ page y when the function x is pressed)

Notes on use:
The calibration process is automatically started when the operator opens the visualisati→ page
TOUCHCALIBRATION.
► Follow the instructions on the screen (→ Setup: Calibrate the touchscreen (→ page 75))!
> When the calibration process is cancelled: The values of the last successful calibration apply.
> When the calibration process has been successfully completed: The touch screen is
recalibrated.

The calibration process can only be cancelled as long as the operator has not yet touched the
last cross in the centre of the screen!
The new values apply immediately upon completion of the calibration process! It is not
necessary to reboot the device.

141
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

6.6 Install and set up mobile camera

Setup and operate Ethernet cameras ..................................................................................................143


Setup and operate analogue cameras .................................................................................................147
14479

142
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

6.6.1 Setup and operate Ethernet cameras


9320
>

Insert an Ethernet camera image in a CODESYS project


9321

1 Create visualisation
► Open CODESYS project.
► In the Object Organizer, select the [Visualizations] tab
► Create a new visualisation object.
> The drawing area appears.
2 Insert placeholder for camera image
► Select [Insert] > [Bitmap].
► Drag out the contour of the planned camera image on the drawing area.
> The [Open] window appears.
► Select the file camera.bmp in the subdirectory ..\targets\ifm\library\bmp_ng.
> The placeholder graphic is inserted into the drawing area.
> Press [OK] to close the window.
3 Set size and position of the camera image
► Select [Extras] > [Elementlist...].
> [Element list] window appears.
► Select the requested image.
► Under [Position] enter the following values:
Parameter Description Possible values
X X coordinate of the upper left corner of the image i.e. 290
Y Y coordinate of the upper left corner of the image i.e. 220
Width Width of the displayed image (in pixels) recommended: 320
max.: 640

Height Height of the displayed image (in pixels) recommended: 240


max: 480

Image resolutions that are in the range between recommended and maximum image
resolution or above the maximum image resolution, cause a high CPU load.
► Avoid to set such values!
Only the visible area of the display can be used for the camera image (→ datasheet,
resoltution of the display). Images outside this area (in the non-visible area) are ignored.
Instead the image is represented at the last valid position. If there was no valid position, NO
image is represented.

► Press [OK] to apply the entered values and close the window.

143
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

Configure the camera bitmap in the dialogue [Bitmap Configuration]


9600

To configure the created camera image:


>

1 Open the configuration dialogue


► Open the visualisati→ page with placeholder graphic.
► Double click on placeholder graphic
> The window [Bitmap Configuration] appears.
► To configure the camera image, set the following variables and parameters as requested.

The variables entered must be declared. Afterwards they can be used for programming
the application.

2 Set the IP address of the Ethernet camera


► In the category [Text] set the following parameters as requested:
Parameter Description / data type Possible values

[Content] IP address of the Ethernet camera e.g. 192.168.83.83


→ Operating instructions of the
camera
>

3 Rotate the camera image


► In the category [Motion absolute] set the following parameter as requested:
Parameter Description / data type Possible values
[Angle]  Rotate the camera image e.g. PLC_PRG.camangle
 INT type variable 0 = no rotation *
(input) 90 = rotate by 90°
180 = rotate by 180°
270 = rotate by 270°
* ... default value which is also applied in case of a not defined variable
>

4 Indicate the failure of an Ethernet camera


► In the category [Variables] set the following parameter as requested:
Parameter Description / data type Possible values
[Input disable]  Display status message of the e.g. PLC_PRG.connect
Ethernet camera FALSE = Ethernet camera failure
 boolean type variable (output) TRUE = Ethernet camera active
>

5 Switch between colour and greyscale representation


► In the category [Variables] set the following parameter as requested:
Parameter Description / data type Possible values
[Change color]  Switching between colour and e.g. PLC_PRG.grey
greyscale representation of the FALSE = 8 bit greyscale
camera image TRUE = RGB555 *
 Boolean type variable (input)
* ... default value which is also applied in case of a not defined variable

>

144
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

6 Mirror the camera image at its horizontal axis


► In the category [Variablen] set the following parameter as requested:
Parameter Description / data type Possible values

[Umrechnungsbasis]  Mirror the camera at its e.g. PLC_PRG.mirror


horizontal axis FALSE = do not mirror the image *
 Boolean type variable TRUE = mirror the image
(input)
* ... default value which is also applied in case of a not defined variable
>

7 Switch the camera on/off


► In the category [Variables] set the following parameter as requested:
Parameter Description / data type Possible values

[Conversion factor]  Program the switching on and e.g. PLG_PRG.enable


off of the camera FALSE = switch off the camera
 Boolean type variable (input) TRUE = switch on the camera

► Observe the note!


→ Use of the Ethernet camera image in CODESYS (→ page 146)

>

8 Provide error messages of the camera


► In the category [Variables] set the following parameter as requested:
Parameter Description / data type Possible values
[Tooltipdisplay]  Providing error messages of the e.g. PLG_PRG.ErrorMessage
connected camera possible error messages: → Table
 STRING type variable (output)

> The following error messages may occur:


Error message Cause Remedy
camera not found The IP address of the camera is Check the settings of the camera
not correct → Set the IP address of the Ethernet camera (→ page
144)
camera not found No connection between the Check the connection between the camera and
camera and the device the device
: If there is already a connection between the
camera and the device, a connection loss via the
variable in the field [Eingabe deaktivieren] is
displayed
→ Indicate the failure of an Ethernet camera (→ page
144)
invalid target area The camera image is not Check the settings of the camera
completely in the visible area of → Insert an Ethernet camera image in a CODESYS
the display project (→ page 143)
invalid rotation angle The indicated angle of rotation is  Check the settings of the camera
invalid → Rotate the camera image (→ page 144)
 valid angles: 0°, 90°, 180° and 270°
framebuffer error or During the setup of the Ethernet Set the boolean variable for switching the
plane already used camera an analogue camera is Ethernet camera on and off to FALSE
exclusively already running in the overlay → Switch the camera on/off (→ page 145)
mode (the Ethernet camera is not
switched on)

145
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

9 Save changed values


► Press [OK] to apply the entered values and close the window.
>

Use of the Ethernet camera image in CODESYS


9585

Switch-off the camera at page change:


Manually:
► Switch off cameras in the visualisation BEFORE a page switch is started. Otherwise, the
old camera image stays visible in the new page.
► Do not switch on the requested cameras until the new visualisation is displayed.
Automatic:
► Use globale variable CamsOffOnPageSwitch to autoatically switch off the camera when a
page switch is started (→ CamsOffOnPageSwitch (→ page 173)).

Only the visible area of the display can be used for the camera image (→ datasheet,
resoltution of the display). Images outside this area (in the non-visible area) are ignored.
Instead the image is represented at the last valid position. If there was no valid position, NO
image is represented.

146
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

6.6.2 Setup and operate analogue cameras


9588
>

Display options for analogue cameras


11733

Analogue cameras provide the following features:

System standard Number of image lines Number of image colums Aspect ratio
PAL 720 576 5:4
NTSC 720 480 3:2

The CR1201 supports the following display modes for analog cameras:

Capture mode Overlay mode


Description The image can only be represented as a  A section of the image can be represented up to
whole. max. 100 % of the original image.
 The centre of the image section is identical with the
centre of the original image.
Scalability Any scaling of the image is possible. The image cannot be scaled.
Scaling behaviour Any scaling of the aspect ratio is The image is represented in the original aspect ratio.
possible.
The image representation may be
distorted.
Frame rate Low frame rate High frame rate
Reason: long processing time!

Place the camera image only in the visible area of the display (datasheet, display resolution)!
Images outside the visible area will be ignored.

147
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

Example: Capture mode


9589

The original image can only be scaled in any manner as full-size image, also asymmetrically.

Original image:

Compressed image: Streched image:

148
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

Example: Overlay mode


9560

The image cannot be scaled.


The centre of the image section is identical with the centre of the original image.

Original image:

Image section 1: Image section 2:

149
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

Insert an analogue camera image in a CODESYS project


9601

1 Create visualisation
► Open CODESYS project.
► In the Object Organizer, select the [Visualizations] tab
► Create a new visualisation object.
> The drawing area appears.
2 Insert placeholder for camera image
► Select [Insert] > [Bitmap].
► Drag out the contour of the planned camera image on the drawing area.
> The [Open] window appears.
► Select the file camera.bmp in the subdirectory ..\targets\ifm\library\bmp_ng.
> The placeholder graphic is inserted into the drawing area.
> Press [OK] to close the window.
3 Set size and position of the camera image
► Select [Extras] > [Elementlist...].
> [Element list] window appears.
► Select the requested image.
► Under [Position] enter the following values:
Parameter Description Possible values
X X coordinate of the upper left corner of the image e.g. 290
Y Y coordinate of the upper left corner of the image e.g. 220
Width Width of the displayed image (in pixels) recommended (PAL): 360
max.: 720

Height Height of the displayed image (in pixels) recommended (PAL): 288
max: 576

Image resolutions that are in the range between recommended and maximum image
resolution or above the maximum image resolution, cause a high CPU load.
► Avoid to set such values!
Only the visible area of the display can be used for the camera image (→ datasheet,
resoltution of the display). Positions outside this area (in the non-visible area) are ignored.

► Press [OK] to apply the entered values and close the window.

150
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

Configure camera image


8653

To configure the created camera image:


>

1 Open the configuration dialogue


► Open the visualisati→ page with placeholder graphic.
► Double click on placeholder graphic
> The window [Bitmap Configuration] appears.
► To configure the camera image, set the following variables and parameters as requested.

The variables entered must be declared. Afterwards they can be used for programming
the application.

>

2 Select analogue camera


► In the category [Text] set the following parameters as requested:
Parameter Description / data type Possible values
[Content] Select camera Camera0 = 1st analogue camera
Camera1 = 2nd analogue camera

► Use lower-case and upper-case letters when entering the parameter values!

3 Set the display mode


► In the category [Variables] set the following parameter as requested:
Parameter Description / data type Possible values
[Change color]  Switching between capture e.g. PLC_PRG.CamMode
mode and detail mode FALSE = capture mode
 Boolean type variable (input) TRUE = overlay mode
>

4 Mirror the camera image at its horizontal axis


► In the category [Variables] set the following parameter as requested:
Parameter Description / data type Possible values

[Coversion base]  Mirror the camera at its e.g. PLC_PRG.mirror


horizontal axis FALSE = do not mirror the image *
 Boolean type variable (input) TRUE = mirror the image
* ... default value which is also applied in case of a not defined variable

Parameter only available in the capture mode!

>

151
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

5 Rotate the camera image


► In the category [Motion absolute] set the following parameter as requested:
Parameter Description / data type Possible values

[Angle]  Rotate the camera image e.g. PLC_PRG.camangle


 INT type variable (input) 0 = no rotation *
90 = rotate by 90°
180 = rotate by 180°
270 = rotate by 270°
* ... default value which is also applied in case of a not defined variable

The rotation function is only available in the capture mode!


The rotation of the camera image causes a high CPU load which leads to a lower frame rate
and a poorer image quality.

>

6 Provide error messages of the camera


► In the category [Variables] set the following parameter as requested:
Parameter Description / data type Possible values
[Tooltipdisplay]  Providing error messages of the e.g. PLG_PRG.ErrorMessage
connected camera possible error messages: → Table
 STRING type variable
(output)

> The following error messages may occur:


Error message Cause Remedy

invalid target area The camera image is not completely Check the settings of the camera
in the visible area of the display → Insert an analogue camera image in a CODESYS
project (→ page 150)
invalid rotation angle The indicated angle of rotation is  Check the settings of the camera
invalid → Rotate the camera image (→ page 151)
 valid angles: 0°, 90°, 180° and 270°
framebuffer or plane During setup of the analogue Set the boolean variable for switching the analogue
can't be used camera an Ethernet camera is camera on and off to FALSE
exclusively already running in the overlay mode → Switch the camera on/off (→ page 145)
(the analogue camera is not
switched on)

>

7 Save changed values


► Press [OK] to apply the entered values and close the window.

152
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Programming Install and set up mobile camera

>

Use the analogue camera image in CODESYS


9738

Switch-off the camera at page change:


Manually:
► Switch off cameras in the visualisation BEFORE a page switch is started. Otherwise, the
old camera image stays visible in the new page.
► Do not switch on the requested cameras until the new visualisation is displayed.
Automatic:
► Use globale variable CamsOffOnPageSwitch to autoatically switch off the camera when a
page switch is started (→ CamsOffOnPageSwitch (→ page 173)).

Only the visible area of the display can be used for the camera image (→ datasheet,
resoltution of the display). Positions outside this area (in the non-visible area) are ignored.

153
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements Install and set up mobile camera

7 ifm function elements

ifm libraries for the device CR1201 ......................................................................................................155


ifm function elements for the device CR1201.......................................................................................164
18588

All CODESYS function elements (FBs, PRGs, FUNs) are stored in libraries. Below you will find a list of
all the ifm libraries you can use with this device.
This is followed by a description of the function elements, sorted by topic.

154
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

>

7.1 ifm libraries for the device CR1201

Library ifm_CR1201_Vxxyyzz.LIB ........................................................................................................156


Library ifm_PDMng_util_Vxxyyzz.LIB ..................................................................................................157
Library ifm_PDM360NG_special_V02yyzz.LIB ....................................................................................157
Library ifm_PDM360NG_linux_syscall_asynch_V02yyzz.LIB .............................................................158
Library ifm_PDM360NG_USB_Vxxyyzz.lib ..........................................................................................158
Library ifm_PDM360NG_USB_LL_V02yyzz.LIB ..................................................................................159
Library ifm_PDM_input_V01yyzz.LIB ...................................................................................................159
Library ifm_RAWCan_NT_Vxxyyzz.LIB ...............................................................................................160
Library ifm_CANopen_NT_Vxxyyzz.LIB ...............................................................................................161
Library ifm_J1939_NT_Vxxyyzz.LIB ....................................................................................................162
Library ifm_NetVarLib_NT_Vxxyyzz.LIB ..............................................................................................163
14235
Legend for ..._Vxxyyzz.LIB:
V version
xx: 00...99 target version number
yy: 00...99 release number
zz: 00...99 patch number

Here you will find a list of the ifm function elements matching this device, sorted according to the
CODESYS libraries.

155
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

>

7.1.1 Library ifm_CR1201_Vxxyyzz.LIB


18536

This is the device library.


This ifm library contains the following elements:
Element Type Short description
FOCUSED_ELEMENT (→ page GV contains the ID of the visualisation object, that has the focus
200)
CURSOR_POSITION (→ page 201) GV contains position of the cursor in alphanumerical input elements (e.g. numpad )
FocusFrameImagePath (→ page GV contains the directora path to the user-defined focus frame image
202)
OverlayVisu (→ page 205) GV contains the designation of the defined overlay visu page
CurrentVisuDisplayed (→ page GV contains the designation of the currently displayed visu page
206)
PointOfContact (→ page 225) GV contains the coordinates of the pressure point on the touch screen and
configuration options for visual feedback
TouchScreenDisable (→ page GV enables/disables the touch screen function of the device
172)
CamsOffOnPageSwitch (→ page GV enables/disables the automatic switch off of the camera at page switch
173)
KEY_MAPPING (→ page 174) GV contains key assignment of system flags with character strings

BUZZER_CLICK (→ page 194) FUN generate acoustic signal using device-internal buzzer
BUZZER_ON (→ page 195) FB generate tone using devcie-internal buzzer
GET_DEVICE_SERIAL (→ page FB read serial number of the device
176)
GET_ETHERNET (→ page 177) FB read IP parameters of the Ethernet interface
GET_VERSIONS (→ page 179) FB read release numbers of the software components of the device
INPUT (→ page 166) FB set the operating mode of the input channel
KEY_CLICK (→ page 196) FB generate click when key is pressed
LOAD_SPLASH_SCREEN (→ page FB define splash screen image
171)
SET_BOOTUP_BACKLIGHT FUN set brightness of the display
(→ page 170)
SET_ETHERNET (→ page 168) FB set IP parameters of the Ethernet interface
Legend:
GV ... Global variable
FB ... Function block
FUN ... Function
PRG ... Program

156
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

>

7.1.2 Library ifm_PDMng_util_Vxxyyzz.LIB


15819

This ifm library contains the following elements:


Element Type Short description
SPEED_UP_VISU_TASK (→ page FB accelerates the visualisation process of the device
199)
NORM_DINT (→ page 182) FB normalises a value within defined limits to a value with new limits
NORM_REAL (→ page 183) FB normalises a value within defined limits to a value with new limits
TOGGLE (→ page 184) FB enables the setting and resetting of a Boolean variable via only one input bit
INIT_DATA_MEMORY FB mounts the NAND flash memory into the file system of the device
PDM_PAGECONTROL PRG controls the opening of certain visualisati→ pages
VERSION (→ page 227) PRG indicates the version and history of the library in the comment of the function
element
Legend:
GV ... Global variable
FB ... Function block
FUN ... Function
PRG ... Program

7.1.3 Library ifm_PDM360NG_special_V02yyzz.LIB


18577

This ifm library contains the following elements:


Element Type Short description
EXITPLC_START_APPLICATION FUN calls the appliclation indicated at input APPLICATION directly from the running
(→ page 228) control program
Legend:
GV ... Global variable
FB ... Function block
FUN ... Function
PRG ... Program

157
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

>

7.1.4 Library ifm_PDM360NG_linux_syscall_asynch_V02yyzz.LIB


18579

This ifm library contains the following elements:


Element Type Short description
SYSTEM_ASYNCH (→ page 229) FB sends any command to the Linux operating system (max. 255 characters)
Legend:
GV ... Global variable
FB ... Function block
FUN ... Function
PRG ... Program

>

7.1.5 Library ifm_PDM360NG_USB_Vxxyyzz.lib


19936

This ifm library contains the following elements:


Element Type Short description

USB_STORAGE_MANAGER FB manages USB memory connected to USB interface of the device


(→ page 186)
USB_STORAGE_REMOVE (→ page FUN umounts an USB memory from the device
188)
COPY_PDM_TO_USB (→ page PRG copies a file from the device to the connected USB memory
189)
COPY_USB_TO_PDM (→ page PRG copies a file from the connected USB memory to the device
190)
USB_STORAGE_HANDLER PRG manages a USB memory
(→ page 191)

Legend:
GV ... Global variable
FB ... Function block
FUN ... Function
PRG ... Program

158
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

>

7.1.6 Library ifm_PDM360NG_USB_LL_V02yyzz.LIB


18578

ifm_PDM360NG_USB_LL_Vxxyyzz.LIB is an internal library. The librarys functions can only


be accressed indirectly through other CODESYS functions!
► Don't use the functions of the library in a IEC application!

>

7.1.7 Library ifm_PDM_input_V01yyzz.LIB


19920

This ifm library contains the following elements:


Element Type Short description

INIT_VAR_RETAIN_DINT (→ page FB initialises the array of DINT with remanent input values
218)
INIT_VAR_RETAIN_INT (→ page FB initialises the array of INT with remanent input values
220)
INIT_VAR_RETAIN_REAL (→ page FB initialises the array of REAL with remanent input values
222)
INPUT_DINT (→ page 207) FB input box for DINT values
INPUT_INT (→ page 210) FB input box for INT values
INPUT_REAL (→ page 215) FB input box for REAL values
Legend:
GV ... Global variable
FB ... Function block
FUN ... Function
PRG ... Program

159
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

>

7.1.8 Library ifm_RAWCan_NT_Vxxyyzz.LIB


14715

This ifm library contains the following function blocks:


Function element Short description
CAN_ENABLE (→ page 232) Initialises the indicated CAN interface
Configures the CAN baud rate
CAN_RECOVER (→ page 233) Activate / deactivate the automatic bus off handling
Restart the CAN interface in case of bus off
CAN_REMOTE_REQUEST (→ page 254) Send a corresponding request and return the response of the other device as a result
CAN_REMOTE_RESPONSE (→ page 256) Provides data to the CAN controller in the device which is automatically sent as a response to
the request of a remote message
CAN_RX (→ page 238) Configures a data receive object and reads out the receive buffer of the data object
CAN_RX_ENH (→ page 239) • Configures a data receive object and reads out the receive buffer of the data object
• Frame type and mask can be selected
CAN_RX_ENH_FIFO (→ page 241) • Configures a data receive object and reads out the receive buffer of the data object
• Frame type and mask can be selected
• Several CAN messages per cycle possible
CAN_RX_RANGE (→ page 243) • Configures a range of data receive objects and reads out the receive buffer of the data objects
• Frame type and mask can be selected
CAN_RX_RANGE_FIFO (→ page 245) • Configures a range of data receive objects and reads out the receive buffer of the data objects
• Frame type and mask can be selected
• Several CAN messages per cycle possible
CAN_SETDOWNLOADID (→ page 234) = Set CAN download ID
Sets the download identifier for the CAN interface
CAN_STATUS (→ page 235) Get status information on the CAN bus selected:
BAUDRATE, DOWNLOAD_ID, BUSOFF, WARNING_RX, WARNING_TX, VERSION,
BUSLOAD
and reset if required: BUSOFF, WARNING_RX, WARNING_TX
CAN_TX (→ page 248) Transfers a CAN data object (message) to the configured CAN interface for transmission at each
call
CAN_TX_ENH (→ page 249) Transfers a CAN data object (message) to the configured CAN interface for transmission at each
call
CAN-specific characteristics can be set
CAN_TX_ENH_CYCLIC (→ page 251) Cyclically transfers a CAN data object (message) to the configured CAN interface for
transmission
CAN-specific characteristics can be set

160
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

>

7.1.9 Library ifm_CANopen_NT_Vxxyyzz.LIB


14914

This ifm library contains the following function blocks:


Function element Short description
CANOPEN_ENABLE (→ page 260) Initialises the indicated CANopen master interface
Configures the CAN baud rate
CANOPEN_GETBUFFERFLAGS (→ page 262) = CANopen get buffer flags
Provides information on the buffer flags
The flags can be reset via the optional inputs.
CANOPEN_GETEMCYMESSAGES (→ page 300) = Get CANopen emergency messages
Lists all emergency messages that have been received by the controller from other nodes in the
network since the last deletion of messages
The list can be reset by setting the according input.
CANOPEN_GETERRORREGISTER (→ page 302) = Get CANopen error register
Reads the error registers 0x1001 and 0x1003 from the controller
The registers can be reset by setting the respective inputs.
CANOPEN_GETGUARDHBERRLIST (→ page 295) = get CANopen guard and heartbeat error list
Lists all nodes in an array for which the master has detected an error:
guarding error, heartbeat error
The list can be reset by setting the according input.
CANOPEN_GETGUARDHBSTATSLV (→ page 297) = CANopen slave get guard and heartbeat state
Signals the following states to the controller in slave operation:
node guarding monitoring, heartbeat monitoring
The signalled errors can be reset by setting the respective input.
CANOPEN_GETNMTSTATESLAVE (→ page 269) = CANopen slave get network management state
Signals the network operating status of the node
CANOPEN_GETODCHANGEDFLAG (→ page 273) = Get object directory changed flag
Reports any change of value for a particular object directory entry
CANOPEN_GETSTATE (→ page 264) = CANopen set state
Request the parameters of the master, a slave device or a specific node in the network
CANOPEN_GETSYNCSTATE (→ page 291) = CANopen get SYNC state
• Reads the setting of the SYNC functionality (active / not active),
• reads the error state of the SYNC functionality (SyncError)
CANOPEN_NMTSERVICES (→ page 270) = CANopen network management services
Updates the internal node status
and, depending on the NMT command entries:
• triggers an NMT command or
• triggers the initialisation of a node
CANOPEN_READOBJECTDICT (→ page 274) = CANopen read object directory
Reads configuration data from the object directory of the device
CANOPEN_SDOREAD (→ page 278) = CANopen read SDO
Reads an "Expedited SDO" = Expedited Service Data Object
CANOPEN_SDOREADBLOCK (→ page 280) = CANopen read SDO block
Reads the indicated entry in the object directory of a node in the network via SDO block transfer
CANOPEN_SDOREADMULTI (→ page 282) = CANopen read SDO multi
Reads the indicated entry in the object directory of a node in the network
CANOPEN_SDOWRITE (→ page 284) = SDO write
Writes an "Expedited SDO" = Expedited Service Data Object
CANOPEN_SDOWRITEBLOCK (→ page 286) = CANopen write SDO block
Writes in the indicated entry in the object directory of a node in the network via SDO block
transfer
CANOPEN_SDOWRITEMULTI (→ page 288) = CANopen write SDO multi
Writes in the indicated entry in the object directory of a node in the network

161
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

Function element Short description


CANOPEN_SENDEMCYMESSAGE (→ page 304) = CANopen send emergency message
Sends an EMCY message. The message is assembled from the according parameters and
entered in register 0x1003
CANOPEN_SETSTATE (→ page 266) = CANopen set state
Set the parameters of the master, a slave device or a specific node in the network
CANOPEN_SETSYNCSTATE (→ page 293) = CANopen set SYNC state
Switch the SYNC functionality on and off
CANOPEN_WRITEOBJECTDICT (→ page 275) = CANopen write object directory
Writes configuration data into the object directory of the device

>

7.1.10 Library ifm_J1939_NT_Vxxyyzz.LIB


14912

This ifm library contains the following function blocks:


Function element Short description
J1939_DM1RX (→ page 334) J1939 Diagnostic Message 1 RX
Receives diagnostic messages DM1 or DM2 from other ECUs
J1939_DM1TX (→ page 336) J1939 Diagnostic Message 1 TX
Transmit an active error message to the CAN stack
J1939_DM1TX_CFG (→ page 339) J1939 Diagnostic Message 1 TX configurable
CAN stack does not send cyclic DM1 "zero active faults" messages
J1939_DM3TX (→ page 341) J1939 Diagnostic Message 3 TX
Deletes inactive DTCs (DM2) on a device
J1939_ENABLE (→ page 308) Initialises the J1939 stack
J1939_GETDABYNAME (→ page 310) = Get destination arbitrary name
Determine the target address of one or several participants by means of the name information
J1939_NAME (→ page 312) Give the device a name for identification in the network
J1939_RX (→ page 321) Receives a single frame message
Shows the message last read on the CAN bus
J1939_RX_FIFO (→ page 322) = J1939 RX with FIFO
Receives all specific messages and successively reads them from a FiFo
J1939_RX_MULTI (→ page 324) = J1939 RX multiframe message
Receives multiframe messages
J1939_SPEC_REQ (→ page 316) = J1939 specific request
Requests and receives a specific message from another controller
J1939_SPEC_REQ_MULTI (→ page 318) = J1939 specific request multiframe message
Requests and receives a specific multiframe message from another controller
J1939_STATUS (→ page 314) Shows relevant information on the J1939 stack
J1939_TX (→ page 326) Sends individual single frame messages
J1939_TX_ENH (→ page 327) = J1939 TX enhanced
Sends individual single frame messages
Can also be set: transmission priority, data length
J1939_TX_ENH_CYCLIC (→ page 329) = J1939 TX enhanced cyclic
Cyclically sends single frame messages
Can also be set: transmission priority, data length, period
J1939_TX_ENH_MULTI (→ page 331) = J1939 TX enhanced Multiframe Message
Sends individual multiframe messages

>

162
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm libraries for the device CR1201

7.1.11 Library ifm_NetVarLib_NT_Vxxyyzz.LIB


14915

ifm_NetVarLib_NT_Vxxyyzz.LIB is an internal library. The librarys functions can only be


accressed indirectly through other CODESYS functions!
► Don't use the functions of the library in a IEC application!

163
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2 ifm function elements for the device CR1201

POUs: Setup the device .......................................................................................................................165


POUs: Read device information ...........................................................................................................175
POUs: Adjust analouge and digital values ...........................................................................................181
POUs: Manage, read and write the USB memory device ....................................................................185
Function elements: Control LED + buzzer ...........................................................................................193
POUs: Manage visualisation ................................................................................................................198
POUs: Use touch screen functions ......................................................................................................224
POUs: Help functions ...........................................................................................................................226
Function elements: RAW-CAN (Layer 2) .............................................................................................230
Function elements: CANopen ..............................................................................................................258
Function elements: SAE J1939 ............................................................................................................306
13988
3826

Here you will find the description of the ifm function elements suitable for this device, sorted by topic.

164
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.1 POUs: Setup the device

INPUT ...................................................................................................................................................166
SET_ETHERNET .................................................................................................................................168
SET_BOOTUP_BACKLIGHT ...............................................................................................................170
LOAD_SPLASH_SCREEN...................................................................................................................171
TouchScreenDisable ............................................................................................................................172
CamsOffOnPageSwitch........................................................................................................................173
KEY_MAPPING ....................................................................................................................................174
8566

Here you find units for the setup of the device from a CODESYS application.

165
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

INPUT
9673

Unit type = function block (FB)


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
14351

INPUT enables determining the state at the input channels (→ data sheet). The FB provides the
current state at the selected channel.
The measurement and the output value result from the operating mode indicated via MODE
• binary input plus switching (BL) for positive sensor signal (with/without diagnosis)
• binary input minus switching (BH) for negative sensor signal
• analogue input 0...20 mA
• analogue input 0...10 V
• analogue input ratiometric 0...32 V

Do not change the operating mode during operation!

The analogue values are provided as standardised values.


>

Parameters of the inputs


9675

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
MODE INPUT_ANALOG_MODE mode of the input channel
S  chapter Possible operating modes inputs/outputs (→ page
352)

166
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


9677

Parameter Data type Description


VALUE WORD current value or status of the input channel
RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block is active
242 F2 Error: setting is not possible

If the value 1 or 242 is provided at output RESULT, reset the input ENABLE (ENABLE =
FALSE)!

167
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

SET_ETHERNET
11681

Unit type = function block (FB)


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
11682

SET_ETHERNET sets the


 IP address
 subnet mask and
 gateway address
of the device. If input ENABLE is set to TRUE, the values on the inputs IP_ADDRESS, NETMASK and
GATEWAY are written.
>

Parameters of the inputs


11683

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
IP ADDRESS STRING(15) IP address of the device
(e.g. 192.168.82.247)
NETMASK STRING(15) Network mask of the TCP/IP network
(e.g. 255.255.255.0)
GATEWAY STRING(15) Gateway address of the TCP/IP network
(e.g. 192.168.82.1)

168
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


11684

Parameter Data type Description


RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block not yet executed
64 40 Error: Execution failed; FB is active

65 41 Error: more than one FB instance active


80 50 Error: invalid IP address
81 51 Error: invalid network mask
82 52 Error: invalid gateway address

If the value 1, 64, 65, 80, 81 or82 is provided at output RESULT, reset input ENABLE (ENABLE
= FALSE)!

169
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

SET_BOOTUP_BACKLIGHT
9681

Unit type = function (FUN) of type INT


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
9683

With the function SET_BOOTUP_BACKLIGHT the brightness of the display can be set.

NOTICE
When functions are called too frequently (FUN) the Flash memory may be destroyed.
► Call functions only if absolutely necessary!

>

Parameters of the inputs


9684

Parameter Data type Description


BACKLIGHT BYTE Display brightness (0...100 %)

>

Parameters of the outputs


9686

Parameter Data type Description


SET_BOOTUP_BACKLIGHT INT Return value of the function

Possible values for the function's reply:


Value
Description
dec | hex
001 01 Brightness of the display set successfully
242 F2 Error: setting is not possible

170
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

LOAD_SPLASH_SCREEN
14531

Unit type = function block (FB)


Unit is contained in the library ifm_CRnnn_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
14533

LOAD_SPLASH_SCREEN loads an image file from a selectable location and saves it in the flash
memory of the device. The image file will be used as splash screen after the next reboot of the device.

NOTE
Each call of the FB executes a write operation on the flash memory of the device.
► Do not call the function block cyclically in the program code!
Only one instance of the FB may be active at a time.
Observe the characteristics of the splash screen → chapter Visualisation limits (→ page 127)

>

Parameters of the inputs


14534

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
PATH_TO_SPLASH STRING (255) Path of the directory in which the image file is stored

>

Output parameters
19879

Parameter Data type Description


RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block is active
242 F2 Error: setting is not possible

If the value 1 or 242 is provided at the RESULT output, reset the ENABLE input (ENABLE =
FALSE)!
>

171
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

TouchScreenDisable
18884

Unit type = global variable (GV)of data type BOOL


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
18901

TouchScreenDisable activates/deactivates the touch screen function of screen.

Parameter Data type Possible values


TouchScreenDisable BOOL FALSE Touch screen function is enabled (default setting).
TRUE Touch screen function is disabled.

172
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CamsOffOnPageSwitch
18888

Unit type = global variable (GV)of data type BOOL


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
18894

CamsOffOnPageSwitch controls the behaviour of connected cameras in case of a visualisati→ page


switch.

Parameter Datentyp Mögliche Werte

CamsOffOnPageSwitch BOOL FALSE = The connected cameras stay switched on.


TRUE* = The connected cameras will be switched off.
* ... Default value

173
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

KEY_MAPPING
8959

Unit type = global variable (GV)of data type KM


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
8960

KEY_MAPPING contains the current key assignment with constant character strings.

174
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.2 POUs: Read device information

GET_DEVICE_SERIAL ........................................................................................................................176
GET_ETHERNET .................................................................................................................................177
GET_VERSIONS ..................................................................................................................................179
19614

175
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

GET_DEVICE_SERIAL
11695

Unit type = function block (FB)


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
11696

GET_DEVICE_SERIAL reads the serial number from the device. The current value is provided at
output SERIAL as long as the input ENABLE is set to TRUE. RESULT provides the return value of the
FB.
>

Parameters of the inputs


11697

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified

>

Parameters of the outputs


1698

Parameter Data type Description


SERIAL STRING(14) Serial number of the device (e.g.: "0412AB055")
RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – no data was received
64 40 Error: Execution failed; FB is active

65 41 Error: more than one FB instance active

If the value 1, 64 or 65 is provided at output RESULT, reset input ENABLE (ENABLE =


FALSE)!
The valied serial number is provided at output SERIAL until the output RESULT has the value
1.

176
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

GET_ETHERNET
11673

Unit type = function block (FB)


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
11674

GET_ETHERNET reads
 the IP address of the sensor
 the network mask of the TCP/IP network and
 the IP address of the gateway
and transfers them to the FB outputs IP_ADDRESS, NETMASK und GATEWAY.
>

Parameters of the inputs


11675

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed

177
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


11676

Parameter Data type Description


IP ADDRESS STRING(15) IP address of the device
(e.g. 192.168.82.247)
NETMASK STRING(15) Network mask of the TCP/IP network
(e.g. 255.255.255.0)
GATEWAY STRING(15) Gateway address of the TCP/IP network
(e.g. 192.168.82.1)
RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB is active: Function successfully executed
8 08 FB is active: Data is read
64 40 FB is active: reading of data failed
65 41 FB is active: more than one instance of the FB active

If the value 1, 64 or 65 is provided at output RESULT, reset input ENABLE (ENABLE =


FALSE)!
There are valid values at the outputs IP-ADDRESS, NETMASK and GATEWAY as long as
output RESULT has the value 1.

178
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

GET_VERSIONS
14360

Unit type = function block (FB)


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
Symbol in CODESYS:

>

Description
14362

GET_VERSIONS provides the version numbers of the following software components:


 Runtime system of the device
 Firmware of the hardware used in the device
>

Parameters of the inputs


14363

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed

179
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


14264

Parameter Data type Description


SW_VERSION STRING(80) Version of the runtime system
FW_VERSION_IO STRING(80) Firmware version input/output co-processor
FW_VERSION_WD STRING(80) Firmware version watchdog co-processor
KBD1_VERSION STRING(80) Firmware version keyboard 1
KBD2_VERSION STRING(80) Firmware version keyboard 2
KBD3_VERSION STRING(80) Firmware version keyboard 3
RESULT INT Feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB is active: Function successfully executed
8 08 FB is active: Data is read
64 40 FB is active: reading of data failed
65 41 FB is active: more than one instance of the FB active

If the value 1, 64 or 65 is provided at output RESULT, reset input ENABLE (ENABLE =


FALSE)!
Valid values are provided at the outputs SW_VERSION, FW_VERSION_IO,
FW_VERSION_WD, KBD1_VERSION, KBD2_VERSION and KBD3_VERSION until output
RESULT has the value 1.

180
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.3 POUs: Adjust analouge and digital values

NORM_DINT ........................................................................................................................................182
NORM_REAL .......................................................................................................................................183
TOGGLE ...............................................................................................................................................184
19615

181
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

NORM_DINT
13238

Unit type = function block (FB)


Unit is contained in the library ifm_PDMng_UTIL_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
3307

NORM_DINT normalises a value within defined limits to a value with new limits.
The FB normalises a value of type DINT, which is within the limits of XH and XL, to an output value
within the limits of YH and YL. This FB is for example used to generate PWM values from analogue
input values.

NOTE
► The value for X must be in the defined input range between XL and XH!
There is no internal plausibility check of the value X.
Outside this value range the output X_OUT_OF_RANGE is set.
► The result of the calculation (XH-XL)•(YH-YL) must remain in the value range of data type DINT
(-2 147 483 648...2 147 483 647)!
> Due to rounding errors the normalised value can deviate by 1.
> If the limits (XH/XL or YH/YL) are defined in an inverted manner, normalisation is also done in an
inverted manner.

>

Parameters of the inputs


3308

Parameter Data type Description


X DINT current input value
XH DINT upper limit of input value range
XL DINT lower limit of input value range
YH DINT upper limit of output value range
YL DINT lower limit of output value range

>

Parameters of the outputs


3309

Parameter Data type Description


Y DINT output value
X_OUT_OF_RANGE BOOL Error: X is beyond the limits of XH and XL

182
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

NORM_REAL
13243

Unit type = function block (FB)


Unit is contained in the library ifm_PDMng_UTIL_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
3310

NORM_REAL normalises a value within defined limits to a value with new limits.
The FB normalises a value of type REAL, which is within the limits of XH and XL, to an output value
within the limits of YH and YL. This FB is for example used to generate PWM values from analogue
input values.

NOTE
► The value for X must be in the defined input range between XL and XH!
There is no internal plausibility check of the value X.
Outside this value range the output X_OUT_OF_RANGE is set.
► The result of the calculation (XH-XL)•(YH-YL) must remain in the value range of data type REAL
(-3,402823466•1038...3,402823466•1038)!
> Due to rounding errors the normalised value can deviate by 1.
> If the limits (XH/XL or YH/YL) are defined in an inverted manner, normalisation is also done in an
inverted manner.

>

Parameters of the inputs


3311

Parameter Data type Description


X REAL Input value
XH REAL Upper limit of output value range
XL REAL Lower limit of the input value range
YH REAL Upper limit of the output value range
YL REAL Lower limit of output value range

>

Parameters of the outputs


3312

Parameter Data type Description


Y REAL Output value
X_OUT_OF_RANGE BOOL Error: X is beyond the limits of XH and XL

183
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

TOGGLE
13247

Unit type = function block (FB)


Unit is contained in the library ifm_PDMng_UTIL_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
3304

TOGGLE enables the setting and resetting of a Boolean variable via only one input bit.
The first rising edge on the input IN sets the output OUT to 'TRUE'.
The next rising edge resets the output back to 'FALSE'.
etc.
>

Parameters of the inputs


3305

Parameter Data type Description


IN BOOL edge FALSE  TRUE:
setting / resetting of the output
>

Parameters of the outputs


3306

Parameter Data type Description


OUT BOOL 1st edge on IN  TRUE
2nd edge on IN  FALSE
3rd edge on IN  TRUE ...

184
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.4 POUs: Manage, read and write the USB memory device
19599

File functions → POUs: File functions

185
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

USB_STORAGE_MANAGER
9691

Unit type = function block (FB)


Unit is contained in the library ifm_PDM360NG_USB_Vxxyyzz.Lib
Symbol in CODESYS:

>

Description
9708

USB_STORAGE_MANAGER manages USB memory devices connected to USB interface of the


device.

The FB must called only once in a application program!

The FB detects the following events:


- a USB memory device was connected
- a USB-memory device was disconnected
- Index of the detected USB memory device
The FB utilizes the variable USB_STORAGE_MANAGER_LL.
>

Parameters of the inputs


9709

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified

186
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


710

Parameter Data type Description


CHANGED BOOL An USB memory has been connected or disconnected
INSERTED BOOL An USB memory has been connected
REMOVED BOOL An USB memory has been disconnected
INDEX BYTE Index of the detected USB memory
RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
001 01 FB is active: change is detected
008 08 FB is active: USB memory is monitored
064 40 FB is active: internal fault
065 41 FB is active: FB is not executed, because another instance of this FB
is busy

187
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

USB_STORAGE_REMOVE
9711

Unit type = function (FUN) of type INT


Unit is contained in the library ifm_PDM360NG_USB_Vxxyyzz.Lib
Symbol in CODESYS:

>

Description
9713

USB_STORAGE_REMOVE safely unmounts the USB memory from the system.


► Monitor the return value of the function call by using the FB USB_STORAGE_MANAGER (→ page
186).
► If there is no value returned, the unmounting process was not successful and needs to be
repeated.
>

Parameters of the inputs


9714

Parameter Data type Description


INDEX BYTE Index of the USB memory, which is to be dismount from
the system on a safety way
>

Parameters of the outputs


9715

Parameter Data type Description


USB_STORAGE_REMOVE INT Result of the function

Possible values for the function's reply:


Value
Description
dec | hex
001 01 The dismount command is successfull sent to the USB subsystem
242 F2 Error: the setting is invalid
The dismount command is not sent

188
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

COPY_PDM_TO_USB
10098

Unit type = program (PRG)


Unit is contained in the library ifm_PDM360NG_USB_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
10100

COPY_PDM_TO_USB copies a file from the memory of the PDM to a connected USB memory device.
>

Parameters of the inputs


10101

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
COPY BOOL TRUE: rising edge of the press of a key
starts the copy process
FALSE: function element is not executed
USB_PATH STRING (80) USB path; is provided by USB_STORAGE_HANDLER
(→ page 191)
LOCAL_PATH STRING (80) Path in the PDM memory
Typical: /home or /data
LOCAL_FILE STRING (80) Filename of the file to be copied
(wildcards ? and * also allowed)
>

Parameters of the outputs


10105

Parameter Data type Description


COMMAND STRING (80) Full Linux command (for control purposes)
DONE BOOL Copy process was successful
RET_VALUE INT Linux return value (for control purposes)

189
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

COPY_USB_TO_PDM
10107

Unit type = program (PRG)


Unit is contained in the library ifm_PDM360NG_USB_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
10109

COPY_USB_TO_PDM copies a file from a connected USB memory device to the device.
>

Parameters of the inputs


10110

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
COPY BOOL TRUE: rising edge of the press of a key
starts the copy process
FALSE: function element is not executed
USB_PATH STRING (80) USB path; is provided by USB_STORAGE_HANDLER
(→ page 191)
LOCAL_PATH STRING (80) Path in the PDM memory
Typical: /home or /data
USB_FILE STRING (80) Filename of the file to be copied
(wildcards ? and * also allowed)

>

Parameters of the outputs


10105

Parameter Data type Description


COMMAND STRING (80) Full Linux command (for control purposes)
DONE BOOL Copy process was successful
RET_VALUE INT Linux return value (for control purposes)

190
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

USB_STORAGE_HANDLER
10090

Unit type = program (PRG)


Unit is contained in the library ifm_PDM360NG_USB_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
10092

USB_STORAGE_HANDLER is the main program for handling USB memory devices.


The function element can manage up to 16 USB memory devices.
>

Parameters of the inputs


10093

Parameter Data type Description


REMOVE BOOL FALSE  TRUE (edge):
prepares the active USB device for removal
FALSE: function element is not executed
SCROLL_UP BOOL FALSE  TRUE (edge):
switches to the USB device with the next higher
index
FALSE: function element is not executed
SCROLL_DOWN BOOL FALSE  TRUE (edge):
switches to the USB device with the next lower
index
FALSE: function element is not executed

191
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


10094

Parameter Data type Description


USB_PATH STRING (80) Path of the active USB device
USB_IDX BYTE Index of the active USB device (1...16)
NUMBER_USB_DEVICES WORD Number of all connected USB devices
SELECTED_DEVICE WORD Index of the selected USB device
REMOVE_RESULT INT Result of the command "remove USB device"
( following table)
USB_INSERTED BOOL TRUE: > 1 USB device connected
FALSE: no USB device connected

Possible results for REMOVE_RESULT:


Value Description
dec | hex
001 01 FB execution was finished without error - USB device is removed
242 F2 Error: Removing is not possible
Possible cause: file still open

192
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.5 Function elements: Control LED + buzzer

BUZZER_CLICK ...................................................................................................................................194
BUZZER_ON ........................................................................................................................................195
KEY_CLICK ..........................................................................................................................................196
8650

Here we show you functions to control the LED and the buzzer in this device.

193
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

BUZZER_CLICK
9651

Unit type = function (FUN) of type INT


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
9654

With BUZZER_CLICK the integrated buzzer of the device generates a click signal as soon as the
function is called. Adjustable features:
- click repetition time in [ms],
- tone pitch in [Hz].
>

Parameters of the inputs


9655

Parameter Data type Description


Tone pitch in [Hz]
FREQUENCY WORD
Permissible = 500...5 000 = 0x01F4...0x1388
DURATION TIME Click repetition time in [ms]
Permissible values: 1...10 ms

>

Parameters of the outputs


9656

Parameter Data type Description


BUZZER_CLICK INT Return value of the function

Possible values for the function's reply:


Value
Description
dec | hex
001 01 Parameters are OK
242 F2 Error: setting is not possible

194
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

BUZZER_ON
9658

Unit type = function block (FB)


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
9660

With BUZZER_ON the integrated buzzer of the device generates an adjustable tone:
- The tone duration is determined by the duration of the ENABLE signal.
- The tone pitch results from the parameter FREQUENCY.
>

Parameters of the inputs


9655

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
Tone pitch in [Hz]
FREQUENCY WORD
Permissible = 500...5 000 = 0x01F4...0x1388

>

Parameters of the outputs


9664

Parameter Data type Description


RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block is active
242 F2 Error: setting is not possible

If the value 1 or 242 is provided at output RESULT, reset the input ENABLE (ENABLE =
FALSE)!

195
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

KEY_CLICK
9667

Unit type = function block (FB)


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
9669

With KEY_CLICK the integrated buzzer of the device generates an adjustable click tone as soon as
one of the keys is pressed:
- The tone pitch results from the parameter FREQUENCY.
- The click repetition time results from the parameter DURATION.

Do not use the FB KEY_CLICK simultaneously with the autorepeat function (→ System flags
(→ page 346)).
Otherwise, the device will produce disagreeable noises.

>

Parameters of the inputs


9670

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
Tone pitch in [Hz]
FREQUENCY WORD
Permissible = 500...5 000 = 0x01F4...0x1388
DURATION TIME Click repetition time in [ms]
Permissible values: 1...10 ms

196
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


9664

Parameter Data type Description


RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block is active
242 F2 Error: setting is not possible

If the value 1 or 242 is provided at output RESULT, reset the input ENABLE (ENABLE =
FALSE)!

197
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.6 POUs: Manage visualisation

SPEED_UP_VISU_TASK.....................................................................................................................199
FOCUSED_ELEMENT .........................................................................................................................200
CURSOR_POSITION ...........................................................................................................................201
FocusFrameImagePath ........................................................................................................................202
PDM_PAGECONTROL ........................................................................................................................203
OverlayVisu ..........................................................................................................................................205
CurrentVisuDisplayed ...........................................................................................................................206
INPUT_DINT ........................................................................................................................................207
INPUT_INT ...........................................................................................................................................210
INPUT_REAL .......................................................................................................................................215
INIT_VAR_RETAIN_DINT ....................................................................................................................218
INIT_VAR_RETAIN_INT ......................................................................................................................220
INIT_VAR_RETAIN_REAL ...................................................................................................................222
8617

Here we show you function to manage visualisations.

198
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

SPEED_UP_VISU_TASK
11711

Unit type = function block (FB)


Unit is contained in the library ifm_PDMng_UTIL_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
11712

SPEED_UP_VISU_TASK accelerates the visualisation process of the PDM. This leads to a faster
change to the next page.
During the execution of the application program the FB can be activated or deactivated at any time.

The FB assigns additional CPU processing times to the visualisatoin process. Therefore there
are fewer resources available to other processes (e.g. CAN_communication, control process).
Before the FB is used, test thoroughly if the change has any negative effects on the correct
execution of the application program!

>

Parameters of the inputs


11713

Parameter Data type Description


FAST BOOL TRUE: execute this function element
FALSE: unit is not executed

>

Parameters of the outputs


11714

Parameter Data type Description


FAST_VISU BOOL Feedback if change was successful
TRUE: Acceleration mode active
FALSE: Acceleration mode not active

199
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

FOCUSED_ELEMENT
18891

Unit type = global variable (GV)of data type DINT


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
8897

FOCUSED_ELEMENT contains the ID of the visualisation objetc, which currently has the focus.

Parameter Data type Possible objects


FOCUSED_ELEMENT DINT depending on used visualisation objects

200
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CURSOR_POSITION
18890

Unit type = global variable (GV)of data type DINT


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
18896

CURSOR_POSITION contains the current position of the cursor when entering alphanumerical
charachters (e.g. numpad, on-screen keyboard).

Parameter Data type Possible values

CURSOR_POSITION DINT

201
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

FocusFrameImagePath
18892

Unit type = global variable (GV)of data type GV


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
18898

FocusFrameImagePath contains the path of the directory where the image file of the user-specific
focus frame is stored.

Parameter Data type Possible values

FocusFrameImagePath STRING[255] Directory path (max. 255 characters)


e.g. '/home/project/my_frame.png'

The image file of the focus frame must have the following characteristics:
 File format: PNG
 Transparency: The area within the frame must be saved as transparent.

202
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

PDM_PAGECONTROL
18886

Unit type = global variable (GV)of data type GV


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
3294

PDM_PAGECONTROL controls the opening of certain visualisati→ pages. In CoDeSys the


visualisati→ pages are opened and feedback is given via the system variable CurrentVisu (type
STRING[40]).
With this program it is possible to open a selected visualisati→ page or to scroll through the
visualisations step by step.
Optimum use of the program is ensured when all visualisation names correspond to the same pattern,
i.e. a combination of a basename followed by a 5-digit number (library version V04.00.07 or higher;
before: 3-digit *)).
Example BASENAME = PAGE:
Visualisation name = PAGE00001, PAGE00002, PAGE00003, etc.
For the basename 1...35 capital letters (no special characters) are allowed. The visualisations should
be numbered consecutively. The program creates the final visualisation name from the parameter
BASENAME and the number or reads the number from the current visualisation name and provides it
in the output parameter ACT_PAGE.
Instead of naming the visualisations with basename and consecutive number every visualisation can
also be named individually, e.g. SERVICE1, MOTORDATA2, CONFIGURATION3. In this case, however,
programming is more complex because basename and visualisation number must be assigned
individually. Scrolling step by step is then very restricted.
Use the letter P as BASENAME, your program is then compatible with the ifm templates.

*) Also note the new 5-digit numbering when naming your existing visualisati→ pages!
>

Parameters of the inputs


3293

Parameter Data type Description


INIT BOOL TRUE (only for 1 cycle):
Display is initialised with the initisalisation indicated in
INIT_PAGE.
FALSE: during further processing of the program
INIT_PAGE WORD visualisation number which is to be called with INIT
PAGE_UP BOOL edge FALSE  TRUE:
increments the visualisation number
PAGE_DOWN BOOL edge FALSE  TRUE:
decrements the visualisation number
PAGE_EXTERN WORD The indicated visualisati→ page is directly opened (independent of
PAGE_UP / PAGE_DOWN).
if PAGE_EXTERN = ACT_PAGE, then PAGE_EXTERN is
reset "0"!
PAGE_MAX WORD maximum number of selectable visualisati→ pages
BASENAME STRING [35] Common part of the name of the visualisati→ page
Visualisati→ pages are numbered by their names: eg. P00001. The
following applies:
• "P" = BASENAME (only capital letters!)
• "00001" = visualisation number (5 digits!)

203
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


3295

Parameter Data type Description


ACT_PAGE WORD current visualisation number

204
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

OverlayVisu
18887

Unit type = global variable (GV)of data type STRING[40]


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
18889

OverlayVisu contains the name of the visualisati→ page which is used as overlay visualisation. An
overlay visualisation overlays the active visualisati→ page.

Parameter Data type Possible values

OverlayVisu STRING[40] Designation (max. 40 characters)


e.g. "OverlayPage"

205
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CurrentVisuDisplayed
18889

Unit type = global variable (GV)of data type STRING[40]


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
18895

CurrentVisuDisplayed conatins the designation of the visualisati→ page currently displayed.

Parameter Data type Possible values

CurrentVisuDisplayed STRING[40] designation of the visualisati→ page (max. 40 characters)

206
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

INPUT_DINT
3223

Unit type = function block (FB)


Unit is contained in the library ifm_PDM_INPUT_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
3333

INPUT_DINT supports up to 6 input fields which can be assigned to 6 different objects in the
visualisation. The input objects are parameterised with the internal variables FIELD1...FIELD6,
COLOR_FIELD1...COLOR_FIELD6 and VALUE_FIELD1...VALUE_FIELD6.
The FB is an alternative to the input function integrated in CoDeSys and more flexible compared to the
CoDeSys input function.
The FB contains no visualisation elements.
>

Parameters of the inputs


3334

Parameter Data type Description


INIT BOOL TRUE (only for 1 cycle):
Sets the focus to the first input field
FALSE: during further processing of the program
ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
INIT_VALUE ARRAY [1..6] OF DINT initialisation values for the input fields for the first call
NO_OF_FIELDS BYTE number of required input fields:
value range = 1...6
MIN_MAX_ARRAY ARRAY [1..12] OF DINT defines input limits
index 1 = min. value field 1
index 2 = max. value field 1
index 3 = min. value field 2
index 4 = max. value field 2 etc.
ESC BOOL TRUE: resets the input value to the last valid value
FALSE: function element is not executed
INCREMENT BOOL edge FALSE  TRUE:
Increments the input value by the value in
INCREMENT_VALUE (or
INCREMENT_VALUE2)

207
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

Parameter Data type Description


DECREMENT BOOL edge FALSE  TRUE:
Decrements the input value by the value in
INCREMENT_VALUE (or
INCREMENT_VALUE2)
ENTER BOOL 1st edge FALSE  TRUE:
> activates input mode for the input field
> changes field colour (only color device)
> cursor flashes
2nd edge FALSE  TRUE:
> resets input mode for the input field
> writes edited values to the output variables
VALUE_FIELD1...VALUE_FIELD6
INCREMENT_VALUE DINT if KEY_INCREMENT_VALUE2 = FALSE:
The value is changed by this amount in the active input
field for INCREMENT / DECREMENT.
KEY_INCREMENT_VALUE2 BOOL TRUE: The value in the active input field is changed by
the amount in INCREMENT_VALUE2 for
INCREMENT / DECREMENT.
FALSE: The value in the active input field is changed by
the amount in INCREMENT_VALUE for
INCREMENT / DECREMENT.
INCREMENT_VALUE2 DINT if KEY_INCREMENT_VALUE2 = TRUE:
The value is changed by this amount in the active input
field for INCREMENT / DECREMENT.
CLEAR_ALL_VALUE BOOL TRUE: set all internal and external input values to 0
FALSE: function element is not executed

>

Parameters of the outputs


3335

Parameter Data type Description


INPUT_ACTIV BOOL current visualisation number

FIELDCOUNTER BYTE number of selected input field


VALUE_FIELD1 DINT
external input value, is only adopted with the 2nd rising
... DINT
edge of ENTER
VALUE_FIELD6 DINT

208
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Internal parameters
3336

Parameter Data type Description


FIELD1 DINT Sets the focus for the selected input field.
... DINT Any visualisation object can be used as a focus. The
variable FIELDx must be assigned to this object in the
FIELD6 DINT visualisation. If the input is active, FIELDx is pulsed.

COLOR_FIELD1 DINT
Sets the alarm colour of the input object (only PDM color).
... DINT
The variable must be assigned in the visualisation.
COLOR_FIELD6 DINT
VALUE_FIELD_1 DINT Internal input value which is immediately visible during
the input and transferred to VALUE_FIELDx on the
... DINT second rising edge of ENTER.
VALUE_FIELD_6 DINT The variable must be assigned in the visualisation.
>

209
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

INPUT_INT
3220

Unit type = function block (FB)


Unit is contained in the library ifm_PDM_INPUT_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
3328

INPUT_INT supports up to 6 input fields which can be assigned to 6 different objects in the
visualisation. The input objects are parameterised with the internal variables FIELD1...FIELD6,
COLOR_FIELD1...COLOR_FIELD6 and VALUE_FIELD1...VALUE_FIELD6.
The FB is an alternative to the input function integrated in CoDeSys and more flexible compared to the
CoDeSys input function.
The FB contains no visualisation elements.

210
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


3329

Parameter Data type Description


INIT BOOL TRUE (only for 1 cycle):
sets the focus to the first input field
FALSE: during further processing of the program
ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
INIT_VALUE ARRAY [1..6] OF INT initialisation values for the input fields for the first call

NO_OF_FIELDS BYTE number of required input fields:


value range = 1...6
MIN_MAX_ARRAY ARRAY [1..12] OF INT 0defines input limits
index 1 = min. value field 1
index 2 = max. value field 1
index 3 = min. value field 2
index 4 = max. value field 2 etc.
ESC BOOL TRUE: resets the input value to the last valid value
FALSE: function element is not executed
INCREMENT BOOL edge FALSE  TRUE:
increments the input value by the value in
INCREMENT_VALUE (or
INCREMENT_VALUE2)
DECREMENT BOOL edge FALSE  TRUE:
decrements the input value by the value in
INCREMENT_VALUE (or
INCREMENT_VALUE2)
ENTER BOOL 1st edge FALSE  TRUE:
> activates input mode for the input field
> changes field colour (only color device)
> cursor flashes
2nd edge FALSE  TRUE:
> resets input mode for the input field
> writes edited values to the output variables
VALUE_FIELD1...VALUE_FIELD6
INCREMENT_VALUE INT if KEY_INCREMENT_VALUE2 = FALSE:
The value is changed by this amount in the active input
field for INCREMENT / DECREMENT.
KEY_INCREMENT_VALUE2 BOOL TRUE: The value in the active input field is changed by
the amount in INCREMENT_VALUE2 for
INCREMENT / DECREMENT.
FALSE: The value in the active input field is changed by
the amount in INCREMENT_VALUE for
INCREMENT / DECREMENT.
INCREMENT_VALUE2 INT if KEY_INCREMENT_VALUE2 = TRUE:
The value is changed by this amount in the active input
field for INCREMENT / DECREMENT.
CLEAR_ALL_VALUE BOOL TRUE: set all internal and external input values to 0
FALSE: function element is not executed

211
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


3330

Parameter Data type Description


INPUT_ACTIV BOOL current visualisation number
FIELDCOUNTER BYTE number of selected input field
VALUE_FIELD1 INT
external input value, is only adopted with the 2nd rising
... INT
edge of ENTER
VALUE_FIELD6 INT
>

Internal parameters
3331

Parameter Data type Description


FIELD1 INT Sets the focus for the selected input field.
... INT Any visualisation object can be used as a focus. The
variable FIELDx must be assigned to this object in the
FIELD6 INT visualisation. If the input is active, FIELDx is pulsed.

COLOR_FIELD1 INT
Sets the alarm colour of the input object (only PDM color).
... INT
The variable must be assigned in the visualisation.
COLOR_FIELD6 INT
VALUE_FIELD_1 INT Internal input value which is immediately visible during
the input and transferred to VALUE_FIELDx on the
... INT second rising edge of ENTER.
VALUE_FIELD_6 INT The variable must be assigned in the visualisation.

>

212
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

Example: INPUT_INT with 3 input elements


3332

► Integrate the requested function block into the application program and link the inputs and outputs
to the parameters and variables:

► Create the requested visualisati→ page. In the example the three right elements are intended for
the input of the values:

► When the input elements are configured with the internal parameters FIELD1...FIELD3 a frame is
shown for the selected input object (FIELDn = TRUE, alarm colour frame = black). For the other
objects it is not visible.

213
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

► Select the internal variable VALUE_FIELD_n as text output variable.


> When the application is running the selected input field is indicated by the frame.
> After first edge FALSE  TRUE on FB-input ENTER:
the object frame flashes and the input value can be edited.
> After second edge FALSE  TRUE on FB-input ENTER:
the value is adopted and the frame is shown again statically.

214
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

INPUT_REAL
3225

Unit type = function block (FB)


Unit is contained in the library ifm_PDM_INPUT_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
3337

INPUT_REAL supports up to 6 input fields which can be assigned to 6 different objects in the
visualisation. The input objects are parameterised with the internal variables FIELD1...FIELD6,
COLOR_FIELD1...COLOR_FIELD6 and VALUE_FIELD1...VALUE_FIELD6.
The FB is an alternative to the input function integrated in CoDeSys and more flexible compared to the
CoDeSys input function.
The FB contains no visualisation elements.

215
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


3338

Parameter Data type Description


INIT BOOL TRUE (only for 1 cycle):
Sets the focus to the first input field
FALSE: during further processing of the program
ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
INIT_VALUE ARRAY [1..6] OF REAL initialisation values for the input fields for the first call
NO_OF_FIELDS BYTE number of required input fields:
value range 1...6
MIN_MAX_ARRAY ARRAY [1..12] OF REAL defines input limits
index 1 = min. value field 1
index 2 = max. value field 1
index 3 = min. value field 2
index 4 = max. value field 2 etc.
ESC BOOL TRUE: resets the input value to the last valid value
FALSE: function element is not executed
INCREMENT BOOL edge FALSE  TRUE:
increments the input value by the value in
INCREMENT_VALUE (or
INCREMENT_VALUE2)
DECREMENT BOOL edge FALSE  TRUE:
decrements the input value by the value in
INCREMENT_VALUE (or
INCREMENT_VALUE2)
ENTER: BOOL 1st edge FALSE  TRUE:
> activates input mode for the input field
> changes field colour (only color device)
> cursor flashes
2nd edge FALSE  TRUE:
> resets input mode for the input field
> writes edited values to the output variables
VALUE_FIELD1...VALUE_FIELD6
INCREMENT_VALUE REAL if KEY_INCREMENT_VALUE2 = FALSE:
The value is changed by this amount in the active input
field for INCREMENT / DECREMENT.
KEY_INCREMENT_VALUE2 BOOL TRUE: The value in the active input field is changed by
the amount in INCREMENT_VALUE2 for
INCREMENT / DECREMENT.
FALSE: The value in the active input field is changed by
the amount in INCREMENT_VALUE for
INCREMENT / DECREMENT.
INCREMENT_VALUE2 REAL if KEY_INCREMENT_VALUE2 = TRUE:
The value is changed by this amount in the active input
field for INCREMENT / DECREMENT.
CLEAR_ALL_VALUE BOOL TRUE: set all internal and external input values to 0
FALSE: function element is not executed

216
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


3339

Parameter Data type Description


INPUT_ACTIV BOOL current visualisation number
FIELDCOUNTER BYTE number of selected input field
VALUE_FIELD1 REAL
external input value, is only adopted with the 2nd rising
... REAL
edge of ENTER
VALUE_FIELD6 REAL
>

Internal parameters
3340

Parameter Data type Description


FIELD1 REAL Sets the focus for the selected input field.
... REAL Any visualisation object can be used as a focus. The
variable FIELDx must be assigned to this object in the
FIELD6 REAL visualisation. If the input is active, FIELDx is pulsed.

COLOR_FIELD1 REAL
Sets the alarm colour of the input object (only PDM color).
... REAL
The variable must be assigned in the visualisation.
COLOR_FIELD6 REAL
VALUE_FIELD_1 REAL Internal input value which is immediately visible during
the input and transferred to VALUE_FIELDx on the
... REAL second rising edge of ENTER.
VALUE_FIELD_6 REAL The variable must be assigned in the visualisation.

217
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

INIT_VAR_RETAIN_DINT
3232

Unit type = function block (FB)


Unit is contained in the library ifm_PDM_INPUT_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
3344

INIT_VAR_RETAIN_DINT initialises the array of INPUT_DINT (→ page 207) indicated on the input
INIT_VALUE with remanent input values.
If input values are to be saved permanently, the values must be initialised after switching on the
display, otherwise they are overwritten in the first cycle. The FB initialises the array INIT_VALUE of
INPUT_DINT with remanent input values.
The function element compares the values of VALUE1...VALUE6 with the values of INIT_VALUE:
> If the contents of VALUE1...VALUE6 = 0, VALUE1...VALUE6 are written to the array INIT_VALUE.
> If the contents of VALUE1...VALUE6  0, the elements of the array INIT_VALUE are written to
VALUE1...VALUE6.

218
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

> The following INPUT function block is then initialised with INIT_VALUE in the first cycle.

Example with INIT_VAR_RETAIN_INT and INPUT_INT


>

Parameters of the inputs


3345

Parameter Data type Description


VALUE1 DINT
The variables VALUE_FIELDx of INPUT_DINT (→ page
... DINT
207) declared as retain must be indicated on this input.
VALUE6 DINT
INIT_VALUE ARRAY [1..6] OF DINT If the contents of VALUE1...VALUE6  0, the elements of
the array INIT_VALUE are written to VALUE1...VALUE6.
>

Parameters of the outputs


3346

Parameter Data type Description


INIT_VALUE ARRAY [1..6] OF DINT If the contents of VALUE1...VALUE6 = 0,
VALUE1...VALUE6 are written to the array INIT_VALUE.

219
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

INIT_VAR_RETAIN_INT
3229

Unit type = function block (FB)


Unit is contained in the library ifm_PDM_INPUT_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
3341

INIT_VAR_RETAIN_INT initialises the array of INPUT_INT (→ page 210) indicated on the input
INIT_VALUE with remanent input values.
If input values are to be saved permanently, the values must be initialised after switching on the
display, otherwise they are overwritten in the first cycle. The FB initialises the array INIT_VALUE of
INPUT_INT with the remanent input values.
The function element compares the values of VALUE1...VALUE6 with the values of INIT_VALUE:
> If the contents of VALUE1...VALUE6 = 0, VALUE1...VALUE6 are written to the array INIT_VALUE.
> If the contents of VALUE1...VALUE6  0, the elements of the array INIT_VALUE are written to
VALUE1...VALUE6.

220
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

> The following INPUT function block is then initialised with INIT_VALUE in the first cycle.

Example with INIT_VAR_RETAIN_INT and INPUT_INT


>

Parameters of the inputs


3342

Parameter Data type Description


VALUE1 INT
The variables VALUE_FIELDx of INPUT_INT (→ page 210)
... INT
declared as retain must be indicated on this input.
VALUE6 INT
INIT_VALUE ARRAY [1..6] OF INT If the contents of VALUE1...VALUE6  0, the elements of
the array INIT_VALUE are written to VALUE1...VALUE6.
>

Parameters of the outputs


3343

Parameter Data type Description


INIT_VALUE ARRAY [1..6] OF INT If the contents of VALUE1...VALUE6 = 0,
VALUE1...VALUE6 are written to the array INIT_VALUE.

221
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

INIT_VAR_RETAIN_REAL
3235

Unit type = function block (FB)


Unit is contained in the library ifm_PDM_INPUT_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
3347

INIT_VAR_RETAIN_REAL initialises the array of INPUT_REAL (→ page 215) indicated on the input
INIT_VALUE with remanent input values.
If input values are to be saved permanently, the values must be initialised after switching on the
display, otherwise they are overwritten in the first cycle. The FB initialises the array INIT_VALUE of
INPUT_INT with the remanent input values.
The function element compares the values of VALUE1...VALUE6 with the values of INIT_VALUE:
> If the contents of VALUE1...VALUE6 = 0, VALUE1...VALUE6 are written to the array INIT_VALUE.
> If the contents of VALUE1...VALUE6  0, the elements of the array INIT_VALUE are written to
VALUE1...VALUE6.

222
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

> The following INPUT function block is then initialised with INIT_VALUE in the first cycle.

Example with INIT_VAR_RETAIN_INT and INPUT_INT


>

Parameters of the inputs


3348

Parameter Data type Description


VALUE1 REAL
The variables VALUE_FIELDx declared as retain have to
... REAL be indicated to the FB INPUT_REAL.INPUT_REAL
(→ page 215)
VALUE6 REAL
INIT_VALUE ARRAY [1..6] OF REAL If the contents of VALUE1...VALUE6 is not 0, the
elements of the array INIT_VALUE are written to
VALUE1...VALUE6.
>

Parameters of the outputs


3349

Parameter Data type Description


INIT_VALUE ARRAY [1..6] OF REAL If the contents of VALUE1...VALUE6 = 0,
VALUE1...VALUE6 are written to the array INIT_VALUE.
>

223
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

7.2.7 POUs: Use touch screen functions

PointOfContact .....................................................................................................................................225
19928

224
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

PointOfContact
18885

Unit type = global variable (GV)of data type POC


Unit is contained in the library ifm_CR1201_Vxxyyzz.LIB
>

Description
18900

PointOfContact is a structured variable. It provides information about the point of contact of the
touchscreen and gives access to configuration options for visual feedback. The following table shows
details regarding the different structure variables.

Variable Data type Description

PointOfContact POC Structured variable


 PointOfContact.AfterGlow INT Display of pressure point and afterglow time (in milliseconds) *
Mögliche Werte:
-1 Display of the pressure point deactivated (default setting)
0 Display of the pressure point activated, without afterglow
>0 Display of the pressure point activated, afterglow time in
milliseconds (maximum afterglow time: 5000 ms)
 PointOfContact.X INT X coordinate of the pressure point **
Possible values:
-1 Touch screen not pressed
X X coordinate of the pressure point
(value range: 0 < X < max. horizontal resolution of display)
 PointOfContact.Y INT Y coordinate of the pressure point **
Possible values:
-1 Touch screen not pressed

Y Y coordinate of the pressure point


(value range: 0 < Y < max. vertical resolution of display)
 PointOfContact.ImagePath STRING Directory path to the memory location of the image file, containing the
user-specific pressure point image *
Possible values:
Standard screen is used (blue square, 30x30 pixels) (default
setting)
'path' Directory path to the memory location of the image file on the
device, permitted image formats: .jpg, .png, .bmp, .tiff; size:
30x30 pixels
The standard screen is displayed if problems occur with the
image file in the indicated directory!
 PointOfContact.Overlap BOOL Overlap of mouse pointer and pressure point *
Possible values:
FALS Pressure point and mouse pointer are independent of each other
E (default setting)
Mouse pointer only visible if a USB mouse has been
detected!
TRUE Pressure point and mouse pointer match.
Legend:
* ... Read and write access
** ... Read access

225
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.8 POUs: Help functions


8365

226
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

VERSION
9688

Unit type = program (PRG)


Unit is contained in the library ifm_PDMng_UTIL_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
9698

The program VERSION indicates the version and history of the library in the comment of the function
element.

227
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

EXITPLC_START_APPLICATION
11702

Unit type = function (FUN) of type INT


Unit is contained in the library ifm_PDM360NG_special_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
11705

EXITPLC_START_APPLICATION calls the appliclation indicated at input APPLICATION directly from


the running control program. As an option, the directory path and the name of the PDF file to be
opened can be enterd at input APP_PARAM1.

When the application is called with EXITPLC_START_APPLICATION, the runtime system of the
PDM including the active visualisation is terminated. When the application has been exited,
the runtime system starts again.

>

Parameters of the inputs


11706

Parameter Data type Description


APPLICATION STRING(80) Name of the application to be called
Permissible indications:
'app-chooser': calls the splalsh screen of the
PDM
'pdf-viewer': calls the PDF file viewer
APP_PARAM1 STRING(255) Directory path and name of the PDF file to open
(e.g. '/home/pdf/example.pdf')
If no indication is made, the PDF-Viewer starts with the
menu screen to select the PDF file.

>

Parameters of the outputs


11707

Parameter Data type Description


RESULT INT feedback of the function block
(possible messages  following table)

Possible results for RESULT:


Value
Description
dec | hex
1 01 function block execution completed without error
242 F2 Error: setting is not possible

228
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

SYSTEM_ASYNCH
9693

Unit type = function block (FB)


Unit is contained in the library ifm_PDM360NG_linux_syscall_asynch_Vxxyyzz.Lib

Symbol in CODESYS:

>

Description
9700

SYSTEM_ASYNCH sends any command (max. 255 characters) to the Linux operating system. The
command is processed asynchronously in the background.
The function block must be executed (EXECUTE = TRUE) until the FB output DONE = TRUE.

Proper Linux knowledge is required to use the function element!


► Monitor the function element using timeout functions!

>

Parameters of the inputs


9701

Parameter Data type Description


EXECUTE BOOL FALSE  TRUE (edge):
starts the command execution
COMMAND STRING (255) Linux command line
>

Parameters of the outputs


9702

Parameter Data type Description


DONE BOOL TRUE (only for 1 cycle):
FB is completely processed
FALSE: during further processing of the program
BUSY BOOL TRUE = system is active (action has not yet been
finished)
ERROR BOOL TRUE (only 1 cycle):
Command failed
FALSE: during further processing of the program
RET_VAL WORD Return value of the Linux command

229
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.9 Function elements: RAW-CAN (Layer 2)

Function elements: RAW-CAN status ..................................................................................................231


Function elements: receive RAW-CAN data ........................................................................................237
Function elements: transmit RAW-CAN data .......................................................................................247
Function elements: RAW-CAN remote.................................................................................................253
15051

Here we describe the RAW-CAN function blocks (CAN Layer 2) of ifm electronic to be used in the
application program.

230
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: RAW-CAN status

CAN_ENABLE ......................................................................................................................................232
CAN_RECOVER ..................................................................................................................................233
CAN_SETDOWNLOADID ....................................................................................................................234
CAN_STATUS ......................................................................................................................................235
15049

231
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_ENABLE
7492

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7494

With CAN_ENABLE the CAN hardware is initialised. Without this call no other calls are possible in
RAW-CAN or they return an error.
In order to change the baud rate the following procedure is required:
► Maintain the function block on ENABLE=FALSE for the duration of one cycle.
> All protocols are reset.
> Re-initialisation of the CAN interface and the CAN protocols running on it. Any information
available for cyclical transmission is lost as well and must be newly created.
> At renewed ENABLE=TRUE, the new baud rate is adopted.
>

Parameters of the inputs


7495

Parameter Data type Description


ENABLE BOOL := FALSE TRUE: enable CAN interface
FALSE: disable CAN interface
CHANNEL BYTE CAN interface (1...n) depending on the device
BAUDRATE WORD := 250 Baudrate [kbits/s]
Permissible = 20, 50, 100, 125, 250, 500, 1000

>

Parameters of the outputs


8530

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
8 08 function block is active
9 09 CAN is not active
242 F2 Error: setting is not possible

232
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_RECOVER
7512

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7513

CAN_RECOVER has the following tasks:


 to activate / deactivate the automatic bus off handling
 to restart the CAN interface in case of bus off
> In case of bus off: CAN Controller deletes all buffers (including the buffers of the other protocols).
If CAN_RECOVER is not used (ENABLE=FALSE):
> in case of a bus off a recovery attempt is automatically made after 1 s.
> after 4 failed recovery attempts in a row the affected CAN interface is deactivated.
>

Parameters of the inputs


7514

Parameter Data type Description


ENABLE BOOL := FALSE TRUE: No automatic recovery after CAN bus off
FALSE: Automatic recovery after CAN bus off
CHANNEL BYTE CAN interface (1...n) depending on the device
RECOVER_EXECUTE BOOL TRUE (only for 1 cycle):
restart of CAN interface
remedy bus off condition
FALSE: function element is not executed
InhibitTime TIME := T#1s Waiting time between bus off and restart of the CAN interface
(optional use of the parameter)

233
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_SETDOWNLOADID
7516

= Set download ID
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7517

The download ID is required for data exchange when connecting the runtime system and the
CODESYS development environment. When the device is started the download ID is set with the
default value from the hardware configuration.
With CAN_SETDOWNLOADID this value can be set in the PLC program (e.g. using certain inputs).
The changed ID is also written into the hardware configuration.
>

Parameters of the inputs


7519

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
DOWNLOAD_ID BYTE 1...127 = set download ID
0 = read download ID

>

Parameters of the outputs


7520

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block is active
242 F2 Error: setting is not possible

234
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_STATUS
7499

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7501

CAN_STATUS provides information on the chosen CAN bus.


Without hardware initialisation the following flags can be reset to FALSE:
- BUSOFF
- WARNING_RX
- WARNING_TX
>

Parameters of the inputs


7502

Parameter Data type Description


ENABLE BOOL := FALSE TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
CLEAR BOOL := FALSE TRUE: Reset the following flags:
• WARNING_RX
• WARNING_TX
• BUSOFF
FALSE: function element is not executed

235
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7504

Parameter Data type Description


BAUDRATE WORD current baudrate of the CANopen node in [kBaud]
DOWNLOAD_ID BYTE current download ID
BUSOFF BOOL Error CAN BUS OFF at the interface
WARNING_RX BOOL Warning threshold for receiving is exceeded at the interface
WARNING_TX BOOL Warning threshold for transmitting is exceeded at the interface
VERSION DWORD Version of the ifm CAN stack library
BUSLOAD BYTE Current bus load in [%]
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block is active
9 09 CAN is not active
242 F2 Error: setting is not possible

236
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: receive RAW-CAN data

CAN_RX ...............................................................................................................................................238
CAN_RX_ENH .....................................................................................................................................239
CAN_RX_ENH_FIFO ...........................................................................................................................241
CAN_RX_RANGE ................................................................................................................................243
CAN_RX_RANGE_FIFO ......................................................................................................................245
15050

237
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_RX
7586

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7588

CAN_RX is used for receiving a message.


The FB limits itself to a few functions and the required memory space is low.
CAN_RX filters for the set identifier. If several CAN messages with the same identifier are received in
one cycle, only the last / latest message is available.
>

Parameters of the inputs


7589

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF

>

Parameters of the outputs


7590

Parameter Data type Description


DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
5 05 FB is being processed – still receiving
9 09 CAN is not active
242 F2 Error: setting is not possible

238
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_RX_ENH
7606

= CAN RX enhanced
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7608

In addition, CAN_RX_ENH provides the following possibilities (as opposed to CAN_RX (→ page 238)):
• select the frame type (11 or 29 bits),
• define a mask for the evaluation of the CAN ID.

Bit comparison of If ID_MASK-Bit = 0, then CAN-ID-Bit may be = 0 or 1.


ID and mask: If ID_MASK-Bit = 1, then CAN-ID-Bit must be = ID-Bit.

With the mask several identifiers can be defined as filters.


Example:
ID = 0x100 = 0b0001 0000 0000
ID_MASK = 0x1F1 = 0b0001 1111 0001
Result The CAN IDs with the following bit pattern are evaluated:
0bxxx1 0000 xxx0 (x = any), i.e. for this example (all in [hex]):
100, 102, 104, 106, 108, 10A, 10C, 10E,
300, 302, 304, 306, 308, 30A, 30C, 30E,
500, 502, 504, 506, 508, 50A, 50C, 50E,
700, 702, 704, 706, 708, 70A, 70C, 70E
>

Parameters of the inputs


7609

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)
ID_Mask DWORD := 0 filter mask for the identifier:
(optional use of the parameter) if ID_MASK bit = 0, CAN ID bit may be = 0 or 1
if ID_MASK bit = 1, CAN ID bit must be = ID bit

239
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7613

Parameter Data type Description


MATCHED_ID DWORD number of the data object identifier
DATALENGTHCOUNT BYTE = Data Length Count
number of the data bytes received
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
5 05 FB is being processed – still receiving
9 09 CAN is not active
242 F2 Error: setting is not possible

240
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_RX_ENH_FIFO
7615

= CAN RX enhanced with FiFo


Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7616

In addition, CAN_RX_ENH_FIFO provides a FiFo for the received data (as opposed to CAN_RX_ENH
(→ page 239)). Thus several CAN messages can be received in one cycle.

No overwriting takes place when the FiFo is full. Inbound messages will be lost.

In this event:
► Deactivate and reactive the FB via ENABLE.
> The FiFo is deleted and can be newly filled.
>

Parameters of the inputs


7609

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)
ID_Mask DWORD := 0 filter mask for the identifier:
(optional use of the parameter) if ID_MASK bit = 0, CAN ID bit may be = 0 or 1
if ID_MASK bit = 1, CAN ID bit must be = ID bit

241
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7617

Parameter Data type Description


MATCHED_ID DWORD number of the data object identifier
DATALENGTHCOUNT BYTE = Data Length Count
number of the data bytes received
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
MORE_DATA_AVAILABLE BOOL TRUE: further received data available in the FiFo
FALSE: no further data available in the FiFo
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
5 05 FB is being processed – still receiving
9 09 CAN is not active
242 F2 Error: setting is not possible
250 FA Error: FiFo is full – data was lost

242
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_RX_RANGE
7592

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7594

CAN_RX_RANGE provides the following settings:


 select the message type (11 or 29 bits),
 define an identifier range.
CAN_RX filters for the set identifier. If several CAN messages with the same identifier are received in
one cycle, only the last / latest message is available.
>

Parameters of the inputs


7595

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID_START DWORD start number of the data object identifier range:
normal frame (211):
0...2 047 = 0x0000 0000...0x0000 07FF
extended frame (229):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
ID_STOP DWORD end number of the data object identifier range:
normal frame (211):
0...2 047 = 0x0000 0000...0x0000 07FF
extended frame (229):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)

243
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7598

Parameter Data type Description


ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
DATALENGTHCOUNT BYTE = Data Length Count
number of the data bytes received
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
5 05 FB is being processed – still receiving
9 09 CAN is not active
242 F2 Error: setting is not possible

244
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_RX_RANGE_FIFO
7601

= CAN RX range with FiFo


Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7603

CAN_RX_RANGE_FIFO basically works like CAN_RX_RANGE (→ page 243).


In addition, CAN_RX_RANGE_FIFO provides a FiFo for the received data. Thus several CAN
messages can be received in one cycle.

No overwriting takes place when the FiFo is full. Inbound messages will be lost.

In this event:
► Use ENABLE to deactivate and reactivate the function.
> The FiFo is deleted and can be newly filled.
>

Parameters of the inputs


7595

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID_START DWORD start number of the data object identifier range:
normal frame (211):
0...2 047 = 0x0000 0000...0x0000 07FF
extended frame (229):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
ID_STOP DWORD end number of the data object identifier range:
normal frame (211):
0...2 047 = 0x0000 0000...0x0000 07FF
extended frame (229):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)

245
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7604

Parameter Data type Description


ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
DATALENGTHCOUNT BYTE = Data Length Count
number of the data bytes received
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
MORE_DATA_AVAILABLE BOOL TRUE: further received data available in the FiFo
FALSE: no further data available in the FiFo
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
5 05 FB is being processed – still receiving
9 09 CAN is not active
242 F2 Error: setting is not possible
250 FA Error: FiFo is full – data was lost

246
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: transmit RAW-CAN data

CAN_TX................................................................................................................................................248
CAN_TX_ENH ......................................................................................................................................249
CAN_TX_ENH_CYCLIC.......................................................................................................................251
15055

247
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_TX
7522

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7523

CAN_TX sends a standard message per cycle.


The FB limits itself to a few functions and the required memory space is low.
> If an instance of this FB is called several times during a cycle, the data is also sent several times.
In case of the simple functions CAN_TX and CAN_RX, it is determined by means of the ID whether a
standard or an extended frame is to be sent. With the enhanced versions this is set via the input
EXTENDED. Therefore, extended frames in the ID area 0...2047 cannot be sent via the easy
functions.
>

Parameters of the inputs


7524

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)

>

Parameters of the outputs


7527

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
242 F2 Error: setting is not possible
250 FA Error: FiFo is full – data was lost
>

248
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_TX_ENH
7558

= CAN TX enhanced
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7559

Additional setting options are offered through CAN_TX_ENH (for: enhanced). Here, all CAN specific
characteristics can be set individually, e.g.:
 Is it an 11 or a 29 bit identifier?
 The additional inputs can be preset so that CAN_TX (→ page 248) is not required.
> If an instance of this FB is called several times during a cycle, the data is also sent several times.
>

Parameters of the inputs


7634

Parameter Data type Description


ENABLE BOOL FALSE  TRUE (edge):
Initialise block (only 1 cycle)
> Read block inputs
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)
DATALENGTHCODE BYTE = Data Length Code
number of the data bytes to be sent (0...8)
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)

249
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7527

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
242 F2 Error: setting is not possible
250 FA Error: FiFo is full – data was lost

250
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_TX_ENH_CYCLIC
7568

= CAN TX enhanced cyclic


Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7569

CAN_TX_ENH_CYCLIC serves for cyclical transmitting of CAN messages.


Otherwise, the FB corresponds to CAN_TX_ENH (→ page 249).
► Set the period duration via the parameter PERIOD.

If a period is too short, this could lead to a high bus load which could affect the performance of the
complete system.

>

Parameters of the inputs


7582

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)
DataLengthCode BYTE := 8 length of the data to be sent (0...8 bytes)
(optional use of the parameter)
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)
PERIOD TIME period duration

251
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7510

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
8 08 function block is active
9 09 CAN is not active
250 FA Error: FiFo is full – data was lost

252
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: RAW-CAN remote

CAN_REMOTE_REQUEST .................................................................................................................254
CAN_REMOTE_RESPONSE...............................................................................................................256
15057

253
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_REMOTE_REQUEST
7625

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7627

In order to request a remote message, an according requirement is dispatched via


CAN_REMOTE_REQUEST and the response of the other device is sent back as result.
>

Parameters of the inputs


7628

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)

>

Parameters of the outputs


7629

Parameter Data type Description


DATALENGTHCOUNT BYTE = Data Length Count
number of the data bytes received
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
5 05 FB is being processed – still receiving
9 09 CAN is not active
242 F2 Error: setting is not possible

254
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

255
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CAN_REMOTE_RESPONSE
7631

Unit type = function block (FB)


Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7633

CAN_REMOTE_RESPONSE provides data to the CAN controller in the device which is automatically
sent upon the request of a remote message.
This FB strongly depends on the device type. Only a limited number of remote messages can be set
up:
BasicController: CR040n, CR041n, CR043n
max. 40 remote messages
BasicDisplay: CR045n
PDM360 NG: CR108n, CR120n max. 100 remote messages
>

Parameters of the inputs


7634

Parameter Data type Description


ENABLE BOOL FALSE  TRUE (edge):
Initialise block (only 1 cycle)
> Read block inputs
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
normal frame (211 IDs):
0...2 047 = 0x0000 0000...0x0000 07FF
extended Frame (229 IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
Extended BOOL := FALSE TRUE: extended Frame (ID = 0...229-1)
(optional use of the parameter) FALSE: normal Frame (ID = 0...211-1)
DATALENGTHCODE BYTE = Data Length Code
number of the data bytes to be sent (0...8)
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)

256
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7636

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
6 06 FB is being processed – remote for ID not active
7 07 FB is being processed – remote for ID active

257
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.10 Function elements: CANopen

Function elements: CANopen status ....................................................................................................259


Function elements: CANopen network management ...........................................................................268
Function elements: CANopen object directory .....................................................................................272
Function elements: CANopen SDOs ....................................................................................................277
Function elements: CANopen SYNC ...................................................................................................290
Function elements: CANopen guarding ...............................................................................................294
Function elements: CANopen emergency............................................................................................299
15059

For CANopen, ifm electronic provides a number of function elements which will be explained in the
following.

258
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: CANopen status

CANOPEN_ENABLE ............................................................................................................................260
CANOPEN_GETBUFFERFLAGS ........................................................................................................262
CANOPEN_GETSTATE .......................................................................................................................264
CANOPEN_SETSTATE .......................................................................................................................266
15061

259
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_ENABLE
7785

Unit type = function block (FB)


Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7787

CANOPEN_ENABLE allows to switch the CANopen master on or off.


► In the application program always call an own instance of the FB CANOPEN_ENABLE (→ page
260) for every CAN interface!

To avoid guarding or heartbeat errors the nodes must be "shut down" via an appropriate sequence
first.

If the master is restarted after a stop, all other connected nodes also have to be re-initialised.
Without CANOPEN_ENABLE, the CANopen master is started automatically, as far as this has been
selected in the configuration.
The configured baud rate is only adopted if CAN_ENABLE (→ page 232) has not been activated before.
>

Parameters of the inputs


7788

Parameter Data type Description


ENABLE BOOL := TRUE TRUE:
• Enable CANopen for the selected channel
• Start CANopen manager or CANopen device
according to the configuration settings
FALSE:
• Disable CANopen for the selected channel
• Terminate CANopen manager or CANopen device
CHANNEL BYTE CAN interface (1...n) depending on the device
Baud rate WORD := 0 Baud rate [kbits/s]
(optional use of the parameter) permissible values = 20, 50, 100, 125, 250, 500, 800, 1 000
0 = use setting from the PLC configuration

260
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7789

Parameters Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
14 0E FB is active
CANopen manager configures devices and sends SDOs
15 0F FB is active
CANopen manager is started
238 EE Error: CANopen configuration is too large and cannot be started
239 EF Error: CANopen manager could not be started
242 F2 Error: setting is not possible

261
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETBUFFERFLAGS
7890

= Get buffer flags


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7892

CANOPEN_GETBUFFERFLAGS supplies information on the buffer flags.


The flags can be reset via the optional inputs.
The function block returns the state of the overflow flags.
>

Parameters of the inputs


7893

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
ResetRXFlags BOOL := FALSE TRUE: Provide fag status at the output and then reset
(optional use of the parameter) FALSE: function element is not executed
ResetTXFlags BOOL := FALSE TRUE: Provide flag status at the output and then reset
(optional use of the parameter) FALSE: function element is not executed

262
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7894

Parameter Data type Description


RXOVFL BOOL condition of the RX overflow flag
TRUE: overflow in the receive buffer
FALSE: no overflow in receive buffer
RXWARN BOOL condition of the RX overflow warning flag
TRUE: level in the receive buffer is critical
FALSE: level in the input buffer is uncritical
TXOVFL BOOL condition of the TX overflow flag
TRUE: overflow in the transmit buffer
FALSE: no overflow in transmit buffer
TXWARN BOOL Condition of the TX overflow warning flag
TRUE: Level in the transmit buffer is critical
FALSE: Level in the transmit buffer is uncritical
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block not yet executed
242 F2 Error: setting is not possible

263
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETSTATE
7865

= Get state
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7867

Via CANOPEN_GETSTATE, parameters of the master, a slave device or a specific node in the
network can be set.
>

Parameters of the inputs


7868

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE Node ID = ID of the node (0...127)
Device as CANopen master:
Value = 0:
Only the status information of the device itself is returned at the
outputs. The outputs with information on the nodes are invalid.
Value not 0:
Node ID of a node in the network. For this one as well as for the
device the states are returned at the outputs.
Device as CANopen slave:
Value = 0 (preset):
The status information of the slave is returned at the outputs.
Value not 0:
no action

264
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7869

Parameter Data type Description


MASTERSTATE BYTE Master state = internal state of the master:
0 = 0x00 = master starts up
4 = 0x04 = node configuration running
5 = 0x05 = normal operating state of the master
255 = 0xFF = PLC running as slave
PLCNODEID BYTE PLC node ID = node ID of the PLC the program is running on
Value = 0...127 = 0x00...0x7F
PLCBAUDRATE DWORD Baudrate of the PLC
PLCVERSION DWORD PLC version
CANSTATE BYTE Status of the CANopen network
Device operated as master:
Node ID = 0 (device as such):
0 = 0x00 = OK
128 = 0x80 = BUSOFF
Node ID ≠ 0 (node):
0 = 0x00 = OK
1 = 0x01 = guard or heartbeat error on node
128 = 0x80 = BUSOFF
Device operated as slave:
0 = 0x00 = OK
1 = 0x01 = guard or heartbeat error
128 = 0x80 = BUSOFF
NODESTATE BYTE Node state = internal node state of a slave seen from the master's
perspective. The input NODEID identifies the node.
-1 = 0xFF = reset after ResetNode
1 = 0x01 = waiting for BOOTUP
2 = 0x02 = after receipt of the BOOTUP message
3 = 0x03 = not yet configured: STOPPED
4 = 0x04 = after configuration with SDOs: PRE-OPERATIONAL
5 = 0x05 = after starting the node: OPERATIONAL
97 = 0x61 = optional node
98 = 0x62 = other device type configured than in 0x1000
99 = 0x63 = node guarding
LASTNODESTATE BYTE Last Node State
Node state according to CANopen (with these values the status is also
coded in the corresponding messages with regard to the node).
0 0x00 BOOTUP
4 0x04 STOPPED
5 0x05 OPERATIONAL
127 0x7F PRE-OPERATIONAL
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

265
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SETSTATE
7858

= Set state
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7860

Via CANOPEN_SETSTATE, parameters of the master, a slave device or a node in the network can be
set.
The treatment of the NMT state of master, node or device is carried out in the CAN stack or via the
commands of the FB CANOPEN_NMTSERVICES (→ page 270). At the same time admissibility checks are
carried out. For reasons of consistency no inputs are provided for this purpose.

266
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


7861

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE Node ID = ID of the node (0...127)
Device as CANopen master:
Value = 0:
The changes only refer to the device itself.
Value not 0:
Node ID of a node in the network the parameters of which are to be
changed. The established settings are only adopted for this node (not
for the device).
Device as CANopen slave:
In slave mode, the node ID of the slave can be set via this input.
Value = 0:
no action
Value not 0:
The function block adopts this value as the new node ID of the device.
GlobalStart BOOL := TRUE Requirement: FB must be called immediately after starting the IEC
(optional use of the parameter) program. This setting overwrites the setting of the configuration.
TRUE: Start all participants simultaneously
FALSE: Start all participants one after the other
CfgTimeout TIME := T#0ms set configuration timeout for a node:
(optional use of the parameter) Value = 0:
no action – retain configuration data
Value not 0:
overwrite data from the configuration with the new value
InitNoSdos BOOL := FALSE To the node indicated in NODE, during initialisation,...
(optional use of the parameter) TRUE: do not send configuration data
FALSE: send configured SDOs

>

Parameters of the outputs


7862

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

267
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: CANopen network management

CANOPEN_GETNMTSTATESLAVE ...................................................................................................269
CANOPEN_NMTSERVICES ................................................................................................................270
15063

268
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETNMTSTATESLAVE
7851

= Get network management state slave


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7853

► Only use the FB if the device is operated as CANopen slave!


With CANOPEN_GETNMTSTATESLAVE, only the operating state according to CANopen and an
error message are reported to the application if an invalid state transition has been requested.
>

Parameters of the inputs


7854

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device

>

Parameters of the outputs


7855

Parameter Data type Description


NMTSTATE BYTE Network operating status of the node
0 = INIT
1 = OPERATIONAL
2 = PRE-OPERATIONAL
3 = STOPPED
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

269
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_NMTSERVICES
7843

= Network management services


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7844

Depending on its NMT command entries, CANOPEN_NMTSERVICES either triggers an NMT


command or the initialisation of a node.
NMT = Network-ManagemenT
The function block updates the internal node status. If a state transition to CANopen (→ system
manual "Know-How ecomatmobile" > NMT state (→ page 361)) should not be permitted, the command
is not executed.
A CANopen device can automatically change its CANopen state by means of the FB:
preoperational  operational
>

Parameters of the inputs


7847

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE CANopen ID of the node
permissible = 1...127 = 0x00...0x7F
NODE = 0:
command applies to all nodes in the network
NODE = Node ID of the device:
command applies to the device as such
NMTSERVICE BYTE network command
0 = init node (except master)
1 = enter PRE-OPERATIONAL
2 = start node
3 = reset node
4 = reset communication
5 = stop node
Timeout TIME := T#0ms waiting time of the FB for the initialisation
(optional use of the parameter) when the time has elapsed, the FB stops waiting.
0 = use value from the configuration

270
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7848

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block is active
35 23 at least 1 SDO of the configuration was not successful
36 24 node was already initialised
37 25 when initialisation was requested the node was not in the
PRE-OPERATIONAL mode
043 2B master / slave is not initialised
241 F1 Error: CANopen state transition is not permitted
242 F2 Error: setting is not possible

271
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: CANopen object directory

CANOPEN_GETODCHANGEDFLAG .................................................................................................273
CANOPEN_READOBJECTDICT .........................................................................................................274
CANOPEN_WRITEOBJECTDICT .......................................................................................................275
15065

272
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETODCHANGEDFLAG
7927

= Get object directory changed flag


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7928

CANOPEN_GETODCHANGEDFLAG reports any change of value for a particular object directory


entry.
>

Parameters of the inputs


7930

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory

>

Parameters of the outputs


7931

Parameter Data type Description


DATA DWORD parameter value
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

273
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_READOBJECTDICT
7933

= Read object directory


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7935

CANOPEN_READOBJECTDICT reads up to 4 bytes of configuration data from the object directory of


the device for use in the application program.
>

Parameters of the inputs


7936

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory

>

Parameters of the outputs


7937

Parameter Data type Description


DATA DWORD parameter value
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block not yet executed
40 28 object directory entry is invalid
242 F2 Error: setting is not possible

274
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_WRITEOBJECTDICT
7940

= Write object directory


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7942

CANOPEN_WRITEOBJECTDICT writes configuration data to the object directory of the controller.

NOTICE
This could lead to falsification of important system settings, e.g.:
- guarding times
- heartbeat times
► Carefully verify input parameters!

>

Parameters of the inputs


7943

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory
DATA DWORD parameter value

275
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7945

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block not yet executed
40 28 object directory entry is invalid
242 F2 Error: setting is not possible

276
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: CANopen SDOs

CANOPEN_SDOREAD ........................................................................................................................278
CANOPEN_SDOREADBLOCK ............................................................................................................280
CANOPEN_SDOREADMULTI .............................................................................................................282
CANOPEN_SDOWRITE ......................................................................................................................284
CANOPEN_SDOWRITEBLOCK ..........................................................................................................286
CANOPEN_SDOWRITEMULTI ...........................................................................................................288
2071

Here you will find ifm function elements for CANopen handling of Service Data Objects (SDOs).

277
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SDOREAD
7791

= SDO read
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7793

CANOPEN_SDOREAD is an easy function block for editing "Expedited SDOs", i.e. SDOs with max.
4 bytes of user data. This type usually represents the bigger part of the SDO communication.
Expedited SDO = Expedited Service Data Object
A considerable amount of memory space can be saved due to the limitation of the data volume to
max. 4 bytes of user data, as this FB only needs to reserve 4 bytes as buffer storage and does not
create a large data array itself.
>

Parameters of the inputs


7794

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE ID of the node
permissible values = 1...127 = 0x01...0x7F
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory
Timeout TIME := T#10ms waiting time of the FB for the response
(optional use of the parameter) when the time has elapsed, the FB stops waiting.
value = 0: use value from the configuration

278
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7795

Parameter Data type Description


LEN BYTE number of the bytes received (1...4)
DATA DWORD the received data value
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
5 05 FB is active – no data received yet
32 20 SDO transmission aborted by client or server
(SDO abort code 0x80)
33 21 TIMEOUT elapsed
242 F2 Error: setting is not possible
255 FF buffer overflow – too many data bytes were received

279
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SDOREADBLOCK
14942

= SDO Read Block


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
14943

CANOPEN_SDOREADBLOCK reads the indicated entry in the object directory of a node in the
network via SDO block transfer.
> If the node doesn't support block transfer, the FB automatically changes to "segmented transfer".
You can also directly change to "segmented transfer" via the input.
> The COB ID for the SDO is calculated from the transmitted node ID.
The length of multiframe SDOs is generally not limited.

For systems without a file system (e.g. BasicController CR04nn) the following applies:
► transmit an address to the FB which is accessed by the pointer for writing. The memory area
determined by the start address DATA and the amount of data MAX_LEN must be available!
> If the amount of data is greater than indicated, the transfer is stopped and signalled via RESULT.

For systems with a file system (e.g. PDM360NG CR108n) the following applies:
► transmit the path and name of a file to the FB, in which the data is to be saved in binary format.
> The output RESULT provides information on the status of the SDO transmission.

280
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


14945

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE (Node ID) ID of the node
allowed = 1...127 = 0x01...0x7F
The COB ID of the SDO is calculated from the node ID + 0x600
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory
DATA DWORD Address of the data zone for storage of the received data
Input is without function for devices with file system (Linux).
FILE STRING(80) Path and file name for storage of the received data in binary format
Input without function for device without file system
(BasicSystem).
MAX_LEN DWORD Maximum permitted number of bytes which may be received
SegmentedTransfer BOOL := FALSE TRUE: Segmented SDO transfer
(optional use of the parameter) FALSE: SDO block transfer
Timeout TIME := T#10ms waiting time of the FB for the response
(optional use of the parameter) when the time has elapsed, the FB stops waiting.
value = 0: use value from the configuration

>

Parameters of the outputs


14951

Parameter Data type Description


LEN DWORD number of received data bytes
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
16 10 Transmission is active as a segmented download
17 11 Transmission is active as a block download
32 20 SDO transmission aborted by client or server
(SDO abort code 0x80)
33 21 TIMEOUT elapsed
64 40 Error: Write pointer outside admissible data range
65 41 Error: File could not be opened
66 42 Error when writing to file
242 F2 Error: setting is not possible
>

281
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SDOREADMULTI
7806

= SDO read multi


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7808

CANOPEN_SDOREADMULTI reads the indicated entry in the object directory of a node in the
network. The COB ID for the SDO is calculated from the transmitted node ID according to CANopen
convention.
>

Parameters of the inputs


7809

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE (Node ID) ID of the node
allowed = 1...127 = 0x01...0x7F
The COB ID of the SDO is calculated from the node ID + 0x600
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory
Timeout TIME := T#10ms waiting time of the FB for the response
(optional use of the parameter) when the time has elapsed, the FB stops waiting.
value = 0: use value from the configuration

282
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7810

Parameter Data type Description


LEN DWORD number of the bytes received
permissible values = 1...2 048 = 0x0000 0001...0x0000 0800
DATA ARRAY [0..SDOMAXDATA] OF buffer memory for user data of the SDO data transmission
BYTE
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
5 05 FB is active – no data received yet
32 20 SDO transmission aborted by client or server
(SDO abort code 0x80)
33 21 TIMEOUT elapsed
242 F2 Error: setting is not possible
255 FF Error: not enough memory available for the consuming multiframe

283
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SDOWRITE
7825

= SDO write
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7826

CANOPEN_SDOWRITE is an easy function block for editing "Expedited SDOs", i.e. SDOs with max.
4 bytes user data. This type usually represents the bigger part of the SDO communication.
Expedited SDO = expedited service data object
A considerable amount of memory space can be saved due to the limitation of the data volume to
max. 4 bytes of user data because this FB only needs to reserve 4 bytes as buffer storage and does
not create a large data array itself.
>

Parameters of the inputs


7828

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE ID of the node
permissible values = 1...127 = 0x01...0x7F
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory
LEN BYTE number of the data bytes to be transmitted
permissible values = 1...4 = 0x01...0x04
DATA ARRAY [0..3] OF BYTE data area (1...4 bytes)
Timeout TIME := T#10ms waiting time of the FB for the response
(optional use of the parameter) when the time has elapsed, the FB stops waiting.
value = 0: use value from the configuration

284
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7829

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
8 08 function block is active
32 20 SDO transmission aborted by client or server
(SDO abort code 0x80)
33 21 TIMEOUT elapsed
242 F2 Error: setting is not possible

285
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SDOWRITEBLOCK
14961

= SDO Write Block


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
14963

CANOPEN _SDOWRITEBLOCK writes in the indicated entry in the object directory of a node in the
network via SDO block transfer.
You can change to segmented transfer via the FB input if required.
> The COB ID for the SDO is calculated from the transmitted node ID.
> The output RESULT provides information on the status of the SDO transmission.
The length of multiframe SDOs is generally not limited.

For systems without a file system (e.g. BasicController CR04nn) the following applies:
► transmit an address to the FB which is accessed by the pointer for reading.

For systems with a file system (e.g. PDM360NG CR108n) the following applies:
► Transmit the path and name of a file to the FB, from which the data is to be read in binary format.

286
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


14964

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE (Node ID) ID of the node
allowed = 1...127 = 0x01...0x7F
The COB ID of the SDO is calculated from the node ID + 0x600
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory
LEN DWORD number of data bytes to be transmitted in DATA
allowed = 1...2 048 = 0x0000 0001...0x0000 0800
DATA DWORD Address of the data zone for reading of the data to be transmitted
Input is without function for devices with file system (Linux).
FILE STRING(80) Path and file name for reading of the data to be transmitted in binary
format
Input without function for device without file system
(BasicSystem).
SegmentedTransfer BOOL := FALSE TRUE: Segmented SDO transfer
(optional use of the parameter) FALSE: SDO block transfer
Timeout TIME := T#10ms waiting time of the FB for the response
(optional use of the parameter) when the time has elapsed, the FB stops waiting.
value = 0: use value from the configuration

>

Parameters of the outputs


14968

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
16 10 Transmission is active as a segmented download
17 11 Transmission is active as a block download
32 20 SDO transmission aborted by client or server
(SDO abort code 0x80)
33 21 TIMEOUT elapsed
65 41 Error: File could not be opened
242 F2 Error: setting is not possible

287
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SDOWRITEMULTI
7832

= SDO write multi


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7834

CANOPEN_SDOWRITEMULTI writes the indicated entry in the object directory of a node in the
network. The COB ID for the SDO is calculated from the transmitted node ID according to CANopen
convention.
>

Parameters of the inputs


7835

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE ID of the node
permissible values = 1...127 = 0x01...0x7F
IDX WORD index in object directory
SUBIDX BYTE sub-index referred to the index in the object directory
LEN DWORD number of the data bytes to be transmitted
permissible values = 1...2 048 = 0x0000 0001...0x0000 0800
DATA ARRAY [0..SDOMAXDATA] OF buffer memory for user data of the SDO data transmission
BYTE
Timeout TIME := T#10ms waiting time of the FB for the response
(optional use of the parameter) when the time has elapsed, the FB stops waiting.
value = 0: use value from the configuration

288
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7836

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
8 08 function block is active
32 20 SDO transmission aborted by client or server
(SDO abort code 0x80)
33 21 TIMEOUT elapsed
242 F2 Error: setting is not possible

289
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: CANopen SYNC

CANOPEN_GETSYNCSTATE .............................................................................................................291
CANOPEN_SETSYNCSTATE .............................................................................................................293
15069

290
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETSYNCSTATE
7871

= Get SYNC state


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7872

CANOPEN_GETSYNCSTATE reads...
• the setting of the SYNC functionality (active / not active),
• the error state of the SYNC functionality (SyncError).
If the PLC CAN runs as CANopen slave, it is signalled via this FB whether SYNC signals are absent or
appear regularly.
Synchronous PDOS etc. are handled in the CAN stack. CANOPEN_GETSYNCSTATE, however,
provides the error state so that the application program can react accordingly.
>

Parameters of the inputs


7874

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device

291
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7875

Parameter Data type Description


SYNC BOOL status of the SYNC functionality
TRUE: SYNC is activated:
In the master mode SYNC telegrams are generated according to the
settings in the configuration, and synchronous PDOs are transmitted
and received.
In the slave mode SYNC telegrams are received and accordingly
processed.
FALSE: SYNC is not active
SYNCERROR BYTE (sync error) SYNC error message
0 = no error
>0 = SYNC error (slave mode)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block not yet executed
242 F2 Error: setting is not possible

292
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SETSYNCSTATE
7883

= Set SYNC state


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7884

With CANOPEN_SETSYNCSTATE, the SYNC functionality is switched on and off.


>

Parameters of the inputs


7886

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
SYNC BOOL status of the SYNC functionality
TRUE: SYNC is activated:
In the master mode SYNC telegrams are generated according to the
settings in the configuration, and synchronous PDOs are transmitted
and received.
In the slave mode SYNC telegrams are received and accordingly
processed.
FALSE: SYNC is not active

>

Parameters of the outputs


7887

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block not yet executed
38 26 SYNC could not be activated
242 F2 Error: setting is not possible

293
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: CANopen guarding

CANOPEN_GETGUARDHBERRLIST .................................................................................................295
CANOPEN_GETGUARDHBSTATSLV ................................................................................................297
15071

294
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETGUARDHBERRLIST
7896

= Get guard and heartbeat error list


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7898

CANOPEN_GETGUARDHBERRLIST lists all nodes in an array for which the master has detected an
error:
• guarding error
• heartbeat error
>

Parameters of the inputs


7899

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
ResetList BOOL := FALSE Reset error list
(optional use of the parameter) TRUE: Provide the error list as well as number of faulty
nodes at the output and then reset.
FALSE: function element is not executed

295
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7900

Parameter Data type Description


N_NODES WORD Number of nodes with heartbeat or guarding error
0 = none of the nodes has a guarding or heartbeat error
NODEID ARRAY List of node IDs with heartbeat or guarding error.
[0..MAXGUARDERROR] OF The most recent entry is in index 0.
BYTE MAXGUARDERROR depends on device
→ chapter Performance limits of the devices (CANopen)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

296
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETGUARDHBSTATSLV
7902

= Get guard and heartbeat state slave


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7904

CANOPEN_GETGUARDANDHBSTATESLAVE reports the following states to the controller in slave


operation:
- monitoring of node guarding
- monitoring of heartbeat
The controller can either be the heartbeat producer or the heartbeat consumer.
>

Parameters of the inputs


7905

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
Reset BOOL := FALSE TRUE: Provide the current states at the outputs
(optional use of the parameter) and then reset to "No error"
FALSE: function element is not executed

297
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7906

Parameter Data type Description


GUARDSTATE BYTE Status of node guarding:
0 = 0x00 = no error (or: not active)
1 = 0x01 = timeout (configuration)
127 = 0x7F = no guarding message received
PROD_HBSTATE BYTE controller as heartbeat producer:
0 = 0x00 = inactive
1 = 0x01 = active
CONS_HBSTATE BYTE controller as heartbeat consumer:
0 = 0x00 = no fault
1 = 0x01 = timeout (configuration)
127 = 0x7F = no heartbeat message received yet
CONS_HBCOBID WORD COB-ID of the heartbeat message the consumer heartbeat of the
controller is reacting to (configuration)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

298
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: CANopen emergency

CANOPEN_GETEMCYMESSAGES ....................................................................................................300
CANOPEN_GETERRORREGISTER ...................................................................................................302
CANOPEN_SENDEMCYMESSAGE ...................................................................................................304
15073

299
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETEMCYMESSAGES
7921

= Get emergency messages


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7923

CANOPEN_GETEMCYMESSAGES returns all emergency messages that have been received by the
controller from other nodes in the network since the last deletion of messages.
The list can be reset by setting the according input. A maximum of MAXEMCYMSGS messages is
stored. Each message contains information from which the node it was sent. The most recent
message is in index 0.
>

Parameters of the inputs


7924

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
RstList BOOL := FALSE TRUE: Provide list with accumulated CAN messages
(optional use of the parameter) at the output and then delete
FALSE: function element is not executed

300
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7925

Parameter Data type Description


N_MSGS DWORD Number of accumulated messages
EMCY ARRAY [0..MAXEMCYMSGS] Emergency messages
OF T_EMCY The most recent entry is in index 0.
Structure of T_EMCY:
.NODEID ID of the node from which the message came
.EEC Emergency Error Code
.ER Error register
.MSEF Manufacturer Specific Error Code
MAXEMCYMSG = 10
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

301
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_GETERRORREGISTER
7915

= Get error register


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7917

CANOPEN_GETERRORREGISTER reads the error registers 0x1001 and 0x1003 from the controller.
>

Parameters of the inputs


7918

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
Reset_1001 BOOL := FALSE TRUE: Reset error register 0x1001
(optional use of the parameter) FALSE: function element is not executed
Reset_1003 BOOL := FALSE TRUE: Reset error register 0x1003
(optional use of the parameter) Set number of entries to 0
FALSE: function element is not executed
The inputs remain unchanged.

302
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7919

Parameter Data type Description


ER BYTE Content of the error register 0x1001
ERROR_FIELD ARRAY [0..MAXERR] OF Content of the error register 0x1003
DWORD Index 0 = number of the stored errors
Index 1...MAXERR = stored errors
The most recent error is in index 1
Preset: MAXERR = 5
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – not yet processed
242 F2 Error: setting is not possible

303
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

CANOPEN_SENDEMCYMESSAGE
7908

= Send emergency message


Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7910

CANOPEN_SENDEMCYMESSAGE sends an EMCY message. The message is assembled from the


according parameters and entered in register 0x1003. The COB ID for the emergency message is
determined from the configuration data.
>

Parameters of the inputs


7911

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
ERRORACTIVE BOOL FALSE  TRUE (edge):
sends the next error code
TRUE  FALSE (edge):
If the error is no longer given, a
message that there is no error is sent
after a delay of 1 s.
EEC WORD EEC = Emergency Error Code
ER BYTE := 0 0 = use value from error register 0x1001
(optional use of the parameter)
MSEF ARRAY [0..4] OF BYTE MSEF = Manufacturer Specific Error Code =
Additional error code which is defined by the manufacturer.
Value comes from the application.
Write1003 BOOL := FALSE TRUE: Enter this EMCY message in object 0x1003
(optional use of the parameter) FALSE: function element is not executed
SendSysStatus BOOL := FALSE Send system status
(optional use of the parameter) TRUE: The system status is checked and in case of an
error state this is transmitted to the network.
FALSE: function element is not executed

304
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7912

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 FB is active – not yet processed
39 27 no object 100116 in the configuration
242 F2 Error: setting is not possible

305
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

7.2.11 Function elements: SAE J1939

Function elements: SAE J1939 status .................................................................................................307


Function elements: SAE J1939 request ...............................................................................................315
Function elements: receive SAE J1939 ...............................................................................................320
Function elements: transmit SAE J1939 ..............................................................................................325
Function elements: SAE J1939 diagnosis ............................................................................................333
2273

For SAE J1939, ifm electronic provides a number of function elements which will be explained in the
following.

306
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: SAE J1939 status

J1939_ENABLE ....................................................................................................................................308
J1939_GETDABYNAME ......................................................................................................................310
J1939_NAME .......................................................................................................................................312
J1939_STATUS ....................................................................................................................................314
15077

307
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_ENABLE
7641

Unit type = function block (FB)


Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7642

For initialisation of the J1939 stack, J1939_ENABLE is set to TRUE=1.


> This FB also causes booting of the soft I/Os of the CFG file.
> A different baud rate is only adopted if CAN_ENABLE has not been activated before.
ACE = Address Claiming Enable:
 If an ifm controller communicates with only one engine controller via J1939:
set ACE = FALSE.
 If however several engine controllers are working on the same bus:
set ACE = TRUE.
In this case the engine controllers must support the address claiming!
Otherwise you will risk an overlapping of addresses with subsequent system failure.
>

Parameters of the inputs


7643

Parameter Data type Description


ENABLE BOOL := FALSE TRUE: Enable J1939 channel
Ace=TRUE: Address claiming effected
FALSE: Block J1939 channel
CHANNEL BYTE CAN interface (1...n) depending on the device
Baud rate WORD := 250 Baud rate [Kbits/s]
(optional use of the parameter) permissible values: 20, 50, 100, 125, 250, 500, 800, 1 000
PreferredAddress BYTE = 252 preferred source address
(optional use of the parameter)
Ace BOOL := TRUE Address Claiming Enable
(optional use of the parameter) TRUE: Address claiming enabled
(control unit is self-configuring)
FALSE: No address claiming

308
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


8542

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block is active
9 09 CAN is not active
242 F2 Error: setting is not possible

309
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_GETDABYNAME
7664

= get destination arbitrary name


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7665

Via J1939_GETDABYNAME, the target address of one or several participants can be determined by
means of the name information.
 If a specific value is set on the optional inputs:
 the result list will only show the participants with this specific value.
 If no value or the default value is set on the optional inputs:
 this entry is not taken into account during filtration of the list.

310
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


7667

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
IndustryGroup BYTE = 0xFF industry group = industry group of the device
(optional use of the parameter) permissible values = 0...7
255 = 0xFF = filter for all
VehicleSystemInstance BYTE := 0xFF instance of the vehicle system
(optional use of the parameter) permissible values = 0...15 = 0x00...0x0F
255 = 0xFF = filter for all
VehicleSystem BYTE := 0xFF vehicle system
(optional use of the parameter) permissible values = 0...127 = 0x00...0x7F
255 = 0xFF = filter for all
nFunction WORD := 0xFFFF function of the device
(optional use of the parameter) permissible values = 0...255 = 0x0000...0x00FF
65 535 = 0xFFFF = filter for all
FunctionInstance BYTE := 0xFF instance of the function
(optional use of the parameter) permissible values = 0...31 = 0x00...0x1F
255 = 0xFF = filter for all
ECUInstance BYTE := 0xFF instance of the control device
(optional use of the parameter) permissible values = 0...7
255 = 0xFF = filter for all
ManufacturerCode WORD := 0xFFFF manufacturer code (must be requested from SAE)
(optional use of the parameter) permissible values = 0...2047 (211-1) = 0x0000...0x07FF
65 535 = 0xFFFF = filter for all
IdentityNumber DWORD := 0xFFFF FFFF serial number of the device (should not be overwritten)
(optional use of the parameter) permissible values = 0...2047 (211-1))
4 294 967 295 = 0xFFFF FFFF = filter for all

>

Parameters of the outputs


7668

Parameter Data type Description


DA ARRAY [0..254] OF BYTE List of found participants
255 = no participant found with this number
NUMBER BYTE Number of found bus participants.
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
8 08 function block is active
242 F2 Error: setting is not possible

311
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_NAME
7646

Unit type = function block (FB)


Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7648

Via J1939_NAME, the device can be given a name for identification in the network.
By default the name of ifm is used.
The user has the following options to change the name of the device:
► use the information from the CFG file or
► overwrite the requested data via J1939_NAME.
> If no value or a default value is set at the optional inputs:
 the preset value is not overwritten.
The following list shows the composition of the 64 bit NAME information according to SAE J1939-81:
Parameter Data type Description
arbitrary address capable 1 bit any desired address available
industry group 3 bits industry group of the device
vehicle system instance 4 bits instance of the vehicle system
vehicle system 7 bits vehicle system
reserved 1 bit reserved
function 8 bits function of the device
function instance 5 bits instance of the function
ECU instance 3 bits instance of the controller
manufacturer code 11 bits manufacturer code (must be applied for at SAE)
identify number 21 bits serial number of the device (should not be overwritten)

Table: Composition of the 64 bit NAME information according to SAE J1939-81

312
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


7652

Parameter Data type Description


ENABLE BOOL := FALSE TRUE: Any desired address available
FALSE: Fixed address
CHANNEL BYTE CAN interface (1...n) depending on the device
IndustryGroup BYTE = 0xFF industry group = industry group of the device
(optional use of the parameter) permissible values = 0...7
255 = 0xFF = filter for all
VehicleSystemInstance BYTE := 0xFF instance of the vehicle system
(optional use of the parameter) permissible values = 0...15 = 0x00...0x0F
255 = 0xFF = filter for all
VehicleSystem BYTE := 0xFF vehicle system
(optional use of the parameter) permissible values = 0...127 = 0x00...0x7F
255 = 0xFF = filter for all
nFunction WORD := 0xFFFF function of the device
(optional use of the parameter) permissible values = 0...255 = 0x0000...0x00FF
65 535 = 0xFFFF = filter for all
FunctionInstance BYTE := 0xFF instance of the function
(optional use of the parameter) permissible values = 0...31 = 0x00...0x1F
255 = 0xFF = filter for all
ECUInstance BYTE := 0xFF instance of the control device
(optional use of the parameter) permissible values = 0...7
255 = 0xFF = filter for all
ManufacturerCode WORD := 0xFFFF manufacturer code (must be requested from SAE)
(optional use of the parameter) permissible values = 0...2047 (211-1) = 0x0000...0x07FF
65 535 = 0xFFFF = filter for all
IdentityNumber DWORD := 0xFFFF FFFF serial number of the device (should not be overwritten)
(optional use of the parameter) permissible values = 0...2047 (211-1))
4 294 967 295 = 0xFFFF FFFF = filter for all

>

Parameters of the outputs


7661

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block is active
242 F2 Error: setting is not possible

313
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_STATUS
7670

Unit type = function block (FB)


Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7672

Via J1939_STATUS, relevant information can be read back to the J1939 stack.
>

Parameters of the inputs


7673

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device

>

Parameters of the outputs


7674

Parameter Data type Description


SA BYTE current source address
(e.g. after address claiming)
CYCLIC WORD number of the cyclic messages
TIMEOUT BYTE source address of the node which did not provided data for the
process image in due time
255 = 0xFF = all nodes sent the data in due time
VERSION DWORD Version of the ifm CAN stack library
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 Protocol is active
2 02 Protocol is not active
3 03 Source address requested
4 04 Address lost
242 F2 Error: setting is not possible
>

314
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: SAE J1939 request

J1939_SPEC_REQ ..............................................................................................................................316
J1939_SPEC_REQ_MULTI .................................................................................................................318
15079

315
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_SPEC_REQ
15023

= J1939 Specific Request


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
15026

J1939_SPECIFIC_REQUEST requests and receives a specific message from another controller.


If a multiframe message is requested:
• the FB provides the first 8 bytes of the data
• RESULT indicates an error
>

Parameters of the inputs


15028

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF
DA BYTE J1939 address of the requested device

316
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


15029

Parameter Data type Description


PRIO BYTE message priority (0…7)
LEN WORD number of the bytes received (0...8)
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
5 05 FB is active – no data received yet
64 40 Error: receive multiframe
242 F2 Error: setting is not possible

317
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_SPEC_REQ_MULTI
15033

= J1939 Specific Request Multiframe Message


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
15036

J1939_SPECIFIC_REQUEST requests and receives a specific multiframe message from another


controller.
>

Parameters of the inputs


15037

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF
DA BYTE J1939 address of the requested device

318
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


15038

Parameter Data type Description


PRIO BYTE message priority (0…7)
LEN WORD number of data bytes to be transmitted
allowed = 1...1 785 = 0x0001...0x06F9
DATA ARRAY [0..1784] OF BYTE Received data (1...1785 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
5 05 FB is active – no data received yet
242 F2 Error: setting is not possible

319
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: receive SAE J1939

J1939_RX .............................................................................................................................................321
J1939_RX_FIFO ...................................................................................................................................322
J1939_RX_MULTI ................................................................................................................................324
15081

320
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_RX
7724

Unit type = function block (FB)


Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7725

J1939_RX is the easiest method for receiving single frame messages. The message read last on the
CAN bus is returned.
>

Parameters of the inputs


7726

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF

The PGN = 0 is not used.


>

Parameters of the outputs


7727

Parameter Data type Description


SA BYTE Source address of the transmitter
PRIO BYTE message priority (0…7)
LEN WORD number of the bytes received (0...8)
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
5 05 FB is active – no data received yet
9 09 CAN is not active
242 F2 Error: setting is not possible

321
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_RX_FIFO
7732

= J1939 RX with FIFO


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7733

J1939_RX_FIFO enables receipt of all specified messages and their successive reading from a FIFO.
>

Parameters of the inputs


7734

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF

The PGN = 0 is not used.

322
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7735

Parameter Data type Description


SA BYTE Source address of the transmitter
PRIO BYTE message priority (0…7)
LEN BYTE number of the bytes received (0...8)
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
MORE_DATA_AVAILABLE BOOL TRUE: further received data available in the FiFo
FALSE: no further data available in the FiFo
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
5 05 FB is active – no data received yet
242 F2 Error: setting is not possible
250 FA Error: FiFo is full – data was lost

323
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_RX_MULTI
7736

= J1939 RX multiframe message


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7741

J1939_RX_MULTI enables receipt of multi-frame messages.


>

Parameters of the inputs


7743

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF

The PGN = 0 is not used.


>

Parameters of the outputs


7744

Parameter Data type Description


SA BYTE Source address of the transmitter
PRIO BYTE message priority (0…7)
LEN WORD number of the bytes received
permissible values = 0...1 785 = 0x0000 0000...0x0000 06F9
DATA ARRAY [0..1784] OF BYTE data to be sent (1...1785 bytes)
RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
5 05 FB is active – no data received yet
242 F2 Error: setting is not possible

324
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: transmit SAE J1939

J1939_TX .............................................................................................................................................326
J1939_TX_ENH ....................................................................................................................................327
J1939_TX_ENH_CYCLIC ....................................................................................................................329
J1939_TX_ENH_MULTI .......................................................................................................................331
15083

325
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_TX
7688

Unit type = function block (FB)


Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7689

J1939_TX is the easiest method for transmitting single frame messages.


>

Parameters of the inputs


7690

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
DA BYTE := 249 DA = Destination Address of the ECU
PGN > 61139: parameter DA is ignored
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)

>

Parameters of the outputs


7693

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
242 F2 Error: setting is not possible
250 FA Error: FiFo is full – data was lost

326
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_TX_ENH
7696

= J1939 TX enhanced
Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7697

Additional setting options are provided by J1939_TX_ENH (for: enhanced) for single frame messages:
 transmitting priority
 data length
Multi frame messages  J1939_TX_ENH_MULTI (→ page 331).
>

Parameters of the inputs


7702

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
DA BYTE := 249 DA = Destination Address of the ECU
PGN > 61139: parameter DA is ignored
Prio BYTE := 3 message priority
(optional use of the parameter) permissible values = 0…7
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF
Len BYTE := 8 number of the bytes to be transmitted
(optional use of the parameter) permissible values = 0...8
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)

327
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7969

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
242 F2 Error: setting is not possible
250 FA Error: FiFo is full – data was lost

328
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_TX_ENH_CYCLIC
7716

= J1939 TX enhanced cyclic


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7718

J1939_TX_ENH_CYCLIC serves for cyclic transmitting of CAN messages.


Otherwise, the FB corresponds to J1939_TX_ENH (→ page 327).
► Set the period duration via the parameter PERIOD.

If a period is too short, this could lead to a high bus load!


The bus load can affect the performance of the complete system.

>

Parameters of the inputs


7719

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
DA BYTE := 249 DA = Destination Address of the ECU
PGN > 61139: parameter DA is ignored
Prio BYTE := 3 message priority
(optional use of the parameter) permissible values = 0…7
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF
Len BYTE := 8 number of the bytes to be transmitted
(optional use of the parameter) permissible values = 0...8
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)
PERIOD TIME period duration

329
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7720

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
8 08 function block is active
242 F2 Error: setting is not possible

330
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_TX_ENH_MULTI
7699

= J1939 TX enhanced multiframe message


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7705

The transmission of multi-frame messages is carried out via J1939_TX_ENH_MULTI.


The FB corresponds to J1939_TX_ENH (→ page 327). In addition, it can be determined whether the
transmission shall be executed as BAM (Broadcast Announce Message).
>

Parameters of the inputs


7712

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
DA BYTE := 249 DA = Destination Address of the ECU
PGN > 61139: parameter DA is ignored
Prio BYTE := 3 message priority
(optional use of the parameter) permissible values = 0…7
PGN DWORD PGN = Parameter Group Number
Permissible = 0...262 143 = 0x00000000...0x0003FFFF
Len BYTE := 8 number of the bytes to be transmitted
(optional use of the parameter) permissible values = 0...8
DATA ARRAY [0..1784] OF BYTE data to be sent (1...1785 bytes)
Bam BOOL := FALSE BAM = Broadcast Announce Message = message to all participants
(optional use of the parameter) TRUE: multi-frame transmission as BAM
message to all participants
FALSE: automatic; message only to target address

331
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7714

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
8 08 function block is active
65 41 Error: transmission is not possible
242 F2 Error: setting is not possible

332
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Function elements: SAE J1939 diagnosis

J1939_DM1RX .....................................................................................................................................334
J1939_DM1TX ......................................................................................................................................336
J1939_DM1TX_CFG ............................................................................................................................339
J1939_DM3TX ......................................................................................................................................341
15085

333
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_DM1RX
14977

= J1939 Diagnostic Message 1 RX


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7761

J1939_RX_DM1 receives diagnostic messages DM1 or DM2 from other ECUs.


>

Parameters of the inputs


14979

Parameter Data type Description


ENABLE BOOL := FALSE TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
DA BYTE DA = Destination Address of the ECU from where the DTCs are to be
retrieved.
DA = 254: read DTCs from the device itself
ACTIVE BOOL TRUE: Read active DTCs (DM1)
FALSE: Read previously active DTCs (DM2)

334
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


14980

Parameter Data type Description


REDSTOPLAMP BOOL red stop lamp (for older projects only)
TRUE: ON
FALSE: OFF
AMBERWARNINGLAMP BOOL Amber warning lamp (for older projects only)
TRUE: ON
FALSE: OFF
PROTECTLAMP BOOL protect lamp (for older projects only)
TRUE: ON
FALSE: OFF
NUMBER BYTE number of the DTCs received (0...8)
SPN WORD Suspect Parameter Number
FMI BYTE Failure Mode Indicator
permissible values = 0...31 = 0x00...0x1F
SPN_CM BOOL conversion method
OC BYTE occurrence count
RESULT BYTE feedback of the function block
(possible messages → following table)
MIL_FC BYTE Status of the electronic component:
Malfunction indicatation light status and flash code:
0 = off
1 = on
2 = flash slowly
3 = flash quickly
REDSTOPLAMP_FC BYTE Status of the electronic component:
red stop light status and flash code:
0 = off
1 = on
2 = flash slowly
3 = flash quickly
AMBERWARNINGLAMP_FC BYTE Status of the electronic component:
Yellow warning light status and flash code:
0 = off
1 = on
2 = flash slowly
3 = flash quickly
PROTECTLAMP_FC BYTE Status of the electronic component:
protection light status and flash mode:
0 = off
1 = on
2 = flash slowly
3 = flash quickly

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 FB execution completed without error – data is valid
8 08 FB is active – no data was received
242 F2 Error: setting is not possible

335
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_DM1TX
14993

= J1939 Diagnostic Message 1 TX


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
7747

With J1939_TX_DM1 (DM = Diagnostic Message) the controller can only transmit an active error
message to the CAN stack.
> This message is stored in the hardware configuration.
> The message is marked "active" and transmitted once per second as DM1.
> If the error has already occurred, the event counter is incremented.
The event counter is managed by the CAN stack.
> A disjunction of all bits of the trouble codes is executed. As soon as a bit is set in one of the
trouble codes, it is equally set in the lamp state.
Upon arrival of a request at DM2, the CAN stack can read the according information from the
hardware configuration and transmit it.
> When a DM3 message arrives, all inactive errors are deleted in the error memory in the hardware
configuration.

336
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the inputs


14995

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
ACTIVE BOOL TRUE: DTC is active
Cyclically transmitted (1x per second) as DM1
FALSE: DTC is no longer active
Saved in the hardware configuration
Transmitted as DM2 when requested
REDSTOPLAMP BOOL red stop lamp (for older projects only)
TRUE: ON
FALSE: OFF
AMBERWARNINGLAMP BOOL Amber warning lamp (for older projects only)
TRUE: ON
FALSE: OFF
PROTECTLAMP BOOL protect lamp (for older projects only)
TRUE: ON
FALSE: OFF
SPN WORD Suspect Parameter Number
FMI BYTE Failure Mode Indicator
permissible values = 0...31 = 0x00...0x1F
SPN_CM BOOL conversion method
MIL_FC BYTE Status of the electronic component:
Malfunction indicatation light status and flash code:
0 = off
1 = on
2 = flash slowly
3 = flash quickly
REDSTOPLAMP_FC BYTE Status of the electronic component:
red stop light status and flash code:
0 = off
1 = on
2 = flash slowly
3 = flash quickly
AMBERWARNINGLAMP_FC BYTE Status of the electronic component:
Yellow warning light status and flash code:
0 = off
1 = on
2 = flash slowly
3 = flash quickly
PROTECTLAMP_FC BYTE Status of the electronic component:
protection light status and flash mode:
0 = off
1 = on
2 = flash slowly
3 = flash quickly

337
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


7750

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 data was marked "active" in the error memory
242 F2 Error: setting is not possible

338
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_DM1TX_CFG
15424

= J1939 Diagnostic Message 1 TX configurable


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_V02.00.02.LIB or higher

Symbol in CODESYS:

>

Description
15426

As from runtime system V03.00.03 the CAN stack automatically sends a DM1 message every second
as soon as the FB J1939_ENABLE (→ page 308) is called for the corresponding CAN interface.
► Use the FB J1939_DM1TX_CFG if you do not want the CAN stack to automatically and cyclically
transmit DM1 messages.
The FB offers the following modes for cyclic transmission of DM1 messages:
MODE = 0 The CAN stack sends DM1 "zero active faults" messages in compliance with standards every second.
(preset) A manual transmission of DM1 messages via the FB J1939_DM1TX (→ page 336)is possible.
MODE = 1 The CAN stack does not send DM1 "zero active faults" messages.
DM2 requests are answered automatically.
A manual transmission of DM1 messages via the FBJ1939_DM1TX (→ page 336) is possible.
MODE = 2 The CAN stack does not send cyclic DM1 "zero active faults" messages
Nor does the CAN stack automatically reply to DM2 requests.
>

Parameters of the inputs


15427

Parameter Data type Description


ENABLE BOOL TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
CHANNEL BYTE CAN interface (1...n) depending on the device
MODE BYTE := 0 Operating mode of the function block
allowed = 0...2 (→ Description of the FB)

339
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

Parameters of the outputs


15429

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
242 F2 Error: setting is not possible

340
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
ifm function elements ifm function elements for the device CR1201

>

J1939_DM3TX
15002

= J1939 Diagnostic Message 3 TX


Unit type = function block (FB)
Unit is contained in the library ifm_J1939_NT_Vxxyyzz.LIB

Symbol in CODESYS:

>

Description
15004

With J1939_DM3TX (DM = Diagnostic Message) you can delete the inactive DTCs on another device.
> As soon as a DM3 message is received, all inactive errors in the error memory are deleted in the
hardware configuration.
>

Parameters of the inputs


15006

Parameter Data type Description


EXECUTE BOOL := FALSE FALSE  TRUE (edge):
execute function element once
otherwise: function element is not active
A function element already started is processed.
CHANNEL BYTE CAN interface (1...n) depending on the device
DA BYTE DA = Destination Address of the ECU on which the DTCs are to be
deteled.
DA = 254: delete DTCs (DM2) in the device itself

>

Parameters of the outputs


15008

Parameter Data type Description


RESULT BYTE feedback of the function block
(possible messages → following table)

Possible results for RESULT:


Value
Description
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
242 F2 Error: setting is not possible

341
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Diagnosis and error handling ifm function elements for the device CR1201

8 Diagnosis and error handling

Diagnosis ..............................................................................................................................................343
Fault ......................................................................................................................................................343
Response to system errors...................................................................................................................343
CAN / CANopen: errors and error handling..........................................................................................343
19598

The runtime-system (RTS) checks the device by internal error checks:


• during the boot phase (reset phase)
• during executing the application program
→ chapter Operating states (→ page 26)
In so doing a high operating reliability is provided, as much as possible.

342
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Diagnosis and error handling Diagnosis

>

8.1 Diagnosis
19601

During the diagnosis, the "state of health" of the device is checked. It is to be found out if and what
→faults are given in the device.
Depending on the device, the inputs and outputs can also be monitored for their correct function.
- wire break,
- short circuit,
- value outside range.
For diagnosis, configuration and log data can be used, created during the "normal" operation of the
device.
The correct start of the system components is monitored during the initialisation and start phase.
Errors are recorded in the log file.
For further diagnosis, self-tests can also be carried out.
>

8.2 Fault
19602

A fault is the state of an item characterized by the inability to perform the requested function, excluding
the inability during preventive maintenance or other planned actions, or due to lack of external
resources.
A fault is often the result of a failure of the item itself, but may exist without prior failure.
In →ISO 13849-1 "fault" means "random fault".
>

8.3 Response to system errors


8504

In principle, the programmer is responsible to react to the error messages in the application program.
An error description is provided via the error message.
> The system resets the error message as soon as the error causing state is not present anymore.
>

8.3.1 Example process for response to an error message


8505

The runtime system cyclically writes the system flag TEMPERATURE.


The application program detects the device temperature by retrieving the INT variable.
If permissible values for the application are exceeded or not reached:
> The application program deactivates the outputs.
► Rectify the cause of the error.
> The application program detects the temperature value which has returned to normal:
The machine / system can be restarted or operation can be continued.
>

8.4 CAN / CANopen: errors and error handling


19604

→ System manual "Know-How ecomatmobile"


→ chapter CAN / CANopen: errors and error handling

343
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CAN / CANopen: errors and error handling

9 Annex

Address assignment in Ethernet networks ...........................................................................................345


System flags .........................................................................................................................................346
Possible operating modes inputs/outputs .............................................................................................352
CANopen tables ...................................................................................................................................353
1664

Additionally to the indications in the data sheets you find summary tables in the annex.

344
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex Address assignment in Ethernet networks

>

9.1 Address assignment in Ethernet networks


14436

NOTE
In the Ethernet network every IP address MUST be unique.
The following IP addresses are reserved for network-internal purposes and are therefore not allowed
as an address for participants: nnn.nnn.nnn.0 | nnn.nnn.nnn.255.
Only network participants whose subnet mask is identical and whose IP addresses are identical with
respect to the subnet mask can communicate with each other.
Rule:
If part of the subnet mask = 255, the corresponding IP address parts must be identical.
If part of the subnet mask = 0, the corresponding IP address parts must be different.
If the subnet mask = 255.255.255.0, 254 participants communicating with each other are possible in
the network.
If the subnet mask = 255.255.0.0, 256x254 = 65 024 participants communicating with each other are
possible in the network.
In the same physical network different subnet masks of the participants are allowed. They form
different groups of participants which cannot communicate with groups of participants having other
subnet masks.

In case of doubt or problems please contact your system administrator.

Examples:
Participant A Participant A Participant B Participant B Communication of
IP address Subnet mask IP address Subnet mask participants possible?

192.168.82.247 255.255.255.0 192.168.82.10 255.255.255.0 Yes, 254 participants possible


192.168.82.247 255.255.255.0 192.168.82.247 255.255.255.0 No (same IP address)
192.168.82.247 255.255.255.0 192.168.82.10 255.255.0.0 No (different subnet mask)
192.168.82.247 255.255.255.0 192.168.116.10 255.255.255.0 No (different IP address
range:
82 vs. 116)
192.168.222.213 255.255.0.0 192.168.222.123 255.255.0.0 Yes, 65 024 participants
possible
192.168.111.213 255.255.0.0 192.168.222.123 255.255.0.0 Yes, 65 024 participants
possible
192.168.82.247 255.255.255.0 192.168.82.0 255.255.255.0 no; the whole network is
disturbed because the IP
address xxx.xxx.xxx.0 is not
allowed

345
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex System flags

>

9.2 System flags

System flags: system ............................................................................................................................347


System flags: Inputs and Outputs ........................................................................................................348
System flags: Status LED .....................................................................................................................348
System flags: function keys ..................................................................................................................349
System flags: navigation keys ..............................................................................................................350
System flags: error flags .......................................................................................................................351
7958

The addresses of the system flags can change if the PLC configuration is extended.
► While programming only use the symbol names of the system flags!

346
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex System flags

>

9.2.1 System flags: system


19907

System flag (symbol name) Data type Access Description

LIGHT_SENSOR BYTE r light sensor 0...255


SUPPLY_VOLTAGE WORD r Supply voltage applied to VBBs in [mV]
CLAMP_15_VOLTAGE BOOL r Voltage monitoring on clamp 15
TEMPERATURE1 INT r Temperature 1 in the device [°C]
TEMPERATURE2 INT r Temperature 2 in the device [°C]
BACKLIGHT BYTE r/w Display brightness 0...100 %
SUPPLY_SWITCH BOOL r/w Bit for switching off the supply latching VBBS. Resetting
the flag is only accepted by the runtime system if the
voltage at clamp 15 < 4 V, otherwise the flag is activated
again.
Separation of VBBS is done before the next PLC cycle
starts. Depending on the charging status of the internal
capacitors it may take some time until the device switches
off.
TRUE: Supply of the device via VBBS is active
FALSE: Supply of the device via VBBS is deactivated
CLAMP_15_SWITCHING_THRESHO WORD r/w Switching threshold for clamp 15
LD
Legend:

r ... read only


r/w ... read and write

347
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex System flags

>

9.2.2 System flags: Inputs and Outputs


1693

System flag (symbol name) Data type Access Description

IN00 BOOL r Status on binary input 00


Requirement: input is configured as binary input
(MODE = IN_DIGITAL_H)
TRUE: Voltage on binary input > 70 % of VBBS
FALSE: Voltage on binary input < 30 % of VBBS
or: not configured as binary input
or: wrong configuration
OUT00 BOOL r/w Status on binary output 00:
TRUE: output activated
FALSE: output deactivated
Legend:

r ... read only


r/w ... read and write

>

9.2.3 System flags: Status LED


14390

System flag (symbol name) Data type Access Description


LED INT r/w LED color for "LED on"
LED_X INT r/w LED color for "LED off"
LED_MODE INT r/w LED flashing frequency
Legend:

r ... read only


r/w ... read and write

348
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex System flags

>

9.2.4 System flags: function keys


19903

The operating elements of the device are systematically numbered. → Numbering of the operating
elements (→ page 132)

System flag (symbol name) Data type Access Description


KEY_PRESSED BOOL r A button was pressed
KEY_CHANGED BOOL r Pulse: Key status changed
(= a button was pressed or released)
EDIT_MODE_ACTIVE BOOL r Status of the edit mode
TRUE = edit mode active
FALSE = edit mode inactive
KEYx_KEYCODE WORD r Bit pattern of all keys of the group x
KEYx_y BOOL r Key y in the group of keys x pressed
(e.g. KEY1_2 = key F2 in the group of keys 1)
RT_KEYx_y BOOL r Pulse (rising trigger):
Key y in the group of keys x pressed
FT_KEYx_y BOOL r Pulse (falling trigger)
Key y in the group of keys x released
AR_KEYx_y BOOL r Signal (auto repeat)
Pulse repetition if the y-key in the group of keys x is
pressed
MD_KEYx_y STRING(31) r/w Assignment of key y in the group of keys x
(preset)
ME_KEYx_y STRING(31) r/w Assignment of key y in the group of keys x
(Edit mode)
LED_KEYx_y BOOL r/w LED for key y in the group of keys x
(e.g. LED_KEY1_2 = LED in key F2 in the group of keys 1)
TRUE = LED on
FALSE = LED off
KEY_AUTOREPEAT_DELAY TIME r/w Delay time until the pulse starts when the key remains
pressed
KEY_AUTOREPEAT_PERIOD TIME r/w Repetition rate of the pulse when the key remains pressed
LED_MAX_VALUE BYTE r/w max. brightness of the key LEDs (0...100 %)
LED_NIGHT BOOL r/w TRUE = night brightness of the key LEDs active
FALSE = night brigtness of the key LEDS inactive
LED_NIGHT_VALUE BYTE r/w Night brightness of the key LEDs (0...100%)
Legend:
x ... 1, 3 (ID of the group of keys → Numbering of the operating elements (→ page 132))
y ... 1...7 (ID of the function key within the group of keys → Numbering of the operating elements (→ page 132))
r ... read only
r/w ... read and write

349
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex System flags

>

9.2.5 System flags: navigation keys


19905

The operating elements of the device are systematically numbered. → Numbering of the operating
elements (→ page 132)

System flag (symbol name) Data type Access Description


KEY3_LEFT BOOL r Navigation key: Key [] pressed
KEY3_RIGHT BOOL r Navigation key: Key [] pressed
KEY3_UP BOOL r Navigation key: Key [] pressed
KEY3_DOWN BOOL r Navigation key: Key [] pressed
KEY3_PUSH BOOL r Navigation key: Center key pressed
RT_KEY3_LEFT BOOL r Pulse (rising trigger)
Navigation key: Key [] pressed
RT_KEY3_RIGHT BOOL r Pulse (rising trigger)
Navigation key: Key [] pressed
RT_KEY3_UP BOOL r Pulse (rising trigger):
Navigation key: Key [] pressed
RT_KEY3_DOWN BOOL r Pulse (rising trigger)
Navigation key: Key [] pressed
RT_KEY3_PUSH BOOL r Pulse (rising trigger)
Navigation key: Center key pressed
FT_KEY3_LEFT BOOL r Pulse (falling trigger)
Navigation key: Key [] released
FT_KEY3_RIGHT BOOL r Pulse (falling trigger)
Navigation key: Key [] released
FT_KEY3_UP BOOL r Pulse (falling trigger)
Navigation key: Key [] released
FT_KEY3_DOWN BOOL r Pulse (falling trigger)
Navigation key: Key [] released
FT_KEY3_PUSH BOOL r Pulse (falling trigger)
Navigation key: Center key released
AR_KEY3_LEFT BOOL r Pulse repetition when the navigation key [] is kept
pressed
AR_KEY3_RIGHT BOOL r Pulse repetition when the navigation key [] is kept
pressed
AR_KEY3_UP BOOL r Pulse repetition when the navigation key [] is kept
pressed
AR_KEY3_DOWN BOOL r Pulse repetition when the navigation key [] is kept
pressed
AR_KEY3_PUSH BOOL r Pulse repetition when the center key of the navigation key
is kept pressed
MD_KEY3_LEFT STRING(31) r/w Navigation key: Assignment [] key
(preset)
MD_KEY3_RIGHT STRING(31) r/w Navigation key: Assignment [] key
(preset)
MD_KEY3_UP STRING(31) r/w Navigation key: Assignment [] key
(preset)

350
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex System flags

System flag (symbol name) Data type Access Description

MD_KEY3_DOWN STRING(31) r/w Navigation key: Assignment [] key


(preset)
MD_KEY3_PUSH STRING(31) r/w Navigation key: Assignment center key pressed
(preset)
ME_KEY3_LEFT STRING(31) r/w Navigation key: Assignment [] key
(edit mode)
ME_KEY3_RIGHT STRING(31) r/w Navigation key: Assignment [] key
(edit mode)
ME_KEY3_UP STRING(31) r/w Navigation key: Assignment [] key
(edit mode)
ME_KEY3_DOWN STRING(31) r/w Navigation key: Assignment [] key
(edit mode)
ME_KEY3_PUSH STRING(31) r/w Navigation key: Assignment center key pressed
(edit mode)
LED_NAVIGATION_SWITCH BOOL r/w LED for navigation key
TRUE = LED on
FALSE = LED off
Legend:

r ... read only


r/w ... read and write

>

9.2.6 System flags: error flags


11545

System flag (symbol name) Data type Access Description


ERROR_TEMPERATURE BOOL r Temperature error
TRUE: Value out of range
> general error
FALSE: Value OK
ERROR_POWER BOOL r Voltage error for VBBS / clamp 15:
TRUE: Value out of range
or: difference (VBB15 - VBBS) too great
> general error
FALSE: Value OK
Legend:

r ... read only


r/w ... read and write

351
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex Possible operating modes inputs/outputs

9.3 Possible operating modes inputs/outputs


9736

Possible configuration combinations (where permissible) are created by adding the configuration
values.

Config. value Config. value


Operating mode of the Operating mode of the
Inputs Outputs
inputs outputs
hex dec hex dec
IN00 IN_DIGITAL_H (plus) 1 1 OUT00 OUT_DIGITAL_H (plus)
IN_DIGITAL_L (minus) 2 2
IN_CURRENT 4 4
IN VOLTAGE10 8 8
IN_VOLTAGE30 10 16
IN_RATIO 20 32

= this configuration value is default

352
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

9.4 CANopen tables

Structure of CANopen messages .........................................................................................................354


Boot-up message .................................................................................................................................359
Network management (NMT) ...............................................................................................................360
CANopen error code .............................................................................................................................365
9941

The following tables will inform you about important values and settings of the CANopen interfaces.

353
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

9.4.1 Structure of CANopen messages

Structure of the COB ID........................................................................................................................355


Function code / Predefined Connectionset ..........................................................................................356
SDO command bytes ...........................................................................................................................357
SDO abort code ....................................................................................................................................358
9971

A CANopen message consists of the COB ID and up to 8-byte data:


COB ID DLC Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8
X X X X X X X X X X X X X X X X X X X X

Details are given in the following chapters.

Please note the reversed byte order! ( Little Endian or Intel format)

Examples:
Value [hex] Data type Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8
12 BYTE 1 2 – – – – – – – – – – – – – –
1234 WORD 3 4 1 2 – – – – – – – – – – – –
12345678 DWORD 7 8 5 6 3 4 1 2 – – – – – – – –

354
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

Structure of the COB ID


9972

The first part of a message is the COB ID. Structure of the 11-bit COB ID:
Nibble 0 Nibble 1 Nibble 2
11 10 9 8 7 6 5 4 3 2 1 0
-- 3 2 1 0 6 5 4 3 2 1 0
-- function code node ID

The COB ID consists of the Function code / Predefined Connectionset (→ page 356) and the node ID.
Example:
Communication object = TPDO1 (TX)
Node number of the device = 0x020 = 32
Calculation:
Function code for the communication object TPDO1 = 0x03
Significance of the function code in the 11-bit COB ID = 0x03 • 0x80 = 0x180
Add the node number (0x020)  the COB ID is: 0x1A0
1 A 0
3 2 1 0 3 2 1 0 3 2 1 0
0 0 0 1 1 0 1 0 0 0 0 0
-- 0x03 = 3 0x020 = 32

355
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

Function code / Predefined Connectionset


9966

In the "CANopen Predefined Connectionset" some function codes are predefined.


When using the predefined connectionset you can operate a CANopen network of up to
127 participants without the risk of a double assignment of COB IDs.
Broadcast or multicast messages:
Function code
Communication object COB ID [hex] Related parameter objects [hex]
[hex]
NMT 0 000
SYNC 1 080 1005, 1006, 1007, 1028
TIME 2 100 1012, 1013

Point-to-point messages:
Function code
Communication object COB ID [hex] Related parameter objects [hex]
[hex]
EMERGENCY 1 080 + node ID 1014, 1015
TPDO1 (TX) 3 180 + node ID 1800
RPDO1 (RX) 4 20016 + node ID 1400
TPDO2 (TX) 5 280 + node ID 1801
RPDO2 (RX) 6 30016 + node ID 1401
TPDO3 (TX) 7 380 + node ID 1802
RPDO3 (RX) 8 400 + node ID 1402
TPDO4 (TX) 9 480 + node ID 1803
RPDO4 (RX) A 500 + node ID 1403
Default SSDO (TX) B 58016 + node ID 1200
Default CSDO (RX) C 60016 + node ID 1280
NMT Error Control E 70016 + node ID 1016, 1017

TX = slave sends to master SSDO = server SDO


RX = slave receives from master CSDO = client SDO

356
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

SDO command bytes


9968

Structure of an SDO message:


COB-ID DLC Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8
Data
XXX 8 Command Index Sub index
depending on the data to be transmitted

Please note the reversed byte order! ( Little Endian or Intel format)

An SDO COB ID consists of:


CANopen
Node ID COB ID SDO
TX: 0x580 + node ID
1…127
RX: 0x600 + node ID
TX = slave sends to master
RX = slave receives from master

DLC = Data Length Code = in CANopen the number of the data bytes in a message.
For →SDO: DLC = 8
SDO command bytes:
Command
Message Data length Description
hex | dec
21 33 request more than 4 bytes send data to slave
22 34 request 1…4 bytes send data to slave
23 35 request 4 bytes send data to slave
27 39 request 3 bytes send data to slave
2B 43 request 2 bytes send data to slave
2F 47 request 1 byte send data to slave

40 64 request --- request data from slave


42 66 response 1…4 bytes send data from slave to master
43 67 response 4 bytes send data from slave to master
47 71 response 3 bytes send data from slave to master
4B 75 response 2 bytes send data from slave to master
4F 79 response 1 byte send data from slave to master

data transfer ok:


60 96 response ---
send confirmation of receipt from slave to master
data transfer failed
80 128 response 4 bytes send abort message from slave to master
 chapter SDO abort code (→ page 358)

357
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

SDO abort code


9970

The SDO abort code is NOT part of the emergency message!


Abord code
Description
[hex]

0503 0000 toggle bit not alternated


0504 0000 SDO protocol timed out
0504 0001 client/server command specifier not valid or unknown
0504 0002 invalid block size (block mode only)
0504 0003 invalid sequence number (block mode only)
0504 0004 CRC error (block mode only)
0504 0005 out of memory
0601 0000 unsupported access to an object
0601 0001 attempt to read a write only object
0601 0002 attempt to write a read only object
0602 0000 object does not exist in the object dictionary
0604 0041 object cannot be mapped to the PDO
0604 0042 the number and length of the objects to be mapped would exceed PDO length
0604 0043 general parameter incompatibility reason
0604 0047 general internal incompatibility in the device
0606 0000 access failed due to an hardware error
0607 0010 data type does not match, length of service parameter does not match
0607 0012 data type does not match, length of service parameter too high
0607 0013 data type does not match, length of service parameter too low
0609 0011 sub-index does not exist
0609 0030 value range of parameter exceeded (only for write access)
0609 0031 value of parameter written too high
0609 0032 value of parameter written too low
0609 0036 maximum value is less than minimum value
0800 0000 general error
0800 0020 data cannot be transferred or stored to the application
0800 0021 data cannot be transferred or stored to the application because of local control
0800 0022 data cannot be transferred or stored to the application because of the present device state
object dictionary dynamic generation fails or no object dictionary is present
0800 0023
(e.g. object dictionary is generated from file and generation fails because of an file error)

358
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

9.4.2 Boot-up message


9961

After booting, the CAN participate sends the boot-up message once:
COB ID DLC Byte 1
hex 0x700 + node ID 0x1 0x00
dec 1 792 + node ID 1 0

The participant is now capable of communicating in the CAN network.


DLC = Data Length Code = in CANopen the number of the data bytes in a message.
For →SDO: DLC = 8
Example:
The node ID of the participant is 0x7D = 125.
The COP ID of the boot-up message is: 0x77D = 1 917
Deviation:
There are devices that cannot send a [0x700 + Node ID] (these are devices that were built before
version 4 of the CANopen specification).
These devices send the following boot-up message and without status instead:
COB ID DLC
hex 0x080 + node ID 0x0
dec 128 + node ID 0

359
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

9.4.3 Network management (NMT)

Network management commands ........................................................................................................361


NMT state .............................................................................................................................................361
9974

360
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

Network management commands


9962

With the following network management commands the user can influence the operating mode of
individual or all CAN participants. Structure:
COB ID DLC Byte 1 Byte 2
0x000 X Command Node ID

Node ID = 00  command valid for all nodes in the network at the same time
COB ID NMT command Description
0x000 0x01 = 01 Node ID start_remode_node Set the node to the "operational" state
0x000 0x02 = 02 Node ID stop_remode_node Set the node to the "STOPPED" state
0x000 0x80 = 128 Node ID enter_pre-operational Set the node to the "PRE-OPERATIONAL" state
0x000 0x81 = 129 Node ID reset_node Node reset
0x000 0x82 = 130 Node ID reset_communication Reset the CAN communication of the node
>

NMT state
9963

The status byte informs about the state of the CAN participant.

Permitted transitions:
(1) State is automatically reached at power on
(2) Internal initialisation completed – node
automatically goes to PRE-OPERATIONAL
(3) NMT service "Start Remote Node"
(4) + (7) NMT service "Enter PRE-OPERATIONAL"
(5) + (8) NMT service "Stop Remote Node"
(6) NMT service "Start Remote Node"
(9)...(11) NMT service "Reset Node"
(12)...(14) NMT service "Reset Communication"

Graphics: state transitions under CANopen

361
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

NMT state for CANopen master


9964

These statuses show the internal status of the CANopen master stack.
They are not defined by the CANopen specification.

State
Description
hex | dec
00 0 not defined
Master waits for a boot-up message of the node.
01 1
OR: Master waits for the expiry of the given guard time.
• Master waits for 300 ms.
02 2 • Master requests the object 0x1000.
• Then the state is set to 3.
The master configures its slaves. To do so, all SDOs generated by the configurator are transmitted to the
03 3
slaves one after the other. Then the master changes to status 5.
After transmission of all SDOs to the slaves the master goes to state 5 and remains in this state. State 5 is the
05 5
normal operating state for the master.

To read the node state out of the FB:


Used function block Node state is found here
CANx_MASTER_STATUS output NODE_STATE
CANOPEN_GETSTATE output MASTERSTATE

362
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

NMT state for CANopen slave


9965

State
Description
hex | dec
FF -1 The slave is reset by the NMT message "Reset Node" and automatically goes to state 1.
00 0 not defined
state = waiting for BOOTUP
01 1
After max. 2 s or immediately on reception of its boot up message the slave goes to state 2.
state = BOOTUP
02 2
After a delay of 0.5 s the slave automatically goes to state 3.
state = PREPARED
The slave is configured in state 3. The slave remains in state 3 as long as it has received all SDOs generated
by the configurator. It is not important whether during the slave configuration the response to SDO transfers is
abort (error) or whether the response to all SDO transfers is no error. Only the response as such received by
the slave is important – not its contents.
03 3
If in the configurator the option "Reset node" has been activated, a new reset of the node is carried out after
transmitting the object 0x1011 sub-index 1 which then contains the value "load". The slave is then polled again
with the upload of the object 0x1000.
Slaves with a problem during the configuration phase remain in state 3 or directly go to an error state
(state > 5) after the configuration phase.
state = PRE-OPERATIONAL
A node always goes to state 4 except for the following cases:
04 4  it is an "optional" slave and it was detected as non available on the bus (polling for object 0x1000) OR:
 the slave is present but reacted to the polling for object 0x1000 with a type in the lower 16 bits other than
expected by the configurator.
state = OPERATIONAL
State 5 is the normal operating state of the slave: [Normal Operation].
If the master was configured to [Automatic startup], the slave starts in state 4 (i.e. a "start node" NMT message
05 5
is generated) and the slave goes automatically to state 5.
If the flag GLOBAL_START was set, the master waits until all slaves are in state 4. All slaves are then started
with the NMT command [Start All Nodes].
A node goes to state 97 if it is optional (optional device in the CAN configuration) and has not reacted to the
SDO polling for object 0x1000.
61 97
If the slave is connected to the network and detected at a later point in time, it is automatically started. To do
so, you must have selected the option [Automatic startup] in the CAN parameters of the master.
62 98 A node goes to state 98 if the device type (object 0x1000) does not correspond to the configured type.
In case of a nodeguarding timeout the slave is set to state 99.
As soon as the slave reacts again to nodeguard requests and the option [Automatic startup] is activated, it is
63 99 automatically started by the master. Depending on the status contained in the response to the nodeguard
requests, the node is newly configured or only started.
To start the slave manually it is sufficient to use the method [NodeStart].

Nodeguard messages are transmitted to the slave ...


• if the slave is in state 4 or higher AND
• if nodeguarding was configured.
To read the node state out of the FB:
Used function block Node state is found here
CANx_MASTER_STATUS
output NODE_STATE
CANx_SLAVE_STATUS
CANOPEN_GETSTATE output NODESTATE

363
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

CANopen status of the node


1973

Node status according to CANopen (with these values the status is also coded by the node in the
corresponding messages).
Status
CANopen status: Description
hex | dec
00 0 BOOTUP BOOTUP message of the node
The node is in the status STOPPED. There is no exchange of data and the node
04 4 STOPPED
cannot be configured, either.
The node is in the status OPERATIONAL and participates in the normal exchange
05 5 OPERATIONAL
of data.
The node is in the status PRE-OPERATIONAL and can be configured by the
7F 127 PRE-OPERATIONAL
master.

If nodeguarding active: the most significant status bit toggles between the messages.
Read the node status from the function block:
Function block used Node status is found here
CANx_MASTER_STATUS Structure element LAST_STATE from the array NODE_STATE_SLAVE
CANx_SLAVE_STATUS Output NODE_STATE
CANOPEN_GETSTATE Output LASTNODESTATE

364
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

9.4.4 CANopen error code

Emergency messages ..........................................................................................................................366


Overview CANopen error codes ...........................................................................................................366
Object 0x1001 (error register) ..............................................................................................................368
9967

365
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

Emergency messages
9973

Device errors in the slave or problems in the CAN bus trigger emergency messages:
COB ID DLC Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
0x80 + object
error code device-specific
node ID 0x1001

Please note the reversed byte order! ( Little Endian or Intel format)

>

Overview CANopen error codes


545

Error Code (hex) Meaning

00xx Reset or no error


10xx Generic error
20xx Current
21xx Current, device input side
22xx Current inside the device
23xx Current, device output side
30xx Voltage
31xx Mains voltage
32xx Voltage inside the device
33xx Output voltage
40xx Temperature
41xx Ambient temperature
42xx Device temperature
50xx Device hardware
60xx Device software
61xx Internal software
62xx User software
63xx Data set
70xx Additional modules
80xx Monitoring
81xx Communication
8110 CAN overrun-objects lost
8120 CAN in error passiv mode
8130 Life guard error or heartbeat error
8140 Recovered from bus off
8150 Transmit COB-ID collision
82xx Protocol error
8210 PDO not processed due to length error
8220 PDO length exceeded

366
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

Error Code (hex) Meaning


90xx External error
F0xx Additional functions
FFxx Device specific

367
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Annex CANopen tables

>

Object 0x1001 (error register)


8547

This object reflects the general error state of a CANopen device. The device is to be considered as
error free if the object 0x1001 signals no error any more.
Bit Meaning (Bedeutung)
0 generic error
1 current
2 voltage
3 temperature

4 communication error
5 device profile specific
6 reserved – always 0
7 manufacturer specific

For an error message more than one bit in the error register can be set at the same time.
Example: CR2033, message "wire break" at channel 2 ( installation manual of the device):
COB-ID DLC Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8
0x80 +
00 FF 81 10 00 00 00 00
node ID

Error code = 0xFF00


Error register = 0x81 = 0b1000 0001, thus it consists of the following errors:
• generic error
• manufacturer specific
Concerned channel = 0x0010 = 0b0000 0000 0001 0000 = wire break channel 2

368
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

10 Glossary of Terms C
A CAN
CAN = Controller Area Network
Address CAN is a priority-controlled fieldbus system for
This is the "name" of the bus participant. All large data volumes. There are several
participants need a unique address so that the higher-level protocols that are based on CAN,
signals can be exchanged without problem. e.g. 'CANopen' or 'J1939'.
>
>

Application software CAN stack


Software specific to the application, CAN stack = software component that deals
implemented by the machine manufacturer, with processing CAN messages.
generally containing logic sequences, limits >

and expressions that control the appropriate


inputs, outputs, calculations and decisions.
CiA
>
CiA = CAN in Automation e.V.
User and manufacturer organisation in
Architecture Germany / Erlangen. Definition and control
Specific configuration of hardware and/or body for CAN and CAN-based network
software elements in a system. protocols.
>

Homepage → www.can-cia.org
B
>

CiA DS 304
Baud DS = Draft Standard
Baud, abbrev.: Bd = unit for the data CANopen device profile for safety
transmission speed. Do not confuse baud with communication
"bits per second" (bps, bits/s). Baud indicates
>

the number of changes of state (steps, cycles) CiA DS 401


per second over a transmission length. But it is
not defined how many bits per step are DS = Draft Standard
transmitted. The name baud can be traced CANopen device profile for binary and
back to the French inventor J. M. Baudot analogue I/O modules
>

whose code was used for telex machines.


1 MBd = 1024 x 1024 Bd = 1 048 576 Bd
>
CiA DS 402
DS = Draft Standard
Boot loader CANopen device profile for drives
>

On delivery ecomatmobile controllers only


contain the boot loader. CiA DS 403
The boot loader is a start program that allows
DS = Draft Standard
to reload the runtime system and the
CANopen device profile for HMI
application program on the device. >

The boot loader contains basic routines...


• for communication between hardware CiA DS 404
modules, DS = Draft Standard
• for reloading the operating system. CANopen device profile for measurement and
The boot loader is the first software module to control technology
be saved on the device. >

>

CiA DS 405
Bus
DS = Draft Standard
Serial data transmission of several participants CANopen specification of the interface to
on the same cable. programmable controllers (IEC 61131-3)
>

>

369
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

Depending on event-controlled branchings in


CiA DS 406 the program this can take longer or shorter.
>

DS = Draft Standard
CANopen device profile for encoders
>
D
CiA DS 407 Data type
DS = Draft Standard Depending on the data type, values of different
CANopen application profile for local public sizes can be stored.
transport Data size in the
min. value max. value
>

type memory

Clamp 15 BOOL FALSE TRUE 8 bits

In vehicles clamp 15 is the plus cable switched BYTE 0 255 8 bits


by the ignition lock. WORD 0 65 535 16 bits
>

DWORD 0 4 294 967 295 32 bits


COB ID SINT -128 127 8 bits
COB = Communication Object
USINT 0 255 8 bits
ID = Identifier
ID of a CANopen communication object INT -32 768 32 767 16 bits
Corresponds to the identifier of the CAN UINT 0 65 535 16 bits
message with which the communication
DINT -2 147 483 648 2 147 483 647 32 bits
project is sent via the CAN bus.
>

UDINT 0 4 294 967 295 32 bits

CODESYS -3.402823466 •
REAL 3.402823466 • 1038 32 bits
1038
CODESYS® is a registered trademark of 3S –
ULINT 0 18 446 744 073 709 551 615 64 Bbts
Smart Software Solutions GmbH, Germany.
'CODESYS for Automation Alliance' associates number of
STRING
companies of the automation industry whose char. + 1
hardware devices are all programmed with the
>

widely used IEC 61131-3 development tool DC


CODESYS®.
Homepage → www.codesys.com Direct Current
>

>

CSV file Diagnosis


CSV = Comma Separated Values (also: During the diagnosis, the "state of health" of
Character Separated Values) the device is checked. It is to be found out if
A CSV file is a text file for storing or and what →faults are given in the device.
exchanging simply structured data. Depending on the device, the inputs and
The file extension is .csv. outputs can also be monitored for their correct
Example: Source table with numerical values: function.
- wire break,
value 1.0 value 1.1 value 1.2 value -1.3
short circuit,
value 2.0 value 2.1 value 2.2 value -2.3
value outside range.
value 3.0 value 3.1 value 3.2 value 3.3diagnosis, configuration and log data can
For
be used, created during the "normal" operation
This results in the following CSV file: of the device.
value 1.0;value 1.1;value 1.2;value 1.3 The correct start of the system components is
value 2.0;value 2.1;value 2.2;value 2.3 monitored during the initialisation and start
value 3.0;value 3.1;value 3.2;value 3.3
.

>
phase. Errors are recorded in the log file.
For further diagnosis, self-tests can also be
Cycle time carried out.
>

This is the time for a cycle. The PLC program


performs one complete run.

370
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

Dither Embedded software


Dither is a component of the →PWM signals to System software, basic program in the device,
control hydraulic valves. It has shown for virtually the →runtime system.
electromagnetic drives of hydraulic valves that The firmware establishes the connection
it is much easier for controlling the valves if the between the hardware of the device and the
control signal (PWM pulse) is superimposed by application program. The firmware is provided
a certain frequency of the PWM frequency. by the manufacturer of the controller as a part
This dither frequency must be an integer part of the system and cannot be changed by the
of the PWM frequency. user.
>

>

DLC EMC
Data Length Code = in CANopen the number EMC = Electro Magnetic Compatibility.
of the data bytes in a message. According to the EC directive (2004/108/EEC)
For →SDO: DLC = 8 concerning electromagnetic compatibility (in
>

short EMC directive) requirements are made


DRAM for electrical and electronic apparatus,
equipment, systems or components to operate
DRAM = Dynamic Random Access Memory.
satisfactorily in the existing electromagnetic
Technology for an electronic memory module
environment. The devices must not interfere
with random access (Random Access
with their environment and must not be
Memory, RAM). The memory element is a
adversely influenced by external
capacitor which is either charged or
electromagnetic interference.
discharged. It becomes accessible via a >

switching transistor and is either read or


overwritten with new contents. The memory EMCY
contents are volatile: the stored information is abbreviation for emergency
lost in case of lacking operating voltage or too Message in the CANopen protocol with which
late restart. errors are signalled.
>

>

DTC Ethernet
DTC = Diagnostic Trouble Code = error code Ethernet is a widely used,
In the protocol J1939 faults and errors well be manufacturer-independent technology which
managed and reported via assigned numbers enables data transmission in the network at a
– the DTCs. speed of 10...10 000 million bits per second
>

(Mbps). Ethernet belongs to the family of


E so-called "optimum data transmission" on a
non exclusive transmission medium. The
ECU concept was developed in 1972 and specified
as IEEE 802.3 in 1985.
(1) Electronic Control Unit = control unit or >

microcontroller
(2) Engine Control Unit = control device of a EUC
engine EUC = Equipment Under Control.
EUC is equipment, machinery, apparatus or
>

EDS-file plant used for manufacturing, process,


transportation, medical or other activities
EDS = Electronic Data Sheet, e.g. for: (→ IEC 61508-4, section 3.2.3). Therefore, the
• File for the object directory in the CANopen EUC is the set of all equipment, machinery,
master, apparatus or plant that gives rise to hazards
• CANopen device descriptions. for which the safety-related system is required.
Via EDS devices and programs can exchange If any reasonably foreseeable action or
their specifications and consider them in a inaction leads to →hazards with an intolerable
simplified way. risk arising from the EUC, then safety functions
>

are necessary to achieve or maintain a safe


state for the EUC. These safety functions are

371
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

performed by one or more safety-related


systems. H
>

F Heartbeat
The participants regularly send short signals.
FiFo In this way the other participants can verify if a
participant has failed.
FIFO (First In, First Out) = Operating principle >

of the stack memory: The data packet that was


written into the stack memory first, will also be HMI
read first. Each identifier has such a buffer HMI = Human Machine Interface
(queue). >

I
>

Flash memory
Flash ROM (or flash EPROM or flash memory) ID
combines the advantages of semiconductor ID = Identifier
memory and hard disks. Similar to a hard disk,
the data are however written and deleted Name to differentiate the devices / participants
blockwise in data blocks up to 64, 128, 256, connected to a system or the message
1024, ... bytes at the same time. packets transmitted between the participants.
>

Advantages of flash memories


 The stored data are maintained even if IEC 61131
there is no supply voltage. Standard: Basics of programmable logic
 Due to the absence of moving parts, flash controllers
is noiseless and insensitive to shocks and • Part 1: General information
magnetic fields. • Part 2: Production equipment requirements
and tests
Disadvantages of flash memories • Part 3: Programming languages
 A storage cell can tolerate a limited • Part 5: Communication
number of write and delete processes: • Part 7: Fuzzy Control Programming
• Multi-level cells: typ. 10 000 cycles >

• Single level cells: typ. 100 000 cycles


IEC user cycle
 Given that a write process writes memory
blocks of between 16 and 128 Kbytes at IEC user cycle = PLC cycle in the CODESYS
the same time, memory cells which require application program.
>

no change are used as well.


Instructions
>

FRAM Superordinate word for one of the following


FRAM, or also FeRAM, means Ferroelectric terms:
Random Access Memory. The storage installation instructions, data sheet, user
operation and erasing operation is carried out information, operating instructions, device
by a polarisation change in a ferroelectric manual, installation information, online help,
layer. system manual, programming manual, etc.
>

Advantages of FRAM as compared to


conventional read-only memories: Intended use
• non-volatile,
Use of a product in accordance with the
• compatible with common EEPROMs, but:
information provided in the instructions for use.
• access time approx. 100 ns, >

• nearly unlimited access cycles possible.


>

IP address
IP = Internet Protocol.
The IP address is a number which is
necessary to clearly identify an internet
participant. For the sake of clarity the number

372
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

is written in 4 decimal values, e.g.


127.215.205.156. M
>

ISO 11898 MAC-ID


MAC = Manufacturer‘s Address Code
Standard: Road vehicles – Controller area
network = manufacturer's serial number.
→ID = Identifier
• Part 1: Data link layer and physical
Every network card has a MAC address, a
signalling
• Part 2: High-speed medium access unit clearly defined worldwide unique numerical
• Part 3: Low-speed, fault-tolerant, medium code, more or less a kind of serial number.
dependent interface Such a MAC address is a sequence of
• Part 4: Time-triggered communication 6 hexadecimal numbers, e.g.
• Part 5: High-speed medium access unit with "00-0C-6E-D0-02-3F".
>

low-power mode
>

Master
ISO 11992 Handles the complete organisation on the bus.
Standard: Interchange of digital information on The master decides on the bus access time
and polls the →slaves cyclically.
electrical connections between towing and >

towed vehicles
• Part 1: Physical and data-link layers Misuse
• Part 2: Application layer for brakes and
The use of a product in a way not intended by
running gear
the designer.
• Part 3: Application layer for equipment other The manufacturer of the product has to warn
than brakes and running gear against readily predictable misuse in his user
• Part 4: Diagnostics
>
information.
>

ISO 16845 MMI


Standard: Road vehicles – Controller area → HMI (→ page 372)
network (CAN) – Conformance test plan >

>

MRAM
J
MRAM = Magnetoresistive Random Access
J1939 Memory
The information is stored by means of
→ SAE J1939 magnetic storage elements. The property of
>

certain materials is used to change their


L electrical resistance when exposed to
magnetic fields.
LED Advantages of MRAM as compared to
conventional RAM memories:
LED = Light Emitting Diode. • non volatile (like FRAM), but:
Light emitting diode, also called luminescent • access time only approx. 35 ns,
diode, an electronic element of high coloured • unlimited number of access cycles possible.
luminosity at small volume with negligible >

power loss.
>

MSB
Link Most Significant Bit/Byte
>

A link is a cross-reference to another part in


the document or to an external document. N
>

NMT
LSB
NMT = Network Management = (here: in the
Least Significant Bit/Byte
>
CANopen protocol).

373
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

The NMT master controls the operating states


of the NMT slaves. PCMCIA card
>

PCMCIA = Personal Computer Memory Card


Node International Association, a standard for
expansion cards of mobile computers.
This means a participant in the network.
>
Since the introduction of the cardbus standard
in 1995 PCMCIA cards have also been called
Node Guarding PC card.
>

Node = here: network participant


Configurable cyclic monitoring of each →slave PDM
configured accordingly. The →master verfies if
PDM = Process and Dialogue Module.
the slaves reply in time. The slaves verify if the
Device for communication of the operator with
master regularly sends requests. In this way
the machine / plant.
failed network participants can be quickly >

identified and reported.


>

PDO
O PDO = Process Data Object.
The time-critical process data is transferred by
Obj / object means of the "process data objects" (PDOs).
The PDOs can be freely exchanged between
Term for data / messages which can be the individual nodes (PDO linking). In addition
exchanged in the CANopen network. it is defined whether data exchange is to be
>

event-controlled (asynchronous) or
Object directory synchronised. Depending on the type of data
to be transferred the correct selection of the
Contains all CANopen communication
type of transmission can lead to considerable
parameters of a device as well as
relief for the →CAN bus.
device-specific parameters and data.
>
According to the protocol, these services are
unconfirmed data transmission: it is not
OBV checked whether the receiver receives the
Contains all CANopen communication message. Exchange of network variables
parameters of a device as well as corresponds to a "1 to n connection"
device-specific parameters and data. (1 transmitter to n receivers).
>

>

OPC PDU
OPC = OLE for Process Control PDU = Protocol Data Unit.
Standardised software interface for The PDU is an item of the →CAN protocol
manufacturer-independent communication in →SAE J1939. PDU indicates a part of the
automation technology destination or source address.
>

OPC client (e.g. device for parameter setting


or programming) automatically logs on to OPC PES
server (e.g. automation device) when
Programmable Electronic System ...
connected and communicates with it.
>
• for control, protection or monitoring,
• dependent for its operation on one or more
Operational programmable electronic devices,
Operating state of a CANopen participant. In • including all elements of the system such as
this mode →SDOs, →NMT commands and input and output devices.
→PDOs can be transferred.
>

>

PGN
P PGN = Parameter Group Number
PGN = PDU format (PF) + PDU source (PS)
PC card The parameter group number is an item of the
→CAN protocol →SAE J1939. PGN collects
→PCMCIA card
>
the address parts PF and PS.

374
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

>

Pictogram PWM
Pictograms are figurative symbols which PWM = pulse width modulation
convey information by a simplified graphic The PWM output signal is a pulsed signal
representation. (→ chapter What do the symbols between GND and supply voltage.
and formats mean? (→ page 7)) Within a defined period (PWM frequency) the
>

mark-to-space ratio is varied. Depending on


the mark-to-space ratio, the connected load
PID controller determines the corresponding RMS current.
The PID controller >

(proportional–integral–derivative controller)
consists of the following parts: R
• P = proportional part
• I = integral part ratiometric
• D = differential part (but not for the controller Measurements can also be performed
CR04nn, CR253n). ratiometrically. If the output signal of a sensor
>

is proportional to its suppy voltage then via


ratiometric measurement (= measurement
PLC configuration proportional to the supply) the influence of the
Part of the CODESYS user interface. supply's fluctuation can be reduced, in ideal
► The programmer tells the programming case it can be eliminated.
system which hardware is to be → analogue input
programmed. >

> CODESYS loads the corresponding RAW-CAN


libraries.
RAW-CAN means the pure CAN protocol
> Reading and writing the periphery states which works without an additional
(inputs/outputs) is possible. communication protocol on the CAN bus (on
ISO/OSI layer 2). The CAN protocol is
>

Pre-Op international defined according to ISO 11898-1


and garantees in ISO 16845 the
Pre-Op = PRE-OPERATIONAL mode. interchangeability of CAN chips in addition.
Operating status of a CANopen participant. >

After application of the supply voltage each


participant automatically passes into this state. remanent
In the CANopen network only →SDOs and Remanent data is protected against data loss
→NMT commands can be transferred in this in case of power failure.
mode but no process data. The →runtime system for example
automatically copies the remanent data to a
>

Process image →flash memory as soon as the voltage supply


falls below a critical value. If the voltage supply
Process image is the status of the inputs and is available again, the runtime system loads
outputs the PLC operates with within one the remanent data back to the RAM memory.
→cycle. The data in the RAM memory of a controller,
 At the beginning of the cycle the PLC however, is volatile and normally lost in case of
reads the conditions of all inputs into the power failure.
process image. >

During the cycle the PLC cannot detect


changes to the inputs. ro
 During the cycle the outputs are only RO = read only for reading only
changed virtually (in the process image). Unidirectional data transmission: Data can only
be read and not changed.
 At the end of the cycle the PLC writes the >

virtual output states to the real outputs.


>
RTC
RTC = Real Time Clock
Provides (batter-backed) the current date and

375
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

time. Frequent use for the storage of error Examples:


message protocols. • Automatic configuration of all slaves via
>

→SDOs at the system start,


• reading error messages from the →object
Runtime system directory.
Basic program in the device, establishes the Every SDO is monitored for a response and
connection between the hardware of the repeated if the slave does not respond within
device and the application program. the monitoring time.
>
>

rw Self-test
RW = read/ write Test program that actively tests components or
Bidirectional data transmission: Data can be devices. The program is started by the user
read and also changed. and takes a certain time. The result is a test
>

protocol (log file) which shows what was tested


S and if the result is positive or negative.
>

SAE J1939 Slave


The network protocol SAE J1939 describes the Passive participant on the bus, only replies on
communication on a →CAN bus in commercial request of the →master. Slaves have a clearly
vehicles for transmission of diagnosis data defined and unique →address in the bus.
(e.g.engine speed, temperature) and control >

information.
Standard: Recommended Practice for a Serial stopped
Control and Communications Vehicle Network Operating status of a CANopen participant. In
• Part 2: Agricultural and Forestry Off-Road this mode only →NMT commands are
Machinery Control and Communication transferred.
Network >

• Part 3: On Board Diagnostics


Symbols
Implementation Guide
• Part 5: Marine Stern Drive and Inboard Pictograms are figurative symbols which
Spark-Ignition Engine On-Board Diagnostics convey information by a simplified graphic
Implementation Guide representation. (→ chapter What do the symbols
• Part 11: Physical Layer – 250 kBits/s, and formats mean? (→ page 7))
Shielded Twisted Pair >

• Part 13: Off-Board Diagnostic Connector


System variable
• Part 15: Reduced Physical Layer, 250
kBits/s, Un-Shielded Twisted Pair (UTP) Variable to which access can be made via IEC
• Part 21: Data Link Layer address or symbol name from the PLC.
• Part 31: Network Layer
>

• Part 71: Vehicle Application Layer


• Part 73: Application Layer – Diagnostics
T
• Part 81: Network Management Protocol
>
Target
The target contains the hardware description
SD card of the target device for CODESYS, e.g.: inputs
An SD memory card (short for Secure Digital and outputs, memory, file locations.
Memory Card) is a digital storage medium that Corresponds to an electronic data sheet.
operates to the principle of →flash storage. >

TCP
>

SDO The Transmission Control Protocol is part of


SDO = Service Data Object. the TCP/IP protocol family. Each TCP/IP data
The SDO is used for access to objects in the connection has a transmitter and a receiver.
CANopen object directory. 'Clients' ask for the This principle is a connection-oriented data
requested data from 'servers'. The SDOs transmission. In the TCP/IP protocol family the
always consist of 8 bytes. TCP as the connection-oriented protocol

376
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Glossary of Terms

assumes the task of data protection, data flow


control and takes measures in the event of
data loss. (compare: →UDP)
>

Template
A template can be filled with content.
Here: A structure of pre-configured software
elements as basis for an application program.
>

U
UDP
UDP (User Datagram Protocol) is a minimal
connectionless network protocol which belongs
to the transport layer of the internet protocol
family. The task of UDP is to ensure that data
which is transmitted via the internet is passed
to the right application.
At present network variables based on →CAN
and UDP are implemented. The values of the
variables are automatically exchanged on the
basis of broadcast messages. In UDP they are
implemented as broadcast messages, in CAN
as →PDOs.
According to the protocol, these services are
unconfirmed data transmission: it is not
checked whether the receiver receives the
message. Exchange of network variables
corresponds to a "1 to n connection"
(1 transmitter to n receivers).
>

Use, intended
Use of a product in accordance with the
information provided in the instructions for use.
>

W
Watchdog
In general the term watchdog is used for a
component of a system which watches the
function of other components. If a possible
malfunction is detected, this is either signalled
or suitable program branchings are activated.
The signal or branchings serve as a trigger for
other co-operating system components to
solve the problem.
>

wo
WO = write only
Unidirectional data transmission: Data can only
be changed and not read.

377
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Index CANopen tables

CAN_TX_ENH_CYCLIC ......................................................................251
11 Index CANopen
Tables .......................................................................................................... 353
A CANopen error code ............................................................................365
CANopen status of the node ...............................................................364
About this manual ....................................................................................5
CANopen tables...................................................................................353
Access the device with SSH ................................................................119
CANOPEN_ENABLE ...........................................................................260
Access the device with Telnet .............................................................119
CANOPEN_GETBUFFERFLAGS .......................................................262
Access to the Linux runtime system ....................................................118
CANOPEN_GETEMCYMESSAGES...................................................300
Activate network variable support .......................................................100
CANOPEN_GETERRORREGISTER ..................................................302
Activate the access protection for an IEC project .................................90
CANOPEN_GETGUARDHBERRLIST ................................................295
Add additional libraries ........................................................................114
CANOPEN_GETGUARDHBSTATSLV ...............................................297
Address ................................................................................................369
CANOPEN_GETNMTSTATESLAVE ..................................................269
Address assignment in Ethernet networks ..........................................345
CANOPEN_GETODCHANGEDFLAG ................................................273
Analogue inputs .....................................................................................21
CANOPEN_GETSTATE ......................................................................264
Analogue video input .............................................................................23
CANOPEN_GETSYNCSTATE ............................................................291
Annex ...................................................................................................344
CANOPEN_NMTSERVICES ...............................................................270
Application program ...............................................................................25
CANOPEN_READOBJECTDICT ........................................................274
Application software.............................................................................369
CANOPEN_SDOREAD .......................................................................278
Architecture..........................................................................................369
CANOPEN_SDOREADBLOCK ...........................................................280
Audio signalling device (buzzer) ............................................................15
CANOPEN_SDOREADMULTI ............................................................282
Automatically restore system files .........................................................82
CANOPEN_SDOWRITE .....................................................................284
B CANOPEN_SDOWRITEBLOCK .........................................................286
CANOPEN_SDOWRITEMULTI...........................................................288
Backup CANOPEN_SENDEMCYMESSAGE ..................................................304
Save the system files .................................................................................... 68
CANOPEN_SETSTATE ......................................................................266
Save the system information......................................................................... 67
CANOPEN_SETSYNCSTATE ............................................................293
Baud.....................................................................................................369
CANOPEN_WRITEOBJECTDICT ......................................................275
Binary inputs ..........................................................................................20
Characteristics of the pressure point ...................................................140
Binary output..........................................................................................22
CiA .......................................................................................................369
Boot loader ..........................................................................................369
CiA DS 304 ..........................................................................................369
Boot-up message.................................................................................359
CiA DS 401 ..........................................................................................369
Bus .......................................................................................................369
CiA DS 402 ..........................................................................................369
BUZZER_CLICK ..................................................................................194
CiA DS 403 ..........................................................................................369
BUZZER_ON .......................................................................................195
CiA DS 404 ..........................................................................................369
C CiA DS 405 ..........................................................................................369
CiA DS 406 ..........................................................................................370
Calibration of the touch screen............................................................141
CiA DS 407 ..........................................................................................370
Camera visualisation .............................................................................17
Clamp 15..............................................................................................370
CamsOffOnPageSwitch.......................................................................173
COB ID.................................................................................................370
CAN ...............................................................................................22, 369
CODESYS ...........................................................................................370
CAN / CANopen
CODESYS programming manual ............................................................7
errors and error handling............................................................................. 343
CODESYS visualisation elements.......................................................129
CAN stack ............................................................................................369
Complete and transmit the project (global network variables) ............101
CAN test
Components of the runtime system.......................................................30
Receive data.................................................................................................. 63
Transmit data................................................................................................. 62 Configuration
camera image .............................................................................................. 143
CAN_ENABLE .....................................................................................232
Configuration of the camera image .....................................................143
CAN_RECOVER .................................................................................233
Configuration of the inputs and outputs...............................................122
CAN_REMOTE_REQUEST ................................................................254
Configure camera image .....................................................................151
CAN_REMOTE_RESPONSE..............................................................256
Configure CAN interfaces ......................................................................87
CAN_RX ..............................................................................................238
Configure input ....................................................................................123
CAN_RX_ENH.....................................................................................239
Configure IP parameter of ethernet interface ........................................34
CAN_RX_ENH_FIFO ..........................................................................241
Configure output ..................................................................................123
CAN_RX_RANGE ...............................................................................243
Configure the camera bitmap in the dialogue [Bitmap Configuration] 144
CAN_RX_RANGE_FIFO .....................................................................245
Configure the controller .........................................................................86
CAN_SETDOWNLOADID ...................................................................234
Configure the device as CANopen master ............................................87
CAN_STATUS .....................................................................................235
Configure the device as CanSlave ........................................................88
CAN_TX ...............................................................................................248
Configure the IP parameter manually....................................................36
CAN_TX_ENH .....................................................................................249
Configuring functions of operating elements .......................................132

378
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Index

Control buzzer .....................................................................................135 FocusFrameImagePath .......................................................................202


Control status LED and key LEDs .......................................................135 Fonts
Copy files with FTP ..............................................................................120 Load the font .................................................................................................. 73
Copy the files with SCP .......................................................................120 Remove the font ............................................................................................ 73
COPY_PDM_TO_USB ........................................................................189 FRAM ...................................................................................................372
COPY_USB_TO_PDM ........................................................................190 Function code / Predefined Connectionset .........................................356
Copyright..................................................................................................6 Function elements
Create CODESYS project manually ......................................................85 CANopen ..................................................................................................... 258
CANopen emergency .................................................................................. 299
Create PLC program............................................................................113
CANopen guarding ...................................................................................... 294
Create visualisation .............................................................................131
CANopen network management ................................................................. 268
Creating application program ..............................................................112 CANopen object directory ........................................................................... 272
CSV file ................................................................................................370 CANopen SDOs .......................................................................................... 277
CurrentVisuDisplayed ..........................................................................206 CANopen status .......................................................................................... 259
CURSOR_POSITION ..........................................................................201 CANopen SYNC .......................................................................................... 290
Cycle time ............................................................................................370 Control LED + buzzer .................................................................................. 193
RAW-CAN (Layer 2) .................................................................................... 230
D RAW-CAN remote ....................................................................................... 253
RAW-CAN status ......................................................................................... 231
Data type..............................................................................................370 receive RAW-CAN data .............................................................................. 237
DC ........................................................................................................370 receive SAE J1939 ...................................................................................... 320
Device configuration ..............................................................................38 SAE J1939 ................................................................................................... 306
Diagnosis .................................................................................... 343, 370 SAE J1939 diagnosis .................................................................................. 333
Diagnosis and error handling...............................................................342 SAE J1939 request ..................................................................................... 315
Display ...................................................................................................14 SAE J1939 status ........................................................................................ 307
Display elements ...................................................................................14 transmit RAW-CAN data ............................................................................. 247
transmit SAE J1939..................................................................................... 325
Display options for analogue cameras ................................................147
Display the I/O configuration ...............................................................123 G
Dither ...................................................................................................371
DLC ......................................................................................................371 General notes ......................................................................................138
Download the update file .......................................................................30 GET_DEVICE_SERIAL .......................................................................176
DRAM ..................................................................................................371 GET_ETHERNET ................................................................................177
Drawing area .......................................................................................125 GET_VERSIONS .................................................................................179
DTC......................................................................................................371
H
E Hardware ...............................................................................................13
ECU .....................................................................................................371 Heartbeat .............................................................................................372
EDS-file ................................................................................................371 History of the instructions ........................................................................8
Embedded software .............................................................................371 HMI ......................................................................................................372
EMC .....................................................................................................371 How is this documentation structured? ...................................................8
EMCY...................................................................................................371
I
Emergency messages .........................................................................366
Enter the recovery mode .......................................................................31 ID .........................................................................................................372
Enter the setup mode ............................................................................39 IEC 61131 ............................................................................................372
Ethernet .........................................................................................23, 371 IEC user cycle ......................................................................................372
EUC .....................................................................................................371 ifm function elements...........................................................................154
Example ifm function elements for the device CR1201 .....................................164
Capture mode .............................................................................................. 148 ifm libraries for the device CR1201 .....................................................155
edit controls in CR1081 ............................................................................... 134 ifm target package for CODESYS .........................................................26
INPUT_INT with 3 input elements .............................................................. 213 ifm weltweit • ifm worldwide • ifm à l’échelle internationale.................384
Overlay mode .............................................................................................. 149 Indicate the failure of an Ethernet camera ..........................................144
Example process for response to an error message ..........................343 Information concering the device ..........................................................12
Exit setup, reboot device .......................................................................82 INIT_VAR_RETAIN_DINT ...................................................................218
EXITPLC_START_APPLICATION ......................................................228 INIT_VAR_RETAIN_INT .....................................................................220
INIT_VAR_RETAIN_REAL ..................................................................222
F
INPUT ..................................................................................................166
Fault .....................................................................................................343 Input functions for touch screens ........................................................139
FB, FUN, PRG in CODESYS ................................................................93 INPUT_DINT........................................................................................207
FiFo ......................................................................................................372 INPUT_INT ..........................................................................................210
First steps ..............................................................................................91 INPUT_REAL.......................................................................................215
Flash memory ......................................................................................372 Inputs (technology) ................................................................................19
FOCUSED_ELEMENT ........................................................................200

379
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Index CANopen tables

Insert an analogue camera image in a CODESYS project .................150 Limitations for program and data memories ..........................................16
Insert an Ethernet camera image in a CODESYS project ..................143 Limitations for visualisations ................................................................128
Install and set up mobile camera.........................................................142 Link ......................................................................................................373
Install fonts (true type fonts) ................................................................136 LOAD_SPLASH_SCREEN..................................................................171
Install the CODESYS programming system..........................................28 LSB ......................................................................................................373
Install the device-specific target package .............................................28
Installation ..............................................................................................27 M
Instructions ..........................................................................................372 MAC-ID ................................................................................................373
Integrate libraries .................................................................................101 Master ..................................................................................................373
Intended use ........................................................................................372 Mirror the camera image at its horizontal axis ........................... 145, 151
Interfaces ...............................................................................................18 Misuse..................................................................................................373
Internal parameters............................................................. 209, 212, 217 MMI ......................................................................................................373
IP address............................................................................................372 Movement of elements ........................................................................130
ISO 11898 ............................................................................................373 MRAM ..................................................................................................373
ISO 11992 ............................................................................................373 MSB .....................................................................................................373
ISO 16845 ............................................................................................373
N
J
Navigation key .......................................................................................46
J1939 ...................................................................................................373 Network management (NMT) ..............................................................360
J1939_DM1RX ....................................................................................334 Network management commands.......................................................361
J1939_DM1TX .....................................................................................336 Network variables via UDP ....................................................................95
J1939_DM1TX_CFG ...........................................................................339 NMT .....................................................................................................373
J1939_DM3TX .....................................................................................341 NMT state ............................................................................................361
J1939_ENABLE ...................................................................................308 NMT state for CANopen master ..........................................................362
J1939_GETDABYNAME .....................................................................310 NMT state for CANopen slave .............................................................363
J1939_NAME.......................................................................................312 Node ....................................................................................................374
J1939_RX ............................................................................................321 Node Guarding ....................................................................................374
J1939_RX_FIFO ..................................................................................322 NORM_DINT .......................................................................................182
J1939_RX_MULTI ...............................................................................324 NORM_REAL ......................................................................................183
J1939_SPEC_REQ .............................................................................316 Note the cycle time! .............................................................................110
J1939_SPEC_REQ_MULTI ................................................................318 Note! ......................................................................................................10
J1939_STATUS ...................................................................................314 Notes..............................................................................................30, 123
J1939_TX.............................................................................................326 Notes on visualisations ........................................................................125
J1939_TX_ENH ...................................................................................327 Notizen • Notes • Notes .......................................................................383
J1939_TX_ENH_CYCLIC ...................................................................329 Numbering of the operating elements ........................................ 132, 133
J1939_TX_ENH_MULTI ......................................................................331
O
K
Obj / object ...........................................................................................374
Key assignment in recovery mode ........................................................30 Object 0x1001 (error register) .............................................................368
Key functionality.....................................................................................41 Object directory....................................................................................374
Key LEDs ...............................................................................................15 OBV .....................................................................................................374
KEY_CLICK .........................................................................................196 OPC .....................................................................................................374
KEY_MAPPING ...................................................................................174 Open the configuration dialogue ................................................ 144, 151
Keywords for edit controls ...................................................................133 Operating elements ...............................................................................15
Operating instructions............................................................................40
L Operating modes ...................................................................................20
LED ......................................................................................................373 Operating modes of the inputs / outputs .............................................352
Libraries ...............................................................................................110 Operating sequence ............................................................................111
Library ifm_CANopen_NT_Vxxyyzz.LIB..............................................161 Operating states ....................................................................................26
Library ifm_CR1201_Vxxyyzz.LIB .......................................................156 Operation
Library ifm_J1939_NT_Vxxyyzz.LIB ...................................................162 Enter a text using the on-screen keyboard ................................................... 45
Library ifm_NetVarLib_NT_Vxxyyzz.LIB .............................................163 Navigate in the file directory .......................................................................... 44
Library ifm_PDM_input_V01yyzz.LIB ..................................................159 Navigate in the setup menu .......................................................................... 42
Navigate within a menu screen ..................................................................... 43
Library ifm_PDM360NG_linux_syscall_asynch_V02yyzz.LIB ............158
Operational ..........................................................................................374
Library ifm_PDM360NG_special_V02yyzz.LIB ...................................157
Output parameters ...............................................................................171
Library ifm_PDM360NG_USB_LL_V02yyzz.LIB.................................159
Outputs (technology) .............................................................................22
Library ifm_PDM360NG_USB_Vxxyyzz.lib .........................................158
OverlayVisu .........................................................................................205
Library ifm_PDMng_util_Vxxyyzz.LIB .................................................157
Overvi ew CANopen error codes ....................................................366
Library ifm_RAWCan_NT_Vxxyyzz.LIB ..............................................160

380
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Index

Overview Retain variables .....................................................................................94


documentation modules for ecomatmobile devices ....................................... 6 ro ..........................................................................................................375
Overview CANopen error codes..........................................................366 Rotate the camera image ........................................................... 144, 152
RTC......................................................................................................375
P Runtime system .............................................................................25, 376
PC card ................................................................................................374 Runtime system update via USB memory device .................................32
PCMCIA card .......................................................................................374 Runtime system update via web browser .............................................33
PDF rw .........................................................................................................376
Navigating in the PDF file ............................................................................. 77
PDF file viewer.......................................................................................76 S
PDF-Viewer SAE J1939 .......................................................................... 165, 306, 376
Display extended menu................................................................................. 79 Safety instructions ...................................................................................9
Display PDF file in full-screen mode ............................................................. 78
Safety instructions about Reed relays ...................................................21
Display the tabel of content of the PDF file .................................................. 80
Save changed values ................................................................. 146, 152
PDM .....................................................................................................374
Save project in the device ...................................................................121
PDM_PAGECONTROL .......................................................................203
SD card ................................................................................................376
PDO .....................................................................................................374
SDO .....................................................................................................376
PDU .....................................................................................................374
SDO abort code ...................................................................................358
PES ......................................................................................................374
SDO command bytes ..........................................................................357
PGN .....................................................................................................374
Select analogue camera ......................................................................151
Pictogram .............................................................................................375
Select first target system and create project .........................................98
Pictograms ...............................................................................................7
Self-test ................................................................................................376
PID controller .......................................................................................375
Set communication parameters.............................................................99
PLC configuration ................................................................................375
Set the display mode ...........................................................................151
PointOfContact ....................................................................................225
Set the IP address of the Ethernet camera .........................................144
Possible operating modes inputs/outputs ...........................................352
Set the target system .............................................................................84
POUs
SET_BOOTUP_BACKLIGHT ..............................................................170
Adjust analouge and digital values ............................................................. 181
Help functions .............................................................................................. 226 SET_ETHERNET ................................................................................168
Manage visualisation ................................................................................... 198 Setting-up the programming interface .................................................116
Manage, read and write the USB memory device ...................................... 185 Setup
Read device information ............................................................................. 175 Backup / Restore software components ....................................................... 66
Setup the device .......................................................................................... 165 Calibrate the touchscreen ............................................................................. 75
Use touch screen functions ......................................................................... 224 Change the system password ....................................................................... 57
Predefined connectionset ....................................................................356 Configure the Ethernet interface ................................................................... 51
Pre-Op .................................................................................................375 Configure the IP parameters automatically .................................................. 52
Configure the IP parameters manually ......................................................... 51
Presets .................................................................................................123
Define the splash screen............................................................................... 64
Previous knowledge...............................................................................10
Display system information ........................................................................... 59
Process image .....................................................................................375 Enable / Disable password protection .......................................................... 58
Process touch screen inputs ...............................................................138 Enter the password for full access to the setup menu ................................. 48
Processing user input ..........................................................................132 Format the internal storage ........................................................................... 74
Programming .........................................................................................83 Manage fonts ................................................................................................. 72
Programming interfaces ......................................................................115 More functions ............................................................................................... 60
Programming notes for CODESYS projects .........................................92 Reboot the device ......................................................................................... 61
Programming system CODESYS 2.3 ....................................................26 Safely remove the USB device ..................................................................... 71
Set the CAN interfaces .................................................................................. 53
Provide error messages of the camera ...................................... 145, 152
Set the display brightness ............................................................................. 55
PWM ....................................................................................................375
Set the network services ............................................................................... 56
Set the password protection ......................................................................... 57
Q Set the real-time clock (RTC) ........................................................................ 54
Quit the recovery mode .........................................................................37 Setup menu with restricted access rights ..................................................... 48
start screen .................................................................................................... 49
R Start the application....................................................................................... 81
System settings ............................................................................................. 50
ratiometric ............................................................................................375
Test input elements ....................................................................................... 65
RAW-CAN ............................................................................................375 Test the CAN interfaces ................................................................................ 62
Real-time clock (RTC) ...........................................................................17 Working with enabled password protection .................................................. 47
remanent..............................................................................................375 Setup and operate analogue cameras ................................................147
Resample / scale image ......................................................................125 Setup and operate Ethernet cameras .................................................143
Response to system errors..................................................................343 Slave ....................................................................................................376
Restore Software components ............................................................................25
Restore the system files ................................................................................ 70 Software description ..............................................................................24

381
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Index CANopen tables

Specifications of the splash screen image ............................................64 Watchdog .............................................................................................377


SPEED_UP_VISU_TASK....................................................................199 Watchdog behaviour ............................................................................111
Start-up behaviour of the controller .......................................................11 What do the symbols and formats mean?...............................................7
Status-LED ............................................................................................14 What previous knowledge is required? .................................................10
stopped ................................................................................................376 wo ........................................................................................................377
Structure of CANopen messages ........................................................354 Write projects for more devices ...........................................................105
Structure of the COB ID.......................................................................355
Supported types of variables .................................................................94
Switch between colour and greyscale representation .........................144
Switch the camera on/off .....................................................................145
Symbol files .........................................................................................137
Symbols ...............................................................................................376
Synchronize the IP parameters with DHCP sever ................................35
System description ................................................................................12
System flags ....................................................................... 109, 346, 348
error flags .................................................................................................... 351
function keys................................................................................................ 349
Inputs and Outputs ...................................................................................... 348
navigation keys ............................................................................................ 350
Status LED .................................................................................................. 348
system ......................................................................................................... 347
System variable ...................................................................................376
SYSTEM_ASYNCH .............................................................................229

T
Target...................................................................................................376
TCP ......................................................................................................376
Template ..............................................................................................377
Test transmission of the global network variables ..............................108
Texts ....................................................................................................125
TOGGLE ..............................................................................................184
Touchscreen ..........................................................................................46
TouchScreenDisable ...........................................................................172
Transmit projects .................................................................................107

U
UDP .....................................................................................................377
Update the runtime system....................................................................31
Update the runtime system of the device ..............................................29
USB........................................................................................................23
USB_STORAGE_HANDLER ..............................................................191
USB_STORAGE_MANAGER .............................................................186
USB_STORAGE_REMOVE ................................................................188
Use access protection ...........................................................................89
Use edit controls ..................................................................................133
Use of optical and acustical feedback .................................................135
Use of the Ethernet camera image in CODESYS ...............................146
Use of touch screen functions .............................................................138
Use the analogue camera image in CODESYS ..................................153
Use visual feedback.............................................................................140
Use visualisations ................................................................................124
Use, intended.......................................................................................377

V
Variables ................................................................................................94
VERSION .............................................................................................227
Visualisation limits ...............................................................................127

W
watchdog..................................................................................... 111, 377

382
ifm Programming manual PDM360 NG 12" / Touch (CR1201) V02.03.xx, CODESYS 2.3 2015-08-27
Notizen • Notes • Notes CANopen tables

12 Notizen • Notes • Notes


13 ifm weltweit • ifm worldwide • ifm à l’échelle
internationale
Version: 2015-03-06 8310

www.ifm.com • Email: info@ifm.com


Service hotline: 0800 / 16 16 16 (only Germany, Mo-Fr 07.00...18.00 h)
ifm Niederlassungen • Sales offices • Agences
D ifm electronic gmbh Vertrieb Deutschland
Niederlassung Nord • 31135 Hildesheim • Tel. 0 51 21 / 76 67-0
Niederlassung West • 45128 Essen • Tel. 02 01 / 3 64 75 -0
Niederlassung Mitte-West • 58511 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
ifm electronic gmbh • Friedrichstraße 1 • 45128 Essen

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


OFF ifm efector pty ltd. • Mulgrave Vic 3170 • Tel. +61 3 00 365 088
B, L ifm electronic N.V. • 1731 Zellik • Tel. +32 2 / 4 81 02 20
BR ifm electronic Ltda. • 03337-000, Sao Paulo SP • Tel. +55 11 / 2672-1730
CH ifm electronic ag • 4 624 Härkingen • Tel. +41 62 / 388 80 30
CN ifm electronic (Shanghai) Co. Ltd. • 201203 Shanghai • Tel. +86 21 / 3813 4800
CND ifm efector Canada inc. • Oakville, Ontario L6K 3V3 • Tel. +1 800-441-8246
CZ ifm electronic spol. s.r.o. • 25243 Průhonice • Tel. +420 267 990 211
DK ifm electronic a/s • 2605 BROENDBY • Tel. +45 70 20 11 08
E ifm electronic s.a. • 08820 El Prat de Llobregat • Tel. +34 93 479 30 80
F ifm electronic s.a. • 93192 Noisy-le-Grand Cedex • Tél. +33 0820 22 30 01
FIN ifm electronic oy • 00440 Helsinki • Tel . +358 75 329 5000
GB, IRL ifm electronic Ltd. • Hampton, Middlesex TW12 2HD • Tel. +44 208 / 213-0000
GR ifm electronic Monoprosopi E.P.E. • 15125 Amaroussio • Tel. +30 210 / 6180090
H ifm electronic kft. • 9028 Györ • Tel. +36 96 / 518-397
I ifm electronic s.a. • 20041 Agrate-Brianza (MI) • Tel. +39 039 / 68.99.982
IL Astragal Ltd. • Azur 58001 • Tel. +972 3 -559 1660
IND ifm electronic India Branch Office • Kolhapur, 416234 • Tel. +91 231-267 27 70
J efector co., ltd. • Chiba-shi, Chiba 261-7118 • Tel. +81 043-299-2070
MAL ifm electronic Pte. Ltd • 47100 Puchong Selangor • Tel. +603 8063 9522
MEX ifm efector S. de R. L. de C. V. • Monterrey, N. L. 64630 • Tel. +52 81 8040-3535
N Sivilingeniør J. F. Knudtzen A/S • 1396 Billingstad • Tel. +47 66 / 98 33 50
NL ifm electronic b.v. • 3843 GA Harderwijk • Tel. +31 341 / 438 438
P ifm electronic s.a. • 4410-136 São Félix da Marinha • Tel. +351 223 / 71 71 08
PL ifm electronic Sp. z o.o. • 40-106 Katowice • Tel. +48 32-608 74 54
RA, ROU ifm electronic s.r.l. • 1107 Buenos Aires • Tel. +54 11 / 5353 3436
ROK ifm electronic Ltd. • 140-884 Seoul • Tel. +82 2 / 790 5610
RP Gram Industrial, Inc. • 1770 Mantilupa City • Tel. +63 2 / 850 22 18
RUS ifm electronic • 105318 Moscow • Tel. +7 495 921-44-14
S ifm electronic a b • 41250 Göteborg • Tel. +46 31 / 750 23 00
SGP ifm electronic Pte. Ltd. • Singapore 609 916 • Tel. +65 6562 8661/2/3
SK ifm electronic s.r.o. • 835 54 Bratislava • Tel. +421 2 / 44 87 23 29
THA SCM Allianze Co., Ltd. • Bangkok 10 400 • Tel. +66 02 615 4888
TR ifm electronic Ltd. Sti. • 34381 Sisli/Istanbul • Tel. +90 212 / 210 50 80
UA TOV ifm electronic • 02660 Kiev • Tel. +380 44 501 8543
USA ifm efector inc. • Exton, PA 19341 • Tel. +1 610 / 5 24-2000
ZA ifm electronic (Pty) Ltd. • 0157 Pretoria • Tel. +27 12 345 44 49
Technische Änderungen behalten wir uns ohne vorherige 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.

You might also like