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:
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] > CR0403 > [Operating instructions]
4.System manual "Know-how ecomatmobile"
→www.ifm.com> select your country > [Data sheet search] > CR0403 > [Operating instructions]
17405
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] > CR0403 > [Operating instructions]
*) The descriptions in brackets are only included in the instructions of certain devices.
>
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"
5
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
NOTICE
About this manual What do the symbols and formats mean?
>
1.4 What do the symbols and formats mean?
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.
Property damage is to be expected or may result.
Important notes concerning malfunctions or disturbances
Other remarks
► ... Request for action
203
>... Reaction, result
→ ... "see"
abcCross-reference
123
0x123
0b010
[...] Designation of pushbuttons, buttons or indications
Decimal number
Hexadecimal number
Binary number
6
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
About this manual How is this documentation structured?
>
1.5 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 → 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]
204
1508
7
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
About this manual History of the instructions (CR040n)
>
1.6 History of the instructions (CR040n)
12110
What has been changed in this manual? An overview:
DateThemeChange
2012-07-24 Target upgrade to v02
2012-10-04 FB PWM1000 RESULT corrected
2013-06-24 various new document structure
2013-09-05 Target Upgrade to V03
2014-01-13 FBs FASTCOUNT, INC_ENCODER, PERIOD • permissible frequency areas corrected
2014-04-28 Various function blocks More precise description of the function block input
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"
2014-08-08 FB PERIOD completed by operating mode "phase measurement"
2014-08-26 Description of inputs, outputs highside / lowside replaced by positive / negative
2014-11-12 Chapter "Outputs (technology)" Section "Diagnostics of the binary outputs"
2015-01-13 Structure of documentation for error codes, system
flags
2015-03-10 Available memory Description improved
>
• new RESULT for FB PERIOD
CHANNEL
(LZS V03.02.zz or higher)
switching
supplemented or corrected
• error flags:
now only in the annex, chapter System flags
• CAN / CANopen errors and error handling:
now only in the system manual "Know-How"
• error codes, EMCY codes:
now in the annex, chapter Error tables
8
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Start-up behaviour of the controller ..................................................................................................... 10
What previous knowledge is required? ............................................................................................... 10
>
213
2.1 Please note!
6091
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 bodily 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]
9
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Safety instructions What previous knowledge is required?
>
2.2 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.3 Start-up behaviour of the controller
6827
15233
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.
>
10
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Status LED .......................................................................................................................................... 26
System description Information about the device
3 System description
Information about the device ............................................................................................................... 11
Note on wiring ...................................................................................................................................... 25
Safety instructions about Reed relays ................................................................................................. 25
975
14551
14081
11
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
3.2.1 Hardware setup
Basic device without cover
Protection IP 20
>
Available memory
>
FLASH-Speicher
14561
13736
13053
FLASH memory (non-volatile, slow memory)
1 536 kByte
overall existing in the device
Thereof the following memory areas are reserved for ...
maximum size of the application program 512 kByte
data other than the application program
64 kByte
read data with FB FLASH_READ (→ page 186)
(files: 128 bytes less for header)
The remaining rest of the memory is reserved for system internal purposes.
>
SRAM
SRAM (volatile, fast memory)
overall existing in the device
SRAM indicates here all kinds of volatile and fast memories.
Thereof the following memory areas are reserved for ...
data reserved by the application program 128 kByte
The remaining rest of the memory is reserved for system internal purposes.
>
592 kByte
FRAM
14027
2262
FRAM (non-volatile, fast memory)
2 kByte
overall existing in the device
FRAM indicates here all kinds of non-volatile and fast memories.
Thereof the following memory areas are reserved for ...
variables in the application program, declared as VAR_RETAIN 128 Byte
fixed as remanent defined flags (%MB0...127) 128 Byte
The remaining rest of the memory is reserved for system internal purposes.
12
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Input group I2 (IN8...IN11) ................................................................................................................... 17
Digital inputs ........................................................................................................................................ 14
Input group I0 (IN0...IN3) ..................................................................................................................... 15
Input group I1 (IN4...IN7) ..................................................................................................................... 15
>
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.
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.
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
Figure: block diagram of the resistor survey input
In = pin resistor survey input n
(CR) = device
(1) = input filter
(2) = constant-current source
(3) = voltage
13
8972
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Digital 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
In = pin binary-input n
(CR) = device
(1) = input filter
(2a) = input minus switching
(2b) = input plus switching
(3) = voltage
1015
7345
Figure: basic circuit of binary input minus switching / plus switching for negative and positive sensor signals
In = pin binary-input n
(S) = sensor
Basic circuit of binary input plus switching (BL)
for positive sensor signal:
Input = open signal = low (GND)
For some of these inputs (→ data sheet) the potential can be selected to which it will be switched.
Basic circuit of binary input minus switching (BH)
for negative sensor signal:
Input = open signal = high (supply)
In = pin binary-input n
(S) = sensor
14
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Input group I0 (IN0...IN3)
These inputs are a group of multifunction channels.
These inputs can be used as follows (each input separately configurable):
• analogue input 0...20 mA
• analogue input 0...10 V
• analogue input 0...32 V
• voltage measurement ratiometric 0...1000 ‰
• binary input plus switching (BL) for positive sensor signal (with/without diagnosis)
• binary input minus switching (BH) for negative sensor signal
• fast input for e.g. incremental encoders and frequency or interval measurement
→ chapter Possible operating modes inputs/outputs (→ page 207)
Sensors with diagnostic capabilities to NAMUR can be evaluated.
All inputs show the same behaviour concerning function and diagnosis.
Configuration of each input is made via the application program:
• FB INPUT (→ page 173) > input MODE
• FBs FASTCOUNT (→ page 169), INC_ENCODER (→ page 171) or PERIOD (→ page 175)
>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 I1 (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 (→ page 207)
Sensors with diagnostic capabilities to NAMUR can be evaluated.
► Configuration of each input is made via the application program:
• FB INPUT (→ page 173) > input MODE
14569
15
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Resistance measurement
Typical sensors on these inputs:
• tank level
• temperature (PT1000, NTC)
Figure: block diagram of the resistor survey input
In = pin resistor survey input n
(CR) = device
(1) = input filter
(2) = constant-current source
(3) = voltage
9773
8972
The resistance for this device is not linearly dependent on the resistance value, → figure:
Figure: resolution dependent on the
resistance value
(1) = resistance value at the input
(2) = resolution
By how many ohms does the measured value change when the signal of the A/D converter on the input changes by 1?
Examples:
• In the range of 1...100 Ω the resolution is 1.2 Ω.
• In the range of 1 kΩ the resolution is approx. 2 Ω.
• In the range of 2 kΩ the resolution is approx. 3 Ω.
• In the range of 3 kΩ the resolution is approx. 6 Ω.
• In the range of 6 kΩ the resolution is approx. 10 Ω.
• In the range of 10 kΩ the resolution is approx. 11 Ω
• In the range of 20 kΩ the resolution is approx. 60 Ω.
8970
16
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Input group I2 (IN8...IN11)
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 (with/without diagnosis)→ chapter Possible operating modes inputs/outputs (→ page 207)
Sensors with diagnostic capabilities to NAMUR can be evaluated.
► Configuration of each input is made via the application program:
• FB INPUT (→ page 173) > input MODE
14570
17
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Output group Q3 (OUT10, OUT11) ..................................................................................................... 24
System description Hardware description
>
3.2.3 Outputs (technology)
Protective functions of the outputs ...................................................................................................... 18
Output group Q0 (OUT0, OUT1) ......................................................................................................... 20
Output group Q1 (OUT2, OUT3, OUT8, OUT9) .................................................................................. 22
Output group Q2 (OUT4...OUT7) ........................................................................................................ 23
>
Protective functions of the outputs
The outputs of this device are protected against overload and short circuit within specific ranges.
→ data sheet
>
Definition: overload
Overload can only be detected on an output with current measurement.
Overload is defined as ...
"a nominal maximum current of 12.5 %" according to the data sheet.
>
Definition: short circuit
A short circuit can be detected on all outputs with diagnostic capabilities and is defined as follows:
A short circuit is defined as ...
"a drop of the output voltage below 93.5% (± 2.0%) of the corresponding supply voltage."
>A ground fault can only be detected in case of output = TRUE.
14093
15248
15249
15644
18
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Reaction of the outputs to overload or short circuit
>
Self-protection of the output
The hardware protects itself, irrespective of the operating mode of the output and of the fault
detection. In case of a too high thermal load (caused by short circuit or overload), the output driver
begins to clock.
The driver may be damaged in case of too long clocking of the output (several hours).
We therefore recommend:
that you operate device outputs with diagnostic capabilities in the following mode, since, in this case,
the software protects the drivers additionally by switching off:
• FB OUTPUT (→ page 180) > input MODE = 16
This is also the default setting if only the flags in the control configuration are used.
>
Reaction according to the operating mode of the output
In case of an overload or a short circuit, the behaviour of the output depends on its operating mode
(→ FB OUTPUT (→ page 180) > input MODE):
•MODE=2: binary output plus switched: no diagnosis and no protection
> the output continues to be operated.
•MODE=15: binary output plus switched with diagnosis
> error is detected and signalled on the output RESULT by the FB OUTPUT:
e.g.: RESULT = 128, 141, 142 or 145.
This depends on the type of output and the current or voltage at the output.
The programmer can react to the error in the program.
•MODE=16: binary output plus switched with diagnosis and protection
> error is detected and signalled on the output RESULT by the FB OUTPUT.
> The respective output is switched off.
> The logic state of the output remains unaffected by this!
>
15251
15253
15252
Reaction when using PWM or CURRENT_CONTROL
The situation is different when the FBs PWM or CURRENT_CONTROL are used:
There is no diagnosis. The →self-protection of the output becomes active.
► For outputs with current feedback:
Query the typical current for the output in the application program!
It is the responsibility of the programmer to react to the event.
15254
19
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Output group Q0 (OUT0, OUT1)
14583
These outputs are a group of multifunction channels.
These outputs provide several function options (each output separately configurable):
• binary output, plus switching (BH) with diagnostic function and protection
• analogue current-controlled output (PWMi)
• analogue output with Pulse Width Modulation (PWM)
→ chapter Possible operating modes inputs/outputs (→ page 207)
► Configuration of each output is made via the application program:
→ FB OUTPUT (→ page 180)> input MODE
PWM output: → FB PWM1000 (→ page 182)
Current control and load current indication → FB CURRENT_CONTROL (→ page 178)
► For the limit values please make sure to adhere to the data sheet!
>
Diagnosis: binary outputs (via current and voltage measuring)
19433
19434
The diagnostics of these outputs is made via internal current and voltage measurement in the output:
Figure: principle block diagram
(1) Output channel
(2a) Read back channel for diagnosis via current measuring
(2b) Read back channel for diagnosis via voltage measuring
(3) Pin output n
(4) Load
>
Diagnosis: overload
19437
15249
Overload can only be detected on an output with current measurement.
Overload is defined as ...
"a nominal maximum current of 12.5 %" according to the data sheet.
>
Diagnosis: wire break (via current measurement)
19435
19400
Wire-break detection is done via the read back channel. When the output is switched (Qn=TRUE) wire
break is detected when no current flows on the resistor Ri (no voltage drops). Without wire break the
load current flows through the series resistor Ri generating a voltage drop which is evaluated via the
read back channel.
>
Diagnosis: wire break (via voltage measurement)
19436
19404
Wire-break detection is done via the read back channel. When the output is blocked (Qn=FALSE) wire
break is detected when the resistor Ru pulls the read back channel to HIGH potential (VBB). Without
the wire break the low-resistance load (RL < 10 kΩ) would force a LOW (logical 0).
20
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Diagnosis: short circuit
Short-circuit detection is done via the read back channel. When the output is switched (Qn=TRUE)
short circuit against GND is detected when the read back channel is pulled to LOW potential (GND).
19405
21
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Output group Q1 (OUT2, OUT3, OUT8, OUT9)
These outputs are a group of multifunction channels.
These outputs provide several function options (each output separately configurable):
• binary output, plus switching (BH) with/without diagnostic function
• analogue output with Pulse Width Modulation (PWM)
→ chapter Possible operating modes inputs/outputs (→ page 207)
► Configuration of each output is made via the application program:
► For the limit values please make sure to adhere to the data sheet!
>
Diagnosis: binary outputs (via voltage measuring)
The diagnostics of these outputs is made via internal voltage measurement in the output:
14577
19403
19397
Figure: principle block diagram
(1) Output channel
(2) Read back channel for diagnosis
(3) Pin output n
(4) Load
>
Diagnosis: overload
19448
The outputs have no current measuring, no overload detection.
>
Diagnosis: wire break
19404
Wire-break detection is done via the read back channel. When the output is blocked (Qn=FALSE) wire
break is detected when the resistor Ru pulls the read back channel to HIGH potential (VBB). Without
the wire break the low-resistance load (RL < 10 kΩ) would force a LOW (logical 0).
>
Diagnosis: short circuit
19405
Short-circuit detection is done via the read back channel. When the output is switched (Qn=TRUE)
short circuit against GND is detected when the read back channel is pulled to LOW potential (GND).
22
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
Output group Q2 (OUT4...OUT7)
These outputs are a group of multifunction channels.
These outputs provide several function options (each output separately configurable):
• binary output, plus switching (BH)
• analogue output with Pulse Width Modulation (PWM)
• These outputs are not able for diagnosis.
→ chapter Possible operating modes inputs/outputs (→ page 207)
► Configuration of each output is made via the application program:
► For the limit values please make sure to adhere to the data sheet!
>
Diagnosis: binary outputs (via voltage measuring)
The diagnostics of these outputs is made via internal voltage measurement in the output:
15237
19403
19397
Figure: principle block diagram
(1) Output channel
(2) Read back channel for diagnosis
(3) Pin output n
(4) Load
>
Diagnosis: overload
19448
The outputs have no current measuring, no overload detection.
>
Diagnosis: wire break
19404
Wire-break detection is done via the read back channel. When the output is blocked (Qn=FALSE) wire
break is detected when the resistor Ru pulls the read back channel to HIGH potential (VBB). Without
the wire break the low-resistance load (RL < 10 kΩ) would force a LOW (logical 0).
>
Diagnosis: short circuit
19405
Short-circuit detection is done via the read back channel. When the output is switched (Qn=TRUE)
short circuit against GND is detected when the read back channel is pulled to LOW potential (GND).
24
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
3.2.4 Note on wiring
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:
A Analogue input
BH Binary high side input: minus switching for negative sensor signal
BL Binary low side input: plus switching for positive sensor signal
CYL Input period measurement
ENC Input encoder signals
FRQ Frequency input
H bridge Output with H-bridge function
PWM
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
Binary high side output: plus switching for positive output signal
Binary low side output: minus switching for negative output signal
Pulse-width modulated signal
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:
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
7348
25
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Hardware description
>
3.2.6 Status LED
The operating states are indicated by the integrated status LED (default setting).
LED colourFlashing frequencyDescription
Off permanently off no operating voltage
Red / green briefly on INIT state, reset checks
Green 5 Hz no runtime system loaded
Green 2 Hz RUN state: application is running
Green permanently on STOP state: application is stopped
Red 5 Hz
Red 10 Hz
Red permanently on
.
The operating states STOP and RUN can be changed by the programming system.
>
STOP state with error: application is stopped
reason: undervoltage
STOP state with error: application is stopped
Cause: exceeded timeout of the application or visualisation:
Delete the application!
PowerOn reset
Reload the application into the device
FATAL ERROR: application is stopped
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!
7998
Control the LED in the application program
Via SET_LED frequency and color of the status LED can be changed in the application program.
The use of the LED function block in the application program replaces the system setting of the
status LED in the RUN state.
15481
26
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
CAN interfaces .................................................................................................................................... 27
CAN: interfaces and protocols ............................................................................................................. 27
System description Interface description
>
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) (→ page 66))
The software in this device communicates with the hardware as below:
software moduleCan user change the module?By means of what tool?
Application program
with libraries
Runtime system *)
Yes
Upgrade yes
Downgrade no
Bootloader No ---
(Hardware) No ---
*) The runtime system version number must correspond to the target version number in the CODESYS target system setting.
→ chapter Set up the target (→ page 43)
Below we describe this software module:
CODESYS,
MaintenanceTool
MaintenanceTool
14107
14110
28
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
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.
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 > Select your country > [Service] > [Download]
>
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.
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.
29
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
Libraries
ifm electronic offers a series of libraries (*.LIB) suitable for each device, containing the program
modules for the application program. Examples:
LibraryUse
ifm_CR0403_Vxxyyzz.LIB Device-specific library
ifm_RawCAN_NT_Vxxyyzz.LIB (optional)
ifm_CANopen_NT_Vxxyyzz.LIB (optional)
ifm_J1939_NT_Vxxyyzz.LIB (optional)
Detail information → ifm libraries for the device CR0403 (→ page 58)
Must always be contained in the application program!
when a CAN interface of the device is to be operated with CAN
Layer 2
when a CAN interface of the device is to be operated as
CANopen master or CANopen slave
when a CAN interface of the device is to communicate with a
motor control
15409
30
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Distribution of the application program ................................................................................................ 34
System description Software description
>
3.4.2 Programming notes for CODESYS projects
FB, FUN, PRG in CODESYS .............................................................................................................. 31
Note the cycle time! ............................................................................................................................. 32
Creating application program .............................................................................................................. 33
Using ifm maintenance tool ................................................................................................................. 34
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] > CR0403 > [Operating instructions]
→ ecomatmobile DVD "Software, tools and documentation".
>
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
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!
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.
31
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
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.
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.
8006
32
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
Creating application program
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.
8007
Graphics: Creation and distribution of the software
33
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
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:
→ www.ifm.com > Select your country > [Service] > [Download] > [Systems for mobile machines]
→ ecomatmobile DVD "Software, tools and documentation" under the tab 'R360 tools [D/E]'
>
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.
34
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
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
1076
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)
8288
35
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
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 (→ page 198).
A transition from this state into one of the following states is possible:
• INIT (after power-on-reset)
• STOP
• ERROR
• FATAL ERROR
>
8287
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
36
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
3.4.4 Performance limits of the device
Note the limits of the device! → Data sheet
>
Watchdog behaviour
In this device, a watchdog monitors the program runtime of the CODESYS application.
If the maximum watchdog time (100 ms) is exceeded:
> the device changes to the "Timeout Error" state
> all processes are stopped (reset)
> all outputs are switched off
> 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 without success:
Goto Bootloader
PowerOn reset
Reload the runtime system into the device
Reload the application program into the device
If without success:
Hardware error: send device to ifm!
7358
15365
37
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
System description Software description
>
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 (→ page 76)
- CAN_RX_RANGE_FIFO (→ page 80)
The number of FIFo messages is limited. The following limitations of the devices are valid:
Device
Criterion
max. FiFo transmit
- with FB CAN_TX...
- with FB CAN_TX_ENH...
max. FiFo receive
- with FB CAN_RX_..._FIFO
>
BasicController: CR040n,
CR041n, CR043n
BasicDisplay: CR045n
SmartController: CR253n
4 messages
16 messages
32 messages
PDM360 NG: CR108n
4 messages
16 messages
32 messages
Limitations for CANopen in this device
The following limitations of the devices are valid:
Device
Criterion
max. guarding error 32 messages 128 messages
max. SDO data 2 048 bytes 2 048 bytes
>
BasicController: CR040n,
CR041n, CR043n
BasicDisplay: CR045n
SmartController: CR253n
PDM360 NG: CR108n
Limitations for CAN J1939 in this device
The following limitations of the devices are valid:
Device
Criterion
max. FiFo transmit
- with FB J1939_TX
- with FB J1939_TX_ENH
max. FiFo receive
- with FB J1939_RX_FIFO
max. DTCs 64 messages 64 messages
max. data J1939 1 785 bytes 1 785 bytes
>
BasicController: CR040n,
CR041n, CR043n
BasicDisplay: CR045n
SmartController: CR253n
4 messages
16 messages
32 messages
PDM360 NG: CR108n
4 messages
16 messages
32 messages
17976
17977
38
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Verify the installation ........................................................................................................................... 41
Configurations Set up the runtime system
4 Configurations
Set up the runtime system ................................................................................................................... 39
Set up the programming system ......................................................................................................... 42
Function configuration in general ........................................................................................................ 46
Function configuration of the inputs and outputs ................................................................................ 47
The device configurations described in the corresponding installation instructions or in the Annex
(→ page 204) to this documentation are used for standard devices (stock items). They fulfil the
requested specifications of most applications.
Depending on the customer requirements for series use it is, however, also possible to use other
device configurations, e.g. with respect to the inputs/outputs and analogue channels.
>
4.1 Set up the runtime system
Reinstall the runtime system ............................................................................................................... 40
Update the runtime system ................................................................................................................. 41
1016
14091
39
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
NOTICE
Configurations Set up the runtime system
>
4.1.1 Reinstall the runtime system
14635
8486
On delivery of the ecomatmobile controller no runtime system is normally loaded (LED flashes green
at 5 Hz). Only the boot loader is active in this operating mode. It provides the minimum functions for
loading the operating system (e.g. RS232, CAN).
Normally it is necessary to download the runtime system only once. The application program can then
be loaded to the device (also several times) without influencing 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 at:
→www.ifm.com > Select your country > [Service] > [Download] > [Systems for mobile machines]
Risk of data loss!
In case of power failure during the data transmission data can be lost so that the device is no longer
functionable. Repair is only possible by ifm electronic.
► Ensure an uninterrupted power supply during the data transmission!
NOTE
The software versions suitable for the selected target must always be used:
• runtime system (ifm_CR0403_Vxxyyzz.RESX),
• PLC configuration (ifm_CR0403_Vxx.CFG),
• device library (ifm_CR0403_Vxxyyzz.LIB ) and
• the further files.
V
xx: 00...99
yy: 00...99
zz: 00...99
The basic file name (e.g. "CR0403") and the software version number "xx" (e.g. "01") 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.
The following files must also be loaded:
• the internal libraries (created in IEC 1131) required for the project,
• the configuration files (*.CFG) and
• the target files (*.TRG).
It may happen that the target system cannot or only partly be programmed with your currently
installed version of CODESYS. In such a case, please contact the technical support department of ifm
electronic gmbh.
The runtime system is transferred to the device using the separate program "Maintenance Tool". (The
downloader is on the ecomatmobile DVD "Software, tools and documentation" or can be downloaded
from ifm's website, if necessary):
→www.ifm.com > Select your country > [Service] > [Download] > [Systems for mobile machines].
Normally the application program is loaded to the device via the programming system. But it can also
be loaded using the "Maintenance Tool" if it was first read from the device.
version
target version number
release number
patch number
4368
40
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Set up the runtime system
>
4.1.2 Update the runtime system
13269
An older runtime system is already installed on the device. Now, you would like to update the runtime
system on the device?
14158
NOTICE
Risk of data loss!
When deleting or updating the runtime system all data and programs on the device are deleted.
► Save all required data and programs before deleting or updating the runtime system!
3084
When the operating system software or the CODESYS runtime system is considerably improved, ifm
releases a new version. The versions are numbered consecutively (V01, V02, V03, ...).
Please see the respective documentation for the new functions of the new software version. Note
whether special requirements for the hardware version are specified in the documentation.
If you have a device with an older version and if the conditions for the hardware and your project are
OK, you can update your device to the new software version.
For this operation, the same instructions apply as in the previous chapter 'Reinstall the runtime
system'.
>
4.1.3 Verify the installation
► After loading of the runtime system into the controller:
• Check whether the runtime system was transmitted correctly!
• Check whether the correct runtime system is loaded in the controller!
► 1st test:
Test with the ifm maintenance tool if the correct runtime system version was loaded:
• Read name and version of the runtime system in the device!
• Manually compare this information with the target data!
► 2nd test (optional):
Check in the application program if the correct runtime system version was loaded:
• read name and version of the runtime system in the device!
• Compare this data with the specified values!
The following FB serves for reading the data:
GET_SW_INFO (→ page 190) Delivers information about the system software of the device:
>
• software name,
• software version,
• build number,
• build date
14637
41
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Set up the programming system via templates ................................................................................... 46
CAN declaration (e.g. CR1080) ........................................................................................................... 45
Configurations Set up the programming system
>
4.2 Set up the programming system
Set up the programming system manually .......................................................................................... 42
>
4.2.1 Set up the programming system manually
Set up the target .................................................................................................................................. 43
Activate the PLC configuration ............................................................................................................ 44
14461
3963
42
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Set up the programming system
>
Set up the target
13136
11379
When creating a new project in CODESYS the target file corresponding to the device must be loaded.
► Select the requested target file in the dialogue window [Target Settings] in the menu
[Configuration].
> The target file constitutes the interface to the hardware for the programming system.
> At the same time, several important libraries and the PLC configuration are loaded when selecting
the target.
► If necessary, in the window [Target settings] > tab [Network functionality] > activate [Support
parameter manager] and / or activate [Support network variables].
► If necessary, remove the loaded (3S) libraries or complement them by further (ifm) libraries.
► Always complement the appropriate device library ifm_CR0403_Vxxyyzz.LIB manually!
NOTE
The software versions suitable for the selected target must always be used:
• runtime system (ifm_CR0403_Vxxyyzz.RESX),
• PLC configuration (ifm_CR0403_Vxx.CFG),
• device library (ifm_CR0403_Vxxyyzz.LIB ) and
• the further files.
V
xx: 00...99
yy: 00...99
zz: 00...99
version
target version number
release number
patch number
The basic file name (e.g. "CR0403") and the software version number "xx" (e.g. "01") 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.
4368
The following files must also be loaded:
• the internal libraries (created in IEC 1131) required for the project,
• the configuration files (*.CFG) and
• the target files (*.TRG).
It may happen that the target system cannot or only partly be programmed with your currently
installed version of CODESYS. In such a case, please contact the technical support department of ifm
electronic gmbh.
43
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Set up the programming system
>
Activate the PLC configuration
10079
The PLC configuration is automatically loaded with the target system. The PLC configuration maps the
contents of the file CR0403.cfg in CODESYS. Like this, the programmer has easy access to
predefined system and error flags, inputs and outputs as well as to the CAN interfaces of the device.
To access the PLC configuration (e.g. CR1080):
► Click on the tab [Resources] in CoDeSys:
► Double-click on [PLC Configuration] in the left column.
> Display of the current PLC configuration (→ following figure):
> Based on the configuration the following is available in the program environment for the user:
•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 be directly symbolically designated (highly recommended!) in the window [PLC
Configuration] (example → figure below) and are available in the whole project as [Global
Variables].
44
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Set up the programming system
>
CAN declaration (e.g. CR1080)
In the CODESYS PLC configuration you now have to declare the CAN interface(s).
► Right-click on the name of the PLC configuration. [CANopen Interface [FIX]] of the desired CAN
interface.
► Click on [Append Subelement].
► Even if the device is operated as a CANopen slave: Click on [CANopen Master...]:
10080
Info
If the device is operated as a slave, the selection [CanSlave_Device] would also be possible.
For the simpler configuration as a master, all CAN Layer 2 and network variable functions can also be
used.
>The CAN parameters of the PLC configuration are displayed. Some CAN parameters are already
set as default:
► If the device is operated on CAN Layer 2 or as a slave via network variables or CAN_RX /
CAN_TX:
Check whether the correct baud rate is set for the device (baud rate must be identical for all
participants).
► If the device is operated as a CANopen master:
Check all parameter settings.
► Close the window [PLC Configuration].
► In the menu [File] > [Save as ...] give a sensible name to the project and save it in the requested
directory.
► In the application program always call an own instance of the FB CANOPEN_ENABLE
(→ page 93) for every CAN interface!
45
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Function configuration in general
>
4.2.2Set up the programming system via templates
ifm offers ready-to-use templates (program templates), by means of which the programming system
can be set up quickly, easily and completely.
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 V…\Projects\Template_DVD_V…
► Open the requested template in CODESYS via:
[File] > [New from template…]
>CODESYS creates a new project which shows the basic program structure. It is strongly
recommended to follow the shown procedure.
>
4.3 Function configuration in general
>
13745
970
3971
4.3.1 System variables
15576
All system variables (→ chapter System flags (→ page 204)) have defined addresses which cannot be
shifted.
46
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
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 (e.g. ifm_CR0020_Vx.LIB)
for the configuration of the inputs and outputs.
For details → Possible operating modes inputs/outputs (→page 207).
47
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Fast inputs ........................................................................................................................................... 52
Configurations Function configuration of the inputs and outputs
>
4.4.1 Configure inputs
Safety instructions about Reed relays ................................................................................................. 48
Configure the software filters of the inputs .......................................................................................... 49
Analogue inputs: configuration and diagnosis ..................................................................................... 50
Binary inputs: configuration and diagnosis .......................................................................................... 51
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
3973
7348
48
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Function configuration of the inputs and outputs
>
Configure the software filters of the inputs
15418
Via the input FILTER in the FB INPUT (→ page 173) a software filter can be configured which filters the
measured input voltage at the analogue inputs.
The filter behaves like a low-pass filter; the filter frequency is set with the value entered in FILTER. For
FILTER, values from 0...8 are permitted.
Table: limit frequency software low-pass filter at the analogue input
FILTER Filter frequency [Hz]
0…70 % 0…90 % 0…99 %
0 Filter deactivated
1 120 2 4 7
2 47 5 9 17
3 22 10 18 35
4 10 19 36 72 recommended
5 5 38 73 146
6 2.5 77 147 293
7 1.2 154 294 588
8 0.7 308 589 1177
The following statements of the step response are relevant:
• Input analogue: 0...90 % and 0...99 %
• Input binary: 0...70 %
Step response [ms] for ...
Remarks
Figure: course of time binary signal at the input upon switch-on / switch-off
49
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Function configuration of the inputs and outputs
>
Analogue inputs: configuration and diagnosis
Configuration of each input is made via the application program:
• FB INPUT (→ page 173) > input MODE
► 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.
As an alternative, an analogue channel can also be evaluated binarily.
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
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Function configuration of the inputs and outputs
>
Binary inputs: configuration and diagnosis
14672
Configuration of each input is made via the application program:
• FB INPUT (→ page 173) > input MODE
MODEBYTEoperating mode of the input channel:
0 = 0x00 off
3 = 0x03 voltage input 0…10 000 mV
6 = 0x06 voltage input, ratiometric 0...1 000 ‰
7 = 0x07 current input 0…20 000 µA
9 = 0x09 voltage input 0…32 000 mV
10 = 0x0A
11 = 0x0B
12 = 0x0C binary input, minus switching (BH)
18 = 0x12 resistance input
>
(only for analogue evaluated inputs)
binary input, plus switching (BL)
(only for analogue evaluated inputs)
binary input, plus switching (BL) with diagnosis
(Namur)
16…3 600 Ω
from HW state
AD:
16...30 000 Ω
Activation of the input diagnosis
If the diagnosis is to be used, it needs to be activated additionally.
► Set the mode of the input via input MODE of the function block INPUT (→ page 173).
>The FB INPUT (→ page 173) provides the diagnostic messages of the inputs on its RESULT
output.
Diagnosis of non-electronic switches:
► Equip the switch with an additional resistor
connection!
Figure: non-electronic switch S at input Inn
Sensors with diagnostic capabilities to NAMUR can be used on these inputs.
In this case, no additional resistor connection is required.
7352
51
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Function configuration of the inputs and outputs
>
Fast inputs
8292
The devices dispose of fast counting/pulse inputs for an input frequency up to 30 kHz (→ data sheet).
If, for example, mechanical switches are connected to these inputs, there may be faulty signals in the
controller due to contact bouncing.
Appropriate function blocks are e.g.:
FAST_COUNT Counter block for fast input pulses
INC_ENCODER (→ page 171) Up/down counter function for the evaluation of encoders
PERIOD (→ page 175) Measures the frequency and the cycle period (cycle time) in [µs] at the indicated channel
When using these units, the parameterised inputs and outputs are automatically configured, so the
programmer of the application does not have to do this.
>
Use as binary inputs
3804
The permissible high input frequencies also ensure the detection of faulty signals, e.g. bouncing
contacts of mechanical switches.
► If required, suppress the faulty signals in the application program!
52
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Via the input FILTER in the FB OUTPUT (→ page 180) a software filter can be configured which filters
the measured output current at the PWM outputs.
The FILTER byte is only valid for outputs with current measurement.
For outputs without current measurement: set FILTER = 0!
The current at the output is averaged over a PWM period.
If dithering is set, the current is averaged over the dither period.
The filter behaves like a low-pass filter; the limit frequency is set by the value entered in FILTER. For
FILTER, values from 0...8 are permitted.
Table: limit frequency software low-pass filter on PWM output
FILTER Filter frequency [Hz]
0…90 % 0…95 % 0…99 %
0 Filter deactivated
1 600 0.8 1.0 1.4
2 233 1.8 2.2 3.4
3 109 3.6 4.6 7.0
4 52 7.2 9.4 14.4
5 26 14.6 19.0 29.2
6 13 29.4 38.2 58.6
7 6 58.8 76.4 117.6
8 4 117.8 153.2 235.4
The following statements of the step response are relevant:
• Output current: 0...90 % and 0...99 %
Step response [ms] for ...
Remarks
outputs without current
measurement
recommended
3976
Figure: time sequence binary current signal on output upon switch-on / switch-off
53
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Function configuration of the inputs and outputs
>
Binary outputs: configuration and diagnosis
The following operating modes are possible for the device outputs (→ data sheet):
• binary output, plus switching (BH) with/without diagnostic function
Qn = pin output n
(L) = load
Basic circuit of binary output plus switching (BH)
for positive output signal
► Configuration of each output is made via the application program:
→ FB OUTPUT (→ page 180)> input MODE.
WARNING
14689
15451
Dangerous restart possible!
Risk of personal injury! Risk of material damage to the machine/plant!
If in case of a fault an output is switched off via the hardware, the logic state generated by the
application program is not changed.
► Remedy:
• Reset the output logic in the application program!
• Remove the fault!
• Reset the outputs depending on the situation.
>
Configuration of the output diagnosis
If the diagnosis is to be used, it needs to be activated additionally.
► If using the output as binary output with diagnosis (→ data sheet):
→ FB OUTPUT > input MODE = 15 or 18
>The FB OUTPUT (→ page 180) provides the diagnostic messages of the outputs on its RESULT
output.
8301
54
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Function configuration of the inputs and outputs
>
PWM outputs
The following operating modes are possible for the device outputs (→ data sheet):
• PWM output, plus switching (BH) without diagnostic function
Qn = pin output n
(L) = load
Basic circuit of binary output plus switching (BH)
for positive output signal
WARNING
Property damage or bodily injury possible due to malfunctions!
For outputs in PWM mode:
• there are no diagnostic functions
• the overload protection OUT_OVERLOAD_PROTECTION is NOT active
14705
15451
15414
9980
NOTE
PWM outputs must NOT be operated in parallel, e.g. in order to increase the max. output current. The
outputs do not operate synchronously.
Otherwise the entire load current could flow through only one output. The current measurement would
no longer function.
>
Availability of PWM
15577
Device
BasicController: CR0403 12 2 20...250
>
Number of available
PWM outputs
FBs for PWM functions
The following function blocks are available for the PWM function of the outputs:
CURRENT_CONTROL (→ page 178) Current controller for a PWMi output channel
PWM1000 (→ page 182) Initialises and configures a PWM-capable output channel
>
the mark-to-space ratio can be indicated in steps of 1 ‰
Current control with PWM (= PWMi)
Current measurement of the coil current can be carried out via the current measurement channels
integrated in the controller. This way, the current can for example be re-adjusted if the coil heats up.
The hydraulic conditions in the system are maintained.
In principle, the current-controlled outputs are protected against short circuit.
of which current-
controlled (PWMi)
PWM frequency
[Hz]
14718
14722
55
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
In this chapter you will learn more about how to handle variables.
The device supports the following types of variables:
Declaration place
local
local retain nonvolatile
global
global retain nonvolatile
in the declaration part of the function
element (POU)
In [Resources] > [Global Variables] >
[Globale_Variables]:
Validity area
Only valid in the function element
(POU) where it was configured.
Valid in all function elements of this
CODESYS project.
Memory behaviour
volatile
volatile
3130
14486
Network
In [Resources] > [Global Variables] >
declaration list
Network retain nonvolatile
Values are available to all CODESYS
projects in the whole network if the
variable is contained in its declaration
lists.
volatile
→ CODESYS programming manual
→ecomatmobile DVD "Software, tools and documentation"
>
4.5.1 Retain variables
Retain variables can be saved automatically in a protected memory area and be reloaded
automatically during a reboot.
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).
8672
14166
56
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Configurations Variables
>
Save retain variables
9853
In the device the data type RETAIN is only stored in the volatile memory (RAM) during the runtime.
To save the data permanently, at the end of each cycle they are automatically be saved in the FRAM
memory ¹).
¹) FRAM indicates here all kinds of non-volatile and fast memories.
NOTE
In this device, do NOT use the following functions from the 3S library SysLibPlcCtrl.lib:
- FUN SysSaveRetains
- FUN SysRestoreRetains
>
Read back retain variables
9854
After power on and before the first program cycle the device automatically writes the saved data back
to the working memory once. To do so, no additional FBs must be integrated into the application
program.
NOTE
In this device, do NOT use the following functions from the 3S library SysLibPlcCtrl.lib:
- FUN SysSaveRetains
- FUN SysRestoreRetains
>
4.5.2 Network variables
15242
9856
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.
► Integrate the following library/libraries into the CODESYS project:
ifm function elements ifm libraries for the device CR0403
5 ifm function elements
ifm libraries for the device CR0403 ..................................................................................................... 58
13586
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.
Provides information on the buffer flags
The flags can be reset via the optional inputs.
network since the last deletion of messages
The list can be reset by setting the according input.
Reads the error registers 0x1001 and 0x1003 from the controller
The registers can be reset by setting the respective inputs.
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.
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.
Signals the network operating status of the node
Reports any change of value for a particular object directory entry
Request the parameters of the master, a slave device or a specific node in the network
• Reads the setting of the SYNC functionality (active / not active),
• reads the error state of theSYNC functionality (SyncError)
Updates the internal node status
and, depending on the NMT command entries:
• triggers an NMT command or
• triggers the initialisation of a node
Reads configuration data from the object directory of the device
Reads an "Expedited SDO" = Expedited Service Data Object
Reads the indicated entry in the object directory of a node in the network via SDO block transfer
Reads the indicated entry in the object directory of a node in the network
Writes an "Expedited SDO" = Expedited Service Data Object
Writes in the indicated entry in the object directory of a node in the network via SDO block
transfer
Writes in the indicated entry in the object directory of a node in the network
Sends an EMCY message. The message is assembled from the according parameters and
entered in register 0x1003
14914
61
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
ifm function elements ifm libraries for the device CR0403
Function element Short description
CANOPEN_SETSTATE (→ page 99) = CANopen set state
Set the parameters of the master, a slave device or a specific node in the network
CANOPEN_SETSYNCSTATE (→ page 126) = CANopen set SYNC state
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_ENABLE
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7492
>
Description
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
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
7494
7495
Parameters of the outputs
RESULTBYTEfeedback of the function block
(possible messages → following table)
Possible results for RESULT:
Value
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
Description
67
8530
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_RECOVER
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7512
>
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
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):
InhibitTime
(optional use of the parameter)
TIME := T#1sWaiting time between bus off and restart of the CAN interface
restart of CAN interfaceremedy bus off condition
FALSE:function element is not executed
68
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_SETDOWNLOADID
= Set download ID
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7516
>
Description
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
EXECUTE BOOL := FALSE FALSE TRUE (edge):
CHANNEL BYTE CAN interface (1...n) depending on the device
DOWNLOAD_ID BYTE 1...127 = set download ID
>
execute function element once
otherwise: function element is not active
A function element already started is processed.
0 = read download ID
Parameters of the outputs
7517
7519
7520
RESULTBYTEfeedback of the function block
(possible messages → following table)
Possible results for RESULT:
Value
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
Description
69
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_STATUS
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7499
>
Description
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
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
• BUSOFFFALSE:function element is not executed
7501
7502
70
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
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
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
Description
7504
71
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
BOOL
TRUE: execute this function element
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_RX
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7586
>
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
ENABLE
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 (2
0...2 047 = 0x0000 0000...0x0000 07FF
Extended Frame (2
>
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
11
IDs):
29
IDs):
Parameters of the outputs
7590
DATA ARRAY [0..7] OF BYTE received data, (1...8 bytes)
RESULT BYTE feedback of the function block
Possible results for RESULT:
Value
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
(possible messages → following table)
Description
73
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
BOOL
TRUE: execute this function element
ifm function elements ifm function elements for the device CR0403
>
CAN_RX_ENH
= CAN RX enhanced
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7606
>
Description
In addition, CAN_RX_ENH provides the following possibilities (as opposed to CAN_RX (→ page 73)):
• select the frame type (11 or 29 bits),
• define a mask for the evaluation of the CAN ID.
Bit comparison of
ID and mask:
If ID_MASK-Bit = 0, then CAN-ID-Bit may be = 0 or 1.
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]):
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
Extended
(optional use of the parameter)
ID_Mask
(optional use of the parameter)
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
normal frame (2
0...2 047 = 0x0000 0000...0x0000 07FF
Extended Frame (2
11
IDs):
29
IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
BOOL := FALSE TRUE: Extended Frame (ID = 0...229-1)
FALSE: Normal Frame (ID = 0...2
11
-1)
DWORD := 0 filter mask for the identifier:
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
74
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
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
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
Description
7613
75
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
BOOL
TRUE: execute this function element
ifm function elements ifm function elements for the device CR0403
>
CAN_RX_ENH_FIFO
= CAN RX enhanced with FiFo
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7615
>
Description
In addition, CAN_RX_ENH_FIFO provides a FiFo for the received data (as opposed to CAN_RX_ENH
(→ page 74)). 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
ENABLE
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
Extended
BOOL := FALSE TRUE: Extended Frame (ID = 0...229-1)
(optional use of the parameter)
ID_Mask
DWORD := 0 filter mask for the identifier:
(optional use of the parameter)
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
normal frame (2
0...2 047 = 0x0000 0000...0x0000 07FF
Extended Frame (2
11
IDs):
29
IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
FALSE:Normal Frame (ID = 0...2
11
-1)
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
7616
7609
76
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
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
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
Description
7617
77
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
BOOL
TRUE: execute this function element
ifm function elements ifm function elements for the device CR0403
>
CAN_RX_RANGE
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7592
>
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
ENABLE
CHANNEL BYTE CAN interface (1...n) depending on the device
ID_START DWORD start number of the data object identifier range:
ID_STOP DWORD end number of the data object identifier range:
Extended
BOOL := FALSE TRUE: Extended Frame (ID = 0...229-1)
(optional use of the parameter)
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
BOOL
TRUE: execute this function element
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_TX
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7522
>
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
ENABLE
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)
>
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
normal frame (2
0...2 047 = 0x0000 0000...0x0000 07FF
Extended Frame (2
11
IDs):
29
IDs):
2 048...536 870 911 = 0x0000 0800...0x1FFF FFFF
Parameters of the outputs
RESULT BYTE feedback of the function block
Possible results for RESULT:
Value
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
7527
(possible messages → following table)
Description
83
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_TX_ENH
= CAN TX enhanced
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7558
>
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 83) 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
ENABLE BOOL FALSE TRUE (edge):
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
Extended
BOOL := FALSE TRUE: Extended Frame (ID = 0...229-1)
(optional use of the parameter)
DATALENGTHCODE BYTE = Data Length Code
DATA ARRAY [0..7] OF BYTE data to be sent (1...8 bytes)
TRUE: execute this function element
FALSE: unit is not executed
> Function block inputs are not active > Function block outputs are not specified
normal frame (2
0...2 047 = 0x0000 0000...0x0000 07FF
Extended Frame (2
11
IDs):
29
IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
FALSE:Normal Frame (ID = 0...2
11
-1)
number of the data bytes to be sent (0...8)
84
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
7527
RESULTBYTEfeedback of the function block
(possible messages → following table)
Possible results for RESULT:
Value
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
Description
85
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
BOOL
TRUE: execute this function element
ifm function elements ifm function elements for the device CR0403
>
CAN_TX_ENH_CYCLIC
= CAN TX enhanced cyclic
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7568
>
Description
CAN_TX_ENH_CYCLIC serves for cyclical transmitting of CAN messages.
Otherwise, the FB corresponds to CAN_TX_ENH (→ page 84).
► 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
ENABLE
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
Extended
BOOL := FALSE TRUE: Extended Frame (ID = 0...229-1)
(optional use of the parameter)
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
FALSE: unit is not executed
> Function block inputs are not active
> Function block outputs are not specified
normal frame (2
0...2 047 = 0x0000 0000...0x0000 07FF
Extended Frame (2
11
IDs):
29
IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
FALSE:Normal Frame (ID = 0...2
11
-1)
7569
7582
86
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
7510
RESULTBYTEfeedback of the function block
(possible messages → following table)
Possible results for RESULT:
Value
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
Description
87
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_REMOTE_REQUEST
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7625
>
Description
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
EXECUTE BOOL := FALSE FALSE TRUE (edge):
CHANNEL BYTE CAN interface (1...n) depending on the device
ID DWORD Number of the data object identifier:
Extended
BOOL := FALSE TRUE: Extended Frame (ID = 0...229-1)
(optional use of the parameter)
>
execute function element once
otherwise: function element is not active
A function element already started is processed.
normal frame (2
0...2 047 = 0x0000 0000...0x0000 07FF
Extended Frame (2
11
IDs):
29
IDs):
0...536 870 911 = 0x0000 0000...0x1FFF FFFF
FALSE:Normal Frame (ID = 0...2
11
-1)
Parameters of the outputs
7627
7628
7629
DATALENGTHCOUNTBYTE= 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
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
Description
89
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CAN_REMOTE_RESPONSE
Unit type = function block (FB)
Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7631
>
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:
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CANOPEN_ENABLE
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7785
>
Description
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 93) 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 67) has not been activated before.
>
Parameters of the inputs
ENABLE BOOL := TRUE TRUE:
CHANNEL BYTE CAN interface (1...n) depending on the device
Baud rate
WORD := 0Baud rate [kbits/s]
(optional use of the parameter)
• Enable CANopen for the selected channel
• Start CANopen manager or CANopen device according to the
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
Parameters Data type Description
RESULTBYTEfeedback of the function block
(possible messages → following table)
Possible results for RESULT:
Value
dec | hex
0 00 FB is inactive
1 01 function block execution completed without error
14 0E FB is active
15 0F FB is active
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
Description
CANopen manager configures devices and sends SDOs
CANopen manager is started
7789
94
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CANOPEN_GETBUFFERFLAGS
= Get buffer flags
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7890
>
Description
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
EXECUTE BOOL := FALSE FALSE TRUE (edge):
CHANNEL BYTE CAN interface (1...n) depending on the device
ResetRXFlags
BOOL := FALSE TRUE: Provide fag status at the output and
(optional use of the parameter)
ResetTXFlags
BOOL := FALSE TRUE: Provide flag status at the output and
(optional use of the parameter)
execute function element once
otherwise: function element is not active
A function element already started is processed.
then reset
FALSE:function element is not executed
then reset
FALSE:function element is not executed
7892
7893
95
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
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
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
Description
7894
96
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
CANOPEN_GETSTATE
= Get state
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7865
>
Description
Via CANOPEN_GETSTATE, parameters of the master, a slave device or a specific node in the
network can be set.
>
Parameters of the inputs
EXECUTE BOOL := FALSE FALSE TRUE (edge):
CHANNEL BYTE CAN interface (1...n) depending on the device
NODE BYTE Node ID = ID of the node (0...127)
execute function element once
otherwise: function element is not active
A function element already started is processed.
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
7867
7868
97
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
ording to CANopen (with these values the status is also
ifm function elements ifm function elements for the device CR0403
>
Parameters of the outputs
MASTERSTATEBYTEMaster 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 ResetNode1 = 0x01 = waiting for BOOTUP2 = 0x02 = after receipt of the BOOTUP message3 = 0x03 = not yet configured: STOPPED
4 = 0x04 = after configuration with SDOs: PRE-OPERATIONAL5 = 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 acc
coded in the corresponding messages with regard to the node).
0 0x00 BOOTUP
4 0x04 STOPPED
5 0x05 OPERATIONAL
127 0x7FPRE-OPERATIONAL
RESULTBYTEfeedback of the function block
(possible messages → following table)
Possible results for RESULT:
Value
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
Description
7869
98
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
ifm function elements ifm function elements for the device CR0403
>
CANOPEN_SETSTATE
= Set state
Unit type = function block (FB)
Unit is contained in the library ifm_CANopen_NT_Vxxyyzz.LIB
Symbol in CODESYS:
7858
>
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 103). At the same time admissibility checks are
carried out. For reasons of consistency no inputs are provided for this purpose.
99
ifm Programming Manual ecomatmobile BasicController (CR0403) Runtime System V03.02 2015-04-01
Parameter
Data type
Description
changed. The established settings are only adopted for this node (not
The function block adopts this value as the new node ID of the device.
Parameter
Data type
Description
ifm function elements ifm function elements for the device CR0403
>
Parameters of the inputs
7861
EXECUTEBOOL := FALSEFALSE 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
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:
GlobalStart
(optional use of the parameter)
BOOL := TRUE Requirement: FB must be called immediately after starting the IEC
program. This setting overwrites the setting of the configuration.
TRUE: Start all participants simultaneously
FALSE: Start all participants one after the other
CfgTimeout
(optional use of the parameter)
TIME := T#0msset configuration timeout for a node:
Value = 0:
no action – retain configuration data
Value not 0:
overwrite data from the configuration with the new value
InitNoSdos
(optional use of the parameter)
>
BOOL := FALSE To the node indicated in NODE, during initialisation,...
TRUE: do not send configuration data
FALSE: send configured SDOs
Parameters of the outputs
RESULT BYTE feedback of the function block
Possible results for RESULT:
Value
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
Description
7862
(possible messages → following table)
100
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.