About this manual Overview: documentation modules for CR0431
>
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 CR0431
The documentation for this devices consists of the following modules:
(Downloads from ifm's website →www.ifm.com )
About this manual How is this documentation structured?
>
Date
Theme
Change
2016-04-27
FBs for fast inputs
Note in case of higher frequencies added
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 (CR043n)
What has been changed in this manual? An overview:
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.
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.
Note on wiring .........................................................................................................................................20
Safety instructions about Reed relays ....................................................................................................20
The device does not start before sufficient voltage is applied to the supply connection VBB15.
In vehicles VBB15 is the plus cable switched by the ignition lock.
A voltage > 8 V is deemed sufficient.
Permissible operating voltage → data sheet
Relays can only be switched on again if VBBs is applied and SUPLY_SWITCH is closed.
>
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.
>
19673
20763
Principle block diagram
19672
Figure: principle block diagram of supply and relays
Figure: block diagram of the resistor survey input
In = pin resistor survey input n
(CR) = device
(1) = input filter
(2) = constant-current source
(3) = internal resistance
(4) = voltage
3.2.2 Inputs (technology)
>
14090
Analogue inputs
15444
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
• resistance measurement 16...30 000 (measurement to GND)
The voltage measurement can also be carried out ratiometrically (0...1000 ‰, adjustable via function
blocks). This means potentiometers or joysticks can be evaluated without additional reference voltage.
A fluctuation of the supply voltage has no influence on this measured value.
As an alternative, an analogue channel can also be evaluated binarily.
Figure: basic circuit of binary input minus switching / plus switching for negative and positive sensor signals
In = pin binary input n
(S) = sensor
In = pin binary input n
(S) = sensor
Basic circuit of binary input plus switching (BL)
for positive sensor signal:
Input = open signal = low (GND)
Basic circuit of binary input minus switching (BH)
for negative sensor signal:
Input = open signal = high (supply)
Binary inputs
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
1015
7345
For some of these inputs (→ data sheet) the potential can be selected to which it will be switched.
Configuration of each input is made via the application program:
• FB INPUT (→ p. 169) > input MODE
• FBs FASTCOUNT (→ p. 165), INC_ENCODER (→ p. 167) or PERIOD (→ p. 171)
>If the analogue inputs are configured for current measurement, the device switches to the safe
voltage measurement range (0...32 V DC) and the output RESULT is set accordingly in the
function block INPUT when the final value (23 mA for > 40 ms) is exceeded. After about one
second the input automatically switches back to the current measuring range.
>
14568
Input group IN4...IN7
These inputs are a group of multifunction channels.
These inputs can be used as follows (each input separately configurable):
• binary input plus switching (BL) for positive sensor signal
• input for resistance measurement (e.g. temperature sensors or fuel sensors)
→ chapter Possible operating modes inputs/outputs (→ p. 206)
Sensors with diagnostic capabilities to NAMUR can be evaluated.
► Configuration of each input is made via the application program:
These outputs are a group of channels with a single specified function.
These outputs have the following fixed setting:
• binary output with LED (e.g. diagnostic message)
The LED outputs can be freely used in the application.
The spatial arrangement on the device provides the following assignment:
Binary high side input: minus switching for negative sensor signal
Binary high side output: plus switching for positive output signal
BL
Binary low side input: plus switching for positive sensor signal
Binary low side output: minus switching for negative output signal
CYL
Input period measurement
ENC
Input encoder signals
FRQ
Frequency input
H bridge
Output with H-bridge function
PWM
Pulse-width modulated signal
PWMi
PWM output with current measurement
IH
Pulse/counter input, high side: minus switching for negative sensor signal
IL
Pulse/counter input, low side: plus switching for positive sensor signal
R
Read back channel for one output
Contacts of Reed relays may be clogged (reversibly) if connected to the device inputs without
series resistor.
1426
The wiring diagrams (→ installation instructions of the devices, chapter "Wiring") describe the standard
device configurations. The wiring diagram helps allocate the input and output channels to the IEC
addresses and the device terminals.
The individual abbreviations have the following meaning:
Allocation of the input/output channels: → Catalogue, mounting instructions or data sheet
>
3.2.5 Safety instructions about Reed relays
For use of non-electronic switches please note the following:
►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
CAN interfaces .......................................................................................................................................22
CAN: interfaces and protocols ................................................................................................................22
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
CAN Layer 2
Interface does not
exist
Interface does not
exist
CANopen
CANopen
SAE J1939
SAE J1939
3.3 Interface description
14098
3.3.1 CAN interfaces
14101
Connections and data → data sheet
>
CAN: interfaces and protocols
14589
15238
The devices are equipped with several CAN interfaces depending on the hardware design. Basically,
all interfaces can be used with the following functions independently of each other:
• RAW-CAN (Layer 2): CAN on level 2 (→ chapter Function elements: RAW-CAN (Layer 2) (→ p. 60))
• CANopen master / CANopen slave (→ chapter Function elements: CANopen (→ p. 86))
Software modules for the device ............................................................................................................23
Programming notes for CODESYS projects ...........................................................................................26
Operating states .....................................................................................................................................29
Performance limits of the device ............................................................................................................31
Runtime system ......................................................................................................................................24
Application program ................................................................................................................................24
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. 38)
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. 23)
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
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.
FB, FUN, PRG in CODESYS .................................................................................................................26
Note the cycle time! ................................................................................................................................27
Important note to program the device ....................................................................................................27
Creating application program .................................................................................................................28
Using ifm maintenance tool ....................................................................................................................29
Distribution of the application program ...................................................................................................29
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!
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
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.
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
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: