IFM Electronic CR0452 Programming Manual

Programming Manual
BasicDisplay
Runtime system v03
CODESYS® v2.3
English
739
100
2 / 04
05 / 2018
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
Contents
Contents
1 About this manual 4
1.1 Copyright .............................................................................................................................. 4
1.2 Overview: documentation modules for CR0452 .................................................................. 5
1.3 What do the symbols and formats mean? ........................................................................... 6
1.4 How is this documentation structured? ................................................................................ 7
1.5 History of the instructions (CR0452) .................................................................................. 7
2 Safety instructions 8
2.1 Please note .......................................................................................................................... 8
2.2 What previous knowledge is required? ................................................................................ 8
2.3 Start-up behaviour of the controller...................................................................................... 9
2.4 Notes: serial number ............................................................................................................ 9
3 System description 10
3.1 Information about the device ..............................................................................................10
3.1.1 Accessories ................................................................................................................................ 10
3.2 Hardware description .........................................................................................................11
3.2.1 Hardware setup ................................................................................................ .......................... 11
3.2.2 Status-LED ................................................................................................................................. 14
3.3 Interface description ...........................................................................................................15
3.3.1 CAN interfaces ........................................................................................................................... 15
3.4 Software description ..........................................................................................................16
3.4.1 Software modules for the device ................................................................................................ 16
3.4.2 Programming notes for CODESYS projects ............................................................................... 19
3.4.3 Operating states ......................................................................................................................... 22
3.4.4 Performance limits of the device ................................................................................................ 25
4 Configurations 32
4.1 Set up the runtime system .................................................................................................32
4.1.1 Reinstall the runtime system ...................................................................................................... 33
4.1.2 Update the runtime system ......................................................................................................... 34
4.1.3 Verify the installation .................................................................................................................. 34
4.2 Set up the programming system ........................................................................................35
4.2.1 Set up the programming system manually ................................................................................. 35
4.2.2 Set up the programming system via templates ........................................................................... 39
4.3 Function configuration in general .......................................................................................40
4.3.1 System variables ........................................................................................................................ 40
4.4 Variables ............................................................................................................................41
4.4.1 Retain variables .......................................................................................................................... 42
4.4.2 Network variables ....................................................................................................................... 43
5 ifm function elements 44
5.1 ifm libraries for the device CR0452 ....................................................................................44
5.1.1 Required libraries ....................................................................................................................... 44
5.1.2 Library ifm_CR0452_Vxxyyzz.LIB .............................................................................................. 45
5.1.3 Library ifm_CR0452_Init_Vxxyyzz.LIB ....................................................................................... 46
5.1.4 Library ifm_PDMsmart_util_Vxxyyzz.LIB ................................................................ .................... 46
5.1.5 Library ifm_RAWCan_NT_Vxxyyzz.LIB...................................................................................... 46
5.1.6 Library ifm_CANopen_NT_Vxxyyzz.LIB ..................................................................................... 47
5.1.7 Library ifm_J1939_NT_Vxxyyzz.LIB ........................................................................................... 48
2
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
Contents
5.2 ifm function elements for the device CR0452 ....................................................................50
5.2.1 Function element outputs ........................................................................................................... 51
5.2.2 Function elements: RAW-CAN (Layer 2) ................................................................ .................... 52
5.2.3 Function elements: CANopen ..................................................................................................... 80
5.2.4 Function elements: SAE J1939 ................................................................................................ 126
5.2.5 Function elements: system ....................................................................................................... 158
5.2.6 Function elements: graphics ..................................................................................................... 176
6 Diagnosis and error handling 186
6.1 Diagnosis .........................................................................................................................186
6.2 Fault .................................................................................................................................186
6.3 Response to system errors ..............................................................................................187
6.3.1 Example process for response to an error message ................................................................ 187
6.4 CAN / CANopen: errors and error handling .....................................................................187
7 Appendix 188
7.1 System flags .....................................................................................................................188
7.2 Error tables .......................................................................................................................190
7.2.1 Error flags ................................................................................................................................. 190
7.2.2 Errors: CAN / CANopen............................................................................................................ 190
8 Terms and abbreviations 191
9 Index 205
10 Notizen • Notes • Notes 209
3
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
About this manual Copyright

