251
System Manual Type R 360 for use with ecolog 100 plus v2.1

System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

System Manual

Type R 360

for use with ecolog 100plus v2.1

Page 2: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Manual ecomat 100 Type R 360

System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P

Note about the guarantee

This manual was written with the utmost care. However, we cannot assume any guarantee for its contents.

Since errors cannot be avoided despite all efforts we appreciate any comment.

We reserve the right to make technical alterations to the product which might result in a change of contents of the manual.

Page 3: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

I

Contents

1. Things you should know........................................................1-1

1.1. Required knowledge............................................................................... 1-1

1.2. Structure of the manual.......................................................................... 1-1

Finding what you’re looking for ................................................................. 1-1

2. General information ...............................................................2-1

2.1. Safety instructions ................................................................................. 2-1

2.2. Intended use............................................................................................ 2-1

2.3. Control configuration ............................................................................. 2-3

3. The monitoring function of the Classic and ExtendedControllers ..............................................................3-1

3.1. Hardware setup....................................................................................... 3-1

3.2. Function principle of delayed disconnection....................................... 3-2

3.3. Function principle of the monitoring system ....................................... 3-3

3.4. Feedback on outputs.............................................................................. 3-3

4. Device configuration ..............................................................4-1

4.1. Digital and PWM outputs........................................................................ 4-1

4.2. Digital inputs ........................................................................................... 4-2

4.3. Fast inputs............................................................................................... 4-2

4.4. Analog inputs .......................................................................................... 4-3

4.5. Configuring the input and output functions......................................... 4-3

Classic and ExtendedController................................................................ 4-4

CabinetController...................................................................................... 4-8

SmartController......................................................................................... 4-9

4.6. Control modes of the ExtendedController...........................................4-11

Page 4: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Manual ecomat 100 Type R 360 II

4.7. The software control configuration ..................................................... 4-13

4.8. Terminal assignment ............................................................................ 4-13

5. Operating states and operating system............................... 5-1

5.1. Operating states...................................................................................... 5-1

5.2. Status LED............................................................................................... 5-2

5.3. Loading the operating system ............................................................... 5-2

5.4. Control modes......................................................................................... 5-4

6. Error codes and error classes .............................................. 6-1

6.1. Response to system error...................................................................... 6-1

7. CAN in the ecomat type R 360 .............................................. 7-1

7.1. Technical specifications of the CAN interface...................................... 7-1

CR7xxx, CR03xx....................................................................................... 7-1

CR250x, CR0xxx (not CR03xx) ................................................................ 7-1

7.2. CAN data exchange ................................................................................ 7-2

7.3. CAN errors and error handling .............................................................. 7-4

7.4. Physical connection to the CAN bus..................................................... 7-6

7.5. General notes about the use of CAN..................................................... 7-9

7.6. Description of the CAN function blocks ............................................. 7-11

7.7. CANopen in the ecomat type R 360..................................................... 7-22

7.8. The ecomat 100 type R 360 as CANopen slave .................................. 7-27

7.9. The ecomat 100 type R 360 as CANopen master ............................... 7-40

7.10. Functions for CANopen I/O modules from ifm electronic ................. 7-61

7.11. Functions for using the second CAN interface to SAE J 1939 and ISO 11992 ............................................................................................... 7-67

8. PWM in the ecomat Type R 360............................................. 8-1

8.1. PWM signal processing and current control ........................................ 8-1

Page 5: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

III

9. High-speed counters in the ecomat type R 360...................9-1

9.1. Counter functions for frequency and period measurement................ 9-1

10. Other functions of the ecomat type R 360..........................10-1

10.1. Software reset ....................................................................................... 10-1

10.2. Saving, reading and converting data .................................................. 10-2

10.3. Data access and verification.............................................................. 10-12

10.4. Processing interrupts......................................................................... 10-17

10.5. Sending data through the built-in SSC interface. ............................ 10-21

10.6. Using the serial interface ................................................................... 10-25

10.7. Reading the system time.................................................................... 10-29

10.8. Processing variables.......................................................................... 10-31

10.9. Processing analog values.................................................................. 10-33

10.10. Function blocks as interface between IEC 61131-3 and C .............. 10-36

11. Closed-loop control functions in the ecomat type R 360 .11-1

11.1. Setting method for closed-loop controllers ........................................11-3

11.2. Controller function blocks ....................................................................11-3

12. Appendix ...............................................................................12-1

12.1. Inputs CR0xxx/CR030x/CR250x........................................................... 12-1

CR0xxx inputs......................................................................................... 12-1

CR03xx inputs ........................................................................................ 12-5

CR25xx inputs ........................................................................................ 12-7

12.2. Outputs CR0xxx/CR030x/CR250x........................................................ 12-8

CR0xxx outputs ...................................................................................... 12-8

CR03xx outputs .....................................................................................12-11

CR25xx outputs .................................................................................... 12-13

12.3. The R 360 flag range........................................................................... 12-14

12.4. Other system flags ............................................................................. 12-15

Page 6: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Manual ecomat 100 Type R 360 IV

12.5. CANopen device interface ecomat type R 360 ................................. 12-18

12.6. Object directory of the ecomat type R 360 ....................................... 12-20

Communication profile data range, index 1000 to 1FFF ....................... 12-20

Legend for object directory.................................................................... 12-32

13. Alphabetical index................................................................ 13-1

Page 7: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

1-1

1. Things you should know If you use this manual as recommended, you will be able to put the ecomat 100 control system into productive use quickly and effectively.

This chapter provides an overview of the following points:

• What you need to know before you use these instructions

• The structure of this manual

• How to find what you are looking for in this manual

• The information contained in this manual.

1.1. Required knowledge These instructions are for persons who are familiar with control engineering and PLC programming with IEC 61131-3, as well as with the ecolog 100plus software.

1.2. Structure of the manual This manual is a combination of different types of instructions. It is a learning aid for the newcomer as well as a reference work for experienced users.

Finding what you’re looking for To simplify the use of this manual, you can use the following aids:

To look up a particular topic, look in the table of contents for this manual.

Alternatively, you can use the alphabetical index to find a particular subject.

At the beginning of each chapter there is a brief overview of its content.

Page 8: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Structure of the manual

1-2

Page headers The page header of each right-hand side contains the title of the currentchapter. On the left side, the current second level heading is shown.

Page footers The footer of each page contains the page number, which includes the chapternumber.

Selective reading The left margin contains notes to help you find specific sections.

The meanings of the symbols in the margin are explained below.

Caution

Sections marked with this symbol contain safety information. Pay particularattention to these sections.

Note

Indicates important notes to help you use the ecomat 100 correctly.

Page 9: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

2-1

2. General information

2.1. Safety instructions Observe the information in this manual. Non-observation of this information, operation not in accordance with the use prescribed in this manual, and incorrect installation or handling can put people and equipment at serious risk.

These instructions are intended for persons that can be regarded as qualified according to the EMC and Low-Voltage Directives. The controllers must be installed and commissioned by a skilled electrician (programmer or service technician).

This description is part of the unit. It contains text and illustrations that describe the correct handling of the controller and must be read before the controller’s installation and use.

If the unit is not supplied by the mobile on-board system (12/24 V battery operation), make sure that the external voltage is generated and supplied according to the criteria for safety extra-low voltage (SELV), since this is supplied directly to the connected controller, the sensors, and the actuators without any further safety measures.

The wiring of all signals in connection with the unit’s SELV circuit must also comply with the SELV criteria (safety extra-low voltage, safe isolation from other electric circuits).

Any external earthing of the supplied SELV voltage (SELV becomes PELV) is implemented under responsibility of the user, who must comply with the applicable national installation regulations. All statements in this operator manual applies to the unit without earthed SELV voltage.

The terminals must be supplied only with the signals indicated in the technical data or on the unit’s nameplate and only approved accessories from ifm electronic must be connected.

The unit can be operated within a wide ambient temperature range according to the technical specifications below. Due to the additional self-heating, the temperature of the enclosure walls may increase noticeably in hot environments.

In the event of a malfunction or if you have any questions, please contact the manufacturer. Interventions in the unit can cause injury and material damage. They are not permitted and invalidate any liability or warranty.

2.2. Intended use The ecomat 100 type R 360 control modules (referred to here as ecomat R 360) are intended for use under adverse operating conditions (such as extended temperature range, strong vibration, and strong EMC interference). They are

Page 10: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Intended use

2-2

therefore suited for direct installation in machines in mobile applications and for harsh environments. The inputs and outputs are designed specifically for this type of use. Built-in hardware and software functions (the operating system) provide the machine with a high level of protection.

The SafetyController R 360 is approved for applications in which the protectionof personal safety is an important factor if the appropriate system test routinesare incorporated in the operating system and the application software. The finalclassification and system release (hardware and software) must be performedby the appropriate authority. The programmer must read any supplementarydocumentation for information about any special features of the hardware andsoftware. This is available on request.

ifm electronic gmbh

Teichstr. 4

D 45127 Essen, Germany

Tel.: +49 (0)180 3436463

(0201 / 2422-330)

Fax: +49 (0)180 2436329

www.ifm-electronic.com

With the ecolog 100plus software, you can easily create your own application software.

All software functions and programming processes described in this documentation apply to the ecolog 100plus programming software. To use this manual, you must be familiar with this software.

You must also observe the software versions used (especially the operating system and the function libraries). Software versions are indicated by letters appended to the file name in alphabetical sequence (for example CR0020_x.LIB). Before you revise existing application projects, find out about any incompatibilities between the old and the new versions.

Users are responsible for the safe functioning of the application programs which they create. If specified by law, you must obtain an approval for your programs from the responsible licensing authority.

Page 11: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

General information

2-3

2.3. Control configuration The ecomat R 360 is a configurable device for series use. Its control modules can be optimised for specific applications. If necessary, special functions and hardware solutions can also be implemented. You can obtain the current version from our website at www.ifm-electronic.com.

As a rule, all versions and explanations in this manual apply universally to the ecomat R 360 control system. Always load the appropriate controller configuration for the unit used in the programming system (for unit with article number CRxxxx, the controller configuration file name is CRxxxx_X).

Before using the control modules, check the availability of the functions, hardware options, inputs and outputs you want to use in the hardware.

Page 12: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Control configuration

2-4

Page 13: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

3-1

3. The monitoring function of the Classic and ExtendedControllers The controllers’ monitoring function is intended mainly to protect the connected machine and plant components.

3.1. Hardware setup The Classic and the ExtendedControllers have two and four built-in relays respectively, each of which can isolate twelve outputs from the power supply.

The monitoring relay is actuated by the µController via two channels: to one channel, an AND sequence of the watchdog signal (internal µController monitoring) and the RELAY bit are applied by a semiconductor switch; to the other channel, only the ERROR bit is applied by a semiconductor switch. In its actuated state, supply voltage is applied to the monitored outputs through the relay contact (not positive-action).

The second relay (a clamp relay) can be linked into the monitoring concept through the user software. As with the monitoring relay, this switches the output circuit off at an Emergency-Stop or when the supply voltage is disconnected. In addition, a program-controlled disconnection of the whole control system (terminal 15 engineering) can be implemented with this relays.

The block diagram shows the dependence of the relays on the applied signals and the logic states of the system flags.

Block diagram of the monitoring system

Page 14: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Function principle of delayed disconnection

3-2

3.2. Function principle of delayed disconnection If the control modules are isolated from the supply voltage (ignition off), all outputs are normally switched off, no more input signals are read and processing of the control software (operating system and user program) are terminated. This happens regardless of the control system’s current program step.

If this behaviour is undesirable, a program-controlled control system shutdown must be performed. This allows, for example, data in memory to be saved after the ignition has been switched off.

The Classic and ExtendedControllers can be shut down under program control through a protective circuit connected to the supply voltage inputs and the evaluation of the associated system flags. The block diagram in section 3.1 shows the relationships of the individual current paths.

Connecting terminal VBBS (23) with ignition switch

Terminal 23 supplies the built-in control electronics.

This terminal is monitored internally. If no supply voltage is applied, system flag CLAMP_15 is set to FALSE. Resetting of flag CLAMP_15 can be monitored by the user program.

Connecting terminal VBBO (5) with battery (not switched)

Through terminal 5, up to 12 outputs of output group VBBO are supplied with voltage. This terminal also supplies the control electronics self-retaining.

In addition, the supply voltage is read through terminal 5 and provided in the global system variables as analog value SUPPLY_VOLTAGE. Its uses include ratiometric analog processing. System flag ERROR_POWER is set if no supply voltage is applied to terminal 5. This allows independent monitoring of this output group’s supply.

Self-retaining

Self-retaining is active when voltage is applied to VBBo and system flag RELAIS_CLAMP_15 (and therefore the clamp relay) is set. When system flag RELAIS_CLAMP_15 is reset, the clamp relay drops out. If no voltage is applied to terminal 23 at that moment, self-retaining is cancelled and the controller switches itself off completely.

Note that on both parts of the ExtendedController terminal 23 is connected to and switched off through the ignition switch. Likewise, the two system flags RELAIS_CLAMP_15 and RELAIS_CLAMP_15_E must be reset to switch the controller off fully.

Page 15: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The monitoring function of the Classic and ExtendedControllers

3-3

3.3. Function principle of the monitoring system During program execution, the monitoring relay is fully software-controlled by the user. This allows, for example, the evaluation of a safety chain parallel contact as input signal and a corresponding de-energization of the monitoring relay. Further safety measures must be implemented according to the applicable national regulations.

If, during program execution, a error occurs, the relay can be de-energised through the the ERROR bit to isolate critical plant components.

By resetting the RELAY bit (via the ERROR bit or directly) all outputs are switched off. The outputs in the VBBR current path are separated directly by means of the monitoring relay. The outputs in the VBBO current path are only separated through the software.

Any program must be designed so that an unintentional, dangerous startup of machine and plant components is neither possible after a fault (watchdog, Emergency-Stop, etc.) has occurred nor during the subsequent fault rectification work. To achieve this, the relevant outputs must additionally be disabled and the logical states linked and evaluated with the relay state. (Output group VBBO is not automatically switched off through the ERROR signal).

If a watchdog error occurs, the program processing will be interrupted automatically and the controller will be reset. It will then start again, like after power-on.

If a monitored output is continually enabled and the contact of the monitoring relay is welded, it is not possible to switch off the output! But because the relay is always switched in a no-load state during normal operation, the contact wear is likely to be minimal.

Monitoring supply voltage VBBR (34)

Through terminal 34, up to 12 outputs of output group VBBR are supplied with voltage. In addition, the presence of supply voltage is indicated through system flag ERROR_VBBR. If ERROR_VBBR is set (TRUE), no supply voltage is present. This information is available for processing by the user program.

3.4. Feedback on outputs If actuators are operated by external sources or if bidirectional inputs/outputs are used in mixed operation with both inputs and outputs, the corresponding output rail must not become potetial-free.

Otherwise, the supply voltage is fed back to the output rail through the protective diode built into the output driver. This can cause a set output to actuate its connected load and the resulting load current to destroy the output issuing the feedback.

Page 16: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Feedback on outputs

3-4

Observe this especially when the device and output voltage supply have separate protection and when disconnection of the output rails VBBO/VBBR is software-controlled through the built-in relays.

Solution for externally connected outputs

Externally connected outputs must be isolated through diodes so that the output terminal has no voltage applied.

Solution for bidirectional inputs and outputs in mixed operation

The inputs must be supplied through the same voltage rail of the associated outputs.

Page 17: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

4-1

4. Device configuration The device configurations described in the installation instructions and the appendix of this manual are available as standard (off-the-shelf) devices. They cover the requirements for most applications.

Depending on customer requirements, other device configurations may also be used, for example with different input/output combinations and different configurations of the analog channels.

The software functions etc. described in this manual apply only to the default configurations. If customer-specific devices are used, any special hardware versions and additional notes (additional documentation) for using the software must be observed.

4.1. Digital and PWM outputs There are three types of controller outputs: highside digital outputs with and without diagnostic function, highside digital outputs with and without diagnostic function and additional PWM mode, and PWM outputs that can be operated with and without current control function. Current-controlled PWM outputs are used mainly for actuating proportional hydraulic functions.

The Classic and ExtendedControllers offer the additional possibility of a changeover between highside and lowside outputs. Up to two H links – for example for controlling electrical motors – can therefore be implemented in these devices.

Highside output for positive output signal

Lowside output for negative output signal

For safety-relevant applications, the outputs with readback function(diagnostics-capable outputs) in the VBBR group must be used.

Page 18: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Digital inputs

4-2

4.2. Digital inputs Depending on the controller, the digital inputs can also be configured in different ways. Beside the fault protection mechanisms, the digital inputs are evaluated internally through an analog stage, which allows a diagnosis of the input signals. In the application software, however, the switching signal is available directly as bit information. For some of these inputs, the switched potential can also be selected.

Block diagram: highside/lowside input for negative and positive sensor signals

Highside input for negative sensor signal

Lowside input for positive sensor signal

4.3. Fast inputs In addition, the control modules have up to 16 fast counter/pulse inputs for an input frequency of up to 50 kHz. If, for example mechanical switches are connected to these inputs, contact bounce can cause false signals in the controller, which may have to be filtered out through the application software (see sample program).

Also note whether the pulse inputs are laid out for frequency (FRQx) and/or period measurement (CYLx).

Page 19: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Device configuration

4-3

4.4. Analog inputs The analog inputs can be configured with the user program. They can be used as 0 – 20 mA current inputs and as voltage inputs.

Used as voltage inputs, their measurement range can be switched over between 0 to 10 V and 0 to 32 V. If the supply voltage is read back in 0 – 32 V mode, radiometric readings can also be taken. This means that potentiometer or joystick signals can be processed without additional reference potential. Supply voltage fluctuations do not affect the reading in this case.

Alternatively, an analog channel can be digitally evaluated.

Block diagram of the analog inputs

4.5. Configuring the input and output functions On the Classic and ExtendedControllers (and – to a limited extent – also on the Smart- and CabinetControllers) the inputs and outputs can be configured.

In addition diagnostic functions can be activated on some inputs and outputs. This allows the corresponding input and output signal to be monitored and, in the event of a fault, an action to be triggered by the user program. Depending on the input and output, certain conditions must be observed when using the diagnostics function.

Use the datasheet to check whether the used device provides the described input or output groups.

Like the ClassicController, the ExtendedController is configured using the same system flags. If it is used in control mode 2 (see 4.8), the inputs and outputs are indicated with the appendix _E.

Page 20: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Configuring the input and output functions

4-4

The inputs and outputs are configured by assigning certain values to a systemvariable (e.g. I14_MODE). Depending on the requested functionality theconstant values have to be added (the configuration active so far will beoverwritten by the new configuration) or the constant values have to be linkedby the OR function (the configuration active so far will not be overwritten by thenew configuration but complemented, if possible).

The programmer has to decide in each individual case which function is the most favourable solution in his project development.

Classic and ExtendedController Input group I0 (ANALOG0 – 7 or %IX0.00–%IX0.07)

This is a group of analog channels that can also be processed digitally.

Used as analog channels, they can be diagnosed any time through the constant analog value in system variables ANALOG0 – ANALOG7 (or ANALOG0_E – ANALOG7_E).

If the analog inputs are configured for current measurement, a breach of the limit value (21 mA) results in a changeover to the safe voltage measurement range (0 – 32 V DC) and the respective error bit in flag byte ERROR_I0 is set. When the reading falls below the limit value again, the input automatically switches back to current measurement.

If you use the analog input functions, the diagnosis does not have to be activated through system variable I0x_MODE.

In the latest R 360 Controller generation, the inputs and outputs are configured through the application software. Function block INPUT_ANALOG configures the control mode of the selected analog channel through function input MODE. Accordingly, the function of the PWM

channels is also set through function blocks.

Alternatively, the inputs and outputs can also be set directly by setting an Ixx_MODE system variable.

The illustrated assignment sets the selected input to mode IN_DIGITAL_H with diagnostics.

Page 21: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Device configuration

4-5

If the diagnostics function is to be used, it must in addition be activated. The diagnostic bit indicates an open circuit or a short circuit of the input signal as group fault.

Diagnostics-capable, NAMUR-conformant sensors can not be used with this input group.

To monitor the input signals of non-electronic switches, these switches must be fitted with an additional resistance (see illustration).

Input group I1–I4 (%IX0.08–%IX0.39)

These are digital inputs that are processed internally as analog signals for diagnosis. In addition, some of these inputs can be configured for negative input signals and for frequency measurement.

Negative input signals (also in combination with frequency inputs) can never be diagnosed.

These inputs are configured through the I1x_MODE–I4x_MODE system variables. If the diagnostics function is to be used, it must in addition be activated. The diagnostic bit indicates an open circuit or a short circuit of the input signal as group fault.

The illustrated assignment sets the selected input to control mode Fast IN_DIGITAL_H input with diagnostics.

Page 22: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Configuring the input and output functions

4-6

Diagnostics-capable, NAMUR-conformant sensors can be used at all inputs. An additional resistance is not required.

Note:

To use the diagnostics function with the inputs of group I4 (%IX0.32–%IX0.39), the corresponding outputs (%QX0.16–%QX0.23) must be switched off through the Q4x_MODE system flags. To do this, use the OUT_NOMODE constant. As supplied, all eight outputs are switched off.

To monitor the input signals of non-electronic switches, these switches must be fitted with an additional resistance (see illustration).

Output group Q1Q2 (%QX0.00–%QX0.07)

These output have a dual function: Used as PWM outputs, the diagnosis is implemented through the built-in current measurement channels, which also provide the current-controlled output functions. Function block OUTPUT_CURRENT returns load currents ≥ 100 mA.

For use as digital outputs, they are configured with system variables Q1x_MODE...Q2x_MODE. If the diagnostics function is to be used, it must in addition be activated. Open circuits and short circuits of the output signal are contained separately by system variables ERROR_BREAK_Q1Q2 and ERROR_SHORT_Q1Q2 respectively. The individual output error bits can, if necessary, be hidden in the application program. In addition, these outputs can be used for indicating and monitoring the load currents ≥ 100 mA with function block OUTPUT_CURRENT.

The assignment sets the selected output to mode OUT_DIGITAL_H with diagnostics. The over-load protection is active.

Note:

The open circuit and short-circuit detection are active when the output is On.

Page 23: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Device configuration

4-7

Output group Q3 (%QX0.08...%QX0.15)

These outputs are configured through the Q3x_MODE system variables. If the diagnostics function is to be used, it must in addition be activated. At the same time, the corresponding input must be disabled by setting system flag I3x_MODE to IN_NOMODE. Open circuits and short circuits of the output signal are contained separately in system variables ERROR_BREAK_Q3 and ERROR_SHORT_Q3 respectively. The individual output error bits can, if necessary, be hidden in the application program.

The illustrated assign-ments disable the input and set the selected output to control mode OUT_DIGITAL_H with diagnostics.

Note:

Open-circuit detection is active if the output is switched Off.

Short-circuit detection is active if the output is switched On.

Output group Q4 (%QX0.16...%QX0.23)

Note:

This output group is disabled as supplied to allow diagnostics through the inputs. To use these outputs, they must be activated.

These outputs are configured through the Q4x_MODE system variables. If the diagnostics function is to be used, it must in addition be activated. At the same time, the corresponding input must be disabled by setting system flag I4x_MODE to IN_NOMODE. Open circuits and short circuits of the output signal are indicated separately through system variables ERROR_BREAK_Q4 and ERROR_SHORT_Q4 respectively. The individual output error bits can, if necessary, be hidden in the application program.

Page 24: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Configuring the input and output functions

4-8

To implement an H link function, outputs %QX0.17/18/21/22 can, in addition, be switched to OUT_DIGITAL_L mode.

Note:

Open-circuit detection is active if the output is switched Off.

Short-circuit detection is active if the output is switched On.

CabinetController Analog input group A_IN0 ... 7

This is a group of analog channels that can also be processed digitally.

They are configured through system variables ANALOGx_y_MODE or, preferably, using function block INPUT_ANALOG (MODE input). A pair of channels is always configured together (A_IN0 and A_IN4, A_IN1_and A_IN5, A_IN2 and A_IN6, A_IN3_and A_IN7).

If the analog inputs are configured for current measurement, a breach of the limit value (23 mA) results in a changeover to the safe voltage measurement range (0 ... 32 V DC) and the respective error bit in flag byte ERROR_A_INx is set. When the reading falls below the limit value again, the input automatically switches back to current measurement.

When the analog input functions are used, the diagnostic function is automatically activated.

Important:

If the limit value is exceeded on one input channel, the other channel of the affected pair also changes over to the safe voltage range.

A_IN_0 > 23 mA => A_IN_0 and A_IN_4 are switched to the safe range 0 ... 32 V DC. The error bit is set only for the incorrect input value.

Input group IN0...I154 (%IX1.0...%IX8.8)

These are digital inputs that are processed internally as analog signals. In addition, some of these inputs can be configured for negative input signals and for frequency measurement.

Inputs IN12 to IN15 are configured in pairs using system variables I12_13_MODE and IN14_15_MODE.

The evaluation of the input frequency at inputs IN8 to IN11 is implemented with function blocks FREQUENCY, PERIOD and PERIOD_RATIO.

Page 25: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Device configuration

4-9

Diagnostics-capable, NAMUR-conformant sensors can be used at all inputs. An additional resistance is not required.

Output group OUT0...OUT11 or OUT0...OUT17 (%QX0.0...%QX5.8/8.8)

Depending on the controller configuration, semiconductors and additional relay outputs are available.

Outputs OUT0 to OUT3 can also be used as PWM outputs (without current control).

SmartController Digital input group I0...I3 (%IX0.0...%IX1.8)

These are digital inputs that are processed internally as analog signals for diagnosis. The diagnostics function is configured through the Ix_MODE system variables. The diagnostics information is indicated by flag bit ERROR_Ix. The diagnostic bit indicates an open circuit or a short circuit of the input signal as group fault.

To monitor the input signals of non-electronic switches, these switches must be fitted with an additional resistance (see illustration).

Diagnostics-capable, NAMUR-conformant sensors can be used at all inputs. An additional resistance is not required.

If the diagnostic function is active, system variables ANALOG_I0...ANALOG_I3 with the voltages at the inputs are also available for each input channel.

Page 26: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Configuring the input and output functions

4-10

Analog inputs ANALOG3 ... 7 (%IW2...%IW9)

This is a group of analog channels that can also be processed digitally.

They are configured through system variables I4_MODE...I7_MODE or, preferably, using function block INPUT_ANALOG (MODE input).

If the analog inputs are configured for current measurement, a breach of the limit value (23 mA) results in a changeover to the safe voltage measurement range (0 ... 32 V DC) and the respective error bit in flag byte ERROR_Ix is set. When the reading falls below the limit value again, the input automatically switches back to current measurement.

Output group Q0...Q4 (%QX0.0...%QX1.8)

When Q0 to Q4 are used as PWM outputs, the diagnosis is implemented through the built-in current measurement channels, which also provide the current-controlled output functions. Function block OUTPUT_CURRENT returns load currents ≥ 100 mA.

If the outputs are used as digital channels, this function block can also be used for diagnostics.

Error indication is then through group error bit ERROR_Qx, which is set on an open circuit or a short circuit. In addition, these outputs can be used for indicating the load currents ≥ 100 mA with function block OUTPUT_CURRENT.

Page 27: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Device configuration

4-11

4.6. Control modes of the ExtendedController The ExtendedController can be operated in two basic modes.

In version 1, two separate applications are loaded into the two sections of the controller. These work completely independently and asynchronously of each other in a master–master mode (not to be confused with CANopen Master). The inputs and outputs are addressed with the same system variables and system functions in both controller sections. If desired, the built-in interface can be used for exchanging data between the two sections. This is implemented with an integration of the functions SSC_TRANSMIT and SSC_RECEIVE (see functional descriptions in section “Data access and verification”) in the application programs.

In version 2, a complete application program is loaded into only one of the two (user-specified) controller sections. The ExtendedController now operates like a controller, the two sections operating in master–slave mode. Because the inputs and outputs are processed synchronously, function block SSC_SET_MASTER must be included in the application program to initialise the slaves. The master also loads a small dummy program into the slave. This requires the inclusion of this program block from slave library SLAVE200.LIB in the application program.

Page 28: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Control modes of the ExtendedController

4-12

Here, too, the same system variables and system functions are addressed. To draw a distinction, an _E (for Extended) are appended to the variable and function names in the second control section. The data transfer between the two controller sections takes place automatically through the built-in interface.

Synchronisation

Exchange of input/output variables and system flags

Exchange of signals from user programs

The software CD contains a sample program, which illustrates the basic program structure. You are strongly advised to follow this scheme.

Page 29: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Device configuration

4-13

4.7. The software control configuration For each hardware configuration, the corresponding software control configuration has to be loaded in the programming system. It provides the interface between programming system and hardware.

The software control configuration also provides the user with all important system and error flags, which must be processed and evaluated. They can be accessed through their symbolic name or the IEC address.

4.8. Terminal assignment The terminal assignments shown in the appendix correspond to the standard device configurations. With the terminal assignment, the input and output channels are assigned to the IEC 61131-3 addresses and the device terminals.

Labelling of the input/output channels

12 GNDA

12 Terminal number

GNDA Terminal marking

30 %IX0.07 BL

30 Terminal number

%IX0.07 IEC address for a binary input

BL Hardware type of input (here binary lowside)

47 %QX0.03 BH/PH

47 Terminal number

%QX0.03 IEC address for a binary output

BH/PH Hardware type of output (here binary lowside or PWM highside)

The codes have the following meanings:

A Analog input

BH Binary input/output, highside

BL Binary input/output, lowside

Page 30: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Terminal assignment

4-14

CYL Cycle duration measurement input

ENC Rotary encoder signal input

FRQ Frequency input

H-Bridge Output with H link function

PH PWM output, highside

PL PWM output, lowside

PWM Pulse-width-modulated signals

PWM I PWM output with current measurement

IH Pulse/counter input, highside

IL Pulse/counter input, lowside

R Readback channel for an output

Assignment of the input/output channels:

Depending on the device configuration, one input and/or one output is available at each device terminal.

Channels that can be used as input and output at the same time (bidirectional inputs/outputs) are highlighted.

See catalogue, installation instructions or data sheet for the device.

Page 31: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

5-1

5. Operating states and operating system

5.1. Operating states After supply voltage is applied, the control module can be in one of five operating states:

