IFM Electronic Ecomat 100 ecomatmobile SmartController CR2500 System Manual

IFM Electronic Ecomat 100 ecomatmobile SmartController CR2500 System Manual

Smartcontroller
Table of Contents

Advertisement

Quick Links

System Manual
SmartController
CR2500
CR2502
®
CoDeSys
V2.3
Target V05

Advertisement

Table of Contents
loading

Summary of Contents for IFM Electronic Ecomat 100 ecomatmobile SmartController CR2500

  • Page 1 System Manual SmartController CR2500 CR2502 ® CoDeSys V2.3 Target V05...
  • Page 2: Table Of Contents

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Contents Contents About this manual What do the symbols and formats mean?.................7 How is this manual structured? ..................8 Safety instructions General..........................9 What previous knowledge is required? ................10 System description Information concerning the device ..................11 Information concerning the software ................11 PLC configuration ......................12 Configurations...
  • Page 3 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Contents Programming and system resources Above-average stress .....................42 Limits of the SmartController...................43 Watchdog behaviour .......................44 Available memory ......................44 Program creation and download in the PLC ..............45 CAN in the ecomatmobile controller General about CAN ......................47 8.1.1 Topology .......................47 8.1.2...
  • Page 4 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Contents Use of the CAN interfaces to SAE J1939..............145 8.9.1 Function J1939_x..................148 8.9.2 Function J1939_x_RECEIVE..............150 8.9.3 Function J1939_x_TRANSMIT ..............152 8.9.4 Function J1939_x_RESPONSE..............154 8.9.5 Function J1939_x_SPECIFIC_REQUEST..........156 8.9.6 Function J1939_x_GLOBAL_REQUEST........... 158 PWM in the ecomatmobile controller PWM signal processing....................
  • Page 5 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Contents 10.5 Processing interrupts....................232 10.5.1 Function SET_INTERRUPT_XMS............. 233 10.5.2 Function SET_INTERRUPT_I..............236 10.6 Use of the serial interface..................... 239 10.6.1 Function SERIAL_SETUP ................. 240 10.6.2 Function SERIAL_TX ................. 242 10.6.3 Function SERIAL_RX................. 243 10.6.4 Function SERIAL_PENDING ..............
  • Page 7: About This Manual

    Nobody is perfect. Send us your suggestions for improvements to this manual and you will receive a little gift from us to thank you. © All rights reserved by ifm electronic gmbh. No part of this manual may be reproduced and used without the consent of ifm electronic gmbh.
  • Page 8: How Is This Manual Structured

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 About this manual How is this manual structured? Info Further hints. ► ... Required action > Response, effect → ... "see" Cross references (links) [...] Designations of keys, buttons or display How is this manual structured? This documentation is a combination of different types of manuals.
  • Page 9: Safety Instructions

    WARNING Property damage or bodily injury possible when the notes in this manual are not adhered to! ifm electronic gmbh does not assume any liability in this regard. ► The acting person must have read and understood the safety instructions and the corresponding chapters of this manual before performing any work on or with this device.
  • Page 10: What Previous Knowledge Is Required

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Safety instructions What previous knowledge is required? What previous knowledge is required? This document is intended for people with knowledge of control technology and PLC programming with IEC 61131-3. ® If this device contents a PLC, in addition these persons should know the CoDeSys software.
  • Page 11: System Description

    Information concerning the software ..................11 PLC configuration ........................12 Information concerning the device This manual describes the ecomatmobile controller family of ifm electronic gmbh with a 16-bit microcontroller for mobile vehicles: • SmartController: CR2500, CR2501, CR2502 Information concerning the software ®...
  • Page 12: Plc Configuration

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 System description PLC configuration Also note: The target for CRnn32 must be > V02, for all other devices > V05. The user is responsible for the reliable function of the application programs he designed. If necessary, he must additionally carry out an approval test by corresponding supervisory and test organisations according to the national regulations.
  • Page 13: Configurations

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations PLC configuration Configurations Set up programming system......................14 Function configuration of the inputs and outputs...............29 Hints to wiring diagrams ......................34 The device configurations described in the corresponding installation instructions and in the annex (→...
  • Page 14: Set Up Programming System

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system Set up programming system 4.1.1 Set up programming system manually Setup the target ® When creating a new project in CoDeSys the target file corresponding to the controller must be loaded.
  • Page 15 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system Activating the PLC configuration During the configuration of the programming system (→ previous section) automatically also the PLC configuration was carried out. The point [PLC Configuration] is reached via the tab [Resources]. Double-click on [PLC Configuration] to open the corresponding window.
  • Page 16: Set Up Programming System Via Templates

    When installing the ecomatmobile CD "Software, Tools and Documentation", projects with templates have been stored in the program directory of your PC: …\ifm electronic\CoDeSys V…\Projects\Template_CDVxxyyzz ► Open the requested template in CoDeSys via: [File] > [New from template…] > CoDeSys creates a new project which shows the basic program structure. It is strongly recommended to follow the shown procedure.
  • Page 17 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system ► Find article number of the unit in the list, e.g. CR2500 as CANopen master: ► How is the CAN network organised? Do you want to work on layer 2 basis or is there a master with several slaves (for CANopen)? (Here an example: CANopen-Slave, →...
  • Page 18 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system ► Select requested element, e.g. "System R360": I/O CompactModule CR2011 (EDS)". The EDS files are in directory C:\…\CoDeSys V…\Library\PLCConf\. > The window [PLC configuration] changes as follows: ► Set CAN parameters, PDO mapping and SDOs for the entered slave according to the requirements.
  • Page 19 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system Folder structure in general The POUs are sorted in the following folders: Folder Description CAN_OPEN for Controller and PDM, CAN operation as master or slave: contains the functions for CANopen. I_O_CONFIGURATION for Controller, CAN operation with layer 2 or as master or slave:...
  • Page 20 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system POUs in the folder Description CAN_OPEN SELECT_NODESTATE for PDM, CAN operation as master or slave: Converts the value of the node status [BYTE] into the corresponding text [STRING]: 4 →...
  • Page 21 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system POUs in the folder Description CONTROL_CR10nn PDM_TO_PLC for PDM, CAN operation with layer 2: Organises the communication from the PDM to the Controller: - monitors the transmission time, - transmits control data for image change, input values etc.
  • Page 22 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system POUs in the root directory Description PLC_CYCLE for Controller, CAN operation with layer 2 or as master or slave: Determines the cycle time of the PLC in the unit. PDM_CYCLE_MS for PDM, CAN operation with layer 2 or as master or slave:...
  • Page 23 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system Supplement project with further functions You have created a project using an template and you have defined the CAN network. Now you want to add further functions to this project. For the example we take a CabinetController CR2500 as CAN open Master to which an I/O CabinetModule CR2011 and an I/O compact module are connected as slaves: PLC configuration:...
  • Page 24 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system ► Highlight the elements which contain only the requested function, in this case e.g.: NOTE: In other cases libraries and/or visualisations might be required. ► Confirm the selection with [OK]. >...
  • Page 25: Ifm Demo Programs

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system ► After possibly required corrections and addition of missing libraries (→ Error messages after rebuild) save the project again. ► Follow this principle to step by step (!) add further functions from other projects and check the results.
  • Page 26 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system Demo program Function I/O compact module CR2031 as slave of a Controller CR2500Demo_CR2031_xx.pro (CANopen master), Current measurement on the PWM outputs I/O compact module CR2032 as slave of a Controller CR2500Demo_CR2032_xx.pro (CANopen master), 4 x digital input,...
  • Page 27 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system Demo program for PDM: Demo program Function separate for PDM360, PDM360 compact, PDM360 CR1051Demo_CanTool_xx.pro smart and Controller: CR1053Demo_CanTool_xx.pro CR1071Demo_CanTool_xx.pro Contains functions to set and analyse the CAN interface. Allows to enter any character in a character string: CR1051Demo_Input_Character_xx.pro - capital letters,...
  • Page 28 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Set up programming system Demo program Function Example with function PDM_POWER_DOWN from CR1051Demo_Powerdown_Retain_bin the library ifm_CR1051_Vxxyyzz.Lib, to save _xx.pro retain variable in the file Retain.bin. Simulation of ShutDown with [F3]. Example with function PDM_POWER_DOWN from CR1051Demo_Powerdown_Retain_bin2 the library ifm_CR1051_Vxxyyzz.Lib, to save _xx.pro...
  • Page 29: Function Configuration Of The Inputs And Outputs

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Function configuration of the inputs and outputs Demo program Function In a list parameters can be selected and changed. CR1051Demo_RW-Parameter_xx.pro Example with the following POUs: - Function READ_PARAMETER_WORD, - Function WRITE_PARAMETER_WORD. Figure P35010: List of 20 parameters _xx = indication of the demo version Function configuration of the inputs and outputs...
  • Page 30 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Function configuration of the inputs and outputs Sensor Sensor High side input for negative sensor signal Low side input for positive sensor signal Fast inputs In addition, the ecomatmobile controllers have up to 16 fast counter/pulse inputs for an input frequency up to 50 kHz (→...
  • Page 31 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Function configuration of the inputs and outputs Analogue inputs The analogue inputs can be configured via the application program. The measuring range can be set as follows: • current input 0...20 mA •...
  • Page 32 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Function configuration of the inputs and outputs Digital input group I0...I3 (%IX0.0...%IX1.8) These inputs are digital inputs with internal analogue evaluation for diagnosis. The configuration of the diagnostic function is carried out via the system variables Ix_MODE. The diagnostic information is indicated via the system flag bit ERROR_Ix.
  • Page 33: Configure Outputs

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Function configuration of the inputs and outputs 4.2.2 Configure outputs Digital and PWM outputs Three types of controller outputs can be distinguished: • high side digital outputs with and without diagnostic function •...
  • Page 34: Hints To Wiring Diagrams

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Configurations Hints to wiring diagrams Hints to wiring diagrams The wiring diagrams (→ installation instructions of the controllers, chapter "Wiring") show the standard device configurations. The wiring diagrams help allocate the input and output channels to the IEC addresses and the device terminals.
  • Page 35: Operating States And Operating System

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Operating states and operating system Operating states Operating states and operating system Operating states ........................35 Status LED..........................36 Load the operating system ......................37 Operating modes ........................37 Operating states After power on the ecomatmobile controller can be in one of five possible operating states: 5.1.1 Reset This state is passed through after every power on reset:...
  • Page 36: No Operating System

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Operating states and operating system Status LED 5.1.5 No operating system No operating system was loaded, the controller is in the boot loading state. Before loading the application software the operating system must be downloaded. >...
  • Page 37: Load The Operating System

    No EPROM replacement is necessary for an update of the operating system. The operating system is provided with this documentation on a separate data carrier. In addition, the current version can be downloaded from the website of ifm electronic gmbh → www.ifm.com >...
  • Page 38: Test Mode

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Operating states and operating system Operating modes 5.4.1 TEST mode This operating mode is achieved by applying a high level (supply voltage) to the test input (→ installation instructions, chapter "wiring"). The ecomatmobile controller can now receive commands via one of the interfaces in the RUN or STOP mode and, for example, communicate with the programming system.
  • Page 39: Error Codes And Diagnostic Information

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Error codes and diagnostic information Operating modes Error codes and diagnostic information Response to the system error ....................40 To ensure maximum operational reliability the operating system checks the ecomatmobile controller in the start phase (reset phase) and during the program execution by internal error checks. The following error flags are set in case of an error: Error Description...
  • Page 40: Response To The System Error

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Error codes and diagnostic information Response to the system error Complete list of the device-specific error codes and diagnostic messages → chapter system flags (→ page 274). Response to the system error In principle, the programmer is responsible to react to the error flags (system flags) in the application program.
  • Page 41: Example Process For Response To A System Error

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Error codes and diagnostic information Response to the system error 6.1.2 Example process for response to a system error The system determines an excessive temperature in the controller. The operating system sets the error bit ERROR_TEMPERATURE. The application program recognises this state by querying the corresponding bits.
  • Page 42: Programming And System Resources

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Programming and system resources Above-average stress Programming and system resources Above-average stress........................42 Limits of the SmartController .....................43 Watchdog behaviour........................44 Available memory ........................44 Program creation and download in the PLC................45 For the programmable devices from the controller family ecomatmobile numerous functions are available which enable use of the devices in a wide range of applications.
  • Page 43: Limits Of The Smartcontroller

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Programming and system resources Limits of the SmartController Function Above average load OUTPUT_CURRENT_CONTROL, Simultaneous use of several current controllers OCC_TASK CAN interface High baud rate (> 250 kbits) with a high bus load PWM, Many PWM channels at the same time.
  • Page 44: Watchdog Behaviour

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Programming and system resources Watchdog behaviour Watchdog behaviour For all ecomatmobile controllers the program runtime is monitored by a watchdog. If the maximum watchdog time is exceeded, the controller carries out a reset and starts again (SafetyController: controller remains in the reset;...
  • Page 45: Program Creation And Download In The Plc

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Programming and system resources Program creation and download in the PLC Program creation and download in the PLC The application program is generated by the CoDeSys programming system and loaded in the controller several times during the program development for testing: In CoDeSys: [Online] >...
  • Page 46 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Programming and system resources Program creation and download in the PLC downloader downloader serves for easy transfer of the program code from the programming station to the controller. As a matter of principle each application software can be copied to the controllers using the downloader.
  • Page 47: Can In The Ecomatmobile Controller

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller General about CAN CAN in the ecomatmobile controller General about CAN ........................47 Exchange of CAN data ......................49 Physical connection of CAN ......................51 Software for CAN and CANopen ....................55 CAN errors and error handling ....................55 Description of the CAN functions....................58 ifm CANopen library........................83...
  • Page 48: Can Interfaces

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller General about CAN 8.1.2 CAN interfaces The controllers have several CAN interfaces depending on the hardware structure. In principle, all interfaces can be used with the following functions independently of each other: •...
  • Page 49: Exchange Of Can Data

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Exchange of CAN data Exchange of CAN data CAN data is exchanged via the CAN protocol of the link layer (level 2) of the seven-layer ISO/OSI reference model specified in the international standard ISO 11898. Every bus participant can transmit messages (multimaster capability).
  • Page 50: Data Reception

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Exchange of CAN data Example 11 bits CAN-ID (base): CAN-ID base Bit 28 ... Bit 18 0 0 0 0 0 1 1 1 1 1 1 1 0 0 Example 29 bits CAN-ID (extended): CAN-ID base CAN-ID extended...
  • Page 51: Physical Connection Of Can

    The line must be terminated at its two ends using a terminating resistor of 120 Ω to prevent corruption of the signal quality. The devices of ifm electronic equipped with a CAN interface have no terminating resistors. Spurs Ideally no spur should lead to the bus participants (node 1 ... node n) because reflections occur depending on the total cable length and the time-related processes on the bus.
  • Page 52: Bus Level

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Physical connection of CAN 8.3.2 Bus level The CAN bus is in the inactive (recessive) state if the output transistor pairs are switched off in all bus participants. If at least one transistor pair is switched on, a bit is transferred to the bus. This activates the bus (dominant).
  • Page 53: Bus Cable Length

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Physical connection of CAN 8.3.3 Bus cable length The length of the bus cable depends on: • type of the bus cable (cable, connector), • cable resistance, • required transmission rate (baud rate), •...
  • Page 54: Wire Cross-Sections

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Physical connection of CAN 8.3.4 Wire cross-sections For the layout of the CAN network the wire cross-section of the bus cable used must also be taken into account. The following table describes the dependence of the wire cross-section referred to the cable length and the number of the connected nodes.
  • Page 55: Software For Can And Canopen

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Software for CAN and CANopen Software for CAN and CANopen In principle, ecomatmobile controllers can directly participate in the CAN communication (layer 2) by using the functions CANx_TRANSMIT and CANx_RECEIVE. In the operating mode CANopen the programmer is provided with the defined services from the programming system CoDeSys.
  • Page 56: Error Counter

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller CAN errors and error handling 8.5.2 Error counter A transmit and receive error counter are integrated in the CAN controller. They are counted up (incremented) for every faulty transmit or receive operation. If a transmission was correct, these counters are counted down (decremented).
  • Page 57: Participant, Bus Off

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller CAN errors and error handling 8.5.5 Participant, bus off If the error count value continues to be incremented, the participant is disconnected from the bus (bus off) after exceeding a maximum count value. To indicate this state the flag CANx_BUSOFF is set in the application program.
  • Page 58: Description Of The Can Functions

    When installing the ecomatmobile CD "Software, Tools and Documentation", projects with templates have been stored in the program directory of your PC: …\ifm electronic\CoDeSys V…\Projects\Template_CDVxxyyzz ► Open the requested template in CoDeSys via: [File] > [New from template…] > CoDeSys creates a new project which shows the basic program structure. It is strongly recommended to follow the shown procedure.
  • Page 59: Function Can1_Baudrate

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.1 Function CAN1_BAUDRATE Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 60 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE (only 1 cycle): function is executed FALSE: function is not executed BAUDRATE WORD Baud rate [kbits/s]...
  • Page 61: Function Can1_Downloadid

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.2 Function CAN1_DOWNLOADID Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 62 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE (only 1 cycle): ID is set FALSE: function is not executed BYTE Download identifier Permissible values: 1…127...
  • Page 63: Function Can1_Ext

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.3 Function CAN1_EXT Contained in the library: ifm_CAN1_EXT_Vxxyyzz.LIB Available for: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • PCB controller: CS0015 •...
  • Page 64 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: Function is executed FALSE: Function is not executed START BOOL TRUE (in the 1st cycle): interface is initialised FALSE: Initialisation cycle completed EXTENDED_MODE...
  • Page 65: Function Can1_Ext_Transmit

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.4 Function CAN1_EXT_TRANSMIT Contained in the library: ifm_CAN1_EXT_Vxxyyzz.LIB Available for: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • PCB controller: CS0015 •...
  • Page 66 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description DWORD Number of the data object identifier Permissible values: 11-bit ID = 0...2 047, 29-bit ID = 0...536 870 911 BYTE Number of bytes to be transmitted from the array DATA...
  • Page 67: Function Can1_Ext_Receive

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.5 Function CAN1_EXT_RECEIVE Contained in the library: ifm_CAN1_EXT_Vxxyyzz.LIB Available for: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • PCB controller: CS0015 •...
  • Page 68 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description CONFIG BOOL TRUE (only for 1 cycle): Configure data object FALSE: function is not executed CLEAR BOOL TRUE: deletes the data buffer (queue)
  • Page 69: Function Can1_Ext_Errorhandler

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.6 Function CAN1_EXT_ERRORHANDLER Contained in the library: ifm_CAN1_EXT_Vxxyyzz.LIB Available for: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • PCB controller: CS0015 •...
  • Page 70: Function Can2

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.7 Function CAN2 (can only be used for devices with a 2nd CAN interface) Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: •...
  • Page 71 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed START BOOL TRUE (in the 1st cycle): interface is initialised FALSE: initialisation cycle completed EXTENDED_MODE...
  • Page 72: Function Canx_Transmit

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.8 Function CANx_TRANSMIT x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: •...
  • Page 73 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description WORD Number of the data object identifier Permissible values = 0...2 047 BYTE Number of bytes to be transmitted from the array DATA Permissible values = 0...8 DATA ARRAY[0...7] OF...
  • Page 74: Function Canx_Receive

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.9 Function CANx_RECEIVE x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: •...
  • Page 75 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description CONFIG BOOL TRUE (only 1 cycle): Configure data object FALSE: function is not executed CLEAR BOOL TRUE: deletes the data buffer (queue)
  • Page 76: Function Canx_Receive_Range

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.10 Function CANx_RECEIVE_RANGE x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: from ifm_CRnnnn_V05yyzz.LIB Available for: •...
  • Page 77 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions By evaluating the output OVERFLOW, an overflow of the data buffer can be detected. If OVERFLOW = TRUE, at least 1 data object has been lost. Receive buffer: max.
  • Page 78 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Example Initialisation of CANx_RECEIVE_RANGE in 4 cycles...
  • Page 79: Function Canx_Ext_Receive_All

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.11 Function CANx_EXT_RECEIVE_ALL x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: For CAN interface 1: ifm_CAN1_EXT_Vxxyyzz.LIB For CAN interface 2...n: ifm_CRnnnn_Vxxyyzz.LIB...
  • Page 80 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions Parameters of the function inputs Name Data type Description CONFIG BOOL TRUE (only for 1 cycle): Configure data object FALSE: Function is not executed CLEAR BOOL TRUE: Deletes the data buffer (queue)
  • Page 81: Function Canx_Errorhandler

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions 8.6.12 Function CANx_ERRORHANDLER x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: •...
  • Page 82 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Description of the CAN functions NOTE In principle, the function CAN2 (→ page 69) must be executed to initialise the second CAN interface, before functions can be used for it. If the automatic bus recover function is to be used (default setting) the function CANx_ERRORHANDLER must not be integrated and instanced in the program! Parameters of the function inputs...
  • Page 83: Ifm Canopen Library

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library ifm CANopen library CANopen network configuration, status and error handling For all programmable devices the CANopen interface of CoDeSys is used. Whereas the network configuration and parameter setting of the connected devices are directly carried out via the programming software, the error messages can only be reached via nested variable structures in the CANopen stack.
  • Page 84 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library NOTE: For all ecomat mobile controllers and the PDM360 smart you must use CANopen libraries with the following addition: • For CR0032 target version up to V01, all other devices up to V04.00.05: "OptTable" •...
  • Page 85: Canopen Master

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library 8.7.2 CANopen master Differentiation from other CANopen libraries The CANopen library implemented by 3S (Smart Software Solutions) differentiates from the systems on the market in various points. It was not developed to make other libraries of renowned manufacturers unnecessary but was deliberately optimised for use with the CoDeSys programming and runtime system.
  • Page 86 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library The following functions defined in CANopen are at present not supported by the CANopen 3S (Smart Software Solutions) library: • Dynamic identifier assignment, • Dynamic SDO connections, •...
  • Page 87 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library NOTE For the ecomatmobile controllers and PDM360 smart the CANopen support by CoDeSys can only be activated for the 1st CAN interface. If the CAN master has already been added, the controller can no longer be used as a CAN device via CoDeSys.
  • Page 88 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Communication Cycle Period/Sync. Window Length After expiry of the [Communication Cycle Period] a SYNC message is transmitted by the master. The [Sync. Window Length] indicates the time during which synchronous PDOs are transmitted by the other network participants and must be received by the master.
  • Page 89 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Add and configure CANopen slaves Next you can add the CAN slaves. To do so, you must call again the dialogue in the controller configuration [Insert] > [Append subelement]. A list of the CANopen device descriptions (EDS files) stored in the directory PLC_CONF is available.
  • Page 90 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Node reset The slave is reset ("load") as soon as the configuration is loaded to the controller. Optional device If the option [optional device] is activated, the master tries only once to read from this node. In case of a missing response, the node is ignored and the master goes to the normal operating state.
  • Page 91 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Transmission For transmission type you receive a selection of possible transmission modes for Type this module: acyclic – synchronous After a change the PDO is transferred with the next SYNC. cyclic –...
  • Page 92 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library (→ page 123) with GLOBAL_START=TRUE. If the slaves are to be reset individually, this input must be set to FALSE. Polling of the slave device type using SDO (polling for object 1000 ) and comparison with the configured slave ID Indication of an error status for the slaves from which a wrong device type was received.
  • Page 93 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Start the network Here you find information about how to start the CANopen network. After downloading the project to the controller or a reset of the application the master starts up the CAN network again.
  • Page 94 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Network states Here you read how to interpret the states of the CANopen network and how to react. For the start-up (→ page 93) of the CANopen network and during operation the individual functions of the library pass different states.
  • Page 95 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Boot up of the CANopen slaves You can read the states of a slave via the array NODE_STATE_SLAVE of the function CANx_MASTER_STATUS (→ page 123). During boot up of the CAN network the slave passes the states -1, 1 and 2 automatically.
  • Page 96: Start-Up Of The Network Without [Automatic Startup]

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Nodeguarding/heartbeat error State Description In case of a nodeguarding timeout the variable NODE_STATE in the array NODE_STATE_SLAVE of the function CANx_MASTER_STATUS (→ page 123) is set to 99.
  • Page 97 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Starting the network with START_ALL_NODES If the network is not automatically started with GLOBAL_START of the function CANx_Master_STATUS (→ page 123), it can be started at any time, i.e. every node one after the other.
  • Page 98 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library The object directory is accessed by the application via an array with the following structure: Structure element Description dwIdxSubIdxF Structure of the component 16#iiiissff: iiii – index (2 bytes, bits 16-31), Idx ss –...
  • Page 99 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library If index and sub-index of the object directory are known, an entry can be addressed as follows: I := GetODMEntryValue(16#iiiiss00, pCanOpenMaster[0].wODMFirstIdx, pCanOpenMaster[0].wODMFirstIdx + pCanOpenMaster[0]. wODMCount; For "iii"...
  • Page 100: Can Device

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library 8.7.4 CAN device CAN device is another name for a CANopen slave or CANopen node. A CoDeSys programmable controller can also be a CANopen slave in a CAN network. Functionality The CAN device library in combination with the CANopen configurator provides the user with the following options:...
  • Page 101 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library CAN device configuration To use the controller as CANopen slave (device) the CANopen slave must first be added via [Insert] > [Append subelement]. For controllers with 2 or more CAN interfaces the CAN interface 1 is automatically configured as a slave.
  • Page 102 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library BaudRate_50=1 BaudRate_100=1 BaudRate_125=1 BaudRate_250=1 BaudRate_500=1 BaudRate_800=1 BaudRate_1000=1 SimpleBootUpMaster=1 SimpleBootUpSlave=0 ExtendedBootUpMaster=1 ExtendedBootUpSlave=0 [1018sub0] ParameterName=Number of entries ObjectType=0x7 DataType=0x5 AccessType=ro DefaultValue=2 PDOMapping=0 [1018sub1] ParameterName=VendorID ObjectType=0x7 DataType=0x7 AccessType=ro DefaultValue=0x0 PDOMapping=0 [1018sub2]...
  • Page 103 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Tab [CAN settings] Here you can set the node ID and the baud rate. Device type (this is the default value of the object 1000 entered in the EDS) has 191 as default value (standard IO device) and can be freely changed.
  • Page 104 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Tab [Default PDO mapping] In this tab the assignment between local object directory (OD editor) and PDOs transmitted/received by the CAN device can be defined. Such an assignment is called "mapping". In the object directory entries used (variable OD) the connection to variables of the application is made between object index/sub-index.
  • Page 105 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Example list of variables The data for the variable PLC_PRG.a is to be received on the first receive PDO (COB ID = 512 + node ID) of the CAN device.
  • Page 106 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library In the default PDO mapping of the CAN device the index/sub-index entry is then assigned to a receive PDO as mapping entry. The PDO properties can be defined via the dialogue known from Add and configure CANopen slaves (→...
  • Page 107 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Access to the CAN device at runtime Setting of the node numbers and the baud rate of a CAN device For the CAN device the node number and the baud rate can be set at runtime of the application program.
  • Page 108: Can Network Variables

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library 8.7.5 CAN network variables General information Network variables Network variables are one option to exchange data between two or several controllers. For users the mechanism should be easy to use. At present network variables are implemented on the basis of CAN and UDP.
  • Page 109 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library ► Please note the particularities when using network variables for the corresponding device types. → Chapter Particularities for network variables (→ page 112) Settings in the global variable lists ►...
  • Page 110 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library > The window [Properties] extends as follows: Meaning of the options: Network type As network type you can enter one of the network names indicated in the target settings. If you click on the button [Settings] next to it, you can select the CAN interface: 1.
  • Page 111 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library NOTE In CAN networks the basic identifier is directly used as COB-ID of the CAN messages. It is not checked whether the identifier is also used in the remaining CAN configuration. To ensure a correct exchange of data between two controllers the global variable lists in the two projects must match.
  • Page 112 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Particularities for network variables Device Description ClassicController: Network variables are only supported on interface 1 (enter the value 0). CR0020, CR0505 CAN master ExtendedController: Transmit and receive lists are processed directly. CR0200 You only have to make the settings described above.
  • Page 113: Information On The Emcy And Error Codes

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Device Description PDM360: CR1050, Network variables are supported on interface 1 (value = 0) and 2 (value = CR1051, CR1060 PDM360 compact: CAN master CR1052, CR1053, Transmit and receive lists are processed directly.
  • Page 114 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Identifier The identifier for the error message consists of the sum of the following elements: EMCY default identifier 128 (80 node ID EMCY error code It gives detailed information which error occurred.
  • Page 115 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Overview of CANopen error codes Error Code Meaning (hex) 00xx Reset or no error 10xx Generic error 20xx Current error 21xx Current, device input side 22xx Current inside the device 23xx...
  • Page 116 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Object 1001 (error register) This object reflects the general error state of a CANopen device. The device is to be considered as error free if the object 1001 signals no error any more.
  • Page 117: Library For The Canopen Master

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Overview CANopen EMCY codes All indications for the 1st CAN interface EMCY code Object Manufacturer-specific information Description object 1003 1001 Byte 0 Diagnosis inputs (bits I0...I7) Terminal voltage VBBo/VBBs Memory error CAN1 monitoring SYNC error (only slave)
  • Page 118 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_MASTER_EMCY_HANDLER x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_CANopenMaster_Vxxyyzz.LIB Available for the following devices: •...
  • Page 119 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Parameters of the function inputs Name Data type Description CLEAR_ERROR_FIELD BOOL TRUE: deletes the contents of the array ERROR_FIELD FALSE: function is not executed Parameters of the function outputs Name Data type Description...
  • Page 120 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_MASTER_SEND_EMERGENCY x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_CANopenMaster_Vxxyyzz.LIB Available for the following devices: •...
  • Page 121 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed ERROR FALSE → TRUE (edge): BOOL transmits the given error code TRUE →...
  • Page 122 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Example with function CANx_MASTER_SEND_EMERGENCY In this example 3 error messages will be generated subsequently: ApplError1, Code = 16#FF00 in the error register 16#81 ApplError2, Code = 16#FF01 in the error register 16#81 ApplError3, Code = 16#FF02 in the error register 16#81 The function CAN1_MASTER_EMCY_HANDLER sends the error messages to the error register "Object1001h"...
  • Page 123 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_MASTER_STATUS x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_CANopenMaster_Vxxyyzz.LIB Available for the following devices: •...
  • Page 124 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Parameters of the function inputs Name Data type Description CANOPEN_LED_STATUS BOOL (input not available for PDM devices) TRUE: the status LED of the controller is switched to the mode "CANopen": flashing frequency 0.5 Hz = preoperational flashing frequency 2.0 Hz = operational...
  • Page 125 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Name Data type Description NODE_STATE_SLAVE ARRAY To determine the status of a single network node the [0...MAX_NODEI global array "NodeStateList" can be used. The array NDEX] STRUCT then contains the following elements: NODE_STATE...
  • Page 126 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Parameters of the function outputs Name Data type Description NODE_ID BYTE Node ID of the master BAUDRATE WORD Baud rate of the master NODE_STATE Current status of the master SYNC BOOL SYNC signal of the master...
  • Page 127 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Detailed description of the functionalities of the CANopen master and the mechanisms → chapter CANopen master (→ page 85). Using the controller CR0020 as an example the following code fragments show the use of the function CANx_MASTER_STATUS (→...
  • Page 128 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Structure Emergency_Message Access to the structures at runtime of the application At runtime you can access the corresponding array element via the global variables of the library and therefore read the status or EMCY messages or reset the node.
  • Page 129: Library For The Canopen Slave

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library 8.7.8 Library for the CANopen slave The library ifm_CRnnnn_CANopenSlave_Vxxyyzz.LIB provides a number of functions for the CANopen slave (= CANopen device = CANopen node) which will be explained below.
  • Page 130 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_SLAVE_NODEID x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_CANopenSlave_Vxxyyzz.LIB Available for the following devices: •...
  • Page 131 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_SLAVE_EMCY_HANDLER x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_CANopenSlave_Vxxyyzz.LIB Available for the following devices: •...
  • Page 132 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Parameters of the function inputs Name Data type Description FALSE → TRUE (edge): CLEAR_ERROR_FIELD BOOL Delete ERROR FIELD FALSE: function is not executed Parameters of the function outputs Name Data type Description...
  • Page 133 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_SLAVE_SEND_EMERGENCY x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_CANopenSlave_Vxxyyzz.LIB Available for the following devices: •...
  • Page 134 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed ERROR BOOL FALSE → TRUE (edge): transmits the given error code TRUE →...
  • Page 135 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Example with function CANx_SLAVE_SEND_EMERGENCY In this example 3 error messages will be generated subsequently: ApplError1, Code = 16#FF00 in the error register 16#81 ApplError2, Code = 16#FF01 in the error register 16#81 ApplError3, Code = 16#FF02 in the error register 16#81 The function CAN1_SLAVE_EMCY_HANDLER sends the error messages to the error register "Object1001h"...
  • Page 136 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_SLAVE_STATUS x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_CANopenSlave_Vxxyyzz.LIB Available for the following devices: •...
  • Page 137 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Example: Parameters of the function inputs Name Data type Description GLOBAL_START BOOL TRUE: all connected network participants (slaves) are started simultaneously during network initialisation. FALSE: the connected network participants are started one after the other.
  • Page 138 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Name Data type Description CLEAR_OD_CHANGED_FLAG BOOL FALSE → TRUE (edge): Delete the flags "data in the object directory changed" and "index position" FALSE: function is not executed Parameters of the function outputs Name Data type...
  • Page 139: Further Ifm Libraries For Canopen

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library 8.7.9 Further ifm libraries for CANopen Here we present further functions which are sensible additions for CANopen.
  • Page 140 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_SDO_READ x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB ifm_CANx_SDO_Vxxyyzz.LIB Available for the following devices: Available for the following devices: CabinetController: CR0301, CR0302, CR0303 PDM360: CR1050, CR1051, CR1060...
  • Page 141 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Example: Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed NODE BYTE Number of the node WORD Index in object directory SUBIDX...
  • Page 142 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Function CANx_SDO_WRITE x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB ifm_CANx_SDO_Vxxyyzz.LIB Available for the following devices: Available for the following devices: CabinetController: CR0301, CR0302, CR0303 PDM360: CR1050, CR1051, CR1060...
  • Page 143 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller ifm CANopen library Example: Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed NODE BYTE number of the node WORD Index in object directory SUBIDX...
  • Page 144: Summary Can / Canopen

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Summary CAN / CANopen Summary CAN / CANopen • The COB ID of the network variables must differ from the CANopen Device ID in the controller configuration and from the IDs of the functions CANx_TRANSMIT and CANx_RECEIVE! •...
  • Page 145: Use Of The Can Interfaces To Sae J1939

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Use of the CAN interfaces to SAE J1939 The CAN interfaces in the ecomatmobile controllers can also be used for communication with special bus protocols for drive technology and utility vehicles.
  • Page 146 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Example of a detailed message documentation: ETC1: Electronic Transmission Controller #1 (3.3.5) 0CF00203 Transmission repetition rate 10 ms Data length: 8 bytes PDU format PDU specific...
  • Page 147 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Example of a short message documentation: But even if the aggregate manufacturer only provides a short documentation, the function parameters can be derived from the identifier.
  • Page 148: Function J1939_X

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 8.9.1 Function J1939_x x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_J1939_x_Vxxyyzz.LIB Available for: •...
  • Page 149 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed START BOOL TRUE (only for 1 cycle):...
  • Page 150: Function J1939_X_Receive

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 8.9.2 Function J1939_x_RECEIVE x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_J1939_x_Vxxyyzz.LIB Available for: •...
  • Page 151 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed CONFIG BOOL TRUE (only for 1 cycle):...
  • Page 152: Function J1939_X_Transmit

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 8.9.3 Function J1939_x_TRANSMIT x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_J1939_x_Vxxyyzz.LIB Available for: •...
  • Page 153 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed PRIO BYTE Message priority (0...7)
  • Page 154: Function J1939_X_Response

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 8.9.4 Function J1939_x_RESPONSE x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_J1939_x_Vxxyyzz.LIB Available for: •...
  • Page 155 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed CONFIG BOOL TRUE (only for 1 cycle):...
  • Page 156: Function J1939_X_Specific_Request

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 8.9.5 Function J1939_x_SPECIFIC_REQUEST x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_J1939_x_Vxxyyzz.LIB Available for: •...
  • Page 157 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed PRIO BYTE Priority (0...7)
  • Page 158: Function J1939_X_Global_Request

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 8.9.6 Function J1939_x_GLOBAL_REQUEST x = number 1...n of the CAN interface (depending on the device, → data sheet) Contained in the library: ifm_J1939_x_Vxxyyzz.LIB Available for: •...
  • Page 159 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 CAN in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed PRIO BYTE Priority (0...7)
  • Page 160: Pwm In The Ecomatmobile Controller

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Use of the CAN interfaces to SAE J1939 PWM in the ecomatmobile controller PWM signal processing ......................161 Current control with PWM....................... 172 Hydraulic control in PWM ....................... 178 In this chapter you will find out more about the pulse width modulation in the controller.
  • Page 161: Pwm Signal Processing

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing PWM signal processing The abbreviation PWM stands for pulse width modulation. It is mainly used to trigger proportional valves (PWM valves) for mobile and robust controller applications. Also, with an additional component (accessory) for a PWM output the pulse-width modulated output signal can be converted into an analogue output voltage.
  • Page 162 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing The PWM frequency is implemented by means of an internally running counter, derived from the CPU pulse. This counter is started with the initialisation of the function PWM. Depending on the PWM output group (0...3 and / or 4...7 or 4...11), it counts from FFFF backwards or from 0000 forwards.
  • Page 163 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing Calculation examples RELOAD value ClassicController SmartController ExtendedController CabinetController (CR0301/CR0302) SafetyController PCB controller CabinetController (CR0303) The PWM frequency shall be 400 Hz. The PWM frequency shall be 200 Hz. 20 MHz 10 MHz _________ = 50 000...
  • Page 164 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing Example: The PWM frequency shall be 200 Hz. 2.5 MHz _________ = 12 500 = 30D4 200 Hz RELOAD value = 10 000 – 30D4 = CF2C Thus the permissible range of the PWM value is the range from CF2C to FFFF...
  • Page 165 CD "Software, Tools and Documentation", projects with examples have been stored in the program directory of your PC: …\ifm electronic\CoDeSys V…\Projects\DEMO_PLC_CDV… (for controllers) or …\ifm electronic\CoDeSys V…\Projects\DEMO_PDM_CDV… (for PDMs). There you also find projects with examples regarding this subject. It is strongly recommended to follow the shown procedure.
  • Page 166: Function Pwm

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing 9.1.2 Function PWM Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 167 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing Using the function OUTPUT_CURRENT (→ page 176) a current measurement for the initialised PWM channel can be implemented. PWM_Dither is called once for each channel during initialisation of the application program. When doing so, input INIT must be set to TRUE.
  • Page 168: Function Pwm100

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing 9.1.3 Function PWM100 IMPORTANT: New ecomatmobile controllers only support the function PWM1000 (→ page 169). Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: •...
  • Page 169 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing A current measurement for the initialised PWM channel can be implemented: • via the function OUTPUT_CURRENT (→ page 176) • or for example using the unit EC2049 (series element for current measurement).
  • Page 170: Function Pwm1000

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing 9.1.4 Function PWM1000 Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 •...
  • Page 171 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller PWM signal processing A current measurement for the initialised PWM channel can be implemented: • via the function OUTPUT_CURRENT (→ page 176) • or for example using the unit EC2049 (series element for current measurement).
  • Page 172: Current Control With Pwm

    This device of the ecomatmobile controller family can measure the actually flowing current on certain outputs and use the signal for further processing. For this purpose ifm electronic provides the user with some functions. 9.2.1 Current measurement with PWM channels...
  • Page 173: Function Output_Current_Control

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Current control with PWM 9.2.2 Function OUTPUT_CURRENT_CONTROL Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • SafetyController: CR7020, CR7021, CR7200, CR7201, CR7505, CR7506 •...
  • Page 174 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Current control with PWM Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed INIT BOOL TRUE (only in the 1st cycle): function initialised FALSE: during processing of the program OUTPUT_CHANNEL...
  • Page 175: Function Occ_Task

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Current control with PWM 9.2.3 Function OCC_TASK Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices (NOT for SafetyController): • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • SafetyController: CR7020, CR7200, CR7505 Function symbol: OCC_TASK...
  • Page 176 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Current control with PWM Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed INIT BOOL TRUE (in the 1st cycle): function initialised FALSE: during processing of the program OUTPUT_CHANNEL...
  • Page 177: Function Output_Current

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Current control with PWM 9.2.4 Function OUTPUT_CURRENT Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 • SafetyController: CR7020, CR7021, CR7032, CR7200, CR7201, CR7232, CR7505, CR7506 •...
  • Page 178: Hydraulic Control In Pwm

    SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Hydraulic control in PWM ifm electronic offers the user special functions to control hydraulic systems as a special field of current regulation with PWM. 9.3.1 The purpose of this library? – An introduction...
  • Page 179: What Does A Pwm Output Do

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Control hydraulic valves with current-controlled outputs As a rule hydraulic valves do not have a completely linear characteristic: Typical characteristic curve of a hydraulic valve: The oil flow starts at approx.
  • Page 180: What Is The Dither

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Figure: The profile of the PWM voltage U and the coil current I at 100 % switch-on time: The effective coil current I is also 100 % 9.3.3 What is the dither? If a proportional hydraulic valve is controlled, its piston does not move right away and at first not...
  • Page 181 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM At a higher PWM frequency (standard value 250 Hz up to 1 kHz) the remaining movement of the valve piston is so short or so slow that this effectively results in a standstill so that the valve piston can again get stuck in its current position (and will do so!) (→...
  • Page 182: Functions Of The Library "Ifm_Hydraulic_16Bitos05_Vxxyyzz.lib

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Example Dither The dither frequency is 1/8 of the PWM frequency. The dither amplitude is 10 %. With the switch-on time of 50 % in the figure, the actual switch-on time for 4 pulses is 60 % and for the next 4 pulses it is 40 % which means an average of 50 % switch-on time.
  • Page 183: Function Control_Occ

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM 9.3.5 Function CONTROL_OCC Contained in the library: ifm_HYDRAULIC_16bitOS05_Vxxyyzz.Lib Available for the following devices: • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • SafetyController: CR7020, CR7021, CR7200, CR7201, CR7505, CR7506 •...
  • Page 184 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM If the function input MANUAL is set to "0", the controller is always self-optimising. The performance of the controlled system is permanently monitored and the updated compensation values are automatically and permanently stored in each cycle.
  • Page 185 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Name Data type Description MANUAL BYTE Value = 0: the controller operates in a self-optimising way. Value > 0: the self-optimising performance of the controller is overwritten (typical: 50).
  • Page 186: Function Joystick_0

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM 9.3.6 Function JOYSTICK_0 Contained in the library: ifm_HYDRAULIC_16bitOS05_Vxxyyzz.Lib Available for the following devices: • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • SafetyController: CR7020, CR7021, CR7200, CR7201, CR7505, CR7506 •...
  • Page 187 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Mode 0: characteristic curve linear for the range XL to XH Mode 1: Characteristic curve linear with dead band Values fixed to: Dead band: 0…10% of 1000 increments Mode 2: 2-step linear characteristic curve with...
  • Page 188 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Parameters of the function inputs Name Data type Description Preset value input in [increments]. XH_POS Max. preset value positive direction in [increments] (negative values also permissible). XL_POS Min.
  • Page 189 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Parameters of the function outputs Name Data type Description OUT1 WORD Standardised output value pairs of values 0 to 10 [increments] e.g. for valve left OUT2 WORD Standardised output value...
  • Page 190: Function Joystick_1

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM 9.3.7 Function JOYSTICK_1 Contained in the library: ifm_HYDRAULIC_16bitOS05_Vxxyyzz.Lib Available for the following devices: • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • SafetyController: CR7020, CR7021, CR7200, CR7201, CR7505, CR7506 •...
  • Page 191 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Mode 1: Characteristic curve linear with dead band Value for the dead band (DB) can be set in % of 1000 increments 100 % = 1000 increments DB = Dead_Band Mode 2: 2-step linear characteristic curve with...
  • Page 192 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Parameters of the function inputs Name Data type Description Preset value input in [increments]. XH_POS Max. preset value positive direction in [increments] (negative values also permissible). XL_POS Min.
  • Page 193 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Parameters of the function outputs Name Data type Description OUT1 WORD Standardised output value pairs of values 0 to 10 [increments] e.g. for valve left OUT2 WORD Standardised output value...
  • Page 194: Function Joystick_2

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM 9.3.8 Function JOYSTICK_2 Contained in the library: ifm_HYDRAULIC_16bitOS05_Vxxyyzz.Lib Available for the following devices: • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 • SafetyController: CR7020, CR7021, CR7200, CR7201, CR7505, CR7506 •...
  • Page 195 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Parameters of the function inputs Name Data type Description Preset value input in [increments]. XH_POS Max. preset value positive direction in [increments] (negative values also permissible). XL_POS Min.
  • Page 196 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Parameters of the function outputs Name Data type Description OUT1 WORD Standardised output value pairs of values 0 to 10 [increments] e.g. for valve left OUT2 WORD Standardised output value...
  • Page 197: Function Norm_Hydraulic

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM 9.3.9 Function NORM_HYDRAULIC Contained in the library: ifm_HYDRAULIC_16bitOS04_Vxxyyzz.LIB ifm_HYDRAULIC_32bit_Vxxyyzz.LIB ifm_HYDRAULIC_16bitOS05_Vxxyyzz.LIB Available for the following devices: Available for the following devices: ClassicController: CR0020, CR0505 ClassicController: CR0032 ExtendedController: CR0200 ExtendedController: CR0232 SafetyController: CR7020, CR7021, CR7200,...
  • Page 198 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Characteristics of the function Parameters of the function inputs Name Data type Description DINT Desired value input DINT Max. input value [increments] DINT Min. input value [increments] DINT Max.
  • Page 199 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 PWM in the ecomatmobile controller Hydraulic control in PWM Examples NORM_HYDRAULIC Parameter Case 1 Case 2 Case 3 Upper limit value input XH 2000 Lower limit value input XL Upper limit value output YH 2000 Lower limit value output YL 2000...
  • Page 200: More Functions In The Ecomatmobile Controller

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement More functions in the ecomatmobile controller Counter functions for frequency and period measurement ............ 200 Software reset......................... 215 Saving, reading and converting data in the memory .............. 216 Data access and data check ....................
  • Page 201: Applications

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement 10.1.1 Applications It must be taken into account that the different measuring methods can cause errors in the frequency detection. The function FREQUENCY (→...
  • Page 202: Function Frequency

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement 10.1.3 Function FREQUENCY Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 203 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement Parameters of the function inputs Name Data type Description INIT BOOL TRUE (only 1 cycle): function initialised. FALSE: during cyclical processing of the program. CHANNEL BYTE Number of the input (0...x value depending on the device).
  • Page 204: Function Period

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement 10.1.4 Function PERIOD Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 205 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement Parameters of the function inputs Name Data type Description INIT BOOL TRUE (only 1 cycle): function initialised FALSE: during cyclical processing of the program CHANNEL BYTE Number of the input (0...x value depending on the device)
  • Page 206: Function Period_Ratio

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement 10.1.5 Function PERIOD_RATIO Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 207 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement Parameters of the function inputs Name Data type Description INIT BOOL TRUE (only 1 cycle): function initialised FALSE: during cyclical processing of the program CHANNEL BYTE Number of the input (0...x value depending on the device)
  • Page 208: Function Phase

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement 10.1.6 Function PHASE Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 209 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement Parameters of the function inputs Name Data type Description INIT BOOL TRUE (only 1 cycle): function is initialised FALSE: during processing of the program CHANNEL BYTE Channel pair 0 or 1...
  • Page 210: Function Inc_Encoder

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement 10.1.7 Function INC_ENCODER Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 211 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement NOTE Depending on the further load on the unit the limit frequency might fall when "many" encoders are evaluated. If the load is too high the cycle time can get unacceptably long (→ system resources, → page 42). Via PRESET_VALUE the counter can be set to a preset value.
  • Page 212 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement Parameters of the function inputs Name Data type Description INIT BOOL TRUE (only 1 cycle): function initialised. FALSE: during cyclical processing of the program. CHANNEL BYTE Number of the input pair (0...3).
  • Page 213: Function Fast_Count

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement 10.1.8 Function FAST_COUNT Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 214 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Counter functions for frequency and period measurement Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed, starting from the start value. FALSE: function is not executed.
  • Page 215: Software Reset

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Software reset 10.2 Software reset Using this function the control can be restarted via an order in the application program. 10.2.1 Function SOFTRESET Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: •...
  • Page 216: Saving, Reading And Converting Data In The Memory

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Saving, reading and converting data in the memory 10.3 Saving, reading and converting data in the memory 10.3.1 Automatic data backup The Ecomatmobil controllers allow to save data (BOOL, BYTE, WORD, DWORD) non-volatilely (= saved in case of voltage failure) in the memory.
  • Page 217: Function Memcpy

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Saving, reading and converting data in the memory 10.3.3 Function MEMCPY Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 218: Function Flashwrite

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Saving, reading and converting data in the memory 10.3.4 Function FLASHWRITE Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 219 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Saving, reading and converting data in the memory Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed Relative start address in the memory.
  • Page 220: Function Flashread

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Saving, reading and converting data in the memory 10.3.5 Function FLASHREAD Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 221: Function E2Write

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Saving, reading and converting data in the memory 10.3.6 Function E2WRITE Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302 • PCB controller: CS0015 •...
  • Page 222: Function E2Read

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Saving, reading and converting data in the memory 10.3.7 Function E2READ Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302 • PCB controller: CS0015 •...
  • Page 223: Data Access And Data Check

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check 10.4 Data access and data check The functions described in this chapter control the data access and enable a data check. 10.4.1 Function SET_DEBUG Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB...
  • Page 224: Function Set_Identity

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check 10.4.2 Function SET_IDENTITY Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 225 Nozzle in front Nozzle in front Downloader reads: Downloader reads: BOOTLD_H 020923 CR0020 CR0020 00.00.01 V2.0.0 041004 ifm electronic gmbh Nozzle in front CANopen tool reads: Hardware version OBV 1009 CR0020 00.00.01 Parameters of the function inputs Name Data type...
  • Page 226: Function Get_Identity

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check 10.4.3 Function GET_IDENTITY Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • ClassicController: CR0032 • ExtendedController: CR0232 Function symbol: GET_IDENTITY DEVICENAME ENABLE FIRMWARE...
  • Page 227 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check Parameters of the function outputs Name Data type Description DEVICENAME STRING(31) Hardware name and version as string of max. 31 characters e.g.: "CR0032 00.00.01" FIRMWARE STRING(31) Name of the runtime system...
  • Page 228: Function Set_Password

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check 10.4.4 Function SET_PASSWORD Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 229 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE (only 1 cycle): ID set FALSE: function is not executed PASSWORD STRING Password (maximum string length 16)
  • Page 230: Function Check_Data

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check 10.4.5 Function CHECK_DATA Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 231 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Data access and data check Parameters of the function inputs Name Data type Description STARTADR DINT Start address of the monitored data memory (WORD address as from %MW0) LENGTH WORD Length of the monitored data memory in [byte]...
  • Page 232: Processing Interrupts

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing interrupts 10.5 Processing interrupts The PLC cyclically processes the stored application program in its full length. The cycle time can vary due to program branchings which depend e.g. on external events (= conditional jumps). This can have negative effects on certain functions.
  • Page 233: Function Set_Interrupt_Xms

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing interrupts 10.5.1 Function SET_INTERRUPT_XMS Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 •...
  • Page 234 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing interrupts NOTE To avoid that the program block called by interrupt is additionally called cyclically, it should be skipped in the cycle (with the exception of the initialisation call). Several timer interrupt blocks can be active.
  • Page 235 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing interrupts Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE (only 1 cycle): changes to data allowed FALSE: changes to data not allowed (during processing of the program) REPEATTIME TIME...
  • Page 236: Function Set_Interrupt_I

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing interrupts 10.5.2 Function SET_INTERRUPT_I Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 237 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing interrupts read and written in the interrupt routine, triggered by the input edge. Reading and writing can be stopped via the function inputs READ_INPUTS, WRITE_OUTPUTS and ANALOG_INPUTS. So in the program block all time-critical events can be processed by linking inputs or global variables and writing outputs.
  • Page 238 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing interrupts Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE (only for 1 cycle): changes to data permissible FALSE: changes to data not permitted (during processing of the program) CHANNEL BYTE...
  • Page 239: Use Of The Serial Interface

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Use of the serial interface 10.6 Use of the serial interface NOTE In principle, the serial interface is not available for the user because it is used for program download and debugging.
  • Page 240: Function Serial_Setup

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Use of the serial interface 10.6.1 Function SERIAL_SETUP Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 241 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Use of the serial interface Parameters of the function inputs Name Data type Description ENABLE BOOL TRUE (only 1 cycle): interface is initialised FALSE: running operation BAUDRATE BYTE Baud rate (permissible values = 9 600, 19 200, 28 800, (57 600))
  • Page 242: Function Serial_Tx

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Use of the serial interface 10.6.2 Function SERIAL_TX Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 243: Function Serial_Rx

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Use of the serial interface 10.6.3 Function SERIAL_RX Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 244 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Use of the serial interface Parameters of the function outputs Name Data type Description BYTE Byte data received from the receive buffer AVAILABLE WORD Number of data bytes received 0 = no valid data available OVERFLOW BOOL...
  • Page 245: Function Serial_Pending

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Use of the serial interface 10.6.4 Function SERIAL_PENDING Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 246: Reading The System Time

    More functions in the ecomatmobile controller Reading the system time 10.7 Reading the system time The following functions offered by ifm electronic allow you to read the continually running system time of the controller and to evaluate it in the application program. 10.7.1 Function TIMER_READ Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB...
  • Page 247: Function Timer_Read_Us

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Reading the system time 10.7.2 Function TIMER_READ_US Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 •...
  • Page 248: Processing Analogue Input Values

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing analogue input values 10.8 Processing analogue input values In this chapter we show you functions which allow you to read and process the values of analogue voltages or currents at the controller input.
  • Page 249: Function Input_Analog

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing analogue input values 10.8.1 Function INPUT_ANALOG Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 250 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing analogue input values Parameters of the function outputs Name Data type Description WORD Output value...
  • Page 251: Function Input_Voltage

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing analogue input values 10.8.2 Function INPUT_VOLTAGE Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 252: Function Input_Current

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Processing analogue input values 10.8.3 Function INPUT_CURRENT Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 253: Adapting Analogue Values

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Adapting analogue values 10.9 Adapting analogue values If the values of analogue inputs or the results of analogue functions must be adapted, the following functions will help you.
  • Page 254: Function Norm

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Adapting analogue values 10.9.1 Function NORM Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 •...
  • Page 255 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 More functions in the ecomatmobile controller Adapting analogue values Parameters of the function inputs Name Data type Description WORD current input value WORD upper limit of input value range WORD lower limit of input value range WORD upper limit of output value range WORD...
  • Page 256: Controller Functions In The Ecomatmobile Controller

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller General Controller functions in the ecomatmobile controller General ........................... 256 Setting rule for a controller ..................... 258 Functions for controllers ......................259 11.1 General Controlling is a process during which the unit to be controlled (control variable x) is continuously detected and compared with the reference variable w.
  • Page 257: Controlled System Without Inherent Regulation

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller General 11.1.2 Controlled system without inherent regulation Controlled systems with an amplifying factor towards infinity are referred to as controlled systems without inherent regulation. This is usually due to an integrating performance. The consequence is that the control variable increases constantly after the manipulated variable has been changed or by the influence of an interfering factor.
  • Page 258: Setting Rule For A Controller

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Setting rule for a controller 11.2 Setting rule for a controller For controlled systems, whose time constants are unknown the setting procedure to Ziegler and Nickols in a closed control loop is of advantage. 11.2.1 Setting control At the beginning the controlling system is operated as a purely P-controlling system.
  • Page 259: Functions For Controllers

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers 11.3 Functions for controllers The section below describes in detail the functions that are provided for set-up by software controllers in the ecomatmobile controller. The functions can also be used as basis for the development of your own control functions.
  • Page 260: Function Delay

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers 11.3.1 Function DELAY Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 •...
  • Page 261 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers Parameters of the function inputs Name Data type Description WORD Input value TIME Time delay (dead time) Parameters of the function outputs Name Data type Description WORD Input value, delayed by the time T...
  • Page 262: Function Pt1

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers 11.3.2 Function PT1 Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 •...
  • Page 263 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers Parameters of the function inputs Name Data type Description Input value TIME Delay time (time constant) Parameters of the function outputs Name Data type Description Output variable...
  • Page 264: Function Pid1

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers 11.3.3 Function PID1 Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 •...
  • Page 265 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers The manipulated variable Y has the following time characteristics: KI * X KP * X Figure: Typical step response of a PID controller Parameters of the function inputs Name Data type Description...
  • Page 266: Function Pid2

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers 11.3.4 Function PID2 Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0032, CR0505 • ExtendedController: CR0200, CR0232 •...
  • Page 267 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers If X > XS, the manipulated variable is increased. If X < XS, the manipulated variable is reduced. A reference variable is internally added to the manipulated variable. Y = Y + 65,536 –...
  • Page 268 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers Recommended setting ► Select TN according to the time characteristics of the system: fast system = small TN slow system = large TN ► Slowly increment KP gradually, up to a value at which still definitely no fluctuation will occur. ►...
  • Page 269: Function Glr

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers 11.3.5 Function GLR Contained in the library: ifm_CRnnnn_Vxxyyzz.LIB Available for the following devices: • CabinetController: CR0301, CR0302, CR0303 • ClassicController: CR0020, CR0505 • ExtendedController: CR0200 •...
  • Page 270 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Controller functions in the ecomatmobile controller Functions for controllers Parameters of the function inputs Name Data type Description WORD actual value channel 1 WORD actual value channel 2 WORD desired value = reference variable XMAX WORD maximum value of the desired value...
  • Page 271: Annex

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Functions for controllers Annex Address assignment and I/O operating modes ..............272 System flags ........................... 274 Overview of the files and libraries used.................. 275 Additionally to the indications in the data sheets you find summary tables in the annex.
  • Page 272: Address Assignment And I/O Operating Modes

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Address assignment and I/O operating modes 12.1 Address assignment and I/O operating modes → also data sheet 12.1.1 Addresses / variables of the I/Os Port IEC address I/O variable Remark %QB4 I0_MODE configuration byte for %IX0.0 flag bit*) ERROR_I0...
  • Page 273: Possible Operating Modes Inputs / Outputs

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Address assignment and I/O operating modes IEC address Name IO Configuration with Default Possible configuration variable variable value %QX1.8 H digital / PWM / PWM PWM description → chapter PWM signal processing (→ page 161) description →...
  • Page 274: System Flags

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex System flags 12.2 System flags (→ chapter Error codes and diagnostic information, → page 39) System flag Type Function CANx_BAUDRATE WORD CAN interface x: Currently set baud rate CANx_BUSOFF BOOL CAN interface x: Interface is not on the bus CANx_LASTERROR ¹) BYTE CAN interface x: Error number of the last CAN...
  • Page 275: Overview Of The Files And Libraries Used

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Overview of the files and libraries used 12.3 Overview of the files and libraries used (as on 2 Feb. 2009) Depending on the unit and the desired function, different libraries and files are used. Some are automatically loaded, others must be inserted or loaded by the programmer.
  • Page 276 ²) valid for CRnn32 target version from V02 onwards, all other devices from V05 onwards: *) memory location of the files: System drive (C: / D:) \ program folder\ ifm electronic NOTE: The software versions suitable for the selected target must always be used: •...
  • Page 277: What Are The Individual Files And Libraries Used For

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Overview of the files and libraries used 12.3.2 What are the individual files and libraries used for? The following overview shows which files/libraries can and may be used with which unit. It may be possible that files/libraries which are not indicated in this list can only be used under certain conditions or the functionality has not yet been tested.
  • Page 278 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Overview of the files and libraries used ifm CANopen libraries master / slave ® These libraries are based on the CoDeSys libraries (3S CANopen functions) and make them available to the user in a simple way. File name Function Available for:...
  • Page 279 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Overview of the files and libraries used ¹) valid for CRnn32 target version up to V01, all other devices up to V04 ²) valid for CRnn32 target version from V02 onwards, all other devices from V05 onwards: Specific ifm libraries File name Function...
  • Page 280 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Overview of the files and libraries used File name Function Available for: ifm_CAN1_EXT_ Vxxyyzz.LIB changes the CAN bus from 11 bits to 29 from target V05: bits CabinetController: CR0301, CR0302, CR0303 ClassicController: CR0020, CR0505 ExtendedController: CR0200 PCB controller: CS0015 SafetyController: CR7020, CR7021,...
  • Page 281 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Annex Overview of the files and libraries used File name Function Available for: Instrumente_x.LIB predefined display instruments all PDM360 monitors Symbols_x.LIB predefined symbols PDM360: CR1050, CR1051, CR1060 PDM360 compact: CR1052, CR1053, CR1055, CR1056 Segment_x.LIB predefined 7-segment displays PDM360: CR1050, CR1051, CR1060...
  • Page 283: Glossary Of Terms

    System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms Glossary of Terms CAN = Controller Area Network CAN is a priority controlled fieldbus system for Address larger data volumes. It is available in different variants, e.g. "CANopen" or "CAN in This is the "name"...
  • Page 284 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms CiA DS 402 CoDeSys ® DS = Draft Standard CoDeSys is a registered trademark of 3S – Smart Software Solutions GmbH, Germany. CAN device profile for drives "CoDeSys for Automation Alliance" associates companies of the automation industry whose CiA DS 403 hardware devices are all programmed with the...
  • Page 285 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms Demand rate rd The actual implementation may vary according to the application and the requested safety: The demand rate r is the frequency of • use of components of several demands to a safety-related reaction of an manufacturers, SRP/CS per time unit.
  • Page 286 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms environment. The devices must not interfere hardware failure is less likely to lead to the with their environment and must not be overall dangerous or fail-to-function state. adversely influenced by external electromagnetic interference.
  • Page 287 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms First fault occurrence time Heartbeat Time until the first failure of a safety element. The participants regularly send short signals. In this way the other participants can verify if a The operating system verifies the controller by participant has failed.
  • Page 288 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms The MTTF is the expectation of the mean time Monitoring to dangerous failure. Safety function which ensures that a protective Designation Range measure is initiated: 3 years < MTTF < 10 years •...
  • Page 289 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms Operational Operating state of a CANopen participant. In this mode SDOs, NMT commands and PDOs can be transferred. NMT = Network Management = (here: in the CAN bus) The NMT master controls the operating states of the NMT slaves.
  • Page 290 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms - dependent for its operation on one or more programmable electronic devices, Programming language, safety- - including all elements of the system such as related input and output devices. Only the following programming languages shall be used for safety-related applications: Pictogram •...
  • Page 291 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms information), avoid that a systematic fault causes all - personal protective equipment (helmet, redundant systems to fail (diverse protective goggles). redundancy). The software of redundant systems should differ in the following aspects: •...
  • Page 292 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms - bring the machine into a safe state in time in • hazard identification (intervention of the event of a failure of the safety function. people, operating status of the machine, foreseeable misuse) and •...
  • Page 293 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms SRVT Examples: The SRVT (Safety-Related Object Validation • Automatic configuration of all slaves via Time) ensures with CANopen safety that the SDOs at the system start, time between the SRDO-message pairs is •...
  • Page 294 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Glossary of Terms Template A template can be filled with content. Watchdog Here: A structure of pre-configured software elements as basis for an application program. In general the term watchdog is used for a component of a system which watches the function of other components.
  • Page 295 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Index CAN interfaces ............ 48 Index CAN network variables......48, 83, 108 About the ifm templates ......... 17, 18 CAN-ID ............49, 50 About this manual ..........7 CANopen master........83, 85, 127 Above-average stress ........... 42 CANopen support by CoDeSys ......
  • Page 296 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Index Cycle time ............284 Example with function CANx_MASTER_STATUS ................127 Damping of overshoot........258 Example with function Data access and data check ........ 223 CANx_SLAVE_SEND_EMERGENCY ... 135 Data reception ............50 Examples NORM_HYDRAULIC ..... 199 Data transmission..........
  • Page 297 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Index Function CANx_SLAVE_SEND_EMERGENCY Function PHASE...........30, 208 ............100, 107, 114, 133 Function PID1............ 264 Function CANx_SLAVE_STATUS ..107, 136 Function PID2............ 266 Function CANx_TRANSMIT....49, 50, 72 Function PT1..........258, 262 Function CHECK_DATA........230 Function PWM........161, 162, 166 Function configuration of the inputs and outputs..
  • Page 298 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Index ifm demo programs ..........25 Obj / object ............289 ifm device libraries..........277 Object directory ..........289 OBV..............289 Information concerning the device....... 11 Information concerning the software ....11 Operating modes ..........37 Information on the EMCY and error codes....
  • Page 299 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Index Protective measure ..........290 Set up programming system via templates... 16 PWM..............291 Setting control............ 258 PWM / PWM1000 ..........161 Setting of the node numbers and the baud rate of a CAN device ..........107 PWM channels 0...3 ...........
  • Page 300 System Manual ecomatmobile SmartController (CR2500, CR2502) V05 Index Tab [Default PDO mapping]......104 Tab [Receive PDO-Mapping] and [Send PDO- Mapping].............. 90 Tab [Service Data Objects] ....91, 140, 142 Target ..............293 Target file............277 TCP ..............293 Template ............294 TEST mode ............

This manual is also suitable for:

Ecomat 100 ecomatmobile smartcontroller cr2502

Table of Contents