1 About this manual

Copyright .................................................................................................................................................. 4
Overview: documentation modules for CR0452 ....................................................................................... 5
What do the symbols and formats mean? ................................................................................................ 6
How is this documentation structured? .................................................................................................... 7
History of the instructions (CR0452) ...................................................................................................... 7
>

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™
• EtherCAT® is a registered trade mark and patented technology, licensed by Beckhoff Automation GmbH, Germany
• IO-Link® ( www.io-link.com) is the property of the PROFIBUS Nutzerorganisation e.V., Germany
• ISOBUS is the property of the AEF – Agricultural Industry Electronics Foundation e.V., Deutschland ( www.aef-online.org)
• Microsoft® is the property of the Microsoft Corporation, USA ( www.microsoft.com)
• Modbus® is the property of the Schneider Electric SE, France ( www.schneider-electric.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
202
4
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
About this manual Overview: documentation modules for CR0452
>
Document
Contents / Description
Data sheet
Technical data in a table
Installation instructions (are supplied with the device)
Instructions for installation, electrical installation, and commissioning  Technical data
Programming manual
Functions of the setup menu of the device  Creation of a CODESYS project with this device  Target settings with CODESYS  Programming of the device-internal PLC with CODESYS  Description of the device-specific CODESYS function libraries
System manual "Know-How ecomatmobile"
Know-how about the following topics (examples):
Overview Templates and demo programs  CAN, CANopen  Control outputs  Visualisations  Overview of the files and libraries

1.2 Overview: documentation modules for CR0452

The documentation for this devices consists of the following modules: (Downloads from ifm's website www.ifm.com )
22853
5
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
About this manual What do the symbols and formats mean?
>
WARNING
Death or serious irreversible injuries may result.
CAUTION
Slight reversible injuries may result.
NOTICE
Property damage is to be expected or may result.
Important note Non-compliance can result in malfunction or interference
Information Supplementary note
...
Request for action
> ...
Reaction, result
...
"see"
abc
Cross-reference
123 0x123 0b010
Decimal number Hexadecimal number Binary number
[...]
Designation of pushbuttons, buttons or indications

1.3 What do the symbols and formats mean?

The following symbols or pictograms illustrate the notes in our instructions:
203
6
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
About this manual How is this documentation structured?
>
Date
Theme
Change
2014-03-24
Visualisation limits
Information concerning the permissible drawing area
2014-04-29
FB CAN_REMOTE_RESPONSE
More precise description of the function block ENABLE
2014-05-12
Limitations CAN
Limitations added for CAN, CANopen and CAN J1939
2014-06-30
Name of the documentation
"System manual" renamed as "Programming manual"
2015-01-13
Structure of documentation for error codes, system flags
• error flags: now only in the appendix, chapter System flags
• CAN / CANopen errors and error handling: now only in the system manual "Know-How"
error codes, EMCY codes: now in the appendix, chapter Error tables
2015-03-10
Available memory
Description improved
2017-01-13
Software manual for CODESYS 2.3
hint to download from the ifm homepage removed
2018-07-09
List of the ifm branch offices
removed

1.4 How is this documentation structured?

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 Appendix.
In case of malfunctions or uncertainties please contact the manufacturer at: Contact www.ifm.com
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: www.ifm.com
>
204
1508

1.5 History of the instructions (CR0452)

What has been changed in this manual? An overview:
15324
7
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
Safety instructions Please note

2 Safety instructions

Please note ............................................................................................................................................... 8
What previous knowledge is required? .................................................................................................... 8
Start-up behaviour of the controller .......................................................................................................... 9
Notes: serial number ................................................................................................................................ 9
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 the ifm website.
Note the installation and wiring information as well as the functions and features of the devices!
supplied installation instructions or on the ifm website.
Homepage www.ifm.com
>

2.1 Please note

6091
11779
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!
213
>

2.2 What previous knowledge is required?

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.
8
215
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
Safety instructions Start-up behaviour of the controller
>
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!

2.3 Start-up behaviour of the controller

6827 15233 11575
A restart can, for example, be caused by:
• Voltage restoration after power failure
• Reset after the watchdog responded because the cycle time was too long
• Error elimination after an E-stop To ensure safe controller behaviour:
monitor the voltage supply in the application program. In case of an error switch off all relevant outputs in the application program. Additionally monitor actuators which can cause hazardous movements in the application program
(feedback).
Monitor relay contacts which can cause hazardous movements in the application program
(feedback).
If necessary, ensure that welded relay contacts in the application project cannot trigger or continue
hazardous movements.
>

2.4 Notes: serial number

20780
In the user's production facility, draw a diagram of the controller network in the machine. Enter the
serial number of each controller installed into the network diagram.
Before downloading a software component, read out this serial number and check the network
diagram to make sure that you are accessing the right controller.
9
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Information about the device

3 System description

Information about the device ..................................................................................................................10
Hardware description ..............................................................................................................................11
Interface description ...............................................................................................................................15
Software description ...............................................................................................................................16
EC0404
Frame for front panel mounting of CR0452
EC0406
RAMmount set for using CR0452 as a desktop unit
EC0452
Cable for power supply and CAN between the display and the BasicController when the cover EC0402 is used
EC0454
5 m cable for power supply and CAN between the display and the BasicController
---
"Maintenance Tool" software for updating firmware, runtime system and application program Download www.ifm.com
>

3.1 Information about the device

This manual describes of the ecomatmobile family for mobile machines of ifm electronic gmbh: BasicDisplayXL: CR0452 The display is part of the family of the BasicController: CR040n, CR041n, CR043n.
>

3.1.1 Accessories

A wide range of accessories is available for the BasicDisplay. Examples:
975
15407
15406
You can find accessories for the article on ifm's website: www.ifm.com > Select your country > [Data sheet search] > article no. > [Accessories]
10
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Hardware description

3.2 Hardware description

Hardware setup ......................................................................................................................................11
Status-LED .............................................................................................................................................14
Available memory ...................................................................................................................................12
Colour display of the CR0452 ................................................................................................................13
Operating elements of CR0452 ..............................................................................................................13
Key LEDs dimmable ...............................................................................................................................13
Connection on the rear panel of the housing .........................................................................................13

3.2.1 Hardware setup

Protection IP 65 on the front panel when mounted: Protection IP 67
14081
15269
11
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Hardware description
>
FLASH memory (non-volatile, slow memory) overall existing in the device
1 536 kByte
maximum size of the application program
128 kByte
data other than the application program read data with FB FLASH_READ ( p. 160) (files: 128 bytes less for header)
64 kByte
SRAM (volatile, fast memory) overall existing in the device SRAM indicates here all kinds of volatile and fast memories.
592 kByte
data reserved by the application program
128 kByte
FRAM (non-volatile, fast memory) overall existing in the device FRAM indicates here all kinds of non-volatile and fast memories.
2 kByte
variables in the application program, declared as VAR_RETAIN
128 Byte
fixed as remanent defined flags (%MB0...127)
128 Byte
Available memory
>
FLASH memory
Thereof the following memory areas are reserved for ...
The remaining rest of the memory is reserved for system internal purposes.
>
SRAM
13736
13053
14027
Thereof the following memory areas are reserved for ...
The remaining rest of the memory is reserved for system internal purposes.
>
FRAM
Thereof the following memory areas are reserved for ...
The remaining rest of the memory is reserved for system internal purposes.
2262
12
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Hardware description
>
Designation
Data
Technology
TFT
Screen diagonal
4.3" (10.9 cm)
Aspect ratio
16:9
Resolution
480 x 272 pixels
Colour depth
8 bits = 256 colours via defined colour palette Create image as a 256-colour file!
Background illumination
LED dimmable in 1 % steps Setting a) can be changed temporarily and b) can be preset (stored)
Illustration
Pin
Designation
Note
1
n.c.
---- 2 VBB
8...32 V DC
3
GND
terminal 31
4
CAN_H
5
CAN_L
Colour display of the CR0452
>
Operating elements of CR0452
The display is fitted with the following operating elements: 4 function keys [F1]...[F4]
backlit with LEDs
1 rocker switch
as a combination of 4 independent keys backlit with LEDs
1 [OK] key
backlit with LED
1 [ESC] key
backlit with LED
All keys work independently of each other. The device detects several simultaneously pressed keys and evaluates them.
>
15258
15260
Key LEDs dimmable
All operating elements are backlit with LEDs.
Night design of the operating elements:
The LEDs for all operating elements can only be dimmed together:
Flag KEY_BACKLIGHT_CTRL
>
Connection on the rear panel of the housing
M12 connector, A-coded, for supply and CAN:
13
8369
8351
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Hardware description
>
LED colour
Display
Description
Off Permanently off
No operating voltage
Orange Briefly on
Initialisation or reset checks
(time frame = 200 ms)
Green Flashing with 5 Hz
no runtime system loaded
(time frame = 200 ms)
Green Flashing with 2 Hz
Application = RUN
(time frame = 200 ms)
Green Permanently on
Application = STOP or: no application loaded
Red Flashing with 5 Hz
Application = stopped because of undervoltage
(time frame = 200 ms)
Red Flashing with 10 Hz
Application = STOP with error application program is stopped Cause: exceeded timeout of the application or visualisation:
Delete the application! PowerOn reset Reload the application into the device
(time frame = 200 ms)
Red Permanently on
Application = STOP and FATAL ERROR Cause: software watchdog has failed PowerOn reset
If without success:
Goto Bootloader PowerOn reset Reload the BasicSystem into the device Reload the application into the device
If without success: Hardware error: send device to ifm!
The use of the LED function block in the application program replaces the system setting of the
status LED in the RUN state.