Reset This state is run after each power-on-reset. The operating system is initialised and various checks are run. This temporary state is followed by the Run state.

The LED briefly lights up orange.

Run This state is achieved:

• from the Reset state (autostart);

• from the Stop state through the Run signal (precondition:

Test mode);

• through the CANopen NMT master through the PREOPERATIONAL orOPERATIONAL functions.

The LED flashes green or red (RUN with error).

Stop This state is achieved:

• from the Reset state if no program is loaded;

• from the Run state if the Stop signal is given through the interface (precondition: Test mode);

• Through the CANopen NMT master through the PREPARED function;

The LED is constantly lit green or red (Stop with error).

Fatal Error The controller enters this state when an unacceptable error is identified. It canbe cancelled only with a Reset.

The LED is lit red.

No operating system

No operating system was loaded; the controller is in bootstrap loader. Before theapplication software is loaded, an operating system download must beperformed.

The LED flashes green (fast).

Page 32: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Status LED

5-2

5.2. Status LED The built-in status LED indicates the following operating states.

LED colour Flashing Description LED off Constant off No operational voltageGreen 5 Hz No operating system loadedGreen 0.5 Hz Run, CANopen: PREOPERATIONAL 2.0 Hz Run, CANopen: OPERATIONAL Constant on Stop, CANopen: PRERPARED Red 0.5 Hz Run w. error (CANopen: PREOPERATIONAL) 2.0 Hz Run w. error (CANopen: OPERATIONAL) Constant on Fatal ErrorOrange Briefly on Initialisation or Reset checksBlue 0.5 Hz Internal communication, ExtendedController

Operating states STOP (PREPARED) and RUN (PRE-OPERATIONAL/ OPERATIONAL) can be changed by the programming system or the NMT master.

In the RUN state, the user program is processed. The controller takes part in CANopen communications (PDO processing, see chapter 7 ff) only when it is set to OPERATIONAL state. To recognise the current operating state in the application program, the user can evaluate flag COP_PREOPERATIONAL. This flag is TRUE in the PREOPERATIONAL state and otherwise FALSE.

On the ClassicController and the ExtendedController, the status LED can also be set by the user program. For this, the value 0 (LED_GREEN) or 1 (LED_BLUE) must be assigned to data structure LED_COLOR. The user program can not set the LED to red: this can be done only by the operating system under fault conditions.

5.3. Loading the operating system As supplied, no operating system is usually loaded in the controller (LED flashing green at 5 Hz). In this operating state, only the bootstrap loader is active, which provides the essential functions for loading the operating system (including support for the RS 232 and CAN interfaces).

The operating system download normally has to be performed only once. The application program can then be loaded, repeatedly if necessary, without affecting the operating system. The advantages of this method are that it is not necessary to replace the EPROM when the operating system is updated and that custom operating systems can be implemented for specific applications.

Page 33: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Operating states and operating system

5-3

The operating system is supplied on a separate disk together with this manual. You can also obtain the current version from our website at www.ifm-electronic.com.

Make sure that the operating system (CR..._x.H86), the controller configuration (CR..._x.M66) and the device library (CR..._x.LIB) always have the same software version number. Otherwise an error message is issued when you download the application software. Software versions are indicated by letters appended to the file name in alphabetical sequence (for example CR0020_N.H86). The basic filename must always be the same.

The operating system can be transferred to the controller with the stand-alone Downloader program (supplied on the software CD and also available for download on our website). The application software can be loaded into the controller either from the programming system or using the Downloader program. The procedure with the external program is described in the supplied documentation.

Page 34: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Control modes

5-4

5.4. Control modes Independently of the operating states, the controller can be operated in different control modes. The corresponding control bits can be set and reset with the application software or, in Test mode, with the ecolog 100plus programming software (Global variables window).

Test This control mode is set through the application of a High level (supply voltage) at the Test input. In the RUN and STOP states, the controller can now receive commands through one of the interfaces and, for example, communicate with the programming system. Software downloads into the controller can be performed only in this mode. With the TEST flag, the state of the user program can be scanned.

Serial Mode The serial interface is available for data exchange in the application. Debugging the application software is now only possible through the CAN interface.

By default, this function is disabled (FALSE). With flag SERIAL_MODE, the state can be controlled and scanned through the user program or the programming system.

Debug If system flag DEBUG is set TRUE, the programming system or the downloader, for example, can communicate with the controller and execute system commands (for example for service functions through the CANcom GSM modem).

A software download is not possible in this control mode.

Page 35: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

6-1

6. Error codes and error classes To maximise reliability, the operating system performs internal error checks on the controller during the start/reset phase and during program execution.

The following error flags are set under fault conditions:

Error Description of error

CAN_INIT_ERROR Unable to initialise CAN block

CAN_DATA_ERROR CAN data inconsistency

CAN_RX_OVERRUN_ERROR CAN overrun, received data

CAN_TX_OVERRUN_ERROR CAN overrun, transmitted data

CAN_BUS_OFF_ERROR CAN not on bus

CAN_ERROR CAN bus group error bit

CAN2_INIT_ERROR Unable to initialise CAN 2 block

CAN2_DATA_ERROR CAN 2 data inconsistency

CAN2_RX_OVERRUN_ERROR

CAN 2 overrun, received data

CAN2_TX_OVERRUN_ERROR

CAN 2 overrun, transmitted data

CAN2_BUS_OFF_ERROR CAN 2 not on bus

CAN2_ERROR CAN 2 bus group error bit

ERROR Group error bit (general)

ERROR_MEMORY Memory error

ERROR_POWER Supply voltage error, VBBO

VBB_ERROR Supply voltage error, VBBR

ERROR_TEMPERATURE Overtemperature error (> 85 °C)

COP_SYNCFAIL_ERROR SYNC object was not transferred

COP_GUARDFAIL_ERROR Guarding object missing (only in the slave)

COP_GUARDFAIL_NODEID Number of missing slaves (in the master)

6.1. Response to system error The responsibility for responding to error flags rests entirely with the programmer.

Page 36: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Response to system error

6-2

All error bits must be processed and reset by the user program. The error bits yields a description of the fault, which can be further processed if necessary.

If a serious error occurs, the ERROR bit can additionally be set. The operation LED then lights up red, the Error output (pin 13) changes to LOW and the monitoring relays (if used) are switched off so that outputs they protect drop out.

With the logic link through the relay bit or bit Relais_Clamp_15 (see chapter 3), all other outputs are also switched off.

Depending on the application, it has to now be decided whether a reset of the ERROR bit should also allow the relay – and therefore also the outputs – to be re-enabled.

If you are using CAN for communication, the use of theCAN_ERRORHANDLER function is strongly recommended. This ensures thatat least all CAN errors are recognised and counted as group faults and CAN isrestarted.

For “user-defined errors”, the ERROR bit can, in addition, be set by the user program.

Because the relays are normally switched only at zero load, this function mustbe used to switch off the outputs only in emergencies.

To reset all outputs during normal operation, implement this function through suitable BIT links and not using the relay.

Example A CAN-BUS-OFF error occurs.

The operating system sets the CAN-BUS-OFF-ERROR bit.

The user program recognises this state by querying the corresponding bits.

If necessary, the ERROR bit can be set:

This causes the operating status LED to flash red and the safety relay to dropout, causing all outputs to be switched off. The level of the Error output changesto Low.

The fault is rectified by restarting CAN through function CAN_RESTART. TheCAN-BUS-OFF-ERROR bit is automatically cleared.

Finally, the ERROR bit may have to be cleared by the user program. The relaypicks up again and the LED flashes green.

Page 37: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

7-1

7. CAN in the ecomat type R 360

7.1. Technical specifications of the CAN interface

CR7xxx, CR03xx Bus type: FULL-CAN

Physical layer: ISO-11898

Baud rate: 10 Kbit/s ... 1 Mbit/s

Protocol: CANopen, free protocol

2048 data objects in the system (11-bit identifier)

CR250x, CR0xxx (not CR03xx) CAN1:

Bus type: FULL-CAN

Physical layer: ISO-11898

Baud rate: 10 Kbit/s ... 1 Mbit/s

Protocol: CANopen, free protocol

2048 data objects in the system (11-bit identifier)

CAN2:

Bus type: FULL-CAN

Physical layer: ISO 11898 (CR2500)

ISO 11992 (CR2501)

Baud rate: 10 Kbit/s ... 500 Kbit/s

Protocol: Free protocol

SAE J1939

LBS+

ISO 11783 (agricultural machinery bus)

ISO 11992-3 (CR2501)

11-bit identifier or 29-bit identifier

Page 38: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN data exchange

7-2

Use of identifier 1 ... 2048 Identifier freely available for data transfer

The following identifiers are reserved (also when CANopen not used):

220 ... 221 Reserved for display tdm R 360

223 ... 252 Slave device identifier

254 Device identifier for a module that has not yet been configured

255 Identifiers of the download system (for example PC)

System configuration

The controllers are supplied as node 0 with device identifier 254 (node ID 32).The download system uses this identifier for the first communication with anunconfigured module.

Only one unconfigured module can be connected to the network at any onetime. Once a new node number from 1 to 30 (corresponds with node identifiers1 to 30 respectively) has been assigned with the programming software, adownload or debugging run can take place and the next device can beconnected to the system (see also 5.3 and 5.4).

7.2. CAN data exchange

CAN communications use layer 2 of the 7-layer ISO/OSI reference model defined in the international ISO 11898 standard.

The CAN protocol has multimaster-capability, meaning that each bus node can transmit messages. The data exchange works similar to radio communications: data is sent to the bus without sender or address, but with an identifier. Each node is responsible for receiving the data and for determining its relevance to itself using the identifier. This process is performed automatically by the CAN controller together with the operating system. To avoid the need to process every single CAN message, an acceptance mask (CAN2_ACCEPTANCE) can be defined to allow only some of the Bus data to reach the CAN controller. The use of this special function makes sense only if some data is not relevant for certain bus nodes and time optimisation of CAN data processing is necessary in a control module. The acceptance mask is often used in connection with the J1939 functions, and the CAN2_ACCEPTANCE function is therefore available only for the second CAN interface. To use this function, you need to be familiar with the CAN controller hardware. Refer to the manufacturer’s documentation or contact Technical Support at ifm electronic.

Page 39: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-3

For normal CAN data exchange, the user program has to identify the data objects with their identifiers to the system using functions CAN_RECEIVE and CAN_TRANSMIT. With these functions, the RAM address of the working data, the data type and the selected identifier are merged into a single data object which then participates in the data exchange through the CAN bus. The transmitted and received objects can be defined as any valid IEC data type (for example BOOL, WORD, INT, or ARRAY).

The CAN message consists of an identifier and up to eight data bytes. Identifiers can be selected between 1 and 2048. As already mentioned, they identify the message, not the sending or receiving module. For data transfer to take place, a transmitting object must be declared in the sending module and a receiving module in at least one other module. Both of these declarations must be assigned to the same identifier.

Receiving data Received data objects are automatically (i.e. without user-interaction) placed in buffer memory.

Buffer memory is allocated to each identifier. The user software processes this queue according to the FIFO (first in, first out) principle using the CAN_RECEIVE function. Up to 30 data packages can be queued. Further CAN messages can be received only once the buffer has been emptied; otherwise a memory overflow occurs and the OVERFLOW bit is set.

Transmitting data When the CAN_TRANSMIT function is called, the user program sends one CAN

message to the CAN controller which signals whether it has successfullyreceived the information and sends the data on to the CAN bus.

If the controller is currently transmitting a data object and therefore not ready, itrejects the transmit request. The user program must then repeat the transmitrequest. A bit is set to indicate this situation.

Page 40: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN errors and error handling

7-4

7.3. CAN errors and error handling The error mechanisms described below are automatically processed by the CAN controller built into the controller. The user program can not influence this process and should merely respond to reported errors.

• The CAN error mechanisms have the following aims:

• To ensure standardised data object across the entire CAN network.

• To ensure continuous network operation even when a CAN node is defective.

• Distinction between temporary and permanent CAN node defects.

• Identification and isolation of a defective node in two stages (error-passive, bus-off) to provide nodes with a temporary fault with a recovery period.

The following simplified error handling procedure is given to provide interested users with an overview of the CAN controller’s behaviour in a fault condition. After error detection, the information is automatically processed and is then available in the user software in the form of CAN error bits.

Error messages If a bus node detects an error condition, it immediately sends an error flag, thuscausing the transmission to be aborted or the error-free messages alreadyreceived by other nodes to be rejected. This ensures that error-free, uniformdata is available to all nodes. Because the error flag is transferred straight away,the sender can immediately resend the faulted message (in contrast to otherfield bus systems, which wait until a defined acknowledgement time haselapsed). This is one of the most important features of CAN.

A basic problem with serial data transmission is that a permanently disturbed orfaulty bus node can block the whole system. Error handling in CAN would beespecially susceptible to this danger. To avoid this problem, a mechanism isneeded which detects a faulty node and isolates it from the bus if necessary.

Page 41: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-5

Error count For error counting, the CAN controller contains a transmission and a receptionerror counter, which are incremented with every faulty transmit and receiveprocess respectively. With error-free transmissions, the counts are decrementedagain.

Because the increments on faulty transmissions are greater than thedecrements for successful ones, the counts can increase significantly over timeeven if the number of successful transmissions is greater than the number offaults. If no transmission errors occur over longer periods of time, the counts arereduced again. The error counts therefore provide a measure of the relativefault frequency.

If one node detects an error before the others (i.e. if it caused the fault), thisnode’s error count is incremented by a higher value than the others. If an errorcount exceeds a specified value, it is likely that the associated node isdefective. To prevent error-active signals from this node interrupting buscommunications, its status is changed to error-passive.

Error-active state

An error-active node takes part in all bus communications and can signal detected errors by sending the active error flag. As already mentioned, this destroys the transmitted message.

An error-passive node is still capable of full communications. But it is only allowed to signal an error it detects with a passive-error flag that does not interfere with bus operation. Error-passive nodes become error-active again when the error count drops below a specified value.

Bus-off state If the error count continues to increase, the bus switches the node off (i.e. to bus-off state) when a specified limit count is reached.

To cancel the bus-off state, the CAN controller must be reset with CAN_RESTART.

Page 42: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Physical connection to the CAN bus

7-6

It is advisable to use the CAN_ERRORHANDLER function, which registers all CAN error conditions and resets the CAN controller as necessary. It also provides an error count for the user program, which could be used, for example, to implement further measures at certain error counts (such as activating the error LED).

For a detailed fault analysis, a detailed evaluation of the error bits is necessary.

7.4. Physical connection to the CAN bus The data transfer and error handling mechanisms described in sections 7.2. and 7.3. are implemented in the CAN controller itself. The physical connection of the CAN nodes is described in ISO 11898 under Layer 1.

The network topology

The ISO 11898 standard specifies a CAN network with a bus topology.

The bus must be terminated at both ends with a 120 Ω terminating resistor. Devices from ifm electronic that are fitted with a CAN interface do not have terminating resistors.

Because the total bus length determines the level of reflection on the bus, nodes (node 1 to Node n) should, if possible, not be connected via spur lines. If spur lines are necessary (for example to an I/O module), keep them as short as possible. Spur lines with a length of 2 m are generally no problem, but the total length of all spur lines within the system should not be greater than 30 m. In special cases it may be necessary to precisely calculate the total line length of the bus and its spurs.

The bus level The CAN bus is in its inactive (coercible) state when the output transistor pairs

are de-energised in all bus nodes. If at least one transistor pair is switched on, abit is set on the bus, to set the bus active (dominant). Current then passesthrough the terminating resistors, generating a potential difference between thetwo bus lines. The coercible and dominant states are converted tocorresponding voltages in the bus nodes and detected by the recipient circuits.

Page 43: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-7

This differential transmission with a common return line clearly improves transmission reliability. Interference voltages from external sources and frame potential transfers affect both signal lines to the same extent and therefore cancel each other out.

Bus line length The length of the bus line depends on the bus connection used (cable,

connectors), the line resistance and the required data transfer rate. In addition,as described above, the length of the spur lines must be taken into account innetwork utilisation calculations. The graph below is a simplified representationof the relationship between bus length and baud rate.

Page 44: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Physical connection to the CAN bus

7-8

Cable cross-sections

The cross-section of the bus cable must be taken into account in the busdesign. The table below illustrates the dependence of the cable cross-sectionon the cable length.

Cable length Cable cross-section

100 m 0.25 ... 0.34 mm2

250 m 0.34 ... 0.5 mm2

500 m 0.5 ... 0.75 mm2

Depending on EMC requirements, a screened or unscreened parallel or twisted pair bus cable can be used.

Physical layer according to ISO 11992-1

The physical layer as specified in ISO 11992-1 has a higher voltage level thanthat defined in ISO 11898. Point-to-point network connections are used here.The termination networks are already built-in. ISO 11992-1 is built into thesecond CAN interface of the CR2501 SmartController.

Page 45: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-9

7.5. General notes about the use of CAN If you are using CAN or CANopen in connection with the ecomat 100 type R 360 SmartController, you need to observe several points regarding the physical network configuration and the correct use of the software.

Physical network configuration

In summary, the following applies to the CAN configuration:

• Do not select a higher data transfer rate than is necessary. A low transferrate increases system reliability.

• Do not exceed total cable length for chosen data transfer rate. For theR 360, it is typically 400 m at 125 Kbit/s.

• Lay the cable as a bus and avoid spur lines. To avoid unnecessaryresistance, make clean, secure connections to the bus. If necessary, usetwisted-pair and/or screened cables.

• Fit 120 Ω terminating resistors at both ends of the bus line.

• The higher the number of networked nodes, the more important are theexact network dimensions (cable types and lengths, etc.).

Software for CAN and CANopen

• Using functions CAN_TRANSMIT and CAN_RECEIVE, the R 360 canparticipate directly in CAN communications (layer 2). In CANopen controlmode, the specified services are available to the programmer.

Note the following points:

• In CAN Direct mode on layer 2, all services must be implemented in theuser program. The controller is in this state after a program download or aReset command from the programming system.

• In CAN Direct mode, the cyclic inclusion of function blockCAN_ERRORHANDLER is recommended. Otherwise the user programmust perform a CAN_RESTART on BUS_OFF.

• After a program download or a Reset command from the programmingsystem, the controller is not yet a CANopen device.

• To change to CANopen mode, flag CAN_OPEN must be set at the start ofthe program. The R 360 then runs as CANopen slave.

Page 46: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

General notes about the use of CAN

7-10

• When an R 360 slave is stopped through the programming software, anysubsequent Node Start commands from the CANopen master are ignored.Stop commands from the master (NMM_SET_PREPARED) are alwaysexecuted.

• If the R 360 slave does not issue a guarding response, the mastercontinues to send Node Resets, which can cause problems for theprogramming system when it tries to log in through the CAN interface. Inthat case, the master must be switched off.

• If the R 360 is to also operate as CANopen master, it must be initialised withfunction NMM_SET_NMT_MASTER.

• If the controller is stopped (through the PC), it retains its CANopenfunctionality, but no longer functions as master (for example no SYNCsignal).

• A unique module ID must be assigned to all nodes in the CAN system.

Device IDs in the ecomat R 360

To communicate within the CAN system, each node must have a unique deviceidentifier, regardless of whether the controller is used as NMT master, asCANopen slave or for direct CAN communications. Note also that deviceidentifiers must not coincide with the IDs of the I/O modules. The ecomat 100type R 360 is supplied with the default ID of 32 (under CANopen). In theecolog 100plus programming software node ID 32 is called module ID No. 0.

Module ID

ecolog 100plus

Node ID

CANopen

Device ID

Debugger

(default) 0 (not configured) 32 0xFE

1 1 0xDF

2 2 0xE0

3 3 0xE1

: : :

29 29 0xFB

30 30 0cFC

The device ID assignments can be made online using ecolog 100plus.

Page 47: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-11

7.6. Description of the CAN function blocks In this section, the CAN function blocks available for use in the user program are described.

To use the full capability of CAN, draw up a detailed bus concept before beginning with the program creation. In addition to the response to any CAN errors, the number of data objects with their identifiers must be specified. The data transfer frequency must also be taken into account and the CAN_TRANSMIT and CAN_RECEIVE functions be invoked at an appropriate frequency. Make sure that the transmission requests from the user program are successfully transferred to CAN_TRANSMIT (using the RESULT bit) and that the received data is read from the queue with CAN_RECEIVE and then immediately processed by the program.

To allow a communication connection to be established, all CAN nodes must be configured for the same baud rate. On the R 360, this is done with the CAN_BAUDRATE function.

Sample program

A FBD (Funktion Blocks Diagram) sample program is included on the ecolog 100plus program CD. This program exchanges data objects with a further CAN node using identifiers 1 and 2. The other node must have a Receive identifier to the Transmit identifier of the node running the program and vice versa.

Because its use requires detailed knowledge of the CAN controller hardware, function CAN2_ACCEPTANCE is not described in detail here.

Page 48: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Description of the CAN function blocks

7-12

Function

CAN_BAUDRATE

Library

CRxxxx_x.LIB

Function symbol

Purpose Sets the data transfer rate for the bus node.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

BAUDRATE WORD Value of baud rate to be set in Kbit/s

(10, 20, 50, 100, 125, 250, 500, 800, 1000 )

Function outputs: none

Description The CAN_BAUDRATE function sets the data transfer rate for the control module. It does this by applying the value Kbit/s at function input BAUDRATE. Once the function is completed, this new value is saved in the device and is therefore available again after a power failure. The factory-set baud rate value is 125 Kbit/s.

This function should be run only once on initialisation during the first program cycle. Thereafter it is inhibited with input ENABLE.

The baud rate becomes active only after a RESET.

Page 49: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-13

Function

CAN_TRANSMIT

CAN2_TRANSMIT

Library

CRxxxx_x.LIB Not CR03xx_x.LIB

Function symbol

CAN_TRANSMIT

IDRTRDLCDATAENABLE

RESULT

CAN2_TRANSMIT

IDRTRDLCDATAENABLE

RESULT

Purpose Passes a CAN data object (message) to the CAN controller for transfer.

Parameters Function inputs

Name Data type Description

ID WORD Contains the number of the data object identifier. Possible values: 0 ... 2048.

RTR BYTE Not used, therefore value 0

DLC BYTE Number of bytes to be transferred from DATA array. (Permissible values: 0 ... 8)

DATA ARRAY The array contains up to 8 data bytes

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

Function outputs

Name Data type Description

RESULT BOOL TRUE: The function has accepted the transmission request (only one cycle set).

Page 50: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Description of the CAN function blocks

7-14

Description CAN_TRANSMIT is called for each data object in the program cycle, alsoseveral times in long program cycles. The user program must process theRESULT bit to ensure that its transmission request was accepted. As a rule ofthumb, one transmit request per millisecond can be executed at 125 Kbit/s.

Through bit input ENABLE, the execution of the function can be temporarilyinhibited, for example to prevent a bus overload. It also allows the simultaneoustransmission of several data objects by assigning a flag flag to each data objectto control the function’s execution using the ENABLE input.

To use function CAN2_TRANSMIT, function CAN2 must first be executed to initialise the second CAN interface.

Page 51: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-15

Function

CAN_RECEIVE

CAN2_RECEIVE

Library

CRxxxx_x.LIB Not CR03xx_x.LIB

Function symbol

CAN_RECEIVE

CONFIGCLEARID

DATADLCRTR

AVAILABLEOVERFLOW

CAN2_RECEIVE

CONFIGCLEARID

DATADLCRTR

AVAILABLEOVERFLOW

Purpose Configures a data receive object and reads the data object’s receive buffer.

Parameters Function inputs

Name Data type Description

CONFIG BOOL This bit must be set TRUE once during configuration of the data object. For the remaining program execution it is FALSE.

CLEAR BOOL Clears the buffer (queue)

ID WORD Contains the number of the data object identifier. Possible values: 0 ... 2048.

Function outputs

Name Data type Description

DATA ARRAY The array contains up to 8 data bytes

DLC BYTE Number of transferred bytes in array DATA.

Possible values: 0 ... 8.

RTR BYTE Not used

AVAILABLE BYTE Number of entered messages

OVERFLOW BOOL TRUE: Buffer overflow.

Loss of data!

FALSE: Buffer not yet full

Page 52: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Description of the CAN function blocks

7-16

Description CAN_RECEIVE must be called once for each data object in the initialisationphase to notify the CAN controller of the data objects’ identifiers.

In the remaining program cycle, CAN_RECEIVE is called to read out therespective receive buffer. Also several times in long program cycles. The userprogram must evaluate the AVAILABLE byte so that newly received data objectsare read from the buffer and processed. Each call of this function reduces thevalue of byte AVAILABLE by 1. If the buffer contains no data, the value ofAVAILABLE is 0.

The OVERFLOW bit indicates a buffer overflow: if the OVERFLOW bit is set, atleast one data object has already been lost.

To use this function, function CAN2 must first be executed to initialise thesecond CAN interface.

Page 53: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-17

Function

CAN_RESTART

CAN2_RESTART

Library

CRxxxx_x.LIB Not CR03xx_x.LIB

Function symbol

CAN_RESTART

ENABLE

CAN2_RESTART

ENABLE

Purpose Restarts the CAN node after serious data transfer errors (bus-off state).

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

Function outputs: none

Description CAN_RESTART allows a distinction between temporary and permanent faultsof bus nodes. As described in section 6.3, three functional states are possible.

Error-active is the normal state for nodes.

If a specified number of transfer errors occurs, the node changes to error-passive mode. If the error rate falls again, the node becomes error-active again.

If a node is already in error-passive mode and further transfer errors occur, it isswitched off by the bus (bus-off) and the error flag CAN_BUS_OFF_ERROR isset. To reconnect the node to the bus, function CAN_RESTART must be used.The error flag is reset after a successful return.

Input ENABLE suppresses the execution of this function.

To use function CAN2_RESTART, function CAN2 must first be executed toinitialise the second CAN interface.

Function CAN_RESTART has to be called only once per cycle.

Page 54: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Description of the CAN function blocks

7-18

Function

CAN_ERRORHANDLER CAN2_ERRORHANDLER

Library

CRxxxx_x.LIB Not CR03xx_x.LIB

Function symbol

RESET ERRORCOUNT

CAN_ERRORHANDLER

RESET ERRORCOUNT

RESET ERRORCOUNT

CAN2_ERRORHANDLER

RESET ERRORCOUNT

Purpose Minimum error routine for monitoring CAN.

Parameters Function inputs

Name Data type Description

RESET BOOL Clears the error count

Function outputs

Name Data type Description

ERROR-COUNT

WORD Error count; contains the number of occurred errors

Description CAN_ERRORHANDLER evaluates all possible CAN errors and totals thenumber of errors in ERRORCOUNT. When a bus-off error occurs, the functiontries to return the node to the bus. Function CAN_RESTART is integrated forthis purpose.

The user program now has to evaluate the error count and the error bitsprovided by the system to determine the exact cause of the error. With functioninput RESET, the count can then be reset to zero.

To use function CAN2_ERRORHANDER, function CAN2 must first be executed to initialise the second CAN interface.

In each application program in which CAN communication is used (also for communications with a CAN display), at least this function should be used and periodically processed.

Page 55: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-19

Function

CAN2

Library

CRxxxx_x.LIB (not CR03xx_x.LIB)

Function symbol

CAN2

ENABLESTARTEXTENDED_MODEBAUDRATE

Purpose Initialises the second CAN interface.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

START BOOL TRUE: Function being initialised, first cycle

FALSE: Initialisation cycle has finished.

EXTENDED_Mode

BOOL TRUE: Second CAN interface working with 29-bit identifier

FALSE: Second CAN interface working with 11-bit identifier

BAUD RATE

WORD Baud rate: 10 kbit/s ... 500 kbit/s

(10, 20, 40, 100,125, 250, 500)

Function outputs: none

Description This function must be called if the second CAN interface is used. Any baud rate changes become active only after the power supply has been switched off and on again. CAN 1 and CAN 2 can have different baud rates. The Start input is set only for one cycle. For the second CAN interface, function libraries for J1939 and ISO 11992 are also available.

Function CAN2 must be executed before functions CAN2_TRANSMIT, CAN2_RECEIVE, CAN2_RESTART and CAN2_ERRORHANDLER.

Page 56: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Description of the CAN function blocks

7-20

Function

GATEWAY

Library

CRxxxx_x.LIB (not CR03xx_x.LIB)

Function symbol

GATEWAY

ENABLE_12CONFIG_12ID_TAB_12ENABLE_21CONFIG_21ID_TAB_21

Purpose Gateway function for the two CAN interfaces.

Parameters Function inputs

Name Data type Description

ENABLE_12 BOOL TRUE: Enable transfer from CAN interface 1 to CAN interface 2

FALSE: Disable transfer from CAN interface 1 to CAN interface 2

CONFIG_12 BOOL TRUE: In first cycle:

Initialise transfer from CAN interface 1 to CAN interface 2

FALSE: In first cycle:

Transfer from CAN interface 1 to CAN interface 2 is not initialised

ID_TAB_12 DWORD ID table address for interface 1 to interface 2

ENABLE_21 BOOL TRUE: Enable transfer from CAN interface 2 to CAN interface 1

FALSE: Disable transfer from CAN interface 2 to CAN interface 1

Page 57: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-21

Name Data type Description

CONFIG_21 BOOL TRUE: In first cycle:

Initialise transfer direction from CAN interface 2to CAN interface 1

FALSE: In first cycle:

Transfer from CAN interface 2 to CAN interface 1 is not initialised

ID_TAB_21 DWORD ID table address for interface 2 to interface 1

Function outputs: none

Description Control module CR2500 has two CAN interfaces. These provide an easy way of implementing gateway functions through which CAN interfaces with different properties can also communicate with each other. Data can be transmitted both from interface 1 to interface 2 and from interface 2 to interface 1. The ENABLE inputs in the first program cycle must be initialised first and the CONFIG inputs set during program execution. The transmit and receive identifiers for both directions are set using a configuration table which is entered, depending on the transfer direction, in GATEWAY21_STRUCT or GATEWAY12_STRUCT.

Variables GATEWAY21_STRUCT and GATEWAY12_STRUCT are global data types with the following structures:

GATEWAY21_STRUCT

ARRAY[0..199] OF Gateway21_Struct TYPE Gateway21_Struct STRUCT RX_ID: DWORD; TX_ID: WORD; END_STRUCT END_TYPE

GATEWAY12_STRUCT

ARRAY[0..199] OF Gateway12_Struct TYPE Gateway12_Struct STRUCT RX_ID: DWORD; TX_ID: WORD; END_STRUCT END_TYPE

This allows the assignment of a corresponding transmit identifier to each receive identifier and vice versa. The RX_ID and TX_ID for the second interface is always type DWORD, since this interface also allows a 29-bit identifier.

The configuration assignments for the identifiers should be called only once and can be skipped after completion of the initialisation phase. Before the GATEWAY function is called in the program, function CAN2 must be invoked.

Page 58: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CANopen in the ecomat type R 360

7-22

7.7. CANopen in the ecomat type R 360 Layers 1 and 2 – described at the start of chapter 6 – define the physical connection and the data transfer between the bus nodes. In practice, this means that the programmer must specify the data protocol for the use of CAN in an application.

To ensure a uniform protocol layer for networking the nodes that describes the significance of the transferred data, the CAL (CAN Application Layer) was specified as layer 7. CANopen builds on CAL and specifies the CAL services used for transmitting each data type. The meaning of the data for each device type (I/O module, drives, shaft encoders, etc.) is also defined. These rules provide the application programmer with access to all CANopen-capable components with little effort. CANopen nodes belonging to the same device family have their data organised in the same way. The properties of these device classes are summarised in the “Device Profiles” (DS-40x).

Despite these rules, the basic structure of CAN that allows each bus node to place data onto the network remains intact. Only the network (NMT) master is unique and serves mainly to start up and monitor the system.

The mechanisms described below aim to provide a brief overview of the functions of CANopen. To make the best use of the CANopen protocol and its capability in a specific application, we recommend further reading (information about CAN in Automation e.V. (CiA), Erlangen, Germany).

General information about CANopen

Every CANopen node has an object directory that can be addressed withService Data Objects (SDOs). In addition, at least two Process Data Objects(PDOs) for transmitting and receiving process data, a Node-Guarding Object forimplementing network monitoring, and an Emergency Object for signalling errorconditions are available.

The object-oriented identifiers (11-bit) are termed CAN Object IDs (COB-IDs)under CANopen. They are split into 16 groups through the four most significantbits (MSBs). The remaining seven bits are used to distinguish between 127CANopen nodes to provide a unique assignment of the individual object typesto the nodes. This default assignment is specified in the predefined connectionset. It can be changed to suit specific applications, but to allow a flexibleselection of different manufacturers’ CANopen devices, it is advisable tocarefully consider whether to take this step.

Page 59: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-23

Object COB IDs

(hex)

COB IDs

(decimal)

Default function

NMT 0 0 Network management

SYNC 80 128 Synchronisation

EMCY 81 – FF 129 – 255 Error conditions

TIME STAMP 100 256 Network time

PDO1(tx) 181 – 1FF 385 – 511 PDO transmit

PDO1(rx) 201 – 27F 513 – 639 PDO receive

PDO2(tx) 281 – 2FF 641 – 767 PDO transmit

PDO2(rx) 301 – 37F 769 – 895 PDO receive

PDO3(tx) 381 – 3FF 897 – 1023 PDO transmit

PDO3(rx) 401 – 47F 1025 – 1151 PDO receive

PDO4(tx) 481 – 4FF 1153 – 1279 PDO transmit

PDO4(rx) 501 – 57F 1281 – 1407 PDO receive

SDO(tx) 581 – 5FF 1409 – 1535 Master–>slave SDO

SDO(rx) 601 – 67F 1537 – 1663 Slave–>master SDO

Node guarding 701 – 77F 1793 – 1919 Node/life guarding

The object directory

All node parameters are stored in the object directory of the correspondingCANopen node. For unique identification, each directory entry is marked with anindex (IDX, length 16 bits) and a subindex (SUBIDX, length 8 bits). These areplaced in the individual index ranges by parameter type. The meanings of theindices for the communication and default parameters are defined in theCANopen standard for each device type. In addition, a range for manufacturer-specific data is available. Here, for example, the configuration parameters forifm electronic’s I/O modules are saved.

Page 60: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CANopen in the ecomat type R 360

7-24

Index (hex) Object

0000 Not used

0001 – 009F Data types

00A0 – 0FFF Reserved

1000 – 1FFF Range for the communication profile

2000 – 5FFF Range for manufacturer-specific data

6000 – 9FFF Range for default device parameters

A000 – FFFF Range for general IEC 61131–3 network variables

Service data objects (SDO)

Read and write access to the object directory is achieved with the service dataobjects (SDOs).

The SDOs are used for all data in CANopen that is not time-critical. They areonly ever transmitted from point to point (network master/slave). The SDOs arechiefly used to transmit the CAN node configuration data during the boot-upphase.

Process data objects (PDO)

Time-critical process data is transferred using the process data objects (PDOs).These can be freely exchanged between the individual nodes (PDO linking).The transfer method (synchronous or asynchronous) is also defined. Dependingon the type of data to be transferred, the right choice of transmission type canconsiderably reduce CAN bus load. The default settings of the ifm electronic I/Omodules specify synchronous transfer of analog input data and all output dataand event-controlled (asynchronous) transfer of digital input data.

Page 61: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-25

Node-guarding object

Node guarding is used for detecting communication errors in the network. Thenetwork master periodically accesses each bus node through the specifiednode guarding COB ID. If it receives no response within the defined guard time,the master signals an error. The life time setting (life time factor x guard time)can also be used to specify the number of unsuccessful attempts before anerror message is generated.

Emergency Object

If an internal error occurs in a bus node (for example wrong configurationparameter or short circuit at the output), an EMCY object is created. This isstandardised and is sent once when the error occurs and once when the errorcondition has cleared.

These errors are additionally stored in the node’s object directory, specifically inthe Error Register, the manufacturer-specific Status Register and the ErrorHistory.

Boot-up routine During the boot-up routine, the network master allows the network to run up.The master is informed of the main communication parameters and, if used,guarding is activated. During boot-up, the configuration parameters should alsobe transferred. The node should be in its Pre-Operational state.

Page 62: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CANopen in the ecomat type R 360

7-26

Status Description

6 Start Remote Node indication

7 Stop Remote Node indication

8 Enter Pre-Operational State indication

10 Reset Node indication

11 Reset_Communication indication

12 Initialisation finished – enter Pre-Operational automatically

To ensure a successful boot-up, at least the node number and baud rate of the CAN node must be set. This setting must match the master’s baud rate and is specified with DIP switches on the node (not on ifm electronic devices) or through an additional parameterisation software. Because the ecomat 100 type R 360 controller also allows the SDOs to write to the object directory, these settings can also be made using the controller.

For the ecomat 100 type R 360 to work in CANopen mode, flag CAN_OPEN must be set TRUE at the start of the program (during initialisation).

Page 63: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-27

7.8. The ecomat 100 type R 360 as CANopen slave Under CANopen, the ecomat 100 type R 360 can also be used as a user-programmable input/output module. It then behaves like a CANopen slave and is classified as “Programmable Device” according to CiA DS 405.

To use the R 360 as CANopen slave, system bit CAN_OPEN must be set.

Object directory The object directory provides access to the device parameters. If these aremarked as read/write, they can be changed through SDO_WRITE and by theNMT master or using an external parameterisation system.

The object directory of the ecomat 100 type R 360 has three main ranges.

• From index 1000 hex, the CANopen communication parameters are stored.

• From index 2000 hex, the manufacturer-specific baud rate and nodenumber are recorded.

• At index A000 hex, the range for the general IEC 61131-3 network variablesbegins. These are transferred through the PDOs. The PDO identifiers andtransmission types are entered in this range.

The exact structure of the object directory is described in the appendix.

Baud rate and node number

Baud rate and node number are entered in the manufacturer-specific range ofthe object directory from index 20F0/20F1 hex and 20F2/20F3 hex. Baud rateand node number can be changed by an SDO from the master, a function callor the programming system. If the change is made through SDO_WRITE, bothentries in the object directory must have the same content. Baud rate changestake effect only after a reset, while node ID changes are effective immediately.

Index Subindex Name Default value

20F0 0 Node ID 32

20F1 0 Node ID 32

20F2 0 Baud rate 3

20F3 0 Baud rate 3

The network must never contain two nodes with the same node number.

The following parameters can be used to set the baud rate:

Number Baud rate (Kbit/s)

0 1000

Page 64: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen slave

7-28

1 500

2 250

3 125

4 100

5 50

6 20

7 10

Data in the IEC flag range

Through the manufacturer-specific range of the object directory (see appendix), a data block of up to 256 bytes can be transmitted to the R 360 slave with SDO_WRITE. The user program can then further process this data through addresses %MB2000 to %MB2255 (%MW1000 to %MW1127), making this data range available as user-defined parameter set. This data is volatile.

PDOs In the “predefined connection set” according to CiA DS 401, the first two RX and TX PDOs are defined according to the node number. With these PDOs, 16 data bytes can each be sent and received. If further PDOs are needed, they must be defined in the user program with functions PDO_RX_CONFIG and PDO_TX_CONFIG and assigned an identifier from 380 hex. If the predefined connection set is not used, the COB-IDs for PDO 1 and PDO 2 must also start at 380 hex. A total of 2 x 8 PDOs can be set up.

Because the COB IDs for the PDOs are not saved (except for PDO 1 and 2 in the predefined connection set), they must be re-initialised once for all PDOs in the initialisation routine after every controller start. The PDO IDs that are not contained in the predefined connection set have the same assignments in all devices (RX PDOs from 380 hex, TX PDOs from 388 hex). If several R 360 slaves are used, they must therefore be reconfigured with PDO_TX/RX_CONFIG to prevent ID conflicts.

Page 65: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-29

RX-PDO ID TX-PDO ID

RX-PDO 1 Pred. C. set TX-PDO 1 Pred. C. set

RX-PDO 2 Pred. C. set TX-PDO 2 Pred. C. set

RX-PDO 3 382 hex TX-PDO 3 38A Hex

RX-PDO 4 383 Hex TX-PDO 4 38B Hex

RX-PDO 5 384 Hex TX-PDO 5 38C Hex

RX-PDO 6 385 Hex TX-PDO 6 38D Hex

RX-PDO 7 386 Hex TX-PDO 7 38E Hex

RX-PDO 8 387 Hex TX-PDO 8 38F Hex

PDO mapping PDO mapping in the conventional sense is not possible in the ecomat 100 type R 360, since this is not necessary for a programmable controller.

With the user program, any data relevant for the CANopen network can be directly written to and read from the PDOs. Network variables in the range from %MW 2000 for the received data and from %MW 2032 for the transmitted data are available directly for processing in the user program (see appendix 13.5.). The user therefore has 8 x 4 transmit words (TX PDOs) and 8 x 4 receive words (RX PDOs).

Monitoring PDO reception

CANopen does not support transmitted data detection. If this function is required, it must be implemented in the user program. This can be done in the following ways:

• Writing signature in received object

• PDO contains toggle bit or running number

• Using function block CAN_RECEIVE

Page 66: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen slave

7-30

Transmission types

Transmission types SYNC (synchronous transmission after a PDO SYNC) and ASYNC (transmission after a change of the network variables) are supported. The sync object’s COB ID can be configured.

In asynchronous (event-controlled) transmission of the transmitted PDO, new data is automatically sent to the bus as soon as the controller’s operating system detects a change in the corresponding PDO flag range from %MW 2032.

The transmission of ASYNC objects can be delayed with the specification of an inhibit time. This is useful, for example, if fluctuating process values cause excessive bus load in event-controlled evaluation. With an inhibit time specified, the next PDO can not be sent to the bus before this time has expired.

If strategically important values are to be sent in ASYNC mode, a single transmission may not be sufficiently reliable. With function block PDO_TX_REFRESH, the important PDO can be repeated intermittently.

By default, all RX PDOs and the first two TX PDOs (the defined connection set) are transmitted after a data change (i.e. in ASYNC mode).

Node guarding When the NMT master addressed an ecomat 100 type R 360 once through a guarding object, it is under full control of the NMT master through the cyclic node guarding. If CAN communications are faulty, a guarding error message is generated in the NMT master and flag COP_EVENT_GUARDFAIL is set in the R 360 CANopen slave.

Especially in critical applications, the user program must evaluate these error messages.

ResetNode If the CANopen master triggers a ResetNode, a complete restart of the R 360slave would normally be necessary (as, for example, with a watchdog reset). Toachieve greater flexibility, this is controlled by the user program in CANopen.

A reset is indicated with flag COP_EVENT_RESETNODE = TRUE and the userprogram can respond, if necessary, by calling function block SOFTRESET. Theflag must then be reset.

To bridge the long resting phase, set a long guarding time or a high lifetime inthe R 360 master.

Emergency objects

Any error occurring in the R 360 CANopen slave is transmitted to the master inan emergency object. The EMCY object’s COB ID can be configured.

The emergency objects (consisting of 8 data bytes) are grouped into three partsfor CANopen.

• Emergency code (error code, EMCY), bytes 0 and 1

• Error register (error reg.), byte 2

• Data (additional information), bytes 3 to 7

Page 67: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-31

The following errors are transmitted:

EMCY code Error reg. Description

0x1000 Bit 0 Error (general), ERROR output set, LED is red

0x2100 Bit 1 Open circuit

0x2300 Bit 1 Short circuit, overload, overtemperature

0x3200 Bit 2 Under/overvoltage error

0x4000 Bit 3 Device temperature error (> 85 °C)

0x8100 Bit 4 Guarding error, no Guard object received

0x8200 Bit 4 SYNC error, no Sync object received

EMCY code Data byte Description

0x2100 Byte 3 Open-circuit bit QX0.0 ... QX0.7

Byte 4 Open-circuit bit QX0.8 ... QX0.15

Byte 5 Open-circuit bit QX0.16 ... QX0.23

0x2300 Byte 3 Short-circuit bit QX0.0 ... QX0.7

Byte 4 Short-circuit bit QX0.8 ... QX0.15

Byte 5 Short-circuit bit QX0.16 ... QX0.23

0x8200 Byte 3 Bit 0, CAN error

Byte 3 Bit 1, SYNC error

Page 68: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen slave

7-32

Function

NMS_SET_NODEID

Library

COP_x.LIB

Function symbol

Purpose Sets the CANopen slave’s node ID.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODEID BYTE Number of identifier (1 ... 30)

Function outputs: none

Description Through function NMS_SET_NODEID, the CANopen slave’s node number canbe set. The function is called once only and its execution is controlled throughfunction input ENABLE.

As NODEID, a number between 1 and 30 can be entered.

The node ID is valid as soon as the function is executed. For the network and therefore also the TX and RX PDOs of the predefined connection set, which are dependent on the node ID, the changes are implemented only after a reset. The node ID remains valid until a new ID is set through the function call or the programming system.

Page 69: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-33

Function

NMS_GUARDING_CONFIG

Library

COP_x.LIB

Function symbol

Purpose Sets the guarding time for an R 360-CANopen slave.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

GUARDTIME TIME Time between two monitoring calls

0 ms = no monitoring

1 ms ... 65535 ms = monitoring time

LIFETIME BYTE Number of permissible incorrect monitoring calls

CYCLEPERIOD TIME Time between two SYNC objects

0 ms = no monitoring

1 ms ... 65535 ms = monitoring time

Function outputs: none

Page 70: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen slave

7-34

Description With the NMS_GUARDING_CONFIG function, the permissible times for nodeguarding and the SYNC objects in the R 360 CANopen slave can be set. Thefunction is called once only and its execution is controlled through function inputENABLE.

If the specified times do not receive the respective objects (for node guarding times number of LIFETIME cycles) from the R 360 slave, the corresponding error bits (COP_GUARDFAIL_ERROR and COP_SYNCFAIL_ERROR) are set. These must then be processed by the user program. In addition, flag COP_SYNC can be evaluated. It is always TRUE for exactly one cycle.

The specified times must be a little longer than the times set in the master.

Page 71: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-35

Function

PDO_TX_CONFIG

Library

COP_x.LIB

Function symbol

Purpose Initialises a transmission PDO in the R 360 CANopen slave or master.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

PDO BYTE Number of the TX-PDO (1 ... 8)

ID WORD Identifier of TX PDO (from 380 hex)

TRANS_TYPE BYTE Type of PDO transfer Types SYNC (1 ... 240) and ASYNC (255) are supported

INHIBIT_TIME TIME Delay time for asynchronous transfer modus (0 ... 65535 ms)

Function outputs: none

Description PDO_TX_CONFIG initialises a transmit PDO for the CANopen slave. Thisfunction must be run once during initialisation with ENABLE = TRUE. After that,ENABLE is set FALSE.

Page 72: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen slave

7-36

At function input PDO, the corresponding number from 1 to 8 is specified.

PDOs that are not used through predefined connection set must begin with an identifier from 380 hex. Otherwise overlaps with other system identifiers may occur. The transmission type (TRANS_TYPE) can be control modes SYNC (1) and ASYNC (255). If a transmission will not take place with every SYNC object, a value between 1 and 240 (number of SYNC objects between two access operations) can be entered.

To allow data transmission in SYNC mode, the SYNC IDs of master and slave should be the same. By default, no SYNC ID is entered for the slave.

In ASYNC mode, the INHIBIT_TIME may have to be specified. Otherwise fluctuating values may cause an overload.

If strategically important values are to be sent in ASYNC mode, a single transmission may not be sufficiently reliable. With function block PDO_TX_REFRESH, the important PDO can be repeated intermittently.

By default, only the TX PDOs defined in the predefined connection set are asynchronously transmitted. The additional six TX PDOs are inactive by default.

If function PDO_TX_CONFIG is used in a CANopen master, it must be processed before function NMM_SET_NMT_MASTER or COP_MSTR_BOOTUP is called, because it triggers an internal CANopen reset, thereby cancelling the master functionality. Initialisation must therefore take place in two stages (start the master Boot-up one cycle later; see sample program).

Page 73: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-37

Function

PDO_RX_CONFIG

Library

COP_x.LIB

Function symbol

Purpose Initialises a receive PDO in the R 360 CANopen slave or master.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

PDO BYTE Number of the RX-PDO (1 ... 8)

ID WORD Identifier of the RX-PDO (from 380 hex)*

TRANS_TYPE BYTE Type of PDO transfer

Only ASYNC (255) is supported

* If predefined connection set is not used.

Function outputs: none

Description PDO_RX_CONFIG initialises a receive PDO for the CANopen slave. This function must be run once during initialisation with ENABLE = TRUE. After that, ENABLE is set FALSE.

At function input PDO, the corresponding number from 1 to 8 is specified.

PDOs that are not used through predefined connection set must begin with an identifier from 380 hex. Otherwise overlaps with other system identifiers may occur. The transmission type (TRANS_TYPE) is control mode ASYNC (255).

To allow data transmission in SYNC mode, the SYNC IDs of master and slave should be the same. By default, no SYNC ID is entered for the slave.

By default, all RX PDOs are transmitted asynchronously.

Page 74: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen slave

7-38

If function PDO_RX_CONFIG is used in a CANopen master, it must be processed before function NMM_SET_NMT_MASTER or COP_MSTR_BOOTUP is called, because it triggers an internal CANopen reset, thereby cancelling the master functionality. Initialisation must therefore take place in two stages (start the master Boot-up one cycle later; see sample program).

Page 75: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-39

Function

PDO_TX_REFRESH

Library

COP_x.LIB

Function symbol

Purpose Retransmits a sent TX PDO.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

PDO BYTE Number of the TX-PDO (1 ... 8)

Function outputs: none

Description If strategically important values are to be sent in ASYNC mode, a singletransmission may not be sufficiently reliable. With function block PDO_TX_REFRESH, the important PDO can be repeated intermittently.

This function must not be run in every cycle, since this could overload the CAN.Execution can be controlled with function input ENABLE.

At function input PDO, the corresponding number from 1 to 8 is specified.

Page 76: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-40

7.9. The ecomat 100 type R 360 as CANopen master CANopen networks usually have a network master. The functions described below provide all basic services for developing master software for the ecomat 100 type R 360 controller. With these functions, slave nodes can be connected to the CAN network and can be configured and monitored. To help you get started with CANopen, you can use the two master functions COP_MSTR_BOOTUP and COP_MSTR_MAIN in library NMS_MS_x.LIB. They make use of the functions described below. For a detailed description see section 7.10. Should these two master functions not provide sufficient flexibility for experienced users, you can use the following functions.

For the ecomat 100 type R 360 to act as CANopen master, flag CAN_OPENmust be set TRUE at the start of the program (during initialisation), and functionNMM_SET_NMT_MASTER must be called once.

Function

NMM_SET_NMT_MASTER

Library

COP_x.LIB

Function symbol

Purpose Initialises the control module as master.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

Function outputs: none

Use only if you are not using function COP_MSTR_BOOTUP from library NMT_MS_x.LIB.

Page 77: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-41

Description NMM_SET_NMT_MASTER initialises the controller as CANopen master. If thisfunction is not called, the controller works only as CANopen node (slave) in thenetwork.

The network master has the task of configuring and monitoring the network. In aCANopen network, only one NMT master – i.e. one master with managementfunction – can be present.

The user program must evaluate all status information provided by the NMT master to ensure reliable network operation.

If functions PDO_RX_CONFIG and PDO_TX_CONFIG are used in a CANopen master, they must be processed before function NMM_SET_NMT_MASTER or COP_MSTR_BOOTUP is called, because they trigger an internal CANopen reset, thereby cancelling the master functionality. Initialisation must therefore take place in two stages (start the master Boot-up one cycle later; see sample program).

Page 78: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-42

Function

NMM_ADD_NODE

Library

COP_x.LIB

Function symbol

Purpose Initialises a monitoring object for the specified node.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE Node number from 1 ... 127

GUARDTIME TIME Time between two monitoring calls

LIFETIME BYTE Number of permissible incorrect monitoring calls

Function outputs

Name Data type Description

RESULT BYTE Result:

0 = successful

1 = not successful

2 = invalid parameters

Use only if you are not using function COP_MSTR_BOOTUP from library NMT_MS_x.LIB.

Page 79: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-43

Description NMM_ADD_NODE initialises the CANopen node and a guarding object in theNMT master. The lifetime factor specifies the number of times an incorrect callcan be made. This function must be run once during initialisation for each node.An example is contained in file NMT_MSTR.PRO.

Node guarding is run only if started with the NMM_START_GUARDINGfunction.

The user program now has to evaluate the error count and the error bits provided by the system to determine the exact cause of the error and respond appropriately.

If a node is not initialised with NMM_ADD_NODE, it can not be addressed with any other master functions (for example SDO_WRITE), regardless of whether node guarding is active or not.

Page 80: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-44

Function

NMM_START_GUARDING

Library

COP_x.LIB

Function symbol

Purpose Starts node guarding for one or all initialised nodes.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

RESULT BYTE Result: 0 = successful

2 = invalid parameters

Description NMM_START_GUARDING starts node guarding for a single node or for all nodes connected to the network. A guarding object must first be initialised with NMM_ADD_NODE for the specified CANopen node.

The user program now has to evaluate the error count and the error bits provided by the system to determine the exact cause of the error and respond appropriately.

Use only if you are not using function COP_MSTR_MAIN from library NMT_MS_x.LIB.

Page 81: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-45

Function

NMM_STOP_GUARDING

Library

COP_x.LIB

Function symbol

Purpose Stops node guarding for one or all initialised nodes.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

RESULT BYTE Result: 0 = successful

2 = invalid parameters

Description NMM_STOP_GUARDING stops node guarding for a single node or for allnodes connected to the network.

If node guarding is disabled, the controller can not detect missing nodes.

The user program now has to evaluate the error count and the error bitsprovided by the system to determine the exact cause of the error and respondappropriately.

Page 82: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-46

Function

NMM_NODE_GUARDING

Library

COP_x.LIB

Function symbol

Purpose Calls up monitoring of all initialised CANopen nodes.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

AUTO_RESTART BOOL TRUE: Monitored node is automatically set

Operational after a guarding error.

FALSE: Node remains in

Pre-Operational state

Function inputs

Name Data type Description

RESULT BYTE Result: 0 = successful

> 0 = missing nodes

0xFF = incorrect call

Use only if you are not using function COP_MSTR_MAIN from library NMT_MS_x.LIB.

Page 83: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-47

Description NMM_NODE_GUARDING organises node guarding for all initialised nodes in the entire network. This function must be called cyclically. If several nodes are missing, they are reported in sequence. Node guarding is run only if started with the NMM_START_GUARDING function. Function input AUTO_RESTART allows the master to automatically start a node after a guarding error. If AUTO_RESTART is set TRUE, the node is automatically set Operational again after a NODE_RESET. If the input is FALSE, the node remains in Pre-Operational state.

It is advisable to work with AUTO_RESTART = TRUE.

If node guarding is disabled, the controller can not detect missing nodes.

Page 84: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-48

Function

NMM_SET_PREOPERATIONAL

Library

COP_x.LIB

Function symbol

Purpose Sets one node or the entire network to Pre-Operational.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

RESULT BYTE Result: 0 = successful

1 = transmission error

2 = invalid parameters

255 = NMT master not active

Description NMM_SET_PREOPERATIONAL sets the specified node or the entire networkto Pre-Operational (see also section 7.7). After the initialisation of one or allnetwork nodes, it/they are set to Pre-Operational state so that it/they cancommunicate with the NMT master responsible for network management onlythrough the SDOs.

Page 85: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-49

Function

NMM_SET_OPERATIONAL

Library

COP_x.LIB

Function symbol

Purpose Sets one node or the entire network to Operational.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

RESULT BYTE Result: 0 = successful

1 = transmission error

2 = invalid parameters

255 = NMT master not active

Description

NMM_SET_OPERATIONAL sets the specified node or the entire network toOperational (see also section 7.7). After the initialisation of one or all networknodes, its/their state normally changes from Pre-Operational to Operational. Inthis state, the node(s) can communicate with the NMT master responsible fornetwork management and with all other network nodes through allcommunication services (SDOs and PDOs).

The network master also has to be set Operational once to allow it to communicate correctly.

Page 86: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-50

Function

NMM_SET_PREPARED

Library

COP_x.LIB

Function symbol

Purpose Sets one node or the entire network to Prepared.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

RESULT BYTE Result: 0 = successful

1 = transmission error

2 = invalid parameters

255 = NMT master not active

Description NMM_SET_PREPARED sets the specified node or the entire network toPrepared (see also section 7.7). In this state, the node(s) no longer take part inPDO communications and can no longer use the SDOs for communicating.

This state is often used for application-specific situations, for example totemporarily isolate one or all nodes from the bus. The Prepared state can becancelled only with NMM_SET_PREOPERATIONAL andNMM_SET_OPERATIONAL.

Page 87: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-51

Function

NMM_GET_NODE_STATE

Library

COP_x.LIB

Function symbol

Purpose Returns the network status of a CANopen node.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

STATE BYTE Status according to CANopen specification

RESULT BYTE Result: 0 = successful

2 = invalid parameters

255 = NMT master not active

Description NMM_GET_NODE_STATE returns the current network state (Preoperational,Operational, or Prepared) of one or all nodes. This value results from theCANopen specification.

127 Pre-Operational state

5 Operational state

4 Prepared state

Page 88: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-52

Function

NMM_RESET_NODE

Library

COP_x.LIB

Function symbol

Purpose Resets the application and communication parameters for one or all nodes tothe default values.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

RESULT BYTE Result: 0 = successful

1 = transmission error

2 = invalid parameters

255 = NMT master not active

Description NMM_RESET_NODE performs a Reset for the called node (or all nodes in thenetwork). All non-volatile data in the node remains intact. After the reset, thenode runs the normal initialisation routine.

For the exact behaviour after a reset, see the device documentation for thenode.

Page 89: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-53

Function

NMM_RESET_COMM

Library

COP_x.LIB

Function symbol

Purpose Resets the communication parameters for one or all nodes to the default values.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE All initialised nodes: 0

Initialised node: 1 ... 127

Function outputs

Name Data type Description

STATE BYTE Status according to CANopen specification

RESULT BYTE Result: 0 = successful

1 = transmission error

2 = invalid parameters

255 = NMT master not active

Description NMM_RESET_COMM performs a CAN interface reset for the called node (or allnodes in the network). All non-volatile data in the node remains intact.

For the exact behaviour after a reset, see the device documentation for thenode.

Page 90: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-54

Function

PDO_INI_SEND_SYNC_OBJ

Library

COP_x.LIB

Function symbol

Purpose Initialises the PDO Sync object for synchronous scanning of I/O data.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

Function outputs: none

Description PDO_SEND_SYNC_OBJ transmits a SYNC object to the CANopen network.SYNC objects are used for synchronous scanning of data (see also 6.7,Process Data Objects). This function must be called cyclically. As in theexample, the two system flags COP_PRESYNC and COB_SYNC are used tocontrol the timing.

Use only if you are not using function COP_MSTR_BOOTUP from library NMT_MS_x.LIB.

Page 91: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-55

Function

PDO_ SEND_SYNC_OBJ

Library

COP_x.LIB

Function symbol

Purpose Sends the synchronisation object.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

Function outputs

Name Data type Description

RESULT BOOL TRUE: Function has been successfully processed

Description PDO_SEND_SYNC_OBJ transmits a SYNC object to the CANopen network.SYNC objects are used for synchronous scanning of data (see also 6.7,Process Data Objects). This function must be called cyclically. As in theexample, the two system flags COP_PRESYNC and COB_SYNC are used tocontrol the timing.

Use only if you are not using function COP_MSTR_MAIN from library NMT_MS_x.LIB.

Page 92: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-56

Function

EMC_GET_EMERGENCY

Library

COP_x.LIB

Function symbol

Purpose Reads the CANopen Emergency object.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

Function outputs

Name Data type Description

RECEIVED BOOL TRUE: New error data exists

NODE BYTE Node number

VALUE WORD Error codes of the emergency object

REGISTER BYTE Error register according to index 0x1001

DATA ARRAY Manufacturer-specific error information

Description Function EMC_GET_EMERGENCY polls the error data of the connectednetwork nodes. As soon as new data is present, output RECEIVED is set TRUEfor one cycle. The error can then be analysed by scanning the node number(NODE), the error code (VALUE) and the error register (REGISTER). At outputDATA, the manufacturer-specific information from the node is available. The I/Omodules from ifm electronic, for example, provide information about open-circuits and short-circuit at the outputs here.