3.2.2 Status-LED

The operating states are indicated by the integrated status LED (default setting).
7998
The status LED can be changed by the programming system for the operating states STOP and RUN.
>
Control the LED in the application program
Via SET_LED frequency and color of the status LED can be changed in the application program.
14
15481
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Interface description
>
CAN interfaces .......................................................................................................................................15
CAN: interfaces and protocols ................................................................................................................15
CAN interface
CAN 1
CAN 2
CAN 3
CAN 4
Default download ID
ID 127
ID 126
ID 125
ID 124
CAN protocols
CAN Layer 2
Interface does not
exist
Interface does not
exist
Interface does not
exist
CANopen
SAE J1939

3.3 Interface description

3.3.1 CAN interfaces

Connections and data data sheet
>
CAN: interfaces and protocols
The device is equipped with only one CAN interface. The interface can be used with the following functions:
• RAW-CAN (Layer 2): CAN on level 2 ( chapter Function elements: RAW-CAN (Layer 2) ( p. 52))
• CANopen master / CANopen slave (→ chapter Function elements: CANopen ( p. 80))
• CANopen network variables (via CODESYS) (→ chapter Network variables ( p. 43))
• SAE J1939 (for drive management, chapter Function elements: SAE J1939 ( p. 126))
• Bus load detection
• Error frame counter
• Download interface
• 100 % bus load without package loss
The following CAN interfaces and CAN protocols are available in this ecomatmobile device:
14098
14101
15270 15271
15272
Standard baud rate = 250 Kbits/s
All CAN interfaces can operate with all CAN protocols at the same time. The IDs used must not
impair each other!
15
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Software modules for the device ............................................................................................................16
Programming notes for CODESYS projects ...........................................................................................19
Operating states .....................................................................................................................................22
Performance limits of the device ............................................................................................................25
Bootloader ..............................................................................................................................................17
Runtime system ......................................................................................................................................17
Application program ................................................................................................................................17
Libraries ..................................................................................................................................................18
software module
Can user change the module?
By means of what tool?
Application program with libraries
yes
CODESYS,
MaintenanceTool
Runtime system *)
Upgrade yes
Downgrade yes
MaintenanceTool
Bootloader
no
---
(Hardware)
no
---