Page 93: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-57

Function

SDO_READ

Library

COP_x.LIB

Function symbol

Purpose Reads the SDO with the specified indices from the node.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE Node number

IDX WORD Index in object directory

SUBIDX WORD Subindex relating to index in object directory

LENGTH WORD Length of entry in number of bytes

Function outputs

Name Data type Description

RESULT BYTE 0 Function not active

1 Function completed

2 Function is active

3 Function was not executed

DATA ARRAY Read data (array, length 0 ... 255)

Page 94: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-58

Description Function SDO_READ is used for reading the entries in the object directory. Thisprovides targetted access to specific node parameters. To use this function, thenode must be in Pre-Operational or Operational state.

Input ENABLE controls the execution of this function. Because the data array is transferred with every function call, this function overloads the control cycle if ENABLE is set FALSE. It is therefore advisable to skip SDO_READ if the function is not used.

The value of LENGTH must correspond with the length of the expected data objects.

Page 95: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-59

Function

SDO_WRITE

Library

COP_x.LIB

Function symbol

Purpose Writes the SDO with the specified indices to the node.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NODE BYTE Node number

IDX WORD Index in object directory

SUBIDX WORD Subindex relating to index in object directory

LENGTH WORD Length of entry in number of bytes

DATA ARRAY Transmitted data (array, length 0 ... 255)

Function outputs

Name Data type Description

RESULT BYTE 0 Function not active

1 Function completed

2 Function is active

3 Function was not executed

Page 96: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The ecomat 100 type R 360 as CANopen master

7-60

Description Function SDO_WRITE is used for writing the entries in the object directory. Thisallows targetted setting of specific node parameters. To use this function, thenode must be in Pre-Operational or Operational state.

Input ENABLE controls the execution of this function. Because the data array is transferred with every function call, this function overloads the control cycle if ENABLE is set FALSE. It is therefore advisable to skip SDO_WRITE if the function is not used.

The value of LENGTH must correspond with the length of the Send array. Otherwise errors will arise during SDO communication.

Page 97: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-61

7.10. Functions for CANopen I/O modules from ifm electronic Control solutions often consist of a central control unit and one or more remote I/O modules. In such applications the central controller also acts as network master (see section 7.9.) The functions below can be used to help you get started with this type of application. If you need the more flexible CANopen functionality, you will have to use the functions described in the previous sections. You do not need the below functions in that case. COP_MSTR_BOOTUP and COP_MSTR_MAIN were deliberately written in the ST language to allow it to be extended or modified. If you are an experienced users and want to modify these functions, file NMT_MSTR_B.PRO containing the source code is available on request.

The functions below are provided specifically for configuring ifm electronic’s I/O modules and evaluating their output.

The following functions are currently available:

• CR2011 (library CR2011_x.lib) • CR1500 (library CR1500_x.lib)

• CR2012 (library CR2012_x.lib) • CR2511 (library CR2511_x.lib)

• CR2013 (library CR2013_x.lib) • CR2512 (library CR2512_x.lib)

• CR2014 (library CR2014_x.lib) • CR2513 (library CR2513_x.lib)

• CR2031 (library CR2031_x.lib) • CR2101 (library CR2101_x.lib)

• CR2033 (library CR2033_x.lib) • CR2102 (library CR2102_x.lib)

With them, you can set the node configuration of the inputs and outputs directly using a configuration structure in the application software or to read it from a selected node. In the same way, you can access digital and analog input and output data through a data structure. For a detailed description of the functions and how to use them, see the device manuals.

Further functions for CANopen devices, such as GSM CANcom and CANmem are also available. You can find all functions in the respective libraries on the R 360 CD or for download on the Internet.

Basic program structure

To use the I/O modules in a control application, you can use the followingprogram structure, which supports the use of up to 31 I/O module in a standardapplication. The 32nd connected node is the R 360 controller configured asnetwork (NMT) master. A node with address 0 is not permissible, since thisaddress is reserved for system-wide control of all nodes (see also NMM_NMTfunctions, section 7.9.)

Page 98: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for CANopen I/O modules from ifm electronic

7-62

Program step 1

COP_MSTR_BOOTUP

This function initialises the controller as master and also its connected nodes. Itis used only in the bootup phase. With this function, flag CAN_OPEN is also setTRUE.

Program step 2

COP_MSTR_MAIN

Called cyclically, this function creates the Sync object for synchronoustransmission of the I/O data. The I/O data is available in this function or can bewritten through it.

Program step 3

CR2xxx etc.

This function writes and reads the slave configuration for each connected I/Onode when the inputs are set with CFG_READ or CFG_WRITE.

After a successful configuration, these inputs are disabled again.

Program step 4

NMM_SET_OPERATIONAL

Called with parameter NODE = 0, this function resets the entire network(including the NMT master) to Operational mode. This function must be run onlyonce.

Program step 5

EMC_GET_EMERGENCY

This function makes the emergency (error) data of the connected nodeavailable.

Sample program DEMO_CR2xxx.PRO on the software CD shows the software’s structure for two nodes. It can be used as a starting point for developing an application program.

For writing a CANopen program with different nodes, you can find sample programs on the ifm electronic website.

Page 99: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-63

Function COP_MSTR_BOOTUP

Library NMT_MS_x.LIB

Function symbol

Purpose Initialises the control module as CANopen NMT master and also all connectedI/O nodes.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NO_NODE BYTE Number of connected nodes

without NMT master

GUARDTIME TIME Guard time for node guarding

LIFETIME BYTE Lifetime factor for node guarding

Function outputs

Name Data type

Description

DONE BOOL FALSE: BOOTUP is still active

TRUE: BOOTUP is completed

Description COP_MSTR_BOOTUP sets the R 360 into CANopen mode and initialises the

controller as NMT master. At the same time, the master is sent the number ofconnected nodes (NO_NODE) with the specified monitoring times(GUARDTIME and LIFETIME factor). When the boot process is completed(> 2 s), function output DONE is set TRUE.

After a successful bootup, function execution must be inhibited with inputENABLE.

Unlike the function in library NMT_MSx2.LIB, up to 30 nodes are initialised inascending order (starting with 1). The master must have a number outside thenode range.

Page 100: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for CANopen I/O modules from ifm electronic

7-64

Function COP_MSTR_BOOTUP

Library NMT_MSx2.LIB

Function symbol

Purpose Initialises the control module as CANopen NMT master and also all connectedI/O nodes.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NO_NODE ARRAY[0..31] Number of connected nodes

without NMT master in any order

GUARDTIME TIME Guard time for node guarding

LIFETIME BYTE Lifetime factor for node guarding

Function outputs

Name Data type

Description

DONE BOOL FALSE: BOOTUP is still active

TRUE: BOOTUP is completed

Description COP_MSTR_BOOTUP sets the R 360 into CANopen mode and initialises thecontroller as NMT master. At the same time, the master is sent the number ofconnected nodes (NO_NODE) with the specified monitoring times(GUARDTIME and LIFETIME factor). When the boot process is completed(> 2 s), function output DONE is set TRUE. After a successful bootup, function execution must be inhibited with inputENABLE.

Unlike the function in library NMT_MS_x.LIB, up to 32 nodes can be entered inthe array elements in any order and not in sequence. Only the specified nodesare initialised. The master must have a different number from the nodes.

Page 101: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-65

Function

COP_MSTR_MAIN

Library

NMT_MS_x.LIB NMT_MSx2.LIB

Function symbol

Purpose Cyclically generates the Sync object and monitors the connected nodes.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

NO_NODE BYTE Number of connected nodes

without NMT master

SYNC_TIME TIME Time between two Sync objects for synchronous scanning of data

AUTO_

OPERATIONAL

BOOL TRUE: Monitored node is automatically set Operational after a guarding error

FALSE: Node remains in Pre-Operational state

RESET_

GUARDING

BOOL TRUE: Clear guarding error register

Function outputs

Name Data type Description

RESULT ARRAY The error register can hold up to eight unrecognised nodes

RESTART BYTE Error on Sync objects transmission > 0

Page 102: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for CANopen I/O modules from ifm electronic

7-66

Description COP_MSTR_MAIN must be executed cyclically in the program. It generates theSYNC object for the connected slave modules and monitors the network. If aslave fails, the node’s number is entered in the RESULT array, which holds upto eight faults in chronological order. The fault memory can be cleared withfunction input RESET_GUARDING.

With function input AUTO_OPERATIONAL, automatic node restarting after a guarding error can be enabled. If AUTO_OPERATIONAL is set TRUE, the node is reset to OPERATIONAL mode after the fault is cleared. It can then take part in PDO data exchange again (reading and writing I/O data). If AUTO_OPERATIONAL is set FALSE, the node remains in the Pre-Operational state after the fault is cleared and must be set Operational through the NMT master with function NMM_SET_OPERATIONAL.

To process fast operations, the SYNC times must be changed.

Page 103: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-67

7.11. Functions for using the second CAN interface to SAE J 1939 and ISO 11992 The second CAN interface in the R 360 controllers can also be used for communicating with special bus protocol for drive control and automotive applications. These protocols operate with the second interface’s CAN controller set to Extended Mode. This means that the CAN messages are transmitted with a 29-bit identifier consisting of two parts: the 11-bit ID and an 18-bit ID. Because of the identifier’s length, a large number of messages can be directly assigned to the identifier.

The protocol takes advantage of this fact by grouping messages into ID groups. The assignment of IDs is defined in standards SAE J 1939 and ISO 11992.

Since ISO 11992 is based on SAE J 1939, the two standards use the same software protocol. The physical interfaces do differ, however, the ISO 11992 type having a higher voltage level. For communicating with devices with ISO 11992 interface, control modules with a modified CAN interface are therefore required (for example SmartController CR2501).

To use the SAE J 1939/ISO 11992 functions, you will need the device manufacturer’s protocol specifications. Some manufacturers do not implement all messages or their implementation is not needed for a particular device type, and you will need to determine the messages that can be used with each type.

Structure of the identifier

Prio

rity

Res

erve

d D

ata

page

PDU format PDU specific Source/destination

address

29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

To develop SAE J 1939 and ISO 11992 programs, you should have access to the following information and tools:

• List of data to be used by the devices

• List overview of the device manufacturer with all relevant data

• CAN monitor with 29-bit support

• If required, a copy of the SAE J 1939 or ISO 11992 standard

Page 104: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-68

Example of detailed message documentation

ETC1: Electronic Transmission Controller #1 (3.3.5) 0CF00203

Transmission repetition rate: 10 ms

Data length: 8 bytes

PDU format: 240

PDU specific: 2

Default priority: 3

Data page: 0

Source address: 3

Parameter group number: 0x00F002

Identifier: 0x0CF00203

Data field: We will not deal with the meaning of data bytes 1 to 8 in detail here. Please refer to the manufacturer’s documentation.

Because all relevant data is already included in the manufacturer’s example, it can be transmitted directly to the function blocks.

Legend:

Name in manufacturer’s documentation

Function input, library function

Example value

Transmission repetition rate RPT T#10ms

Data length LEN 8

PDU format PF 240

PDU specific PS 2

Default priority PRIO 3

Data page PG 0

Source address/destination address SA / DA 3

Data field SRC/DST Array address

Depending on the required function, the corresponding values are then entered. In fields SA/DA and SRC/DST the meaning (but not the value) changes depending on whether it is a receive or a transmit function.

The individual data bytes must then be read out from the array and processed according to their meaning.

Page 105: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-69

Example of short message documentation

Even if the device manufacturer provides only brief documentation, the function parameters can be derived from the identifier. In addition to the ID, the transmission repetition rate and the meaning of the data arrays are needed.

For protocol messages that are not manufacturer-specific, the SAE J 1939 or ISO 11992 standard can also be used for information.

Identifier 0x0CF00203 has the following structure:

PRIO, reserv., PG PF + PS SA / DA

0 C F 0 0 2 0 3

Because the numbers are hex values, of which individual bits sometimes need to be read, the numbers need to be split up further .

SA / DA Source/destination address, hexadecimal

Source/destination address, decimal

0 3 0x03 3

PF PDU format (PF) hexadecimal

PDU format (PF) decimal

F 0 0xF0 240

PS PDU specific (PS)

hexadecimal PDU specific (PS)

decimal

0 2 0x02 2

PRIO, reserv., PG PRIO, reserv., PG binary

0 C 0000 1100

Of the eight bits, only the five least significant are needed.

Not required Priority Res. DP x x x 0 1 1 0 0

(decimal) 3 0 0 Further typical combinations

(binary) 1 1 0 0 0 (decimal) 6 0 0 0x18 (hex) (binary) 1 1 1 0 0

(decimal) 7 0 0 0x1C (hex)

Page 106: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-70

Function

J1939

Library

J1939_x.LIB

Function symbol

Purpose Protocol handler for SAE J 1939 communication profile.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

START BOOL TRUE: Protocol handler will be started

FALSE: in cyclic program execution

MY_ADRESS BYTE Controller device address

Function outputs: none

Description To implement communications, the protocol handler must be called in every program cycle with input ENABLE set TRUE.

The protocol handler is started when the START input is set TRUE for a cycle.

MY_ADRESS transmits a device address (which must be unique) to the control module, where it can then be read by other bus nodes.

To allow the use of J 1939 communications, the second CAN interface must first be initialised with function CAN2.

Page 107: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-71

Function

J1939_RECEIVE

Library

J1939_x.LIB

Function symbol

Purpose Receiving an individual message or a message block.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

CONFIG BOOL This bit must be set TRUE once during configuration of the data object. For the remaining program execution it is FALSE.

PG BYTE Page address. Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

DST DWORD Destination address of the array under which the received data is saved.

RPT TIME Monitoring time within which the messages must be received again. If it is not, an error is signalled. To disable monitoring, set RPT to T#0s.

LIFE BYTE Number of permissible incorrect monitoring calls

Page 108: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-72

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data has been received 3: Error signalling

Nothing received within time window (LIFE * RPT)

DEVICE BOOL Sender’s device address

LEN BYTE Number of received bytes

Description Function block J1939_RECEIVE takes care of receiving messages and message blocks. It must be initialised for each cycle with input CONFIG. During initialisation, parameters PG, PF, PS, RPT, LIFE, and the memory address of the destination address are transmitted. The address must be determined with function ADR.

The received data must be evaluated with the RESULT byte. If its value is 1, the data is available at the memory address transmitted through DST. When a new message is received, the existing data at the destination address is overwritten.

The number of received message bytes is available at function output LEN.

If RESULT = 3, no valid messages were received in the specified time (LIFE * RPT).

This function block must also be used if the messages are requested with functions J1939_........_REQUEST.

Page 109: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-73

Function

J1939_TRANSMIT

Library

J1939_x.LIB

Function symbol

Purpose Sending messages.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

PRIO BYTE Message priority (0 to 7)

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

SRC DWORD Memory address of data array whose content is to be transmitted

LEN BYTE Number of bytes to be transmitted

RPT TIME Repeat time within which the messages are sent cyclically

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data transmission completed 2: Function active (data transfer) 3: Error, data can not be sent

Page 110: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-74

Description Function block J1939_TRANSMIT takes care of sending messages and message blocks. Parameters PG, PF, PS, RPT, and the address of data array SRC are passed to the function. The address must be determined with function ADR. In addition, the number of data bytes to be transferred and the priority (normally 3, 6 or 7) must be passed to the function.

Because sending takes place over several controller cycles, it must be evaluated through the RESULT byte. If RESULT = 1, all data has been transmitted.

If more than eight bytes are to be sent, a packet transfer is performed.

Page 111: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-75

Function

J1939_RESPONSE

Library

J1939_x.LIB

Function symbol

Purpose Automatic response to a request message.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

CONFIG BOOL This bit must be set TRUE once during configuration of the data object. For the remaining program execution it is FALSE.

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

SRC DWORD Memory address of data array whose content is to be transmitted

LEN BYTE Number of bytes to be transmitted

Function outputs: none

Page 112: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-76

Description Function block J1939_RESPONSE is responsible for automatic sending ofmessages in response to global requests and specific requests. It must beinitialised for each cycle with input CONFIG.

Parameters PG, PF, PS, RPT, and the address of data array SRC are passed tothe function. The address must be determined with function ADR. In addition,the number of data bytes to be transferred is passed to the function.

Page 113: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-77

Function

J1939_SPECIFIC_REQUEST

Library

J1939_x.LIB

Function symbol

Purpose Requesting and receiving data from a specific network node

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

PRIO BYTE Priority (0 ... 7)

DA BYTE Logical (destination) address of requested device

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

DST DWORD Destination address of the array under which the received data is saved.

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data transmission completed 2: Function active (data transfer) 3: Error, data can not be sent

LEN BYTE Number of received data bytes

Page 114: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-78

Description Function block J1939_SPECIFIC_REQUEST is used for automaticallyrequesting individual messages from a specific J 1939 network node. The logicDA device addresses parameters PG, PF, and PS, and the address of arrayDST in which the received data is placed are passed to the function. Theaddress must be determined with function ADR. In addition, the priority(normally 3, 6 or 7) must be passed to the function.

Because requesting takes place over several controller cycles, it must beevaluated through the RESULT byte. If RESULT = 1, all data has been received.

Output LEN indicates the number of received data bytes.

Page 115: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-79

Function

J1939_GLOBAL_REQUEST

Library

J1939_x.LIB

Function symbol

Purpose Globally requesting and receiving data from the network nodes

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

PRIO BYTE Priority (0 ... 7)

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

DST DWORD Destination address of the array under which the received data is saved.

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data transmission completed 2: Function active (data transfer) 3: Error, data can not be sent

SA BYTE Logical (transmit) device address of requested device

LEN BYTE Number of received data bytes

Page 116: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-80

Description Function block J1939_GLOBAL_REQUEST is used for automatically requestingindividual messages from all active J 1939 network nodes. The logic DA deviceaddresses parameters PG, PF, and PS, and the address of array DST in whichthe received data is placed are passed to the function. The address must bedetermined with function ADR. In addition, the priority (normally 3, 6 or 7) mustbe passed to the function.

Because requesting takes place over several controller cycles, it must beevaluated through the RESULT byte. If RESULT = 1, all data has been received.

Output LEN indicates the number of received data bytes.

Page 117: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-81

Function

ISO11992

Library

ISO11992_x.LIB

Function symbol

Purpose Protocol handler for ISO 11992 communication profile.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

START BOOL TRUE: Protocol handler will be started

FALSE: in cyclic program execution

MY_ADRESS BYTE Controller device address

Function outputs: none

Description To implement communications, the protocol handler must be called in everyprogram cycle with input ENABLE set TRUE.

The protocol handler is started when the START input is set TRUE for a cycle.

MY_ADRESS transmits a device address (which must be unique) to the controlmodule, where it can then be read by other bus nodes.

To allow the use of ISO 11992 communications, the second CAN interface must first be initialised with function CAN2.

Page 118: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-82

Function

ISO11992_RECEIVE

Library

ISO11992_x.LIB

Function symbol

Purpose Receiving an individual message or a message block.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

CONFIG BOOL This bit must be set TRUE once during configuration of the data object. For the remaining program execution it is FALSE.

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

DST DWORD Destination address of the array under which the received data is saved.

RPT TIME Monitoring time within which the messages must be received again. If it is not, an error is signalled. To disable monitoring, set RPT to T#0s.

LIFE BYTE Number of permissible incorrect monitoring calls

Page 119: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-83

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data has been received 3: Error signalling

Nothing received within time window (LIFE * RPT)

DEVICE BOOL Sender’s device address

LEN BYTE Number of received bytes

Description Function block ISO11992_RECEIVE takes care of receiving individualmessages and message blocks. It must be initialised for each cycle with inputCONFIG. During initialisation, parameters PG, PF, PS, RPT, LIFE, and thememory address of the destination address are transmitted. The address mustbe determined with function ADR.

The received data must be evaluated with the RESULT byte.If its value is 1, the data is available at the memory address transmitted throughDST. When a new message is received, the existing data at the destinationaddress is overwritten.

The number of received message bytes is available at function output LEN.

If RESULT = 3, no valid messages were received in the specified time (LIFE *RPT).

This function block must also be used if the messages are requested with functions ISO11992_........_REQUEST.

Page 120: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-84

Function

ISO11992_TRANSMIT

Library

ISO11992_x.LIB

Function symbol

Purpose Sending messages.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

PRIO BYTE Priority (0 ... 7)

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

SRC DWORD Memory address of the data to be sent

LEN BYTE Number of bytes to be transmitted

RPT TIME Repeat time within which the messages are sent cyclically

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data transmission completed 2: Function active (data transfer) 3: Error, data can not be sent

Page 121: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-85

Description Function block ISO11992_TRANSMIT takes care of sending messages andmessage blocks. Parameters PG, PF, PS, RPT, and the address of data arraySRC are passed to the function. The address must be determined with functionADR. In addition, the number of data bytes to be transferred and the priority(normally 3, 6 or 7) must be passed to the function.

Because sending takes place over several controller cycles, it must beevaluated through the RESULT byte. If RESULT = 1, all data has beentransmitted.

If more than eight bytes are to be sent, a packet transfer is performed.

Page 122: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-86

Function

ISO11992_RESPONSE

Library

ISO11992_x.LIB

Function symbol

Purpose Automatic response to a request message.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

CONFIG BOOL This bit must be set TRUE once during configuration of the data object. For the remaining program execution it is FALSE.

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

SRC DWORD Memory address of data array whose content is to be transmitted

LEN BYTE Number of bytes to be transmitted

Function outputs: none

Page 123: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-87

Description Function block ISO11992_RESPONSE is responsible for automatic sending ofmessages in response to global requests and specific requests. It must beinitialised for each cycle with input CONFIG.

Parameters PG, PF, PS, RPT, and the address of data array SRC are passed tothe function. The address must be determined with function ADR. In addition,the number of data bytes to be transferred is passed to the function.

Page 124: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-88

Function

ISO11992_SPECIFIC_REQUEST

Library

ISO11992_x.LIB

Function symbol

Purpose Requesting and receiving data from a specific network node

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

PRIO BYTE Priority (0 ... 7)

DA BYTE Logical (destination) address of requested device

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

DST DWORD Destination address of the array under which the received data is saved.

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data transmission completed 2: Function active (data transfer) 3: Error, data can not be sent

LEN BYTE Number of received data bytes

Page 125: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-89

Description Function block ISO11992_SPECIFIC_REQUEST is used for automaticallyrequesting individual messages from a specific ISO 11992 network node. Thelogic DA device addresses parameters PG, PF, and PS, and the address ofarray DST in which the received data is placed are passed to the function. Theaddress must be determined with function ADR. In addition, the priority(normally 3, 6 or 7) must be passed to the function.

Because requesting takes place over several controller cycles, it must beevaluated through the RESULT byte. If RESULT = 1, all data has been received.

Output LEN indicates the number of received data bytes.

Page 126: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-90

Function

ISO11992_GLOBAL_REQUEST

Library

ISO11992_x.LIB

Function symbol

Purpose Globally requesting and receiving data from the network nodes

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

PRIO BYTE Priority (0 ... 7)

PG BYTE Page address Normally = 0

PF BYTE PDU format byte

PS BYTE PDU specific byte

DST DWORD Destination address of the array under which the received data is saved.

Function outputs

Name Data type Description

RESULT BYTE 0: Not active 1: Data transmission completed 2: Function active (data transfer) 3: Error, data can not be sent

SA BYTE Logical (transmit) device address of requested device

LEN BYTE Number of received data bytes

Page 127: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CAN in the ecomat type R 360

7-91

Description Function block ISO11992_GLOBAL_REQUEST is used for automaticallyrequesting individual messages from all active ISO 11992 network nodes. Thelogic DA device addresses parameters PG, PF, and PS, and the address ofarray DST in which the received data is placed are passed to the function. Theaddress must be determined with function ADR. In addition, the priority(normally 3, 6 or 7) must be passed to the function.

Because requesting takes place over several controller cycles, it must beevaluated through the RESULT byte. If RESULT = 1, all data has been received.

Output LEN indicates the number of received data bytes.

Page 128: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Functions for using the second CAN interface to SAE J 1939 and ISO 11992

7-92

Page 129: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

8-1

8. PWM in the ecomat Type R 360

8.1. PWM signal processing and current control PWM (pulse-width-modulation) In control applications, it is used mainly for mobile use and adverse conditions requiring rugged equipment for controlling proportional (PWM) valves. With available accessories, pulse-width-modulated output signals can be converted into analog output voltages.

PWM output signals are clocked signals between GND and supply voltage, whose pulse/pause ratio is varied within a fixed period (the PWM frequency). Depending on the pulse/pause ratio, the required current is generated through the connected load.

The ecomat 100 type R 360 controller’s PWM function is a hardware function provided by the processor. To use the controllers’ 4/8/12 built-in PWM outputs, they must be initialised in the user program and configured for the required output signal.

Page 130: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-2

PWM/PWM 100 Depending on the application and the required resolution, you can choose between the functions PWM and PWM100. The controller functions require a high accuracy and therefore also a high resolution. The PWM function is usually best in this case.

For a fast, easy implementation in applications with less stringent accuracy requirements, function PWM100 can be used. With this function, the PWM frequency can be input in Hz and the pulse/pause ratio in 1 % steps.

PWM frequency The required PWM frequency depends on the controlled valve type. With the PWM function, the frequency is transmitted with the Reload value (function PWM) or directly as numerical value in Hz (function PWM100). The PWM outputs’ mode of operation depends on the controller used, but their purpose is always the same.

The PWM frequency is given by an internal count derived from the CPU clock pulse. This count is started when the PWM function is initialised and – depending on the PWM output group (0 ... 3, 4 ... 7 or 4 ... 11) – counts down from FFFF hex or up from 0000 hex. When it reaches a reference value (VALUE), the output is set. When the count overflows (i.e. changes from 0000 hex to FFFF hex or from FFFF hex to 0000 hex), the output is reset and the process begins from the start.

With the specification of another RELOAD value, the internal count can be set to run between values other than 0000 hex and FFFF hex. This increases the PWM frequency and the reference value must then lie within the specified range.

PWM channels

0 ... 3

These four PWM channels provide maximum flexibility in parameterization. A separate PWM frequency (RELOAD value) can be set and one of the functionsPWM or PWM100 selected for each channel.

Calculating the RELOAD value

The reload value of the internal PWM count depends on input DIV64 and the CPU frequency and is calculated as follows:

Classic/ExtendedController

DIV64 = 0: fPWM = 20.00 MHz / Reload

DIV64 = 1: fPWM = 312.5 kHz / Reload

Page 131: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-3

Smart/CabinetController

DIV64 = 0: fPWM = 10.00 MHz / Reload

DIV64 = 1: fPWM = 156.25 kHz / Reload

Depending on whether a high or low PWM frequency is required, input DIV64 must be set to 0 or 1. For PWM frequencies below 305/152 Hz, DIV64 must be set to 1 to prevent the Reload value being larger than FFFF hex.

Example for ClassicController

Example for SmartController

The desired PWM frequency is 400 Hz.

20 MHz _________ = 50000 ⇒ C350 hex

400 Hz

The permissible PWM value range therefore lies from 0000 hex to C350 hex.

The reference value at which the output switches must then lie between 0000 hex and C350 hex.

The desired PWM frequency is 200 Hz.

10 MHz _________ = 50000 ⇒ C350 hex

200 Hz

The permissible PWM value range therefore lies from 0000 hex to C350 hex.

The reference value at which the output switches must then lie between 0000 hex and C350 hex.

The resulting pulse/pause ratios are as follows:

Minimum pulse/pause ratio (0 % On): C350 hex

Maximum pulse/pause ratio (100 % On): 0000 hex

Between minimum and maximum, 50,000 intermediate (PWM) values are possible.

All controller versions have PWM channels 0 to 3, although only some modelsfeature current control.

Page 132: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-4

PWM channels 4 ... 7

8 ... 11

These four/eight PWM channels can be set only to a common PWM frequency. A combined use of functions PWM and PWM100 is not permissible.

Calculating the RELOAD value

The reload value of the internal PWM count depends on input DIV64 and the CPU frequency and is calculated as follows:

Classic/ExtendedController

DIV64 = 0: fPWM = 2.50 MHz / (10000 hex – Reload)

DIV64 = 1: fPWM = 312.50 kHz / (10000 hex – Reload)

Smart/CabinetController

DIV64 = 0: fPWM = 2.50 MHz / (10000 hex – Reload)

DIV64 = 1: fPWM = 312.50 kHz / (10000 hex – Reload)

Depending on whether a high or low PWM frequency is required, input DIV64 must be set to 0 or 1. For PWM frequencies below 39 Hz, DIV64 must be set to 1 to prevent the Reload value being smaller than 0000 hex.

Example

The desired PWM frequency is 200 Hz.

2.5 MHz _________ = 12500 ⇒ 30D4 Hex

200 Hz

Reload value 10000 hex – 30D4 hex = CF2C hex

The permissible PWM value range therefore lies from CF2C hex to FFFF hex.

The reference value at which the output switches must then lie between CF2C hex and FFFF hex.

The PWM frequency is the same for all PWM outputs (4 ... 7 or 4 ... 11). A combined use of functions PWM and PWM100 is not permissible.

Page 133: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-5

The resulting pulse/pause ratios are as follows:

Minimum pulse/pause ratio (0 % On): FFFF hex

Maximum pulse/pause ratio (100 % On): CF2C hex

Between minimum and maximum, 12500 intermediate (PWM) values are possible.

When you use the Classic/ExtendedController in your system, observe the following points:

If you are using PWM outputs 4 to 7 (regardless of whether current-controlled or through one of the PWM function blocks), you must also use the same frequency or the corresponding Reload value for outputs 8 to 11. This means that you must use the same function blocks with these outputs.

Current control blocks OCC_TASK and OUTPUT_CURRENT_CONTROL are based on the PWM function block. If you are using the current control blocks, use only the PWM function block with channels 8 to 11 and calculate the Reload value corresponding to the frequency.

PWM dither With certain hydraulic valve types, the PWM frequency must be superimposed with a dither frequency. If these valves are actuated with a constant PWM value over a longer time, they could seize due to an elevated system temperature. To prevent this, the PWM value is increased and lowered about a fixed value (DITHER_VALUE) at the dither frequency. The result is a superimposed beat at dither frequency and amplitude DITHER_VALUE on the constant PWM value. The dither frequency is given as a ratio (DITHER_DIVIDER * 2) of the PWM frequency.

Current measurement on PWM channels

Through the current measurement channels integrated in the controller, the coil current can be measured, for example to allow the current to be adjusted as the coil temperature rises. This allows the a maintenance of constant hydraulic conditions in the system.

Overload protection of the Classic/ExtendedController

The current-controlled outputs are short-circuit protected. In the event of an overload, in which the current is limited, for example to between 8 A and 20 A by the cable lengths and cross-sections, the shunts suffer thermal overload. Because the current is undefinable, output mode OUT_OVERLOAD_PROTECTION should be set in the user program. On currents above 4.1 A, the affected output is automatically disabled. When it falls to within its limit values again, the output is automatically re-enabled.

Page 134: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-6

Ramp function If a soft change from one PWM value to the next is desired (for example from 15 % On to 70 % On; see illustration in this section), function PT1 (see chapter 10) can be used, for example, to implement a delayed rise. Alternatively, this process can be implemented in the application software by gradually incrementing up to the new setpoint value. This allows, for example, soft starting of hydraulic systems.

Sample program

A sample program to illustrate the use of the ecomat 100 type R 360’s PWM functionality is included on the ecolog 100plus program CD.

The ecomat 100 type R 360 controller’s PWM function is a hardware function provided by the processor. The PWM function remains set until a hardware reset (supply voltage switched off and on again) of the controller is performed.

Page 135: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-7

Function

PWM

Library

CRxxxx_x.LIB

Function symbol

Purpose Initialising and configuring the PWM outputs.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: PWM output is initialised

FALSE: New values are assigned to PWM output

RELOAD WORD Value for defining PWM frequency

DIV64 BOOL CPU clock pulse/64

CHANNEL BYTE Current PWM channel/output

VALUE WORD Current PWM value

CHANGE BOOL TRUE: New PWM value is accepted

FALSE: Changed PWM value does not effect output

DITHER_VALUE WORD Amplitude of dither value

DITHER_DIVIDER WORD Dither frequency = PWM frequency/ DIVIDER * 2

Function outputs: none

Page 136: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-8

Description Function PWM allows the PWM values to be output in very small steps, making it suitable for use in closed-loop controllers.

The PWM function must be run once for each channel during initialisation of the user program with input INIT set TRUE. Parameter RELOAD is also transferred during initialisation.

Channels 4 to 7 (4 to 11 on the Classic-/ExtendedController) must all have the same RELOAD value. A combined use of functions PWM and PWM100 is not permissible with these channels.

The PWM frequency (and therefore the RELOAD value) is internally limited to 5 kHz.

Depending on whether a high or low PWM frequency is required, input DIV64 must be set to 0 or 1.

During the cyclic program execution, INIT is set FALSE. The function is called and the new PWM value transmitted. It is accepted if input CHANGE is set TRUE.

With function FAST_ANALOG, a current measurement can be implemented for the initialised PWM channel.

PWM_DITHER must be run once for each channel during initialisation of the user program with input INIT set TRUE. During initialisation, the DIVIDER for forming the dither frequency and the VALUE are passed.

The DITHER_DIVIDER value and the DITHER_VALUE can be different for all channels.

Page 137: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-9

Function

PWM100

Library

CRxxxx_x.LIB

Function symbol

Purpose Initialising and configuring the PWM outputs.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: PWM100 is initialised

FALSE: in cyclic program execution

FREQUENCY WORD PWM frequency in Hz

CHANNEL BYTE Current PWM channel/output

VALUE BYTE Current PWM value

CHANGE BOOL TRUE: New PWM value is accepted

FALSE: Changed PWM value has no effect on output

DITHER_VALUE BYTE Amplitude of dither value in percent

DITHER_

FREQUENCY

WORD Dither frequency in Hz

Function outputs: none

Page 138: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-10

Description Function PWM100 allows a simple implementation of the PWM functionality in the ecomat type R 360. The PWM frequency can be input in Hz and the pulse/pause ratio in 1 % steps. Because of the stepped value input, this function is not suitable for use in closed-loop controllers.

The PWM100 function must be run once for each channel during initialisation of the user program with input INIT set TRUE. Parameter FREQUENCY is also transferred during initialisation.

Channels 4 to 7 (4 to 11 on the Classic-/ExtendedController) must all have the same FREQUENCY value. A combined use of functions PWM and PWM100 is not permissible with these channels.

The PWM frequency is internally limited to 5 kHz.

During the cyclic program execution, INIT is set FALSE. The function is called and the new PWM value transmitted. It is accepted if input CHANGE is set TRUE.

With function FAST_ANALOG, a current measurement can be implemented for the initialised PWM channel. See also article EC 2049 (Current Control).

DITHER must be run once for each channel during initialisation of the user program with input INIT set TRUE. During initialisation, the FREQUENCY value for forming the dither frequency and the dither value (VALUE) are passed.

The DITHER_FREQUENCY value and the DITHER_VALUE can be different for all channels.

Page 139: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-11

Function

PWM1000

Library

CRxxxx_x.LIB

Function symbol

Purpose Initialising and configuring the PWM outputs.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: PWM1000 is initialised

FALSE: in cyclic program execution

FREQUENCY WORD PWM frequency in Hz

CHANNEL BYTE Current PWM channel/output

VALUE BYTE Current PWM value

CHANGE BOOL TRUE: New PWM value is accepted

FALSE: Changed PWM value has no effect on output

DITHER_VALUE BYTE Amplitude of dither value in percent

DITHER_

FREQUENCY

WORD Dither frequency in Hz

Function outputs: none

Page 140: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-12

Description Function PWM1000 allows a simple implementation of the PWM functionality in the ecomat type R 360. The PWM frequency can be input in Hz and the pulse/pause ratio in 1 ‰ steps, making it suitable for use in closed-loop controllers.

The PWM100 function must be run once for each channel during initialisation of the user program with input INIT set TRUE. Parameter FREQUENCY is also transferred during initialisation.

Channels 4 to 7 (4 to 11 on the Classic-/ExtendedController) must all have the same FREQUENCY value. A combined use of functions PWM and PWM100 is not permissible with these channels.

The PWM frequency is internally limited to 5 kHz.

During the cyclic program execution, INIT is set FALSE. The function is called and the new PWM value transmitted. It is accepted if input CHANGE is set TRUE.

With function FAST_ANALOG, a current measurement can be implemented for the initialised PWM channel. See also article EC 2049 (Current Control).

DITHER must be run once for each channel during initialisation of the user program with input INIT set TRUE. During initialisation, the FREQUENCY value for forming the dither frequency and the dither value (VALUE) are passed.

The DITHER_FREQUENCY value and the DITHER_VALUE can be different for all channels.

Page 141: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-13

Function

FAST_ANALOG

Library