3.4 Software description

3.4.1 Software modules for the device

The software in this device communicates with the hardware as below:
14107
14110
*) The runtime system version number must correspond to the target version number in the CODESYS target system setting. chapter Set up the target ( p. 36)
Below we describe this software module:
16
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
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.
Bootloader
14111
On delivery ecomatmobile controllers only contain the boot loader. The boot loader is a start program that allows to reload the runtime system and the application program on the device. The boot loader contains basic routines...
• for communication between hardware modules,
• for reloading the operating system. The boot loader is the first software module to be saved on the device.
>
Runtime system
14112
Basic program in the device, establishes the connection between the hardware of the device and the application program. → chapter Software modules for the device (→ p. 16)
On delivery, there is normally no runtime system loaded in the controller (LED flashes green at 5 Hz). Only the bootloader is active in this operating mode. It provides the minimum functions for loading the runtime system, among others support of the interfaces (e.g. CAN).
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.
The runtime system is provided with this documentation on a separate data carrier. In addition, the current version can be downloaded from the website of ifm electronic gmbh: www.ifm.com
>
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.
The visualisation pages and embedded graphics are part of the CODESYS application program.
8340
17
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Library
Use
ifm_CR0452_Vxxyyzz.LIB
Device-specific library Must always be contained in the application program!
ifm_RawCAN_NT_Vxxyyzz.LIB
(optional) when a CAN interface of the device is to be operated with CAN Layer 2
ifm_CANopen_NT_Vxxyyzz.LIB
(optional) when a CAN interface of the device is to be operated as CANopen master or CANopen slave
ifm_J1939_NT_Vxxyyzz.LIB
(optional) when a CAN interface of the device is to communicate with a motor control
Libraries
15409
ifm electronic offers several libraries (*.LIB) to match each device containing program modules for
the application program. Examples:
Details: chapter ifm libraries for the device CR0452 ( p. 44)
18
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
FB, FUN, PRG in CODESYS .................................................................................................................19
Note the cycle time! ................................................................................................................................20
Important note to program the device ....................................................................................................20
Creating application program .................................................................................................................21
Using ifm maintenance tool ....................................................................................................................22
Distribution of the application program ...................................................................................................22
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 may contain maximum 8000 function elements; in this device maximum 512
function elements!