CRxxxx_x.LIB (not CR03xx_x.LIB

Function symbol

Purpose PWM-synchronous analog value reading. The result is the mean value over aPWM frequency period.

Parameters Function inputs

Name Data type Description

PWM_CHANNEL BYTE Monitored PWM channel

ANALOG_CHANNEL BYTE Measuring analog channel

Function outputs

Name Data type Description

Q WORD Averaged analog value over a PWM period

Description The analog inputs built into the controller can also be used for measuring thecurrent in a PWM channel. Externally fitted shunt resistors are used for thispurpose. To synchronise scanning of the analog values by the A/D transformerwith the PWM frequency, use function FAST_ANALOG

The specified PWM channel is scanned by the analog channel at a rate of 1 ms. At the function output, the mean value for a full PWM Period is then available.

See also article EC 2049 (Current Control).

Page 142: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-14

Function

OUTPUT_CURRENT_CONTROL

Library

CRxxxx_x.LIB (not CR03xx_x.LIB)

Function symbol

Purpose Current control for the PWM outputs.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

INIT BOOL TRUE: Function being initialised, first cycle

FALSE: In program execution

OUTPUT _CHANNEL

BYTE 0 ... x PWM output channel (values depend on device)

ACTUAL _CURRENT

WORD Present current at PWM output in mA. Function OUTPUT_CURRENT must be called. The output value of OUTPUT_CURRENT is passed to the input of ACTUAL_CURRENT.

DESIRED _CURRENT

Setpoint current in mA

PWM_ FREQUENCY

WORD Permissible PWM frequency for the load connected to the output

MODE BYTE Control characteristic:

0 no overshoot

1 Minimal overshoot

2 Moderate overshoot permissible

Function outputs

Page 143: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-15

Name Data type Description

PWM_RATIO BYTE For monitoring; indicates the PWM pulse duty factor between 0 and 100 %.

Description The closed-loop controller is laid out as an adaptive control system and istherefore self-optimising. To achieve an optimal control characteristic, adapt thecontroller to the control phase with a teach-in. To do this, carry out a fewsetpoint jumps in the expected setpoint range. A teach-in is possible only withthe test input enabled. The controller parameters are written to the EEPROM.Once commissioning is completed, disable the test input again.

To achieve a stable output value, call function OUTPUT_CURRENT_CONTROL periodically at equal intervals. For an accurate cycle time (5 ms) use function block OCC_TASK.

OUTPUT_CURRENT_CONTROL is based on the PWM function block.

If OUTPUT_CURRENT_CONTROL is used for outputs 4 to 7 and PWM outputs 8 to 11 are also used, only the PWM function block can be used for outputs 8 to 11.

Page 144: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-16

Function

OCC_TASK

Library

CRxxxx_x.LIB (not CR03xx_x.LIB)

Function symbol

Purpose Current control for the PWM outputs.

Parameters Function inputs

Name Data type

Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

INIT BOOL TRUE: Function being initialised, first cycle

FALSE: In program execution

OUTPUT _CHANNEL

BYTE 0 ... x PWM output channel (value depends on device)

DESIRED _CURRENT

WORD Setpoint current in mA

PWM _FREQUENCY

Permissible PWM frequency for the load connected to the output

MODE BYTE Control characteristic:

0 Very slow rise, no overshoot

1 Slow rise, no overshoot

2 Minimal overshoot

3 Moderate overshoot permissible

Page 145: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM in the ecomat Type R 360

8-17

Function outputs

Name Data type Description

PWM_RATIO BYTE For monitoring; indicates the PWM pulse duty factor between 0 and 100 %.

Description The closed-loop controller is laid out as an adaptive control system and istherefore self-optimising. To achieve an optimal control characteristic, adapt thecontroller to the control phase with a teach-in. To do this, carry out a fewsetpoint jumps in the expected setpoint range. A teach-in is possible only withthe test input enabled. The controller parameters are written to the EEPROM.Once commissioning is completed, disable the test input again.

In contrast to OUTPUT_CURRENT_CONTROL, no actual values must be fed back with this function block, since they are already acquired within the function. In addition, OCC_TASK works with a fixed cycle time of 5 ms.

OCC_TASK is based on the PWM function block.

If OCC_TASK is used for outputs 4 to 7 and PWM outputs 8 to 11 are also used, only the PWM function block can be used for outputs 8 to 11.

Page 146: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

PWM signal processing and current control

8-18

Function

OUTPUT_CURRENT

Library

CRxxxx_x.LIB (not CR03xx.LIB)

Function symbol

Purpose Current measurement in connection with an active PWM channel.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed.

FALSE: The function is not processed

OUTPUT _CHANNEL

BYTE 0 ... x PWM output channel (value depends on device)

ACTUAL _CURRENT

WORD Output current in mA.

Description Function supplies the present output current of outputs used as PWM outputs.Function PWM100 or PWM must first be called for the required channel. Thecurrent is measured within the device, i.e. no external shunts are required.

Page 147: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

9-1

9. High-speed counters in the ecomat type R 360

9.1. Counter functions for frequency and period measurement Depending on the controller type used, up to 16 fast inputs for processing input frequencies up to 50 kHz are supported. In addition to pure frequency measurement at the FRQ inputs, the ENC inputs can also be used for evaluating incremental rotary encoders (counter function) with a frequency of up to 10 kHz. The CYL inputs are used for measuring period duration of slow signals.

Input Frequency Description

FRQ 0/ENC 0 50 /10 kHz Frequency measurement/channel A, rotary enc. 1

FRQ 1/ENC 0 50 /10 kHz Frequency measurement/channel B, rotary enc. 1

FRQ 2/ENC 1 50 /10 kHz Frequency measurement/channel A, rotary enc. 2

FRQ 3/ENC 1 50 /10 kHz Frequency measurement/channel B, rotary enc. 2

CYL 0/ENC 2 10 kHz Period measurement/channel A, rotary enc. 3

CYL 1/ENC 2 10 kHz Period measurement/channel B, rotary enc. 3

CYL 2/ENC 3 10 kHz Period measurement/channel A, rotary enc. 4

CYL 3/ENC 3 10 kHz Period measurement/channel B, rotary enc. 4

For simple evaluation, functions FREQUENCY, CYCLE and INC_ENCODER are available.

If the fast inputs of the ecomat 100 type R 360 are used as “normal” digital inputs, their increased sensitivity to interference must be observed (for example contact bounce of mechanical contacts). The standard digital input has an input frequency of 50 Hz. It may be necessary to debounce the input signal through the software.

Page 148: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Counter functions for frequency and period measurement

9-2

Function

FREQUENCY

Library

CRxxxx_x.LIB

Function symbol

Purpose Measures the applied signal frequency at the specified channel.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: FREQUENCY is initialised

FALSE: in cyclic program execution

CHANNEL BYTE Number of input (0 ... x: value depends on device)

TIMEBASE TIME Time base

Function outputs

Name Data type Description

F WORD Frequency in Hz

Description FREQUENCY measures the frequency of the signal applied to the selected channel (CHANNEL). The positive edge is evaluated. In dependence of the time base (TIMEBASE), frequency measurements can be performed across a wide value range. High frequencies require a short time base, low frequencies a longer time base. The frequency is output in Hz.

For function FREQUENCY, only inputs FRQ 0 to FRQ 3 can be used.

Page 149: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

High-speed counters in the ecomat type R 360

9-3

Function

CYCLE

Library CR25xx_x.LIB

Function symbol

Purpose Measures the cycle time in μs at the specified channel.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: CYCLE is initialised

FALSE: in cyclic program execution

CHANNEL BYTE Number of input (0 ... x: value depends on device)

Function outputs

Name Data type Description

C WORD Cycle time in μs

Description CYCLE measures the cycle time of the signal applied to the selected channel(CHANNEL). The positive edge is evaluated. At low frequencies, theFREQUENCY function yields an inaccurate result. To avoid this, use the CYCLEfunction. The cycle time is output in μs.

The maximum measurement range is 65535 μs (= 15 Hz).

For function CYCLE, only inputs CYL0 to CYL3 can be used. The measurement range lies between 15 and 1000 Hz.

CYCLE is a compatibility function. In new application programs, use the more powerful PERIOD function.

Page 150: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Counter functions for frequency and period measurement

9-4

Function

PERIOD

Library CRxxxx_x.LIB

Function symbol

Purpose Measures the frequency and the cycle time in μs at the specified channel.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: PERIOD is initialised

FALSE: in cyclic program execution

CHANNEL BYTE Number of input (0 ... x: value depends on device)

PERIODS BYTE Number of periods to be compared

Function outputs

Name Data type Description

C DWORD Cycle time in μs of scanned periods

F WORD Frequency of scanned periods

ET TIME Elapsed time since the start of period measurement (for use with very slow signals)

Page 151: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

High-speed counters in the ecomat type R 360

9-5

Description PERIOD measures the frequency and the cycle time of the signal applied to theselected channel (CHANNEL). For calculation, all positive edges are evaluatedand the mean value over the number of specified Periods (PERIODS)calculated.

At low frequencies, the FREQUENCY function yields an inaccurate result. Toavoid this, use the PERIODS function. The cycle time is output in seconds.

The maximum measurement range is about 71 minutes.

For function PERIODS, only inputs CYL0 to CYL3 can be used.

Page 152: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Counter functions for frequency and period measurement

9-6

Function

PERIOD_RATIO

Library CRxxxx_x.LIB

Function symbol

Purpose The PERIOD_RATIO function measures the frequency and the cycle time overthe specified periods in μs at the specified channel. In addition, the pulse/pauseratio is given in thousandths.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: PERIOD is initialised

FALSE: in cyclic program execution

CHANNEL BYTE Number of input (0 ... x: value depends on device)

PERIODS BYTE Number of periods to be compared

Function outputs

Name Data type Description

C DWORD Cycle time in μs of scanned periods

F WORD Frequency of scanned periods

ET TIME Elapsed time since the start of period measurement (for use with very slow signals)

RATIO1000 WORD pulse/pause ratio in thousandths

Page 153: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

High-speed counters in the ecomat type R 360

9-7

Description PERIOD_RATIO measures the frequency and the cycle time of the signalapplied to the selected channel (CHANNEL). For calculation, all positive edgesare evaluated and the mean value over the number of specified Periods(PERIODS) calculated. In addition, the pulse/pause ratio is given inthousandths. Example: At a signal ratio of 25 ms High-level and 75 ms Low-level, the value RATIO100 of 250 ‰ is output.

At low frequencies, the FREQUENCY function yields an inaccurate result. Toavoid this, use the PERIODS_RATIO function. The cycle time is output in μs.

The maximum measurement range is about 71 minutes.

For function PERIODS_RATIO, only inputs CYL0 to CYL3 can be used.

Page 154: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Counter functions for frequency and period measurement

9-8

Function

PHASE

Library

CRxxxx_x.LIB

Function symbol

Purpose Reads a channel pair with fast inputs and compares the signals’ phase angle.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: In first cycle

FALSE: In program execution

CHANNEL BYTE Channel pair 0 or 1

Function outputs

Name Data type Description

C DWORD Period duration in μs

P INT Phase angle between 0 and 360 degrees

ET TIME Elapsed time since the start of period measurement (for use with very slow signals)

Description The PHASE function block is internally based on the CYCLE block. It differsfrom CYCLE in that it groups channel pairs with fast inputs so that the phaseangle of two signals to each other can be determined. Unlike CYCLE, it cantherefore be used to evaluate longer periods of up to several seconds.

Page 155: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

High-speed counters in the ecomat type R 360

9-9

Function

INC_ENCODER

Library

CRxxxx_x.LIB

Function symbol

Purpose Up/down counting function for evaluation of rotary encoders.

Parameters Function inputs

Name Data type Description

INIT BOOL TRUE: INC_ENCODER is initialised

FALSE: in cyclic program execution

CHANNEL BYTE Number of input pair (0 ... 3)

PRESET_

VALUE

DINT Counter starting value

PRESET BOOL TRUE: Starting count is accepted

FALSE: Counter active

Function outputs

Name Data type Description

COUNTER DINT Current count

UP BOOL TRUE: Counter counts up

DOWN BOOL TRUE: Counter counts down

Page 156: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Counter functions for frequency and period measurement

9-10

Description The INC_ENCODER function is laid out as up/down counter up to a frequencylimit of about 10 kHz. Two frequency inputs always form the input pair that isevaluated with this function. Up to four incremental shaft encoders can beconnected.

With PRESET_VALUE, the counter can then be set to a starting value. It isaccepted if PRESET is set TRUE. To activate the counter, PRESET must be setback to FALSE. Output COUNTER provides the current count. Outputs UP andDOWN provide the current counting direction. The outputs are TRUE when thecounter’s previous program cycle counted in the corresponding direction. If thecounter stops, the direction output is reset in the next program cycle.

Page 157: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

High-speed counters in the ecomat type R 360

9-11

Function

FAST_COUNT

Library

CRxxxx_x.LIB

Function symbol

Purpose Counter for fast input pulses.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

INIT BOOL TRUE: In the initialisation cycle

FALSE: During program execution

CHANNEL BYTE Number of input (0 ... 3)

MODE_UP_DOWN

BOOL TRUE: Counter counts down

FALSE: Counter counts up

LOAD BOOL TRUE: Starting value is loaded

FALSE: No starting value is loaded

PV WORD Starting value

With the R 360 controllers, channel 0 can be used only as up counter, while channels 1 to 3 can be used as both up and down counters.

Page 158: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Counter functions for frequency and period measurement

9-12

Function outputs

Name Data type Description

CV WORD Counter output value

Description

Function block FAST_COUNT reads fast pulses at FRQ input channels 0 to 3. With FRQ input channel 0, FAST_COUNT works like function block CTU. The highest supported frequency is 50 kHz.

Page 159: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

10-1

10. Other functions of the ecomat type R 360

10.1. Software reset

Function

SOFTRESET

Library

CRxxxx_x.LIB

Function symbol

Purpose Performs a complete controller restart.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

Function outputs: none

Description SOFTRESET performs a complete controller restart. This function can, forexample be used in connection with CANopen to perform a node reset. Thebehaviour of the controller after a SOFTRESET is the same as it does after adisconnection of the power supply.

Observe the long reset phase during running communications, otherwise guarding errors may occur.

Page 160: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Saving, reading and converting data

10-2

10.2. Saving, reading and converting data Automatic data backups

The ecomat 100 type R 360 controller allows data (BOOL, BYTE, WORD, andDWORD) to be saved to non-volatile flash memory. Backups are startedautomatically as soon as the supply voltage drops. A precondition is that thedata is written to flag range MB0 ... MB255 (MB0 ... MB1024 in theClassic/ExtendedController).

Automatic saving has the advantage that current values (such as counts) arenot lost when the supply voltage suddenly drops or is interrupted altogether.

When the supply voltage is re-established, the operating system reads thesaved values from the memory and writes them back to the flag range.

Manual data backup on Classic/ ExtendedController

In addition to the possibility of an automatic data backup, function FRAMWRITEcan be used to write a further 16 Kbytes of user data to the built-in FRAM. Thisdata can then be read again with the FRAMREAD function.

Manual data backup on Smart/CabinetController

Beside the possibility of automatically saving data from the flag range up toMB255, you can use a function call to save the data range between MB256 andMB1024 to the built-in serial EEPROM. This data can then be read again withanother function call. The data is always written and read as a block.

Direct memory access

The user program has direct read–write access to the volatile flag rangethrough the corresponding IEC addresses.

IEC byte

address

IEC word

address

Description

%MB0 ...

%MB1024

%MW0 ...

%MW5132

Non-volatile data, automatic backup

Classic and ExtendedController

%MB0 ...

%MB255

%MW0 ...

%MW127

Non-volatile data, automatic backup

Smart and CabinetController

%MB256 ...

%MB1023

%MW128 ...

%MW511

Volatile data can be saved with function E2WRITE (Smart- and CabinetControllers only)

Through the memory allocation, (see appendix), free memory ranges can be identified.

Page 161: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-3

Function

MEMCPY

Library

CRxxxx_x.LIB

Function symbol

Purpose Allows direct reading and writing of different data types into memory.

Parameters Function inputs

Name Data type Description

DST DWORD Target variable address

SRC DWORD Source variable address

LEN WORD Number of data bytes

Function outputs: none

Description MEMCPY writes the content of a memory range starting at address SRC to arange beginning with address DST. The number of bytes to be transmitted isspecified with LEN. This also allows the transmission of only one byte of a wordfile.

The address must be determined with function ADR and passed to MEMCPY.

Page 162: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Saving, reading and converting data

10-4

Function

E2WRITE_

Library

CR25xx_x.LIB, CR03xx_x.LIB

Function symbol

Purpose Allows direct writing of different data types into the serial EEPROM.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is executed

FALSE: Function is not executed

DST INT Starting address in the memory

(0 ... 2FF hex and 340 hex to EEPROM size)

LEN INT Number of data bytes to be sent

SRC DINT Source variable address

Function outputs

Name Data type Description

RESULT BYTE 0 = Function is not active

1 = Function is completed

2 = Function is in progress

Description E2WRITE_ writes the content of the memory range with address SRC to theserial EEPROM. Because processing of this function takes some time, it mustbe monitored through function output RESULT. If RESULT = 1, input ENABLEmust be reset to FALSE.

The address in SRC must be determined with function ADR and passed to E2WRITE_.

Page 163: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-5

Function

E2READ_

Library

CR25xx_x.LIB, CR03xx_x.LIB

Function symbol

Purpose Allows reading of different data types from the serial EEPROM.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is executed

FALSE: Function is not executed

SRC INT Starting address in the memory

(0 ... 2FF hex and 340 hex to EEPROM size)

LEN INT Number of data bytes to be sent

DST DINT Target variable address

Function outputs

Name Data type Description

RESULT BYTE 0 = Function is not active

1 = Function is completed

2 = Function is in progress

Description E2READ_ reads the content from the serial EEPROM starting at address SRC.Because processing of this function takes some time, it must be monitoredthrough function output RESULT. If RESULT = 1, input ENABLE must be resetto FALSE.

The address in DST must be determined with function ADR and passed toE2READ_.

Page 164: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Saving, reading and converting data

10-6

Function

FLASHWRITE

Library

CRxxxx_x.LIB

Function symbol

Purpose Allows direct writing of different data types into the flash memory.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is executed

FALSE: Function is not executed

DST INT Relative starting address in the memory

LEN INT Number of data bytes (up to 65536 Bytes)

SRC DINT Source variable address

Function outputs: None

Description FLASHWRITE writes the content of a memory range with address SRC to flashmemory. The number of bytes to be transmitted is specified with LEN.

The address in SRC must be determined with function ADR and passed toFLASHWRITE.

Before the memory can be written to again, it must be cleared by overwritingaddress 0.

The FLASHWRITE function must not be run during the process, since theprocess is briefly interrupted during the write operation. This function isintended for saving large data volumes during commissioning. This data isread-only while the process is running.

Page 165: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-7

Function

FLASHREAD

Library

CRxxxx_x.LIB

Function symbol

FLASHREAD

ENABLESRCLENDST

Purpose Allows direct reading of different data types from flash memory.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is executed

FALSE: Function is not executed

SRC INT Relative starting address in the memory

LEN INT Number of data bytes (up to 65536 Bytes)

DST DINT Target variable address

Function outputs: None

Description FLASHREAD reads the content of the flash memory from address SRC. Thenumber of bytes to be transmitted is specified with LEN.

The address in DST must be determined with function ADR and passed toFLASHREAD.

Page 166: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Saving, reading and converting data

10-8

Function

FRAMWRITE

Library

CRxxxx_x.LIB (not CR03xx_x.LIB and CR25xx_x.LIB)

Function symbol

Purpose Allows fast writing of different data types into FRAM memory.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is executed

FALSE: Function is not executed

DST INT Relative starting address in memory (0...3FFF Hex)

LEN INT Number of data bytes (up to 16384 Bytes)

SRC DWORD Source variable address

Function outputs: None

Description FRAMWRITE writes the content of the memory range with address SRC to non-volatile FRAM memory. The number of bytes to be transmitted is specified withLEN.

The address in SRC must be determined with function ADR and passed withFRAMWRITE.

The FRAM memory can be written to in several independent segments.Memory segment monitoring must be performed by the user program.

Page 167: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-9

Function

FRAMREAD

Library

CRxxxx_x.LIB (not CR03xx_x.LIB and CR25xx_x.LIB)

Function symbol

Purpose Allows fast reading of different data types from FRAM memory.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is executed

FALSE: Function is not executed

SRC INT Relative starting address in memory (0...3FFF Hex)

LEN INT Number of data bytes (up to 16384 Bytes)

DST DWORD Target variable address

Function outputs: None

Description FRAMREAD reads the content of the FRAM memory from address SRC. Thenumber of bytes to be transmitted is specified with LEN.

The address in DST must be determined with function ADR and passed toFRAMREAD.

The FRAM memory can be read in several independent segments. Memorysegment monitoring must be performed by the user program.

Page 168: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Saving, reading and converting data

10-10

Function

STR

Library

CRxxxx_x.LIB

Function symbol

Purpose Converts a numerical value into a string and formats the string.

Parameters Function inputs

Name Data type Description

A DINT Address of variables to be converted

F STRING Formatting instruction

Function outputs

Name Data type Description

STR STRING Formatted string

Description STR converts a variable value to a string and formats it. The variable’s addressmust be passed to the function. The variable address is generated with the ADRoperator. In addition, a formatting string as per table can be passed to thefunction.

The function output is the converted string, which can then, for example, beviewed on the built-in display.

Standard library (STANDARD.LIB) contains further functions for processing andlinking strings.

Page 169: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-11

Overview of supported formatting characters:

Char-acter

Variable type

Initial format

%d Integer Decimal number with prefix %u Integer without prefix Decimal number

without prefix %o Integer without prefix Octal number without prefix %x Integer without prefix Hexadecimal number

(0123456789abcdef) without prefix

%X Integer without prefix Hexadecimal number (0123456789ABCDEF) without prefix

%f Floating point Floating point number [-]dddd.dddd

%e Floating point Floating point number [-]d.dddde[-]dd

%E Floating point Floating point number [-]d..ddddE[-]dd

%g Floating point Floating point number %G Floating point Floating point number %c Floating point Floating point number %ld DINT Decimal number with prefix %lu DWORD Decimal number without prefix

Note: The variable passed to function STR with ADR must be of string format.

for example %d = integer = variable type

Page 170: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Data access and verification

10-12

10.3. Data access and verification Function

SET_IDENTITY

Library

CRxxxx_x.LIB

Function symbol

Purpose Setting application-specific program ID.

Parameters Function inputs

Name Data type Description

ID STRING(80) Any string with a maximum length of 80 characters

Function outputs: none

Description With function SET_IDENTITY, the application program can generate a programID, which is placed in index 100A of the object directory (OBV). From there, theDOWNLOADER.EXE software or any CANopen tool can be used to read it toestablish the software version.

Using the ClassicController CR0020 as an example, the illustration below shows the relationships between the various identifiers and how they are displayed by the various software tools.

Page 171: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-13

Bootloader

Identity

BOOTLD_H 020923

Extended Identity

CR0020 00.00.01

Operating system

Identity

CR0020_P nnnnnn

Hardware version

CR0020 00.00.01

Software version

Front nozzle

Application

SET_IDENTITY

Front nozzle

Downloader reads

BOOTLD_H 020923CR0020 00.00.01

Downloader reads

CR0020_P nnnnnn Front nozzle

CANopen tool reads

Hardware version OBV 1009

CR0020 00.00.01

Software version OBV 100A

Front nozzle

Page 172: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Data access and verification

10-14

Function

SET_PASSWORD

Library

CRxxxx_x.LIB

Function symbol

Purpose Setting user ID for program and memory upload with the DOWNLOADER.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Identity is set

FALSE: The function is not processed

PASSWORD WORD Numeric user ID

Function outputs: none

Description The SET_PASSWORD function is used for setting a user ID. When active, theDOWNLOADER software tool can read the application program or the memoryonly if the correct password has been entered. With PASSWORD set to 0(default state), a user software or memory upload can be performed at any time.

When a new user program is loaded, the ID is reset.

Page 173: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-15

Function

CHECK_DATA

Library

CRxxxx_x.LIB

Function symbol

Purpose Saving data in the user data memory through a CRC code.

Parameters Function inputs

Name Data type Description

STARTADR DINT Start address of the monitored memory (address from %MW0)

LENGTH WORD Length of monitored memory in bytes

UPDATE BOOL TRUE: Data changes permissible

FALSE: Data changes not permissible

Function outputs

Name Data type Description

RESULT BOOL TRUE: CRC checksum OK

FALSE: CRC checksum incorrect

Description The CHECK_DATA function monitors a memory range (possible addressesfrom %MW0) for unauthorised data modifications in applications requiring ahigh level of security. It does this by forming a CRC checksum for the specifieddata range.

When data is modified without authorisation, RESULT changes to FALSE. Theresult can then be used for further actions (for example disabling the outputs).The UPDATE input must be set FALSE in this case.

Data modifications (for example through the user program or PDM360) arepermitted only if input UPDATE is TRUE. Output RESULT is then permanentlyset TRUE.

Page 174: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Data access and verification

10-16

The Start address must be passed to the function by address operator ADR. In addition, the number of data bytes (LENGTH – length from STARTADR) must be specified.

This is a safety function. Its use does not, however, automatically turn acontroller in which it is used into a safety controller. Only approved, testedcontrollers with a special operating system can be used as safety controllers.

Page 175: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-17

10.4. Processing interrupts Function

SET_INTERRUPT_1MS

Library

CRxxxx_x.LIB

Function symbol

Purpose Running a subroutine at a 1 ms interval.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Data changes permissible

FALSE: Data changes not permissible

Function outputs: none

Description In conventional PLCs, the timebase for real-time processes is provided by thecycle time. This puts PLCs at a disadvantage compared to custom controllers.Even a real-time operating system does not change this fact if the wholeapplication program runs in a single task.

One solution is to keep the cycle time short. This often results in the application being split up over several control cycles, which makes programming more difficult.

Another possibility is to call a particular program block at fixed intervals (here 1 ms) independently of the control cycle.

The user can group the time-critical part of the application in a single block of the PROGRAM (PRG) type. This block is then declared as a 1 ms interrupt routine with a one-off call of the SET_INTERRUPT_1MS function during initialisation. The program block is then processed once every millisecond. To prevent it being called at cycle time intervals as well, it must be skipped in the cycle time (except during initialisation). If inputs and outputs are used in this program block, they are also read and written to at 1 ms intervals.

Within the program block, all time-critical events can then be processed, by combining inputs or global variables and writing to outputs. This allows more precise monitoring of timers than is possible with PLC clock cycles.

Page 176: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Processing interrupts

10-18

Only one timer interrupt block can be active at any one time. Depending on the program state, a changeover to another interrupt block is possible during program execution.

Because the required time must be kept short, do not use calculations, floating-point arithmetic and controller functions in this block.

The interrupt routine prevents a unique identification of the inputs and outputswithin the cycle. Only one of them can therefore be processed at the millisecondinterval.

Inputs: %IX0.08 ... %IX0.23

Outputs: %QX0.00 ... %QX0.07

All other inputs and outputs are processed at the PLC clock pulse interval as usual.

The same applies to global variables if they are accessed at the same time in the PLC cycle and through the interrupt routine. This affects especially larger data types, such as DINT.

SET_INTERRUPT_1MS is a compatibility function for older programs. In new programs, use the new SET_INTERRUPT_XMS function.

Page 177: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-19

Function

SET_INTERRUPT_XMS

Library

CRxxxx_x.LIB

Function symbol

Purpose Running a program block at an x ms interval.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Data changes permissible

FALSE: Data changes not permissible

REPEATTIME TIME Time window in which the interrupt is triggered

READ_INPUTS BOOL TRUE: Inputs included in the routine are read

FALSE: Inputs included in the routine are not read

WRITE_OUTPUTS BOOL TRUE: Outputs included in the routine are written to

FALSE: Outputs included in the routine are not written to

ANALOG_INPUTS BYTE Selection of bit-coded inputs:

0 No input selected 1 Analog input 1 (0b0000 0001) 2 Analog input 2 (0b0000 0010) ... 8 Analog input 8 (0b1000 0000)

A combination of inputs results from performing an AND operation on the values.

Function outputs: none

Page 178: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Processing interrupts

10-20

Description In conventional PLCs, the timebase for real-time processes is provided by thecycle time. This puts PLCs at a disadvantage compared to custom controllers.Even a real-time operating system does not change this fact if the wholeapplication program runs in a single task.

One solution is to keep the cycle time short. This often results in the application being split up over several control cycles, which makes programming more difficult.

Another possibility is to call a particular program block at fixed intervals (here every x ms) independently of the control cycle.

The user can group the time-critical part of the application in a single block of the PROGRAM (PRG) type. This block is then declared as an interrupt routine with a one-off call of the SET_INTERRUPT_XMS function during initialisation. This program block is then always called after expiry of the REPEATTIME (every x ms). To prevent it being called at cycle time intervals as well, it must be skipped in the cycle time (except during initialisation). If inputs and outputs are used in this program block, they are also read and written to at the specified interval. Reading and writing can be suppressed with functions READ_INPUTS, WRITE_OUTPUTS and ANALOG_INPUTS.

Within the program block, all time-critical events can then be processed, by combining inputs or global variables and writing to outputs. This allows more precise monitoring of timers than is possible with PLC clock cycles.

Several timer interrupt blocks can be active. The time required by the interrupt functions must be calculated so that all called functions can be executed. This applies especially to calculations, floating-point arithmetic and controller functions.

The interrupt routine prevents a unique identification of the inputs and outputswithin the cycle. Only some of them is therefore processed.

Inputs: Digital %IX0.12 ... %IX0.15, %IX0.20 ... %IX0.23

Analog All channels (selection bit-coded)

Outputs: Digital %QX0.00 ... %QX0.07

All other inputs and outputs are processed once at the PLC clock pulse interval as usual. The same applies to global variables if they are accessed at the same time in the PLC cycle and through the interrupt routine. This affects especially larger data types, such as DINT.

Page 179: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-21

10.5. Sending data through the built-in SSC interface. Function

SSC_RECEIVE

Library

CR02xx_x.LIB

Function symbol

Purpose Receiving data through the built-in SSC interface.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is active

FALSE: Function is not active

Function outputs

Name Data type Description

RX ARRAY Array [0..19]

VALID BOOL New data has been transmitted. The output is TRUE for one cycle.

Description SSC_RECEIVE is an internal communication function for theExtendedController. Each time it is called, it reads the transferred data bytes (upto 16 messages with 20 bytes/control cycles) from the receive buffer. Functioninput ENABLE must set TRUE. When new, valid data has been transmitted,output VALID is set TRUE for one cycle.

The user program must read and process the received data from the array straight away, since it will be overwritten again in the next cycle.

Note that the number of messages that can be sent with SSC_TRANSMIT is limited to the number that the other half of the controller can receive. Otherwise data may be lost, for example due to the different cycle times.

Page 180: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

10-22

Function

SSC_TRANSMIT

Library

CR02xx_x.LIB

Function symbol

Purpose Sending data through the built-in SSC interface.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is active

FALSE: Function is not active

TX ARRAY Array [0..19]

Function outputs: none

Description SSC_TRANSMIT is an internal communication function for theExtendedController. Each time it is called, it sends the data contained in arrayTX. Up to 16 messages of 20 bytes each can be transmitted per control cycle.Function input ENABLE must set TRUE for transmission to take place.

The user program must read and process the received data from the array straight away, since it will be overwritten again in the next cycle.

Note that the number of messages that can be sent with SSC_TRANSMIT is limited to the number that the other half of the controller can receive. Otherwise data may be lost, for example due to the different cycle times.

Page 181: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-23

Function

SSC_SET_MASTER

Library

CR02xx_x.LIB

Function symbol

Purpose Activating master/slave operation of the ExtendedController.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Function is active

FALSE: Function is not active

Function outputs

Name Data type Description

RESULT BYTE 0: Not active (SSC_NO_WORKING) 1: Data transmission completed (SSC_DONE) 2: Function active (transmission in progress)

(SSC_BUSY) 3: Error, data can not be sent

(SSC_ERROR)

Description SSC_SET_MASTER is an internal communication function for theExtendedController. It initialises master/slave control mode. The inputs andoutputs are processed synchronously. The master also loads a small dummyprogram into the slave. This program block from slave library SLAVE200.LIBmust be included in the application program.

To distinguish the I/O level 2 system variables and functions from those of level1, an _E (for Extended) is appended to their name. The data transfer betweenthe two controller sections takes place automatically through the built-ininterface.

Page 182: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

10-24

The user program must read and process the received data from the array straight away, since it will be overwritten again in the next cycle.

Note that the number of messages that can be sent with SSC_TRANSMIT is limited to the number that the other half of the controller can receive. Otherwise data may be lost, for example due to the different cycle times.

The example shows the basic program structure with initialisation, inclusion of the dummy program (function block DUMMY) and two functions that are executed in the slave module (..._E). To maintain the timed execution sequence during initialisation, use the structure of the example for your application program.

Page 183: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-25

10.6. Using the serial interface

Function

SERIAL_BAUDRATE

Library

CRxxxx_x.LIB

Function symbol

Purpose Sets the baud rate of the serial RS 232 interface.

Parameters Function inputs

Name Data type

Description

ENABLE BOOL TRUE: Set baud rate

FALSE: Function is not active

BAUDRATE BYTE Baud rate (permissible values: 9600, 19200, 38400)

Function outputs; None

Description SERIAL_BAUDRATE sets the serial interface to the specified baud rate. With function input ENABLE, the function is activated for one cycle and sets the value specified through input BAUDRATE.

The SERIAL functions form the basis for creating a custom protocol for the serial interface.

The serial interface is not normally available to the user, since it is used for downloading programs and for debugging. To use the interface, set system flag bit SERIAL_MODE to TRUE. You will then have to use the CAN interface for program downloads and debugging.

Page 184: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Using the serial interface

10-26

Function

SERIAL_TX

Library

CRxxxx_x.LIB

Function symbol

Purpose Transmits a data byte through the serial RS 232 interface.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: Enable transmission

FALSE: Disable transmission

DATA BYTE Byte data to be transferred

Function outputs; None

Description SERIAL_TX transfers the DATA byte through the serial interface. Transmission can be enabled and inhibited with function input ENABLE.

The SERIAL functions form the basis for creating a custom protocol for the serial interface.

The serial interface is not normally available to the user, since it is used for downloading programs and for debugging. To use the interface, set system flag bit SERIAL_MODE to TRUE. You will then have to use the CAN interface for program downloads and debugging.

Page 185: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-27

Function

SERIAL_RX

Library

CRxxxx_x.LIB

Function symbol

Purpose Reads a received data byte from the serial receive buffer.

Parameters Function inputs

Name Data type Description

CLEAR BOOL TRUE: Receive buffer will be cleared

FALSE: Default state

Function outputs

Name Data type Description

RX BYTE Received byte data from the receive buffer

AVAILABLE WORD Number of received data bytes

OVERFLOW BOOL Buffer overflow. Los of data!

Description SERIAL_RX reads a data byte from the serial receive buffer each time it is called. The value of AVAILABLE is counted down by 1 with each call. If the buffer contains no data, the value of AVAILABLE is 0.

The buffer’s capacity is 1000 bytes; if more data is received, data will be lost and the OVERFLOW bit is set.

The SERIAL functions form the basis for creating a custom protocol for the serial interface.

The serial interface is not normally available to the user, since it is used for downloading programs and for debugging. To use the interface, set system flag bit SERIAL_MODE to TRUE. You will then have to use the CAN interface for program downloads and debugging.

Page 186: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Using the serial interface

10-28

Function

SERIAL_PENDING

Library

CRxxxx_x.LIB

Function symbol

Purpose Determines the number of data bytes saved to the serial receive buffer.

Parameters Function inputs, none

Function outputs

Name Data type Description

NUMBER WORD Number of received data bytes

Description SERIAL_PENDING determines the number of data bytes in the receive buffer. In contrast to the SERIAL_RX function, the buffer’s content remains unchanged when the function is called

The SERIAL functions form the basis for creating a custom protocol for the serial interface.

The serial interface is not normally available to the user, since it is used for downloading programs and for debugging. To use the interface, set system flag bit SERIAL_MODE to TRUE. You will then have to use the CAN interface for program downloads and debugging.

Page 187: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-29

10.7. Reading the system time Function

TIMER_READ

Library

CRxxxx_x.LIB

Function symbol

Purpose Reads the current system time.

Parameters Function inputs, none

Function output

Name Data type Description

T TIME Current system time in seconds

Description When the supply voltage is applied, an internal clock pulse is generated and a register is incremented. This register can be read with the TIMER_READ function, for example for measuring time.

When the system timer reaches 0xFFFF FFFF (about 49,7 days), it starts again at zero.

Page 188: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Reading the system time

10-30

Function

TIMER_READ_US

Library

CRxxxx_x.LIB

Function symbol

Purpose Reads the current system time in μseconds.

Parameters Function inputs, none

Function outputs

Name Data type Description

TIME_US DWORD Current system time in μseconds

Description When the supply voltage is applied, an internal clock pulse is generated and a register is incremented. This register can be read with the TIMER_READ function, for example for measuring time.

When the system timer reaches 4294967295 (μs), it starts again at zero.

Page 189: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-31

10.8. Processing variables

Function

NORM

Library

CRxxxx_x.LIB

Function symbol

Purpose Normalises a value within specified limits to a value with new limits.

Parameters Function inputs

Name Data type Description

X WORD Output value

XH WORD Upper limit of input value range

XL WORD Lower limit of input value range

YH WORD Upper limit of output value range

YL WORD Lower limit of output value range

Function outputs

Name Data type Description

Y WORD Normalised data of type WORD

Description The NORM function normalises a value of type WORD that lies within limits XHand XL to an output value within limits YH and YL. This function can be used,for example, for creating PWM values from analog input values.

Page 190: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Processing variables

10-32

Example Non-normalised value: 50 *

Lower limit value of input: 0

Upper limit value of input: 100

Lower limit value of output: 0

Upper limit value of output: 2000

Standardised value: 1000

* The value of X must lie between XL and XH (the values are not internally checked for validity).

The rounding error can result in deviations about the normalised value about 1. If inverted limits (XH/XL or YH/YL) are specified, the normalisation is also inverted.

Page 191: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-33

10.9. Processing analog values

Function

INPUT_VOLTAGE

Library

CRxxxx_x.LIB

Function symbol

Purpose Measures voltage at the analog channels.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

MODE_ 10V_32V

BOOL TRUE: Voltage range 0 ... 32 V

FALSE: Voltage range 0 ... 10 V

INPUT_ CHANNEL

BYTE Input channel

Function outputs

Name Data type Description

ACTUAL_ VOLTAGE

WORD Output voltage in mV

Description This function displays the current input voltage in mV at the selected analogchannel. The reading relates to the voltage range (10,000 mV or 32,000 mV)specified with MODE_10V_32V.

INPUT_VOLTAGE is a compatibility function for older programs. In new programs, use the more powerful INPUT_ANALOG function.

Page 192: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Processing analog values

10-34

Function

INPUT_CURRENT

Library

CR250x_LIB

Function symbol

Purpose Reads the analog current inputs.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

INPUT_ CHANNEL

BYTE Analog current inputs 4 ... 7

ACTUAL_ CURRENT

WORD Input current in µA

Description This function displays the current input current in µA at the analog currentinputs.

INPUT_CURRENT is a compatibility function for older programs. In new programs, use the more powerful INPUT_ANALOG function.

Page 193: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other functions of the ecomat type R 360

10-35

Function

INPUT_ANALOG

Library

CRxxxx_x.LIB

Function symbol

Purpose Current/voltage measurement at the analog channels.

Parameters Function inputs

Name Data type Description

ENABLE BOOL TRUE: The function is processed

FALSE: The function is not processed

MODE

BYTE IN_DIGITAL_H Digital input

IN_CURRENT 0 ... 20000 μA current input

IN_VOLTAGE10 0 ... 10000 mV voltage input

IN_VOLTAGE30 0 ... 30000 mV voltage input

IN_RATIO Ratiometric analog input

INPUT_ CHANNEL

BYTE Input channel

Function outputs

Name Data type Description

OUT WORD Output value

Description This function displays the current analog value at the selected analog channel.The reading and the output value result from the mode (digital input,0 ... 20 mA, 0 ... 10 V, 0 ... 30 V) specified with MODE. Use the above globalsystem variables for setting the mode. The analog values are output asstandardised values.

Page 194: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Function blocks as interface between IEC 61131-3 and C

10-36

10.10. Function blocks as interface between IEC 61131-3 and C

C_FB Passes a function call to the C code’s entry table. Any number of instances ofthe C object can be formed.

SET_C_1MS A C routine is attached to the operating system’s 1 ms task. An associated fastI/O routine is activated and processes a subset of inputs and outputs.

SET_C_EA The operating system’s I/O routine is replaced with a C routine.

SET_C_EA_ FAST

The operating system’s fast I/O routine for the 1 ms task is replaced with a Croutine.

All interrupts that are not used by the operating system are passed to the freeflash memory. An interrupt handler must therefore be included here. The vectoraddresses correspond with the original vector table + 0x70000.

Calling operating system routines from C

This can be done in two ways: through a branch table in the operating systemand using the IEC user program’s function table list (details on request).

Page 195: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

11-1

11. Closed-loop control functions in the ecomat type R 360 In closed-loop control, controller continually reads the value of the controlled variable (x), compares it with a reference input variable and – if there is a difference between the two values – adjusts the controlled variable accordingly.

To select and set up a suitable controller, you will need detailed information about the steady-state behaviour and the dynamic behaviour of the controlled system. In most cases, these characteristics can only be determined by experiment and can hardly be influenced.

Controlled systems can be broadly split into three types:

Controlled systems with compensation

In controlled systems with compensation, the controlled variable (x) tendstowards a new steady-state target value after a change in the manipulatedvariable. In these controlled systems, the gain (transfer coefficient KS) plays adecisive role: the smaller the gain, the better controllable is the system.

This type of controlled system is called proportional (or P) system.

Page 196: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Function blocks as interface between IEC 61131-3 and C

11-2

Controlled systems without compensation

Controlled systems with a gain factor tending towards infinity, are known asuncompensated controlled systems. This is usually due to an integratingbehaviour, which results in a steady rise of the controlled variable after achange in the manipulated variable or due to disturbance. This means that thetarget value is never reached.

This type of controlled system is called integral (or I) system.

Controlled systems with lag

Most controlled systems consist of P systems and one or more T1 systems(systems with lag). A first-order controlled system consists for example of achoke upstream of a series-connected vessel.

In controlled systems with delay, the controlled variable responds to a change in the manipulated variable only after the delay time Tt has expired. Delay Tt or the sum of Tt and Tu determines the controllability of the system: the higher the ratio Tg/Tu, the better controllable is the system.

The controllers contained in the library combine the above basic functions. Which combination of functions you use will depend on your controlled system.

Page 197: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-3

11.1. Setting method for closed-loop controllers For controlled systems whose time constants are not known, the setting procedure according to Ziegler and Nickols in the closed control circuit is recommended.

Setting method Initially, the controlling system is operated as a pure P controller. For a systemwith lag, set the rate time TV to 0 and the reset time TN to a large value (ideally∞). For a fast controlled system, choose a low value for TN. Then increase theproportional coefficient KP until the system deviation at KP = KPcrit oscillates atconstant amplitude. The stability limit is now reached. Then determine theperiod duration Tcrit of the oscillation. Only if necessary add a D (derivative)component. TV should be about 2 to 10 times less than TN and KP = KD.

The ideal settings would be as follows:

Controller setting

KP = KD TN TV

P 2.0 x KPcrit - -

PI 2.2 x KPcrit 0.83 x Tcrit -

PID 1.7 x KPcrit 0.50 x Tcrit 0.125 x Tcrit

When you use this setting method, make sure that the oscillations do not damage the controlled system. In sensitive controlled systems, do not increase KP to a value at which oscillation may occur.

Damping overshoot

To dampen overshoot, you can use the PT1 (low-pass) function. This uses the P-T1 element to dampen the setpoint value XS before passing it to the controller function. T1 should be about 4 to 5 times larger than TN (of the PID or GLR controller).

11.2. Controller function blocks This section provides a detailed description of the functions used to create software controllers within the control system. You can also use them as a basis for developing your own control functions.

Page 198: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-4

Function

DELAY

Library

CRxxxx_x.LIB

Function symbol

Purpose Delays the output of the input value by time T (lag element).

Parameters Function input

Name Data type Description

X WORD Input value

T TIME Delay

Function outputs

Name Data type Description

Y WORD Input value delays by time T

Description Function DELAY is used to delay an input value by time T.

Output variable y has the following time characteristic:

To work correctly, this function must be called in every cycle.

Page 199: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-5

Function

PT1

Library

CRxxxx_x.LIB

Function symbol

Purpose Controlled system with first-order delay.

Parameters Function inputs

Name Data type Description

X INT Input value

T1 TIME Delay time

Function outputs

Name Data type Description Y INT Output variable

Description Function PT1 is a proportional system with one time constant. It is used, forexample, to form ramps when using the PWM functions.

Output variable y of the low-pass filter has the following unit step response:

Function

PID

Page 200: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-6

Library

CRxxxx_x.LIB

Function symbol

Purpose PID control.

Parameters Function inputs

Name Data type Description

X WORD Actual value

XS WORD Setpoint value

XMAX WORD Maximum setpoint value

KP BYTE Constant of the P component (/10)

TN TIME Reset time (I component)

KD BYTE Proportional component of the D component (/10)

TV TIME Rate time (D component)

SO BOOL Self-optimisation

Function outputs

Name Data type Description

Y WORD Manipulated variable

Description The changes in the manipulated variable of a PID controller consist of aproportional, an integral and a differential component. The manipulated variableinitially changes by an amount that depends on the rate of change of the inputvariable (D component). After expiry of rate time TV, the manipulated variablegoes back to the value corresponding to the proportional range and thenchanges according to the reset time TN.

The values entered at function inputs KP and KD are internally divided by 10 to achieve a higher resolution (e.g. KP = 17 means 1.7).

Page 201: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-7

Variable Y is already normalised to the PWM function (RELOAD value = 65535). Observe the inverse logic (65535 = lowest value, 0 = largest value).

If X > XS, the variable increases.

If X < XS, the variable reduces.

A reference input variable is internally added to the value of the manipulated variable:

Y = Y + 65536 – (XS / XMAX x 65536).

Page 202: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-8

Variable y has the following time characteristic:

Typical step response of a PID controller

Page 203: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-9

Recommended settings

• Select TN according to the system’s time response (fast system: small TN;slow system: high TN)

• Gradually increase KP in small steps up to a value at which no oscillationswill yet occur.

• If necessary, adjust TN.

• Only if necessary add a D component, selecting a value for TV about 2 to10 times smaller than TN and set KD approximately to the value of KP.

Note that the maximum control deviation is +/- 127. For a good controlperformance, utilise this range as fully as possible without actually exceeding it.

Function input SO (self-optimisation) clearly improves the control performance.A precondition for achieving the desired characteristics:

• The controller is operated with I component (TN ≥ 50 ms)

• Parameters KP and especially TN are already well adjusted to the actualcontrolled system.

• The control range (X – XS) of +/- 127 is utilised (if necessary, increase thecontrol range by multiplying X, XS and XMAX).

When you have finished setting the parameters, you can set SO = TRUE. Thiswill significantly improve the control performance, especially reducingovershoot.

Example PI controller in a simulated system.

SO = FALSE

SO = TRUE

Page 204: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-10

Overshooting does not occur.

Example

Speed control with PID controller

Features:

• Double control range spread

• Self-optimisation

• Adaptation of controller output Y to a PWM function block. Adaptation of TNto the relatively slow system behaviour (rotating mass).

• Despite the D component, overshoot is relatively low.

Special feature The motor in the example already reaches its maximum speed at 20 % PWM.Function module NORM takes this into account.

Page 205: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-11

Example P controller

This P controller consists of a 2-point controller with P-T1 feedback and adownstream P-T1 element.

The controlled system is simulated.

This controller is particularly rugged and is therefore ideal for difficult systems.

Note the intended natural oscillation of the controller, which is caused by itsinternal feedback. The initial rough switching behaviour of the 2-point controlleris improved and the switching frequency increases.

Page 206: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-12

Page 207: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-13

Function

PID1

Library

CRxxxx_x.LIB

Function symbol

Purpose PID control

Parameters Function inputs

Name Data type Description

X WORD Actual value

XS WORD Setpoint value

XMAX WORD Maximum setpoint value

KP BYTE Constant of the P component

KI BYTE I component

KD BYTE Proportional component of the D component

Function outputs

Name Data type Description

Y WORD Manipulated variable

Description The changes in the manipulated variable of a PID controller consists of aproportional, an integral and a differential component. The manipulated variableinitially changes by an amount that depends on the rate of change of the inputvariable (D component). After expiry of rate time TV, the manipulated variablegoes back to the value corresponding to the proportional range and thenchanges according to the reset time.

Page 208: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-14

Variable Y is already normalised to the PWM function (RELOAD value = 65535). Observe the inverse logic (65535 = lowest value, 0 = largest value).

If X > XS, the variable increases.

If X < XS, the variable reduces.

Variable y has the following time characteristic:

Typical step response of a PID controller

Page 209: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-15

Recommended settings

• KP = 50

• KI = 30

• KD = 5

With the values specified above, control is both fast and stable withoutoscillations.

To optimise control performance, you can then change the values in steps.

Note that input variables KI and KD are dependent on the cycle time. For stable, reproducible control performance, call PID1 under time control.

Page 210: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-16

Function

GLR

Library

CRxxxx_x.LIB

Function symbol

Purpose Synchro control

Parameters Function inputs

Name Data type Description

X1 WORD Actual value, channel 1

X2 WORD Actual value, channel 2

XS WORD Setpoint value = reference input variable

XMAX WORD Maximum setpoint value

KP BYTE Constant of the P component (/10)

TN TIME Reset time (I component)

KD BYTE Proportional component of the D component (/10)

TV TIME Rate time (D component)

Function outputs

Name Data type Description

Y1 WORD Manipulated variable, channel 1

Y2 WORD Manipulated variable, channel 2

Page 211: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Closed-loop control functions in the ecomat type R 360

11-17

Description The synchro-controller is a controller with PID behaviour.

The values entered at function inputs KP and KD are internally divided by 10 to achieve a higher resolution (e.g. KP = 17 means 1.7).

Variables Y1 and Y2 are already normalised to the PWM function (RELOAD value = 65535). Observe the inverse logic (65535 = lowest value, 0 = largest value).

The manipulated variable for the higher actual value is increased, while the variable for the smaller actual value corresponds to the reference variable.

Reference variable = 65536 – (XS / XMAX x 65536).

Page 212: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Controller function blocks

11-18

Page 213: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

12-1

12. Appendix Address assignment, ecomat type R 360

12.1. Inputs CR0xxx/CR030x/CR250x

CR0xxx inputs Name Terminal IEC address Default Remark

I0 %IB0 Input byte 0 (%IX0.00...%IX0.07), port 0 ERROR_I0 Flag byte* Error byte, port 0 (%IX0.00...%IX0.07) 08 %IX0.00

%IW3 Digital input mode

Analog input mode I00_MODE %QB8 17 Configuration byte %IX0.00 / %IW3 27 %IX0.01

%IW4 Digital input mode

Analog input mode I01_MODE %QB9 17 Configuration byte %IX0.01 / %IW4 09 %IX0.02

%IW5 Digital input mode

Analog input mode I02_MODE %QB10 17 Configuration byte %IX0.02 / %IW5 28 %IX0.03

%IW6 Digital input mode

Analog input mode I03_MODE %QB11 17 Configuration byte %IX0.03 / %IW6 10 %IX0.04

%IW7 Digital input mode

Analog input mode I04_MODE %QB12 17 Configuration byte %IX0.04/ %IW7 29 %IX0.05

%IW8 Digital input mode

Analog input mode I05_MODE %QB13 17 Configuration byte %IX0.05/ %IW8 11 %IX0.06

%IW9 Digital input mode

Analog input mode I06_MODE %QB14 17 Configuration byte %IX0.06 / %IW9 30 %IX0.07

%IW10 Digital input mode

Analog input mode I07_MODE %QB15 17 Configuration byte %IX0.07 / %IW10

The default value 17 of configuration bytes I00_MODE to I07_MODE results as follows:

IN_DIGITAL_H (1) AND IN_VOLTAGE_30 (16) => 17.

The other values IN_VOLTAGE_10, etc. can be set only in Analog control mode.

Page 214: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Inputs CR0xxx/CR030x/CR250x

12-2

Name Terminal IEC address Default Remark

I1 %IB1 Input byte 1 (%IX0.08...%IX0.15), port 1 ERROR_I1 Flag byte* Error byte, port 1 (%IX0.08...%IX0.15) 44 %IX0.08 Digital input mode 45 %IX0.09 Digital input mode 46 %IX0.10 Digital input mode 47 %IX0.11 Digital input mode 20 %IX0.12 Digital input mode / fast Input FRQ0 I14_MODE %QB16 1 Configuration byte %IX0.12 02 %IX0.13 Digital input mode / fast Input FRQ1 I15_MODE %QB17 1 Configuration byte %IX0.13 21 %IX0.14 Digital input mode / fast Input FRQ2 I16_MODE %QB18 1 Configuration byte %IX0.14 38 %IX0.15 Digital input mode / fast Input FRQ3 I17_MODE %QB19 1 Configuration byte %IX0.15 I2 %IB2 Input byte 2 (%IX0.16...%IX0.23), port 2 ERROR_I2 Flag byte* Error byte, port 2 (%IX0.16...%IX0.23) 36 %IX0.16 Digital input mode 54 %IX0.17 Digital input mode 17 %IX0.18 Digital input mode 53 %IX0.19 Digital input mode 19 %IX0.20 Digital input mode / fast Input CYL0 I24_MODE %QB20 1 Configuration byte %IX0.20 55 %IX0.21 Digital input mode / fast Input CYL1 I25_MODE %QB21 1 Configuration byte %IX0.21 18 %IX0.22 Digital input mode / fast Input CYL2 I26_MODE %QB22 1 Configuration byte %IX0.22 37 %IX0.23 Digital input mode / fast Input CYL3 I27_MODE %QB23 1 Configuration byte %IX0.23

Page 215: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-3

Name Terminal IEC address Default Remark

I3 %IB3 Input byte 3 (%IX0.24...%IX0.31), port 3

ERROR_I3 Flag byte* Error byte, port 3 (%IX0.24...%IX0.31) 39 %IX0.24 Digital input mode I30_MODE %QB24 1 Configuration byte %IX0.24 03 %IX0.25 Digital input mode I31_MODE %QB25 1 Configuration byte %IX0.25 40 %IX0.26 Digital input mode I32_MODE %QB26 1 Configuration byte %IX0.26 22 %IX0.27 Digital input mode I33_MODE %QB27 1 Configuration byte %IX0.27 41 %IX0.28 Digital input mode I34_MODE %QB28 1 Configuration byte %IX0.28 42 %IX0.29 Digital input mode I35_MODE %QB29 1 Configuration byte %IX0.29 43 %IX0.30 Digital input mode I36_MODE %QB30 1 Configuration byte %IX0.30 04 %IX0.31 Digital input mode I37_MODE %QB31 1 Configuration byte %IX0.31 I4 %IB4 Input byte 4 (%IX0.32...%IX0.39), port 4 ERROR_I4 Flag byte* Error byte, port 4 (%IX0.32...%IX0.39) 48 %IX0.32 Digital input mode I40_MODE %QB32 1 Configuration byte %IX0.32 49 %IX0.33 Digital input mode I41_MODE %QB33 1 Configuration byte %IX0.33 31 %IX0.34 Digital input mode I42_MODE %QB34 1 Configuration byte %IX0.34 50 %IX0.35 Digital input mode I43_MODE %QB35 1 Configuration byte %IX0.35 51 %IX0.36 Digital input mode I44_MODE %QB36 1 Configuration byte %IX0.36 52 %IX0.37 Digital input mode I45_MODE %QB37 1 Configuration byte %IX0.37 16 %IX0.38 Digital input mode I46_MODE %QB38 1 Configuration byte %IX0.38 35 %IX0.39 Digital input mode I47_MODE %QB39 1 Configuration byte %IX0.39

Page 216: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Inputs CR0xxx/CR030x/CR250x

12-4

Note for input byte I4 (%IX0.32...%QX0.39)

Only when the corresponding output channel in output byte 4 is disabled (OUT_NOMODE) can the corresponding input in input byte I4 be used.

Note for ExtendedController

Symbolic names with suffix _E (for example ANALOG0_E) denote system addresses in the ExtendedController’s slave module. They have the same functions as the addresses in the master module.

Possible control modes, inputs CR0xxx:

Byte I0, 0 ... 7 IN_NOMODE 0 IN_DIGITAL_H (plus) 1 (default) IN_CURRENT 4 IN VOLTAGE10 8 IN_VOLTAGE30 16 (default) IN_RATIO 32 IN_DIAGNOSIC 64 Byte I1 4 ... 7 IN_NOMODE 0 IN_DIGITAL_H (plus) 1 (default) IN_DIAGNOSIC 64 IN_FAST 128 Byte I2 4 ... 7 IN_NOMODE 0 IN_DIGITAL_H (plus) 1 (default) IN_DIGITAL_L (minus) 2 IN_DIAGNOSIC 64 IN_FAST 128 Byte I3 0 ... 7 IN_NOMODE 0 IN_DIGITAL_H (plus) 1 (default) IN_DIGITAL_L (minus) 2 IN_DIAGNOSIC 64 Byte I4 0 ... 7 IN_NOMODE 0 IN_DIGITAL_H (plus) 1 (default) IN_DIAGNOSIC 64 Possible configuration combinations are created by adding the values.

* Addresses can differ depending on controller configuration.

Page 217: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-5

CR03xx inputs Name Terminal IEC address Default Remark

ANALOG_ARRAY %IW13 Raw data analog conversion (not for application: evaluation through function block)

ANALOG0_4_MODE %QB30 Configuration byte, analog channels 0 and 4 X2.1

X2.7 Access to analog value via the function block

INPUT_ANALOG ERROR_A_IN0 Flag bit* Analog value 0 outside valid range ERROR_A_IN4 Flag bit* Analog value 4 outside valid range ANALOG1_5_MODE %QB31 Configuration byte, analog channels 1 and 5 X2.2

X2.8 Access to analog value via the function block

INPUT_ANALOG ERROR_A_IN1 Flag bit* Analog value 1 outside valid range ERROR_A_IN5 Flag bit* Analog value 5 outside valid range ANALOG2_6_MODE %QB32 Configuration byte, analog channels 2 and 6 X2.3

X2.9 Access to analog value via the function block

INPUT_ANALOG ERROR_A_IN2 Flag bit* Analog value 2 outside valid range ERROR_A_IN6 Flag bit* Analog value 6 outside valid range ANALOG3_7_MODE %QB33 Configuration byte, analog channels 3 and 7 X2.4

X2.10 Access to analog value via the function block

INPUT_ANALOG ERROR_A_IN3 Flag bit* Analog value 3 outside valid range ERROR_A_IN7 Flag bit* Analog value 7 outside valid range IN0 %IX1.0 Digital input IN0 IN1 %IX1.8 Digital input IN1 IN2 %IX2.0 Digital input IN2 IN3 %IX2.8 Digital input IN3 IN4 %IX3.0 Digital input IN4 IN5 %IX3.8 Digital input IN5 IN6 %IX4.0 Digital input IN6 IN7 %IX4.8 Digital input IN7 IN8 %IX5.0 Digital input IN8 / schneller Eingang FRQ0/CYL0 IN9 %IX5.8 Digital input IN9 / schneller Eingang FRQ1/CYL1 IN10 %IX6.0 Digital input IN10 / schneller Eingang FRQ2/CYL2 IN11 %IX6.8 Digital input IN11 / schneller Eingang FRQ3/CYL3 IN12 %IX7.0 Digital input IN12 IN13 %IX7.8 Digital input IN13 IN12_13_MODE %QB28 Configuration byte, inputs IN12 and IN13 IN14 %IX8.0 Digital input IN14 IN15 %IX8.8 Digital input IN15 IN14_15_MODE %QB29 Configuration byte, inputs IN12 and IN13

Page 218: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Inputs CR0xxx/CR030x/CR250x

12-6

Name Terminal IEC address Default Remark

DIP0 %IX9.0 DIP switch block switch position 0 DIP1 %IX9.8 DIP switch block switch position 1 DIP2 %IX10.0 DIP switch block switch position 2 DIP3 %IX10.8 DIP switch block switch position 3 DIP4 %IX11.0 DIP switch block switch position 4 DIP5 %IX11.8 DIP switch block switch position 5 DIP6 %IX12.0 DIP switch block switch position 6 DIP7 %IX12.8 DIP switch block switch position 7

Possible control modes, inputs CR03xx:

ANALOG0 / 4 ANALOG1 / 5 ANALOG2 / 6 ANALOG3 / 7: Voltage 0 ... 10V 0 Voltage 0 ... 32 V 1 (default) Current 0 ... 20 mA 2 Ratiometric 0 ... 32 V 3 Digital IN 4

(configuration via the function block INPUT_ANALOG)

IN12 / IN13 IN 14 / 15: Digital IN high (plus) 0 Digital IN low (minus) 2

* Addresses can differ depending on controller configuration.

Page 219: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-7

CR25xx inputs Name Terminal IEC address Default Remark

I0 ANALOG0 40 %IX0.0

%IW2 Digital input mode (FRQ0/CYL0)

Diagnostic information if I0_MODE = IN_DIAGNOSTIC ERROR_I0 Flag bit* Diagnostic bit, input I0 I0_MODE %QB4 0 Configuration byte %IX0.00 I1 ANALOG1 41 %IX0.1

%IW3 Digital input mode (FRQ1/CYL1)

Diagnostic information if I1_MODE = IN_DIAGNOSTIC ERROR_I1 Flag bit* Diagnostic bit, input I1 I1_MODE %QB5 0 Configuration byte %IX0.01 I2 ANALOG2 52 %IX0.2

%IW4 Digital input mode

Diagnostic information if I2_MODE = IN_DIAGNOSTIC ERROR_I2 Flag bit* Diagnostic bit, input I2 I2_MODE %QB6 0 Configuration byte %IX0.02 I3 ANALOG3 53 %IX0.3

%IW5 Digital input mode

Diagnostic information if I3_MODE = IN_DIAGNOSTIC ERROR_I3 Flag bit* Diagnostic bit, input I3 I3_MODE %QB7 0 Configuration byte %IX0.03

ANALOG4 46 %IW6 Analog input mode (digital processing is also possible)

ERROR_I4 Flag bit* Diagnostic bit, input I4 I4_MODE %QB8 3 Configuration byte %IW6

ANALOG5 47 %IW7 Analog input mode (digital processing is also possible)

ERROR_I5 Flag bit* Diagnostic bit, input I5 I5_MODE %QB9 3 Configuration byte %IW7

ANALOG6 48 %IW8 Analog input mode (digital processing is also possible)

ERROR_I6 Flag bit* Diagnostic bit, input I6 I6_MODE %QB10 3 Configuration byte %IW8

ANALOG7 49 %IW9 Analog input mode

(digital processing is also possible)

ERROR_I7 Flag bit* Diagnostic bit, input I7 I07_MODE %QB11 3 Configuration byte %IW9 SAMPELS %QB12 4 Number of analog conversions for mean value calculation

Possible control modes, inputs CR25xx:

I0...I3 IN_DIGITAL 0 (default) IN_DIAGNOSIC 4 I4...I7 IN_CURRENT 1 IN_VOLTAGE10 2 IN_VOLTAGE32 3 (default) IN_DIAGNOSIC 4

Page 220: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Outputs CR0xxx/CR030x/CR250x

12-8

12.2. Outputs CR0xxx/CR030x/CR250x

CR0xxx outputs Name Terminal IEC address Default Remark

Q1Q2 %QB0 Output byte 0 (%QX0.00...%QX0.07), port 1/2 ERROR_SHORT_Q1Q2 Flag byte* Error byte 1/2, short circuit (%QX0.00...%QX0.07)ERROR_BREAK_Q1Q2 Flag byte* Error byte 1/2, open circuit (%QX0.00...%QX0.07) 44 %QX0.00 Digital output mode Q10_MODE %QB40 1 Configuration byte %QX0.00 / PWM0 45 %QX0.01 Digital input mode Q11_MODE %QB41 1 Configuration byte %QX0.01 / PWM1 46 %QX0.02 Digital output mode Q12_MODE %QB42 1 Configuration byte %QX0.02 / PWM2 47 %IQ0.03 Digital output mode Q13_MODE %QB43 1 Configuration byte %QX0.03 / PWM3 36 %QX0.04 Digital output mode Q20_MODE %QB44 1 Configuration byte %QX0.04 / PWM4 54 %QX0.05 Digital output mode Q21_MODE %QB45 1 Configuration byte %QX0.05 / PWM5 17 %QX0.06 Digital output mode Q22_MODE %QB46 1 Configuration byte %QX0.06 / PWM6 53 %IQ0.07 Digital output mode Q23_MODE %QB47 1 Configuration byte %QX0.07 / PWM7

Page 221: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-9

Name Terminal IEC address Default Remark

Q3 %QB1 Output byte 1 (%QX0.08...%QX0.15), port 3 ERROR_SHORT_Q3 Flag byte* Error byte 3, short circuit (%QX0.08...%QX0.15) ERROR_BREAK_Q3 Flag byte* Error byte 3, open circuit (%QX0.08...%QX0.15) 39 %QX0.08 Digital output mode Q30_MODE %QB48 1 Configuration byte %QX0.08 03 %QX0.09 Digital output mode Q31_MODE %QB49 1 Configuration byte %QX0.09 40 %QX0.10 Digital output mode Q32_MODE %QB50 1 Configuration byte %QX0.10 22 %IQ0.11 Digital output mode Q33_MODE %QB51 1 Configuration byte %QX0.11 41 %QX0.12 Digital output mode Q34_MODE %QB52 1 Configuration byte %QX0.12 42 %QX0.13 Digital output mode Q35_MODE %QB53 1 Configuration byte %QX0.13 43 %QX0.14 Digital output mode Q36_MODE %QB54 1 Configuration byte %QX0.14 04 %QX0.15 Digital output mode Q37_MODE %QB55 1 Configuration byte %QX0.15 Q4 %QB2 Output byte 2 (%QX0.16...%QX0.23), port 4 ERROR_SHORT_Q4 Flag byte* Error byte 4, short circuit (%QX0.16...%QX0.23) ERROR_BREAK_Q4 Flag byte* Error byte 4, open circuit (%QX0.16...%QX0.23) 48 %QX0.16 Digital output mode Q40_MODE %QB56 0 Configuration byte %QX0.16 / PWM8 49 %QX0.17 Digital output mode Q41_MODE %QB57 0 Configuration byte %QX0.17 / H link 31 %QX0.18 Digital output mode Q42_MODE %QB58 0 Configuration byte %QX0.18 / H link 50 %QX0.19 Digital output mode Q43_MODE %QB59 0 Configuration byte %QX0.19 / PWM9 51 %QX0.20 Digital output mode Q44_MODE %QB60 0 Configuration byte %QX0.20 / PWM10 52 %QX0.21 Digital output mode Q45_MODE %QB61 0 Configuration byte %QX0.21 / H link 16 %QX0.22 Digital output mode Q46_MODE %QB62 0 Configuration byte %QX0.22 / H link 35 %QX0.23 Digital output mode Q47_MODE %QB63 0 Configuration byte %QX0.23 / PWM11

Page 222: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Outputs CR0xxx/CR030x/CR250x

12-10

Note for output byte I4 (%QX0.16...%QX0.23)

Only when the corresponding output channel in output byte 4 is disabled (OUT_NOMODE) can the corresponding input in input byte I4 be used.

Note for ExtendedController

Symbolic names with suffix _E (for example Q30_MODE_E) denote system addresses in the ExtendedController’s slave module. They have the same functions as the addresses in the master module.

Possible control modes, outputs CR0xxx:

Byte Q1Q2, 0 ... 7 OUT_NOMODE 0 OUT_DIGITAL_H (plus) 1 (Default) OUT_CURRENT 4 OUT_DIAGNOSIC 64 OUT_OVERLOAD_PROTECTION 128 (Default) Byte Q3, 0 ... 7 OUT_NOMODE 0 OUT_DIGITAL_H (plus) 1 (Default) OUT_DIAGNOSIC 64 Byte Q4. 0,4,5,7 OUT_NOMODE 0 OUT_DIGITAL_H (plus) 1 (Default) OUT_DIAGNOSIC 64 Byte Q4 1,2,5,6 OUT_NOMODE 0 (Default) OUT_DIGITAL_H (plus) 1 OUT_DIGITAL_L (minus) 2 OUT_DIAGNOSIC 64 Possible configuration combinations are created by adding the values.

* Addresses can differ depending on controller configuration.

Page 223: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-11

CR03xx outputs Name Termi-

nal IEC address Default Remark

LED0 %QX9.0 LED block, LED position 1 LED1 %QX9.8 LED block, LED position 2 LED2 %QX10.0 LED block, LED position 3 LED3 %QX10.8 LED block, LED position 4 LED4 %QX11.0 LED block, LED position 5 LED5 %QX11.8 LED block, LED position 6 LED6 %QX12.0 LED block, LED position 7 LED7 %QX12.8 LED block, LED position 8 LED8 %QX13.0 LED block, LED position 9 LED9 %QX13.8 LED block, LED position 10 OUT0 X3.1 %QX0.0 Digital output OUT0 / PWM0 OUT1 X3.2 %QX0.8 Digital output OUT1 / PWM1 OUT2 X3.3 %QX1.0 Digital output OUT2 / PWM2 OUT3 X3.4 %QX1.8 Digital output OUT3 / PWM3 OUT4 X3.6 %QX2.0 Digital output OUT4 OUT5 X3.7 %QX2.8 Digital output OUT5 OUT6 X3.8 %QX3.0 Digital output OUT6 OUT7 X3.9 %QX3.8 Digital output OUT7 OUT8 X5.4 %QX4.0 Digital output OUT8 (CR0301) OUT8 X5_1.1

X5_1.2 X5_1.3

%QX4.0 Digital output OUT8 (CR0302)

OUT9 %QX4.8 Digital output OUT9 (CR0301) OUT9 X5_1.5

X5_1.6 X5_1.7

%QX4.8 Digital output OUT9 (CR0302)

OUT10 %QX5.0 Digital output OUT10 (CR0301) OUT10 X5_1.9

X5_1.10 X5_1.11

%QX5.0 Digital output OUT10 (CR0302)

OUT11 %QX5.8 Digital output OUT11 (CR0301) OUT11 X5_1.13

X5_1.14 X5_1.15

%QX5.8 Digital output OUT11 (CR0302)

Page 224: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Outputs CR0xxx/CR030x/CR250x

12-12

Name Termi-nal

IEC address Default Remark

OUT12 X5_1.16 X5_1.17 X5_1.18

%QX6.0 Digital output OUT12 (CR0302)

OUT13 X5_2.1 X5_2.2 X5_2.3

%QX6.8 Digital output OUT13 (CR0302)

OUT14 X5_2.5 X5_2.6 X5_2.7

%QX7.0 Digital output OUT14 (CR0302)

OUT15 X5_2.9 X5_2.10 X5_2.11

%QX7.8 Digital output OUT15 (CR0302)

OUT16 X5_2.13 X5_2.14 X5_2.15

%QX8.0 Digital output OUT16 (CR0302)

OUT17 X5_2.16 X5_2.17 X5_2.18

%QX8.8 Digital output OUT17 (CR0302)

Page 225: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-13

CR25xx outputs Name Termi-

nal IEC address Default Remark

Q0 38 %QX0.0 Digital output mode / PWM0 ERROR_Q0 Flag bit* Diagnostic bit, output Q0 (group bit) Q1 39 %QX0.8 Digital input mode / PWM1 ERROR_Q1 Flag bit* Diagnostic bit, output Q0 (group bit) Q2 54 %QX1.0 Digital output mode / PWM2 ERROR_Q2 Flag bit* Diagnostic bit, output Q0 (group bit) Q3 55 %QX1.8 Digital output mode / PWM3 ERROR_Q3 Flag bit* 1 Diagnostic bit, output Q0 (group bit)

For a detailed fault analysis, the output current must be monitored, from which the exact fault status (open circuit, overload, short circuit) can be derived.

* Addresses can differ depending on controller configuration.

Page 226: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

The R 360 flag range

12-14

12.3. The R 360 flag range Content Flag address Remark

TX PDOs %MW 2032 64 bytes TX PDOs

RX PDOs %MW 2000 64 bytes RX PDOs

Data from manufacturer-specific area of CANopen OBV

%MW 1127

%MW 1000

127 words / 256 bytes (%MB2000 ... %MB2255)

Access through OBV index 2000 ... 2003

Retentive

data

%MW 511

%MW 0

1024 bytes / 511 words

(Classic/ExtendedController only)

Retentive

data

%MW 127

% MW 0

256 bytes/127 words retentive data

(CR25xx and CR03xx only)

The above flag range can be used freely in the application program. The remaining flag range is used by the programming. Whether it is available to the user must be determined in each case. If possible, therefore, do not use direct addressing.

Page 227: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-15

12.4. Other system flags Symbol Description

LED Set LED colour (green/blue) (Classic/ExtendedController only)

SUPPLY_VOLTAGE Supply voltage

RELAIS Relay bit (Classic/ExtendedController only)

RELAY_CLAMP_15 Terminal 15 relay (Classic/ExtendedController only)

CLAMP_15 (%IX12.0) Monitoring, trm. 15 (Classic/ExtendedController only)

CLAMP_15_E (%IX44.0) Monitoring, trm. 15 (Slave ExtendedController only)

ERROR Set error bit (see remark)

ERROR_IO I/O error (group bit) (CR25xx and CR03xx only)

TEST Enable programming mode (FALSE)

DEBUG Enable communication mode (FALSE)

SERIAL_MODE Enable serial communication (FALSE)

SERIALBAUDRATE Baud rate of the RS 232 interface (Classic/ExtendedController only)

CANBAUDRATE Currently set CAN baud rate, interface 1

CAN_ERROR CAN bus error (group fault), interface 1

CAN_INIT_ERROR CAN initialisation error, interface 1

CAN_BUS_OFF_ERROR CAN bus-off error, interface 1

CAN_DATA_ERROR CAN data error, interface 1

CAN_TX_OVERRUN_ERROR CAN TX overrun error, interface 1

CAN_RX_OVERRUN_ERROR CAN RX overrun error, interface 1

CAN2_ERROR CAN bus error (group fault), interface 2 (not CR03xx)

CAN2_INIT_ERROR CAN initialisation error, interface 2 (not CR03xx)

CAN2_BUS_OFF_ERROR CAN bus-off error, interface 2 (not CR03xx)

CAN2_DATA_ERROR CAN data error, interface 2 (not CR03xx)

CAN2_TX_OVERRUN_ERROR CAN TX overrun error, interface 2 (not CR03xx)

CAN2_RX_OVERRUN_ERROR CAN RX overrun error, interface 2 (not CR03xx)

CAN_OPEN Enable CANopen mode (FALSE)

COP_EVENT_RESETCOM Communication reset was triggered by master

COP_EVENT_RESETNODE Node reset was triggered by master

Page 228: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Other system flags

12-16

Symbol Description

COP_GUARDING_AGAIN Restart node guarding after node reset

COP_GUARDFAIL_ERROR No guarding object

COP_GUARDFAIL_NODEID Number of missing CANopen slave

COP_PREOPERATIONAL CANopen mode Pre-Operational

COP_PRESYNC Presync flag

COP_SYNC Sync flag

COP_SYNCFAIL_ERROR No SYNC object

NODEID Currently set node number

ERROR_MEMORY Memory error

ERROR_POWER Under/overvoltage error

ERROR_TEMPERATUR Overtemperature error (> 85 °C)

TEXT_KEY_F1 Function key F1, compact display

TEXT_KEY_F2 Function key F2, compact display

TEXT_KEY_F3 Function key F3, compact display

TEXT_KEY_ESC ESC key, compact display

TEXT_KEY_LEFT Left arrow key, compact display

TEXT_KEY_RIGHT Right arrow key, compact display

TEXT_KEY_DOWN Down arrow key, compact display

TEXT_KEY_UP Up arrow key, compact display

TEXT_KEY_ENTER Enter key, compact display

TEXT_LED_F1 LED function key F1, compact display

TEXT_LED_F2 LED function key F1, compact display

TEXT_LED_F3 LED function key F1, compact display

TEXT_MODE CAN communication, compact display (FALSE)

Symbolic names with suffix _E (for example CAN_ERROR_E) denote system addresses in the ExtendedController’s slave module. They have the same functions as the addresses in the master module.

Page 229: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-17

Use only the symbolic names for programming, since the associated flag addresses can change when the control configuration is extended.

Special characteristics of the ERROR flag and the ERROR output

In controllers CR0020, CR0200 and CR0505, output ERROR (terminal 13) is set FALSE when system flag ERROR is set. Under no-fault conditions, the ERROR output is TRUE (negative logic).

Page 230: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

CANopen device interface ecomat type R 360

12-18

12.5. CANopen device interface ecomat type R 360 • This device is classified and marked as “programmable device” according

to CiA DS 405.

• One server SDO and the four default PDOs are set up according to CiA DS 401. The default identifiers are assigned according to the predefined connection set. In addition, 2 x 6 PDOs are available for the user.

• The PDO’s COB IDs and the transfer mode (synch/asynch) of the individual PDOs can be configured.

• In Slave mode, the I/O module expects a SYNC object. The synch object’s CAN identifier can be configured. After a change, the ID is automatically saved in non-volatile memory.

• In Master mode, the I/O module generates a SYNC object. The synch object’s CAN identifier can be configured. After a change, the ID is automatically saved in non-volatile memory.

• The I/O module supports node guarding. The guard time, the life time factor and the CAN guard object’s identifier can be configured and are saved in non-volatile memory.

• The I/O module generates an emergency object. The EMCY object’s COB ID can be configured.

Page 231: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-19

Parameter overview

Parameters Factory default value Changes saved automatically

Valid after

Node ID 32 X Reset

Baud rate 3 (125 Kbit/s) X Reset

Synch object COB ID 0x80 X Immediately

Communication Cycle 0 (Off) X Immediately

Guard Time 0 (Off) X Immediately

Life Time Factor 0 (Off) X Immediately

COB ID Guarding 0x70 + Node ID X Immediately

COB ID EMCY 0x80 + Node ID X Immediately

Transmit Type Receive PDO1 Asynchronous – Operational*

Transmit Type Receive PDO2 Asynchronous – Operational*

Transmit Type Transmit PDO1 Asynchronous – Operational*

Transmit Type Transmit PDO2 Asynchronous – Operational*

COP ID Receive PDO1 0x200 + Node ID – Immediately

COP ID Receive PDO2 0x300 + Node ID – Immediately

COP ID Transmit PDO1 0x180 + Node ID – Immediately

COP ID Transmit PDO2 0x280 + Node ID – Immediately

* The change with PDO_RX_CONFIG and PDO_TX_CONFIG results in a CANopen reset. This resets all settings that have not been saved to their default values. A two-stage boot-up must therefore be performed.

Page 232: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Object directory of the ecomat type R 360

12-20

12.6. Object directory of the ecomat type R 360

Communication profile data range, index 1000 to 1FFF

Index S-Idx Name Type Default Description

1000 0 device type u32 ro 0x195 Profil 405; programable device

1001 0 error register u8 ro 0x0 Bitmapped according to Profil 301. Supported are:

0b0000 0000 no error

0b0000 0001 generic error

0b0001 0000 communication error

0b1000 0000 manufacturer-specific error

1004 0 number of PDOs u32 ro 0x20002 2 transmit PDOs

2 receive PDOs

1 number of synch PDOs

u32 ro 0x20002 All PDOs can be transmitted synchronously or asynchronously

2 number of asynch PDOs

u32 ro 0x20002 All PDOs can be transmitted synchronously or asynchronously

1005 0 COB ID SYNC-Object u32 rw 0x80000080 CAN identifier of the SYNC object

1006 0 Communic. Cycle u32 rw 0x0 Max. time between 2 SYNC objects in µs.

Effective resolution: 1 ms

1007 0 synch window Is not implemented

1008 0 device name str ro ecomat 100 R 360

Device name: “ecomat 100 R 360”

1009 0 HW version str ro CRxxxx_x Operating system version

100A 0 SW version str ro yymmdd Software date

100B 0 Node ID u32 ro For enquiry only

100C 0 guard time u16 rw 0x0 Time in ms.

The device expects a node guarding signal from the

Page 233: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-21

Index S-Idx Name Type Default Description

network master within this time. Set to 0, this function is not supported.

100D 0 life time factor u8 rw 0x0 If no node guarding response is received for (guard time x lifetime) the device reports an error COP_GUARDFAIL_ERROR

100E 0 COB ID guarding u32 rw 0x00000700+ Node ID

CAN identifier of node guarding object

100F 0 number of SDOs Not implemented

(only the default SDO is supported)

1012 0 Time Stamp Not implemented

1013 0 high res. Time Stamp Not implemented

1014 0 COB ID Emergcy u32 rw 0x40000080+Node ID

I/O module does not respond to external EMCY message (bit 31 = 0)

I/O module generates EMCY message (bit 30 = 1)

11-bit ID (bit 29 = 0)

ID = 0x80 + node ID CAN identifier can be changed by user.

1200 0 Server SDOs u8 ro 0x02 Number of entries

1 COB ID Rec SDO u32 rw 0x600+ID SDO is valid (bit 31 = 0)

CAN ID of Receive SDO

2 COB ID Trans SDO u32 rw 0x580+ Node ID

SDO is valid (bit 31 = 0)

CAN ID of Transmit SDO

Page 234: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Object directory of the ecomat type R 360

12-22

1400 0 Receive PDO 1 u8 ro 0x02 Number of entries, RX PDO 1

1 COB ID u32 rw 0x200 +

Node ID

PDO is valid (bit 31 = 0)

CAN ID of first RX PDO

2 Trans Type u8 rw 0xFF 0x00 = synch acyclic

0x01 ... 0xF0 = synch cyclic; Number of Synch objects between two access runs

0xFC Not implemented

0xFD Not implemented

0xFE = asynch manufac. specific event

0xFF = asynch device profile event

1401 0 Receive PDO 2 u8 ro 0x02 Number of entries, RX PDO 2

1 COB ID u32 rw 0x300 +

Node ID

PDO is valid (bit 31 = 0)

CAN ID of second RX PDO

2 Trans Type u8 rw 0xFF Permissible values as for RX PDO1

1402 0 Receive PDO 3 u8 ro 0x02 Number of entries, RX PDO 3

1 COB ID u32 rw 0x382 PDO is valid (bit 31 = 0)

CAN ID of third RX PDO

2 Trans Type u8 rw 0xFF Permissible values as for RX PDO1

1403 0 Receive PDO 4 u8 ro 0x02 Number of entries, RX PDO 4

1 COB ID u32 rw 0x383 PDO is valid (bit 31 = 0)

CAN ID of fourth RX PDO

2 Trans Type u8 rw 0xFF Permissible values as for RX PDO1

Page 235: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-23

1404 0 Receive PDO 5 u8 ro 0x02 Number of entries, RX PDO 5

1 COB ID u32 rw 0x384 PDO is valid (bit 31 = 0)

CAN ID of fifth RX PDO

2 Trans Type u8 rw 0xFF Permissible values as for RX PDO1

1405 0 Receive PDO 6 u8 ro 0x02 Number of entries, RX PDO 6

1 COB ID u32 rw 0x385 PDO is valid (bit 31 = 0)

CAN ID of sixth RX PDO

2 Trans Type u8 rw 0xFF Permissible values as for RX PDO1

1406 0 Receive PDO 7 u8 ro 0x02 Number of entries, RX PDO 7

1 COB ID u32 rw 0x386 PDO is valid (bit 31 = 0)

CAN ID of seventh RX PDO

2 Trans Type u8 rw 0xFF Permissible values as for RX PDO1

1407 0 Receive PDO 8 u8 ro 0x02 Number of entries, RX PDO 8

1 COB ID u32 rw 0x387 PDO is valid (bit 31 = 0)

CAN ID of eighth RX PDO

2 Trans Type u8 rw 0xFF Permissible values as for RX PDO1

Page 236: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Object directory of the ecomat type R 360

12-24

1600 0 Mapping Receive PDO 1

u32 ro 0x04 Number of linked appl. objects

1 Index in object directory u32 ro 0x5800 01 5800 SIdx 01 contains 1. word

Received data RX PDO 1

2 Index in object directory u32 ro 0x5800 02 5800 SIdx 02 contains 2. word

Received data RX PDO 1

3 Index in object directory u32 ro 0x5800 03 5800 SIdx 03 contains 3. word

Received data RX PDO 1

4 Index in object directory u32 ro 0x5800 04 5800 SIdx 04 contains 4. word

Received data RX PDO 1

1601 0 Mapping Receive PDO 2

u32 ro 0x04 Number of linked appl. objects

1 Index in object directory u32 ro 0x5810 01 5810 SIdx 01 contains 1. word

Received data RX PDO 2

2 Index in object directory u32 ro 0x5810 02 5810 SIdx 02 contains 2. word

Received data RX PDO 2

3 Index in object directory u32 ro 0x5810 03 5810 SIdx 03 contains 3. word

Received data RX PDO 2

4 Index in object directory u32 ro 0x5810 04 5810 SIdx 04 contains 4. word

Received data RX PDO 2

1602 0 Mapping Receive PDO 3

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0x5820 01 5820 SIdx 01 contains 1. word

Received data RX PDO 3

2 Index in object directory u32 ro 0x5820 02 5820 SIdx 02 contains 2. word

Received data RX PDO 3

3 Index in object directory u32 ro 0x5820 03 5820 SIdx 03 contains 3. word

Received data RX PDO 3

4 Index in object directory u32 ro 0x5820 04 5820 SIdx 04 contains 4. word

Received data RX PDO 3

Page 237: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-25

1603 0 Mapping Receive PDO 4

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0x5830 01 5830 SIdx 01 contains 1. word

Received data RX PDO 4

2 Index in object directory u32 ro 0x5830 02 5830 SIdx 02 contains 2. word

Received data RX PDO 4

3 Index in object directory u32 ro 0x5830 03 5830 SIdx 03 contains 3. word

Received data RX PDO 4

4 Index in object directory u32 ro 0x5830 04 5830 SIdx 04 contains 4. word

Received data RX PDO 4

1604 0 Mapping Receive PDO 5

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0x5840 01 5840 SIdx 01 contains 1. word

Received data RX PDO 5

2 Index in object directory u32 ro 0x5840 02 5840 SIdx 02 contains 2. word

Received data RX PDO 5

3 Index in object directory u32 ro 0x5840 03 5840 SIdx 03 contains 3. word

Received data RX PDO 5

4 Index in object directory u32 ro 0x5840 04 5840 SIdx 04 contains 4. word

Received data RX PDO 5

1605 0 Mapping Receive PDO 6

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0x5850 01 5850 SIdx 01 contains 1. word

Received data RX PDO 6

2 Index in object directory u32 ro 0x5850 02 5850 SIdx 02 contains 2. word

Received data RX PDO 6

3 Index in object directory u32 ro 0x5850 03 5850 SIdx 03 contains 3. word

Received data RX PDO 6

4 Index in object directory u32 ro 0x5850 04 5850 SIdx 04 contains 4. word

Received data RX PDO 6

Page 238: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Object directory of the ecomat type R 360

12-26

1606 0 Mapping Receive PDO 7

u32 ro 0x04 Number of linked appl. objects

1 Index in object directory u32 ro 0x5860 01 5860 SIdx 01 contains 1. word

Received data RX PDO 7

2 Index in object directory u32 ro 0x5860 02 5860 SIdx 02 contains 2. word

Received data RX PDO 7

3 Index in object directory u32 ro 0x5860 03 5860 SIdx 03 contains 3. word

Received data RX PDO 7

4 Index in object directory u32 ro 0x5860 04 5860 SIdx 04 contains 4. word

Received data RX PDO 7

1607 0 Mapping Receive PDO 8

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0x5870 01 5870 SIdx 01 contains 1. word

Received data RX PDO 8

2 Index in object directory u32 ro 0x5870 02 5870 SIdx 02 contains 2. word

Received data RX PDO 8

3 Index in object directory u32 ro 0x5870 03 5870 SIdx 03 contains 3. word

Received data RX PDO 8

4 Index in object directory u32 ro 0x5870 04 5870 SIdx 04 contains 4. word

Received data RX PDO 8

1800 0 Transmit PDO 1 u8 ro 0x02 Number of entries, TX PDO 1

1 COB ID u32 rw 0x180 +

Node ID

PDO is valid (bit 31 = 0)

CAN ID of first TX PDO

2 Trans Type u8 rw 0xFF 0x00 = synch acyclic

0x01 ... 0xF0 = synch cyclic; Number of Synch objects between two access runs

0xFC Not implemented

0xFD Not implemented

0xFE = asynch manufac. specific event

0xFF = asynch device

profile event

Page 239: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-27

1801 0 Transmit PDO 2 u8 ro 0x02 Number of entries, TX PDO 2

1 COB ID u32 rw 0x280 +

Node ID

PDO is valid (bit 31 = 0)

CAN ID of second TX PDO

2 Trans Type u8 rw 0xFF Permissible values as for

TX PDO1

1802 0 Transmit PDO 3 u8 ro 0x02 Number of entries, TX PDO 3

1 COB ID u32 rw 0x38A PDO is valid (bit 31 = 0)

CAN ID of third TX PDO

2 Trans Type u8 rw 0xFF Permissible values as for

TX PDO1

1803 0 Transmit PDO 4 u8 ro 0x02 Number of entries TX, PDO 4

1 COB ID u32 rw 0x38B PDO is valid (bit 31 = 0)

CAN ID of fourth TX PDO

2 Trans Type u8 rw 0xFF Permissible values as for

TX PDO1

1804 0 Transmit PDO 5 u8 ro 0x02 Number of entries, TX PDO 5

1 COB ID u32 rw 0x38C PDO is valid (bit 31 = 0)

CAN ID of fifth TX PDO

2 Trans Type u8 rw 0xFF Permissible values as for

TX PDO1

1805 0 Transmit PDO 6 u8 ro 0x02 Number of entries, TX PDO 6

1 COB ID u32 rw 0x38D PDO is valid (bit 31 = 0)

CAN ID of sixth TX PDO

2 Trans Type u8 rw 0xFF Permissible values as for

TX PDO1

1806 0 Transmit PDO 7 u8 ro 0x02 Number of entries, TX PDO 7

1 COB ID u32 rw 0x38E PDO is valid (bit 31 = 0)

CAN ID of seventh TX PDO

2 Trans Type u8 rw 0xFF Permissible values as for

TX PDO1

Page 240: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Object directory of the ecomat type R 360

12-28

1807 0 Transmit PDO 8 u8 ro 0x02 Number of entries, TX PDO 8

1 COB ID u32 rw 0x38F PDO is valid (bit 31 = 0)

CAN ID of eighth TX PDO

2 Trans Type u8 rw 0xFF Permissible values as for

TX PDO1

1A00 0 Mapping Transmit PDO 1

u32 ro 0x04 Number of linked appl. objects

1 Index in object directory u32 ro 0xA100 01 A100 SIdx 01 contains 1. word

Transmitted data TX PDO 1

2 Index in object directory u32 ro 0xA100 02 A100 SIdx 02 contains 2. word

Transmitted data TX PDO 1

3 Index in object directory u32 ro 0xA100 03 A100 SIdx 03 contains 3. word

Transmitted data TX PDO 1

4 Index in object directory u32 ro 0xA100 04 A100 SIdx 04 contains 4. word

Transmitted data TX PDO 1

1A01 0 Mapping Transmit PDO 2

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0xA101 01 A101 SIdx 01 contains 1. word

Transmitted data TX PDO 2

2 Index in object directory u32 ro 0xA101 02 A101 SIdx 02 contains 2. word

Transmitted data TX PDO 2

3 Index in object directory u32 ro 0xA101 03 A101 SIdx 03 contains 3. word

Transmitted data TX PDO 2

4 Index in object directory u32 ro 0xA101 04 A101 SIdx 04 contains 4. word

Transmitted data TX PDO 2

Page 241: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-29

1A02 0 Mapping Transmit PDO 3

u32 ro 0x04 Number of linked appl. objects

1 Index in object directory u32 ro 0xA102 01 A102 SIdx 01 contains 1. word

Transmitted data TX PDO 3

2 Index in object directory u32 ro 0xA102 02 A102 SIdx 02 contains 2. word

Transmitted data TX PDO 3

3 Index in object directory u32 ro 0xA102 03 A102 SIdx 03 contains 3. word

Transmitted data TX PDO 3

4 Index in object directory u32 ro 0xA102 04 A102 SIdx 04 contains 4. word

Transmitted data TX PDO 3

1A03 0 Mapping Transmit PDO 4

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0xA103 01 A103 SIdx 01 contains 1. word

Transmitted data TX PDO 4

2 Index in object directory u32 ro 0xA103 02 A103 SIdx 02 contains 2. word

Transmitted data TX PDO 4

3 Index in object directory u32 ro 0xA103 03 A103 SIdx 03 contains 3. word

Transmitted data TX PDO 4

4 Index in object directory u32 ro 0xA103 04 A103 SIdx 04 contains 4. word

Transmitted data TX PDO 4

1A04 0 Mapping Transmit PDO 5

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0xA104 01 A104 SIdx 01 contains 1. word

Transmitted data TX PDO 5

2 Index in object directory u32 ro 0xA104 02 A104 SIdx 02 contains 2. word

Transmitted data TX PDO 5

3 Index in object directory u32 ro 0xA104 03 A104 SIdx 03 contains 3. word

Transmitted data TX PDO 5

4 Index in object directory u32 ro 0xA104 04 A104 SIdx 04 contains 4. word

Transmitted data TX PDO 5

Page 242: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Object directory of the ecomat type R 360

12-30

1A05 0 Mapping Transmit PDO 6

u32 ro 0x04 Number of linked appl. objects

1 Index in object directory u32 ro 0xA105 01 A105 SIdx 01 contains 1. word

Transmitted data TX PDO 6

2 Index in object directory u32 ro 0xA105 02 A105 SIdx 02 contains 2. word

Transmitted data TX PDO 6

3 Index in object directory u32 ro 0xA105 03 A105 SIdx 03 contains 3. word

Transmitted data TX PDO 6

4 Index in object directory u32 ro 0xA105 04 A105 SIdx 04 contains 4. word

Transmitted data TX PDO 6

1A06 0 Mapping Transmit PDO 7

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0xA106 01 A106 SIdx 01 contains 1. word

Transmitted data TX PDO 7

2 Index in object directory u32 ro 0xA106 02 A106 SIdx 02 contains 2. word

Transmitted data TX PDO 7

3 Index in object directory u32 ro 0xA106 03 A106 SIdx 03 contains 3. word

Transmitted data TX PDO 7

4 Index in object directory u32 ro 0xA106 04 A106 SIdx 04 contains 4. word

Transmitted data TX PDO 7

1A07 0 Mapping Transmit PDO 8

u32 ro 0x04 Number of linked appl. Objects

1 Index in object directory u32 ro 0xA107 01 A107 SIdx 01 contains 1. word

Transmitted data TX PDO 8

2 Index in object directory u32 ro 0xA107 02 A107 SIdx 02 contains 2. word

Transmitted data TX PDO 8

3 Index in object directory u32 ro 0xA107 03 A107 SIdx 03 contains 3. word

Transmitted data TX PDO 8

4 Index in object directory u32 ro 0xA107 04 A107 SIdx 04 contains 4. word

Transmitted data TX PDO 8

Page 243: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-31

Manufacturer-specific data range, index 2000 to 5FFF

Index S-Idx Name Type Default Description

2000 0 Retain Data dom. rw 0x0 Up to 256 bytes saved to the Retain flag range between %MW0 and %MW127.

20F0 0 Node ID setting u8 rw 0x20 Node ID under which the I/O module is addressed in the CANopen network.

20F1 0 Node ID setting u8 rw 0x20 Changes are accepted only if entries 20F0 and 20F1 contain the same changed value. The change takes effect immediately.

20F2 0 Baud rate setting u8 rw 0x3 Baud rate of CAN network Entry 0 => 1000 Kbit/s Entry 1 => 500 Kbit/s Entry 2 => 250 Kbit/s Entry 3 => 125 Kbit/s Entry 4 => 100 Kbit/s Entry 5 => 50 Kbit/s Entry 6 => 20 Kbit/s Entry 7 => 10 Kbit/s

20F3 0 Baud rate setting u8 rw 0x3 Changes are accepted only if entries 20F2 and 20F3 contain the same changed value. The change becomes active only after a Reset.

2100 0...32 Flag addresses %MW1000...%MW1031

u16 rw 0x0 Access to IEC flag with OBV through SDO service

2101 0...32 Flag addresses %MW1032...%MW1063

u16 rw 0x0 Access to IEC flag with OBV through SDO service

2102 0...32 Flag addresses %MW1064...%MW1095

u16 rw 0x0 Access to IEC flag with OBV through SDO service

2103 0...32 Flag addresses %MW1096...%MW1127

u16 rw 0x0 Access to IEC flag with OBV through SDO service

Page 244: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Object directory of the ecomat type R 360

12-32

Legend for object directory Abbrevia-tion

Name Explanation

u8 unsigned 8 Data length 1 byte, no prefix

u16 unsigned 16 Data length 2 bytes, no prefix

u32 unsigned 32 Data length 4 bytes, no prefix

dom domain Variable data length

ro read only Values are read-only

rw read-write Values are read-write

0x.... ... hex Numerical value represented as hexadecimal number

0b.... ... binary Numerical value represented as dual/binary number

Page 245: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Appendix

12-33

Page 246: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written
Page 247: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

13-1

13. Alphabetical index

Address assignment................................12-1 Inputs .......................................................... 12-1

Marker range............................................. 12-14

Outputs ....................................................... 12-8

System marker..........................................12-15

Analog values, processing ....................10-33 INPUT_CURRENT.................................... 10-34

INPUT_VOLTAGE .........................10-33, 10-35

Basic program structure ..........................7-62

Baud rate and node number....................7-28

Boot-up routine........................................7-26

Bus level ....................................................7-7

Bus line length ...........................................7-8

Bus-off state ..............................................7-6

Cable cross-sections .................................7-9

CAN Data exchange............................................ 7-2

Identifier, use of ............................................7-2

Receiving data ..............................................7-3

System configuration ....................................7-2 Technical specifications............................ 7-1

Transmitting data ..........................................7-3

CAN errors.................................................7-4 Bus-off state..................................................7-6

Error count ....................................................7-5

Error message ..............................................7-4

Error-active state...........................................7-5

Error-passive state........................................7-5

Handling........................................................7-4

CAN function blocks ................................7-12 CAN_BAUDRATE....................................... 7-13

CAN_ERRORHANDLER ............................ 7-19

CAN_RECEIVE...........................................7-17

CAN_RESTART..........................................7-18

CAN_TRANSMIT ........................................ 7-15

CAN2 ..........................................................7-20

GATEWAY.................................................. 7-22

CAN, general information ........................7-10

Device IDs .................................................. 7-11

Physical network configuration ................... 7-10

Software for CAN and CANopen ................ 7-10

CAN, physical connection ......................... 7-6 Bus level ....................................................... 7-7

Bus line length .............................................. 7-8

Cable cross-sections .................................... 7-9

Network topology .......................................... 7-6

CAN_BAUDRATE ................................... 7-13

CAN_BUS_OFF_ERROR ......................... 6-1

CAN_DATA_ERROR ................................ 6-1

CAN_ERROR............................................ 6-1

CAN_ERRORHANDLER......................... 7-19

CAN_INIT_ERROR................................... 6-1

CAN_RECEIVE ....................................... 7-17

CAN_RESTART...................................... 7-18

CAN_RX_OVERRUN_ERROR................. 6-1

CAN_TRANSMIT .................................... 7-15

CAN_TX_OVERRUN_ERROR ................. 6-1

CAN2....................................................... 7-20

CAN2_BUS_OFF_ERROR ....................... 6-1

CAN2_DATA_ERROR .............................. 6-1

CAN2_ERROR.......................................... 6-1

CAN2_INIT_ERROR................................. 6-1

CAN2_RX_OVERRUN_ERROR............... 6-1

CAN2TX_OVERRUN_ERROR ................. 6-1

CANopen................................................. 7-23 Boot-up routine ........................................... 7-26

Emergency Object ...................................... 7-26

General....................................................... 7-23

Node-guarding object ................................. 7-26

Object directory........................................... 7-24

Process Data Object (PDO)........................ 7-25

Service Data Object (SDO)......................... 7-25

CANopen device interface..................... 12-18 Object directory......................................... 12-20

CANopen I/O module functions............... 7-62

Page 248: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

13-2

CANopen I/O modules Basic program structure.............................. 7-62

COP_MSTR_BOOTUP............. 7-63, 7-64, 7-65

EMC_GET_EMERGENCY ......................... 7-63

NMM_SET_OPERATIONAL....................... 7-63

CANopen I/O modules COP_MSTR_MAIN..................................... 7-63

CANopen I/O modules COP_MSTR_MAIN..................................... 7-67

CANopen master .....................................7-41 EMC_GET_EMERGENCY ......................... 7-57

NMM_ADD_NODE ..................................... 7-44

NMM_GET_NODE_STATE........................ 7-52

NMM_NODE_GUARDING ......................... 7-48

NMM_RESET_COMM................................ 7-54

NMM_RESET_NODE................................. 7-53

NMM_SET_NMT_MASTER ....................... 7-42

NMM_SET_OPERATIONAL....................... 7-50

NMM_SET_PREOPERATIONAL ............... 7-49

NMM_SET_PREPARED ............................ 7-51

NMM_START_GUARDING........................ 7-45

NMM_STOP_GUARDING.......................... 7-46

PDO_INI_SEND_SYNC_OBJ .................... 7-55

PDO_SEND_SYNC_OBJ........................... 7-56

SDO_READ................................................ 7-59

SDO_WRITE .............................................. 7-61

CANopen slave........................................7-28 Baud rate and node number ....................... 7-28

Emergency objects ..................................... 7-31

NMS_SET_NODEID................................... 7-33

Node guarding ............................................ 7-31

Object directory .......................................... 7-28

PDO mapping ............................................. 7-30

PDO reception ............................................ 7-30

PDO_RX_CONFIG..................................... 7-39

PDO_TX_CONFIG ..................................... 7-36

PDO_TX_REFRESH .................................. 7-40

PDOs.......................................................... 7-29

ResetNode.................................................. 7-31

Retentive data ............................................ 7-29

Transmission types..................................... 7-31

CANopen slave NMS_GUARDING_CONFIG ...................... 7-35

CHECK_DATA ......................................10-15

Control configuration .................................2-3

Control modes Debug............................................................5-4

Control modes .........................................5-4 Serial Mode ...................................................5-4

Test ...............................................................5-4

Controlled systems..................................11-1

Controller functions..................................11-1 Controlled systems with compensation .......11-1

Controlled systems with lag.........................11-2

Controlled systems without compensation ..11-2

Damping overshoot .....................................11-3

DELAY ........................................................11-4

GLR...........................................................11-16

PID ..............................................................11-5

PID1 ..........................................................11-13

PT1..............................................................11-5

Setting method ............................................11-3

COP_GUARDFAIL_ERROR .....................6-1

COP_GUARDFAIL_NODEID ....................6-1

COP_MSTR_BOOTUP ........ 7-63, 7-64, 7-65

COP_MSTR_MAIN.........................7-63, 7-67

COP_SYNCFAIL_ERROR ........................6-1

Current measurement................................8-5

CYCLE.......................................................9-3

Damping overshoot .................................11-3

Data – saving, reading and converting....10-2 Automatic backup........................................10-2

Direct memory access.................................10-2

E2READ_....................................................10-5

E2WRITE ....................................................10-4

FLASHREAD...............................................10-7

FLASHWRITE .............................................10-6

FRAMREAD ................................................10-9

FRAMWRITE...............................................10-8

Manual data backup ....................................10-2

MEMCPY ....................................................10-3

STR...........................................................10-10

Data access and verification ..............10-12

Data access and verification

Page 249: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Alphabetical index

13-3

SET_IDENTITY......................................... 10-12

Data access and verification SET_PASSWORD .................................... 10-14

Data access and verification CHECK_DATA.......................................... 10-15

Debug ........................................................5-4

DELAY.....................................................11-4

Device configuration...............................4-1 Analog inputs ............................................. 4-3

Control modes of ExtendedContr........... 4-11

Digital inputs .............................................. 4-2

Digital outputs............................................ 4-1

Fast inputs.................................................. 4-2

Function configuration .............................. 4-3

PWM outputs .............................................. 4-1

Software control configuration ............... 4-13

Device IDs ...............................................7-11

Direct memory access.............................10-2

E2READ_ ................................................10-5

E2WRITE.................................................10-4

EMC_GET_EMERGENCY.............7-57, 7-63

Emergency Object...................................7-26

Emergency objects..................................7-31

Error...........................................................6-1 CAN_BUS_OFF_ERROR.............................6-1

CAN_DATA_ERROR....................................6-1

CAN_ERROR ...............................................6-1

CAN_INIT_ERROR.......................................6-1

CAN_RX_OVERRUN_ERROR.....................6-1

CAN_TX_OVERRUN_ERROR.....................6-1

CAN2_BUS_OFF_ERROR...........................6-1

CAN2_DATA_ERROR..................................6-1

CAN2_ERROR .............................................6-1

CAN2_INIT_ERROR.....................................6-1

CAN2_RX_OVERRUN_ERROR...................6-1

CAN2_TX_OVERRUN_ERROR ...................6-1

COP_GUARDFAIL_ERROR.........................6-1

COP_GUARDFAIL_NODEID........................6-1

COP_SYNCFAIL_ERROR............................6-1

ERROR.........................................................6-1

ERROR_MEMORY.......................................6-1

ERROR_POWER .........................................6-1

ERROR_TEMPERATURE............................ 6-1

ERROR...................................................... 6-1

Error classes ............................................. 6-1

Error codes................................................ 6-1

Error count................................................. 7-5

Error description ........................................ 6-1

Error message........................................... 7-4

ERROR_MEMORY ................................... 6-1

ERROR_POWER...................................... 6-1

ERROR_TEMPERATURE ........................ 6-1

Error-active state ....................................... 7-5

Error-passive state .................................... 7-5

FAST_ANALOG ...................................... 8-13

FAST_COUNT ........................................ 9-12

Fatal Error ................................................. 5-1

Feedback on outputs................................. 3-3

FLASHREAD........................................... 10-7

FLASHWRITE ......................................... 10-6

FRAMREAD ............................................ 10-9

FRAMWRITE........................................... 10-8

FREQUENCY............................................ 9-2

Functions for CANopen I/O modules ...... 7-62

Functions, ISO 11992.............................. 7-68

Functions, SAE J 1939............................ 7-68

GATEWAY .............................................. 7-22

General notes about use of CAN ............ 7-10

GLR ....................................................... 11-16

High-speed counters...............................9-1 CYCLE.......................................................... 9-3

FAST_COUNT............................................ 9-12

FREQUENCY ............................................... 9-2

INC_ENCODER.......................................... 9-10

PERIOD........................................................ 9-4

PERIOD_RATIO........................................... 9-6

PHASE ......................................................... 9-8

Identifier, use of......................................... 7-2

INC_ENCODER ...................................... 9-10

INPUT_CURRENT................................ 10-34

INPUT_VOLTAGE......................10-33, 10-35

Page 250: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

13-4

Intended use..............................................2-1

Interrupt processing...............................10-17 SET_INTERRUPT_1MS........................... 10-17

SET_INTERRUPT_XMS .......................... 10-20

ISO 11992 ISO11992 ................................................... 7-82

ISO11992_GLOBAL_REQUEST................ 7-91

ISO11992_RECEIVE.................................. 7-83

ISO11992_RESPONSE.............................. 7-87

ISO11992_SPECIFIC_REQUEST.............. 7-89

ISO11992_TRANSMIT ............................... 7-85

Manual data backup ................................10-2

MEMCPY.................................................10-3

Monitoring system .....................................3-3 Block diagram ............................................... 3-1

Clamp relay .................................................. 3-1 Delayed shutdown ........................................ 3-2 Function principle ......................................3-3

Terminal 15 engineering ............................... 3-1

Network topology.......................................7-6

NMM_ADD_NODE..................................7-44

NMM_GET_NODE_STATE.....................7-52

NMM_NODE_GUARDING ......................7-48

NMM_RESET_COMM.............................7-54

NMM_RESET_NODE..............................7-53

NMM_SET_NMT_MASTER ....................7-42

NMM_SET_OPERATIONAL ..........7-50, 7-63

NMM_SET_PREOPERATIONAL............7-49

NMM_SET_PREPARED .........................7-51

NMM_START_GUARDING.....................7-45

NMM_STOP_GUARDING.......................7-46

NMS_GUARDING_CONFIG ...................7-35

NMS_SET_NODEID................................7-33

No operating system..................................5-1

Node guarding .........................................7-31

Node-guarding object ..............................7-26

NORM....................................................10-31

Object directory ..............................7-24, 7-28

OCC_TASK .............................................8-17

Operating states ........................................5-1

Fatal Error .....................................................5-1

No operating system .....................................5-1

Reset.............................................................5-1

Run................................................................5-1 Status LED ..................................................5-2

Stop...............................................................5-1

Operating system ...............................5-1, 5-2 Loading .......................................................5-2

Orientation aids Page footers ..................................................1-2

Page headers ................................................1-2

Symbols ........................................................1-2

Other functions ........................................10-1 SOFTRESET...............................................10-1

OUTPUT_CURRENT ..............................8-18

OUTPUT_CURRENT_CONTROL ..........8-15

P controller ............................................11-11

PDO mapping ..........................................7-30

PDO reception .........................................7-30

PDO_INI_SEND_SYNC_OBJ .................7-55

PDO_RX_CONFIG..................................7-39

PDO_SEND_SYNC_OBJ........................7-56

PDO_TX_CONFIG ..................................7-36

PDO_TX_REFRESH...............................7-40

PDOs .......................................................7-29

PERIOD.....................................................9-4

PERIOD_RATIO........................................9-6

PHASE ......................................................9-8

Physical connection to CAN ......................7-6

Physical layer, ISO 11992-1......................7-9

Physical network configuration................7-10

PI controller .............................................11-9

PID...........................................................11-5

PID controller................................11-8, 11-14

PID1.......................................................11-13

Process data objects (PDO)....................7-25

PT1 ..........................................................11-5

PWM..........................................................8-1 Current measurement ...................................8-5

FAST_ANALOG ..........................................8-13

Page 251: System manual R 360 - ifm · Manual ecomat 100 Type R 360 System Manual: ecomat 100 Type R 360 01 / 2007, from software version CRxxxx_P Note about the guarantee This manual was written

Alphabetical index

13-5

Ramp function...............................................8-6

Sample program ...........................................8-6

PWM channels ..........................................8-2

PWM dither.........................................8-4, 8-5

PWM frequency.........................................8-2

PWM function ............................................8-1

PWM functions FAST_ANALOG..........................................8-13

OCC_TASK................................................. 8-16

OUTPUT_CURRENT..................................8-18

OUTPUT_CURRENT_CONTROL .............. 8-14

PWM .............................................................8-7

PWM100 .......................................................8-9

PWM1000 ................................................... 8-11

PWM/PWM 100.........................................8-2

Ramp function ...........................................8-6

Receiving data...........................................7-3

Required knowledge..................................1-1

Reset .........................................................5-1

ResetNode...............................................7-31

Retentive data .........................................7-29

Run ............................................................5-1

SAE J 1939 J1939_GLOBAL_REQUEST....................... 7-80

J1939_RECEIVE ...............................7-71, 7-72

J1939_RESPONSE .................................... 7-76

J1939_SPECIFIC_REQUEST .................... 7-78

J1939_TRANSMIT......................................7-74

Safety instructions .....................................2-1

SDO_READ.............................................7-59

SDO_WRITE ...........................................7-61

Serial interface.......................................10-25 SERIAL_BAUDRATE................................ 10-25

SERIAL_PENDING...................................10-28

SERIAL_RX .............................................. 10-27

SERIAL_TX............................................... 10-26

Serial Mode ...............................................5-4

SERIAL_BAUDRATE ............................10-25

SERIAL_PENDING ............................... 10-28

SERIAL_RX........................................... 10-27

SERIAL_TX ........................................... 10-26

Service data objects (SDO)..................... 7-25

SET_IDENTITY ..................................... 10-12

SET_INTERRUPT_1MS ....................... 10-17

SET_INTERRUPT_XMS....................... 10-20

SET_PASSWORD ................................ 10-14

SOFTRESET........................................... 10-1

Software for CAN and CANopen............. 7-10

SSC interface ........................................ 10-21 SSC_MASTER ......................................... 10-23

SSC_RECEIVE......................................... 10-21

SSC_TRANSMIT ...................................... 10-22

SSC_MASTER ...................................... 10-23

SSC_RECEIVE ..................................... 10-21

SSC_TRANSMIT................................... 10-22

Status LED ...............................................5-2

Stop ........................................................... 5-1

STR ....................................................... 10-10

System configuration................................. 7-2

System error ............................................6-1 Response ....................................................6-1

System time........................................... 10-29 TIMER_READ........................................... 10-29

TIMER_US_READ ..............................10-30

Terminal assignment ............................4-13 Labelling of input/output channels .............. 4-13

Test............................................................ 5-4

TIMER_READ ....................................... 10-29

TIMER_US_READ ............................ 10-30

Transmission types ................................. 7-31

Transmitting data....................................... 7-3

Variables, processing ............................ 10-31 NORM....................................................... 10-31