3.4.2 Programming notes for CODESYS projects

Here you receive tips how to program the device. See the notes in the CODESYS programming manual.
>
FB, FUN, PRG in CODESYS
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.
7426
15410
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 function block call in a function:
• every time there is an additional initialisation call and
• the data of the last call gets lost.
19
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
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.
Note the cycle time!
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.
>
Important note to program the device
Applies to the following devices:
• BasicController relay CR0431 For the time of programming interconnect the connections B:1 (VBB15) and B:8 (VBBs).
Otherwise programming is not possible.
Background:
The controller resets all outputs when programming begins, also SUPPLY_SWITCH.  Without VBB15 the controller would be separated from the voltage supply and is switched off.  When the controller is switched on again, the device is in bootloader mode.
The programmer has to load the Basic System to the device again. Then reload the application program to the device.
8006
20763
20
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Creating application program
The application program is generated by the CODESYS 2.3 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 2.3 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.
8007
Graphics: Creation and distribution of the software
21
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Using ifm maintenance tool
8492
The ifm Maintenance Tool serves for easy transfer of the program code from the programming station to the controller. As a matter of principle each application software can be copied to the controllers using the ifm Maintenance Tool. Advantage: A programming system with CODESYS licence is not required.
Here you will find the current ifm Maintenance Tool: Homepage www.ifm.com
>
Distribution of the application program
8493
We recommend the following sequence, if the application software is to be copied to the series machine and used:
Saving the software
After completion of program development the latest version of the application program loaded in the controller using the ifm Maintenance Tool has to be read from the controller and saved on a data carrier using the name project_file.RESX. Only this process ensures that the application software and its checksums are stored.
Download of the software.
To equip all machines of a series production with an identical software only this file may be loaded in the controllers using the ifm Maintenance Tool.
An error in the data of this file is automatically recognised by the integrated checksum when
loaded again using the ifm Maintenance Tool.
>

3.4.3 Operating states

After power on the ecomatmobile device can be in one of five possible operating states:
• BOOTLOADER
• INIT
• STOP
• RUN
• SYSTEM STOP
>
INIT state (Reset)
Premise: a valid runtime system is installed. This state is passed through after every power on reset:
> The runtime system is initialised. > Various checks are carried out, e.g. waiting for correctly power supply voltage. > This temporary state is replaced by the RUN or STOP state. > The LED lights orange.
Change out of this state possible into one of the following states:
• RUN
• STOP
1075
20647
22
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
STOP state
A transition into this state is possible in the following cases:
• from the INIT state if no application program is loaded.
• From the RUN state if the following condition is met:
• The STOP command is sent via the CODESYS interface. In the STOP state:
> The outputs of the device are switched off. > Processing of the application program is stopped. > The LED lights green.
A transition from this state into one of the following states is possible:
• RUN
• ERROR
• FATAL ERROR
• INIT (after power-on-reset)
>
RUN state
A transition into this state is possible in the following cases: from the INIT state (autostart) if the following conditions are met:
• The operating voltage has reached a minimum value. AND:
• The application program exists.
From the STOP state:
• via the CODESYS command RUN.
• The operating voltage has reached or exceeded a minimum value.
In the RUN state:
> The runtime system is running. > The application program is running. > The LED flashes green with 2 Hz.
The LED can be controlled differently by the application program FB SET_LED ( p. 172).
A transition from this state into one of the following states is possible:
• INIT (after power-on-reset)
• STOP
• ERROR
• FATAL ERROR
8288
8287
23
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
ERROR state
A transition into this state is possible in the following cases:
• if the supply voltage is too low. In the ERROR state:
> The outputs of the device are switched off. > Processing of the application program is stopped. > System parameters are saved. > The LED flashed red with 5 Hz.
A transition from this state into one of the following states is possible:
• INIT (after power-on-reset)
• RUN
• STOP
• FATAL ERROR
>
FATAL ERROR state
A transition into this state is possible in the following cases:
memory error (RAM / Flash)
• exception error
• runtime system error In the FATAL ERROR state:
> The outputs of the device are switched off. > The application program is terminated. > The runtime system is terminated. > The LED lights red.
A transition from this state into one of the following states is possible:
• INIT (after power-on-reset)
8290
8289
24
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Note the limits of the device! Data sheet

3.4.4 Performance limits of the device

>
Watchdog behaviour
In this device, a watchdog monitors the program runtime of the CODESYS application. If the maximum watchdog time (application program: 100 ms; visualisation: 1 200 ms) is exceeded:
> the device changes to the "Timeout Error" state > all processes are stopped (reset) > all outputs are switched off > the screen goes black > the status LED flashes red at 10 Hz
Eliminate the fault: Delete application program! PowerOn Reset Reload the application program into the device
If the watchdog in question fails: > a second watchdog leads the device to the state "Fatal Error" > the status LED lights red
Eliminate the fault: PowerOn Reset
If unsuccessful: Goto Bootloader PowerOn Reset Reload the runtime system into the device Reload the application program into the device
If unsuccessful: Hardware error: return device to ifm!
7358
15277
25
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Parameter
Limitation CR0451
Limitation CR0452
File type
Bitmap (*.bmp)
File name
Only small letters, naming convention = 8.3
Image size
320 x 240 pixels
480 x 272 pixels
Colours
8 bit = 28 colours = 256 colours can be represented
Required memory space
< 76 Kbytes, depending on the image content for RLE compression
Visualisation limits
Embedded displays, used e.g. in ecomatmobile devices, cannot provide the full colour scope of bitmap graphics because the available power reserves are restricted. Nevertheless, the following preparations enable bitmap images in the device:
Correct selection of the motifs,  clever shifting of colours or
clever compilation of a colour palette and
the correct scaling of the bitmaps before using them in the device.  Performance limits of the device ( p. 25)
Table: specifications for the start image
The graphics used in the project may be larger than the specified image size. In this case, however, only a (selectable) section of the image will be visible.
Colours: The device supports 28 (= 256) colour nuances. Create bitmap (BMP) with 256 colours:
8337
8465
8464
>
Resample / scale image
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.
26
3117
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Designation
Limitation
Length of character strings
< 80 characters
Length of path names
not relevant
Number of visualisation pages
< 15
Number of graphical objects per visualisation page
< 20
Number of bitmaps per project
< 256 depending on the size and the available flash memory for the
application
Number of character sets per project
Character sets are permanently stored and cannot be changed.
Number of POUs ¹) per project
< 512
Limitations for visualisations
¹) POU (Program Organization Unit) = function, function block or program block Because of the limited memory:
• avoid grouping of elements
• avoid visualisation as a master slide
• avoid visualisation of master background slides
8319
27
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Visualisation element
Functional safety for the PDM
Polyline
o
A polyline is to consist of maximum 5 anchor points; not scalable A polyline is not to enclose any area.
Curve
--
Not supported
Rectangle
+
No problems known
Rounded rectangle
--
Not supported
Circle, ellipse
+
No problems known
Polygon
o
A polygon is to consist of maximum 10 anchor points; not scalable
Pie chart
--
Not supported
Visualisation
--
Not supported
Button
--
Not supported
Table
--
Not supported
Scroll bar
--
Not supported
Trend curve
--
Not supported
Alarm table
--
Not supported
Scales
+
Create scale as BMP file
Pointer instrument
+
Represent pointer instrument as BMP file with a superposed CoDeSys polygon
Bar graph
+
Create scale as BMP file Represent value as a superposed CoDeSys rectangle
Histogram
+
Create scale as BMP file Represent value as a superposed CoDeSys rectangle
Graphic file
+
Up to 256 per project possible
• BMP ¹)
• BMP RLE compressed
• TIFF ¹)
• JPEG ¹)
Graphics scaling mode
o
Supported for circle, ellipse, rectangle, line, polyline, polygon
ActiveX element
--
Not supported
Pointer diagram
--
Not supported
Edit tools
--
Not supported
+ o
--
can be used without problem can be used with restrictions cannot be used
CODESYS visualisation elements
Bitmap graphics (BMP) chapter Visualisation limits ( p. 26)
Not all CODESYS functions can be executed successfully on this device:
453
¹) During the integration into the project the file is converted into an RLE compressed bitmap. From the CODESYS version 2.3.9.24 an additional dialogue opens when an image is integrated. Using this dialogue the file is adapted to the Colour palette used for the device. During the colour conversion you can select between 'most similar colour' (deactivate [Dithering]) and 'Dithering'.
Drawing area:
The left upper corner marks the home position (0,0) of the virtual and physical drawing area.  Virtual drawing area = 2,560 x 1,536 pixels
(enlarges the physical drawing area)
Elements in the virtual drawing area are not calculated.
28
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
Drawing area
15987
The left upper corner marks the home position (0,0) of the virtual and physical drawing area.  Virtual drawing area (X/Y coordinates) = -32768...+32767
(enlarges the physical drawing area)
All objects including their outer dimensions must be within the borders of the virtual drawing area
even after scaling or shifting! Otherwise the visualisation will not be correct any more.
Elements in the virtual drawing area are not calculated.
>
Texts
The smallest font size which is clearly visible on the device is 11 point.  Permissible fonts:
- Arial (standard)
- Lucida Console
Permissible font size [Pixel] and font weight:
- Arial: 11 (standard), 16, 24, 32 (all only normal)
- Lucida Console: 16, 24, 48*) (all only normal) *) Lucida Console in the font size 48 only has the following characters:
- numbers 0 to 9
- special characters + - . : %
- space.
Permissible effects:
- none (standard)
The following text scripts are ignored:
- Western
- Hebrew
- Arabic
- Greek
- Turkish
- Baltic
- Central European
- Cyrillic
- Vietnamese
8436
29
ifm Programming Manual BasicDisplay CR0452 v03.02 05 / 2018
System description Software description
>
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
• rectangle
• ellipse / circle
Each edge of the element can be shifted by a specified number of pixels via an INT type variable:
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
Device
BasicController: CR040n, CR041n,
CR043n
BasicDisplay: CR045n
ioControl: CR205n
SmartController: CR253n
PDM360 NG: CR108n, CR120n
Criterion
max. FiFo transmit
- with FB CAN_TX...
- with FB CAN_TX_ENH...
4 messages
16 messages
4 messages
16 messages
max. FiFo receive
- with FB CAN_RX_..._FIFO
32 messages
32 messages
Movement of elements
Image and text elements can be moved on the display in a defined manner.
7392
>
Limitations for CAN in this device
17975
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 read first. Each identifier has such a buffer (queue). Some Raw-CAN function elements enable transmitting and receiving of several messages in one PLC
cycle as the messages are temporarily stored in a FiFo:
- CAN_TX..., Function elements: transmit RAW-CAN data
- CAN_RX_ENH_FIFO ( p. 62)
- CAN_RX_RANGE_FIFO ( p. 66) The number of FIFo messages is limited. The following limitations of the devices are valid:
30
Loading...
+ 179 hidden pages