Page 2
System manual ecomat 100 type R 360, April 1999 Guarantee This manual was written with the utmost care. However, we cannot assume any guarantee for the contents. Since errors cannot be avoided despite all efforts we appreciate any comment. We reserve the right to make technical alterations to the product which might result in a change of contents of the manual.
6.6. Description of the CAN function blocks 6.7. CANopen in the ecomat R 360 6.8. The ecomat R 360 as CANopen slave 6.9. The ecomat R 360 as CANopen master 6.10. Functions for CANopen I/O modules from ifm electronic page 3...
Page 4
7. PWM in the ecomat R 360 8. Fast counters in the ecomat R 360 9. Other functions in the ecomat R 360 9.1. Software reset 9.2. Save data in memory and read 9.3. Use of the serial interface 9.4. Reading the system time 9.5.
The terminals may only be supplied with the signals indicated in the technical data or on the unit label and only the approved accessories of ifm electronic gmbh may be connected. The unit can be operated within a wide temperature range according to the technical specification indicated below.
The programmer has to obtain information about the special characteristics of the hardware and software in the additional documentation which can be obtained on request. ifm electronic gmbh Teichstr. 4 D 45127 Essen Tel.: 0201 / 2422-0 Fax: 0201 / 2422-303...
The user is responsible for the safe functioning of the application programs which creates himself. necessary, he must additionally obtain an approval according to the corresponding national regulations by the relevant testing and supervisory organisations. 1.3. Controller configuration The ecomat R 360 is a customer or application-specific concept for series use which means that the control modules have the optimum configuration to the application.
1.4. Technical data Housing: closed, screened metal housing with flange fastening Housing dimensions: 225 x 153 x 43 mm (WxHxD), without connector 240 x 153 x 43 mm (WxHxD), with connector Mounting position: preferably vertical, alternatively horizontal Connection of the unit: 55-pin connector, latched, protected against reverse polarity, AMP pr Framatom type housing with crimp connection contacts AMP junior timer 0.5/2.5 mm...
Page 9
Binary input Low-Side (PNP): ≥ 10 V, I ≥ 3.3 mA Inputs IX0.0 ... IX0.7: switch-on level ≤ 5 V, I ≤ 1.7 mA switch-off level input frequency 50 Hz , I ≥ 6.7 mA Inputs IX0.8 ... IX0.39: switch-on level 0.6 U ...
Page 10
Binary output High-Side (PNP): Outputs QX0.0 ... QX0.23: semiconductor output; short-circuit and overload protection, diagnostic capability as an option switching voltage 10 ... 17 V (12 V DC); 11 ... 32 V (24 V DC) switching current 50 mA ... 2.5 A overload current sum current 10 A (per 8 outputs)
Page 11
Input Test: For the duration of the test operation (e.g. programming) the connection needs to be connected to U (supply). For ”RUN” operation the input needs to be disconnected from (supply). Output Error (pin 13): semiconductor output; short-circuit and overload protection switching voltage 10 ...
1.5. Mounting of the modules In order to expose the controller modules to the minimum mechanical stress they should preferably mounted horizontally or vertically on the mounting panel. The module must be fixed with four screws to DIN 7500 or DIN 7984 (M5 x If possible, the modules should be mounted in such a way that the cable entry of the plug points downwards.
Page 13
If an output terminal receives current externally, e.g. for bidirectional inputs and outputs, the output rail must not be floating (i.e. open-circuit) Reason The supply voltage is fed back to the output rail via the integrated protective diode in the output. If a second output connected to the same potential is switched, the load of this output is fed through the transistor of the first output thus causing the first output to overload and fail.
The monitoring function The safe operation of the controller outputs is ensured by the monitoring function. 2.1. Hardware setup The relay is triggered on two channels via the µcontroller. For this purpose the negative channel is triggered by means of an AND link of the watchdog signal (internal µcontroller monitoring) and the RELAY bit with a semiconductor switch.
2.2. Function of the monitoring concept While the program is running the monitoring relay is under the complete control of the software user. A parallel contact from the safety circuit for example can be evaluated as an input and the monitoring relay can be switched off. For further safety the appropriate national regulations must be applied.
Unit I/O configuration The unit I/O configurations described in the annex are available as standard units (ex stock). They cover the required specifications for most of the applications. Depending customer’s requirements series applications it is possible to realise other configurations, e.g. regarding the arrangement of inputs and outputs and the design of the analog channels.
This function is based on the condition that in the controllers high-side outputs are combined with low-side inputs or low-side outputs are combined with high-side inputs so that no conflicts can occur, i.e. short circuit via the switched output transistor and closed switch at the input.
The block circuit diagram shows: • Short-circuit detection (overload) is possible via the input channel. When the output is switched the LOW (logic 0) can be read in. The output transistor automatically switches off in the case of a short circuit/overload. For safety reasons it does not switch on again automatically.
Page 20
Labelling of the input/output channels: pin number pin description 30 %IX0.07 BL pin number %IX0.07 IEC address for a binary input hardware design of the input (here binary low-side) 47 %QX0.03 BH/PH pin number %QX0.03 IEC address for a binary output BH/PH hardware design of the output (here binary high-side or PWM high-side)
States and operating system 4.1. Operating modes When the supply voltage is applied, the controller module may be in one of 5 possible operating modes: Reset This status is run through after each power-on reset. The operating system is initialised. Different checks are carried out. This status is only temporary and is superseded by the run status.
4.2. Status LED These operating states are shown with the integrated status LED. LED colour Flash frequency Description LED off constantly off Fatal Error green 5 Hz no operating system loaded green 0.5 Hz Run, CANopen: PREOPERATIONAL 2.0 Hz Run, CANopen: OPERATIONAL constantly on Stop, CANopen: PRERPARED 0.5 Hz...
Page 23
The programmer has to ensure that the same software level of the operating system (CR..._x.H86), of the controller configuration (CR..._x.M66) and the unit library (CR..._x.LIB) are used. If not, an error message is generated during the download of the application software. Software states are marked by suffixed letters in alphabetical order in the file name (e.g.
Page 24
!" The controller configuration screen is activated via the button or via menu item Window / PLC Configuration. !" The requested controller configuration (CR..._x.M66) is called via menu item Insert / Firmware. !" The connection between controller and PC is established via Online / Login.
4.3. Operating modes Independent of the operating states the controller can be operated in different operating modes. The control bits can be set and reset via the application software or in test operation plus with the programming software ecolog 100 (window: Global Variables).
5. Error codes and error classes In order to ensure maximum operational reliability the operating system carries out internal error checks in the controller during the start-up phase (reset phase) and during the program execution. The following error flags are set in the case of an error: Error Error description CAN_INIT_ERROR...
Page 28
In addition, it is also possible to set the ERROR bit of "free defined errors" via the user program. In normal operation the relay should only be switched load- free, so the function must only be used in an "emergency" for a general switching-off of the outputs.
CAN in the ecomat R 360 6.1. Technical specifications Bus type: FULL-CAN Physical layer: ISO/DIS 11898 Baud rate: 10 kBit/s ... 1 MBit/s Protocol: CANopen free protocol 2048 data objects in the system (CAN specification 2.0B) Identifier use 1 ... 2048 identifiers freely available for the data transfer From these the following identifiers are reserved: 220 ...
Page 30
CAN processing. To employ this function hardware knowledge of the CAN controller is necessary. This information is provided in the manufacturer's documentation or can be obtained from the technical support of ifm electronic gmbh. For the normal exchange of data via CAN the programmer only...
6.3. CAN errors and error handling The error mechanisms described below are automatically processed by the CAN controller integrated in the plc. This is not influenced by the user. He must/should only react to errors signalled in the application software. Goal of the CAN error mechanisms: •...
Page 32
If a participant immediately detects an error it made (it is responsible for the error), this participant is more severely "punished" for the error than the other bus participants. To do so, the counter is incremented by a higher amount. If the count exceeds a certain value, it can be assumed that this participant is faulty.
The standard ISO 11898 assumes a line-structured set-up of the CAN network. In addition, the line must be fitted with a terminating resistor of 120 Ω Ω Ω Ω at its two ends. In principle, ifm electronic's devices fitted with a CAN interface have no terminating resistors.
Page 34
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 sent to the bus which then becomes active (dominant).
Page 35
Wire cross-sections For the design of the CAN network the wire cross-section of the bus cable used must be taken into account. The following table describes the dependence of the wire cross-sections on the number of the bus participants referred to a transmission rate of 1 Mbit/s and a maximum cable length of 40 m (cable resistance r = 70 mΩ/m).
6.5. General remarks on the CAN utilization If in connection with the plc ecomat R 360 CAN or CANopen is used, some points must be taken into account. They concern the physical structure of the CAN network and the correct software handling.
Page 37
• In case of a missing guarding reply of the R 360 slave the master continuously sends node resets. This can lead to problems when logging on the programming system via the CAN interface. In this case the master must be switched off.If the R 360 is also to operate as a CANopen master, it must initialized...
6.6. Description of the CAN function blocks The CAN function blocks for use in the application program will be described below. To utilize the full functions of CAN it is absolutely required for the programmer to create a precise bus concept before starting to work.
Page 39
CAN_BAUDRATE Function Library CRxxxx.LIB Function symbol Purpose Sets the transmission rate for the bus participant. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. BAUDRATE WORD Value of the baud rate to be set in kBit/s (10, 20, 50, 100, 125, 250, 500, 1000 ) Function outputs, none Description...
Page 40
CAN_TRANSMIT Function Library CRxxxx.LIB Function symbol Purpose Passes a CAN data object (message) on to the CAN controller for transmission. Parameters Function inputs Name Data type Description WORD Contains the number of the data object identifier 0 ... 2048. BYTE Not used, therefore value 0 BYTE Number of the bytes to be transmitted from...
Page 41
CAN_RECEIVE Function Library CRxxxx.LIB Function symbol Purpose Configures a data reception object and reads the reception buffer of the data object. Parameters Function inputs Name Data type Description CONFIG BOOL For the configuration of the data object the bit must be set TRUE once. For data transmission to commence the CONFIG bit must be set to FALSE.
Page 42
CAN_RESTART Function Library CRxxxx.LIB Function symbol Purpose Restart of the CAN participant after "serious" transmission errors (bus-off state). Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. Function outputs, none Description CAN enables a distinction between a temporary and a per- manent disturbance of a bus participant.
Page 43
CAN_ERRORHANDLER Function Library CRxxxx.LIB Function symbol Purpose Minimum error routine to monitor CAN. Parameters Function inputs Name Data type Description RESET BOOL Deletes the error counter. Function outputs Name Data type Description ERROR- WORD Error counter, contains the number of the COUNT errors occurred.
6.7. CANopen in the ecomat R 360 The CAN layers 1 and 2 described at the beginning of chapter 6 control the physical link and the transmission of the data between the bus participants. For a practical CAN application this means that the programmer is responsible for the definition of the data protocol for the special application.
Page 45
CANopen standard. In addition, an area for manufacturer- specific data is available. In this area the configuration parameters for the I/O modules from ifm electronic gmbh are for example stored. Index (hex)
Page 46
CAN bus. The default setting of the I/O modules from ifm electronic gmbh specifies a synchronous transmission of analog input data and all output data and an event-controlled transmission of digital input data.
Page 47
Boot-up routine During the boot-up routine the network master allows the network to run up. In this process the master is informed of the most important communication parameters and, if necessary, guarding activated. During boot-up routine configuration parameters should also be transferred. The node should be in the "pre-operational"...
6.8. The ecomat R 360 as CANopen slave The ecomat R 360 can also be used as a programmable input/output module under CANopen. It behaves like a CANopen slave. As CANopen slave the ecomat R 360 is classified as a "programmable device" according to CiA DS 405. To use the R 360 as CANopen slave the system bit CAN_OPEN must be set.
Page 49
For setting the baud rate the following parameters are allowed: Number Baud rate (kBit/s) 1000 Retentive data Via the manufacturer-specific area of the object directory it is possible to transfer a max. 256-byte data block to the R 360 slave by means of SDO_WRITE. These data are stored in the flash memory in a non-volatile way and can be further processed in the application program via the retain addresses %MB0 ...
Page 50
PDO mapping A conventional PDO mapping is not possible in the ecomat R 360 since this is not necessary for a plc. Via the application program the data relevant to the CANopen network can be directly written into the PDOs or read from them. Network variables in the area from %MW 2000 for the received data and from %MW 2032 for the data to be transmitted can be immediately processed by the application program (see...
Page 51
ResetNode If a ResetNode is triggered by the CANopen master, a complete restart of the R 360 slave would normally have to be carried out (as for a watchdog reset for example). To achieve a higher flexibility, this is controlled by the application program for CANopen.
Page 52
NMS_SET_NODEID Function Library COB.LIB Function symbol Purpose The node ID of the CANopen slave is set. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODEID BYTE Number of the identifier (1 ... 30) Function outputs, none Description Via the function NMS_SET_NODEID the node number of the...
Page 53
NMS_GUARDING_CONFIG Function Library COB.LIB Function symbol Purpose The guard time for a R 360 CANopen slave is set. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. GUARDTIME TIME Time between two monitoring calls 0 ms = no monitoring 1ms ..
Page 54
PDO_TX_CONFIG Function Library COB.LIB Function symbol Purpose Initializes a transmit PDO in the R 360 CANopen slave. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. BYTE Number of the TX-PDO (1 ... 8) WORD Identifier of the TX-PDO (from 380 hex) TRANS_TYPE BYTE...
Page 55
If necessary, the INHIBIT_TIME (waiting time) must be indicated in the ASYNC mode. Otherwise, considerably fluctuating values can lead to an extremely high bus load. If strategically important values are to be transmitted in the ASYNC mode, a single transmission may not be safe enough. Via the function block PDO_TX_REFRESH the important PDO can be repeated from time to time.
Page 56
PDO_RX_CONFIG Function Library COB.LIB Function symbol Purpose Initializes a receive PDO in the R 360 CANopen slave. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. BYTE Number of the RX-PDO (1 ... 8) WORD Identifier of the RX-PDO (from 380 hex) TRANS_TYPE BYTE...
Page 57
If the function PDO_RX_CONFIG is used in a CANopen master, it must be processed before the execution of the function NMM_SET_NMT_MASTER because it triggers an internal CANopen reset. This leads to the loss of the master functions. This is why the initialization must be carried out in two steps (start the master booting one cycle later - see example program).
Page 58
PDO_TX_REFRESH Function Library COB.LIB Function symbol Purpose A sent TX-PDO is transmitted once more. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. BYTE Number of the TX-PDO (1 ... 8) Function outputs, none Description Especially if strategically important values are to be transmitted...
6.9. The ecomat R 360 as CANopen master A typical CANopen network has a network master. The functions which will be described below provide all fundamental services to design a master software for the plc ecomat R 360. By using the functions the slave nodes can be integrated into the CAN network, configured and monitored.
Page 60
NMM_SET_NMT_MASTER Function Library COB.LIB Function symbol Purpose Initializes the plc module as master. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. Function outputs, none Description NMM_SET_NMT_MASTER initializes the plc as CANopen master.
Page 61
NMM_ADD_NODE Function Library COB.LIB Function symbol Purpose Initializes a guarding object for the specified node. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE Node number from 1 ... 127 GUARDTIME TIME Time between two monitoring calls...
Page 62
NMM_START_GUARDING Function Library COB.LIB Function symbol Purpose Starts the node guarding for one or all initialized nodes. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE All initialized nodes: Initialized node: 1 ...
Page 63
NMM_STOP_GUARDING Function Library COB.LIB Function symbol Purpose Stops the node guarding for one or all initialized nodes. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE All initialized nodes: Initialized node: 1 ...
Page 64
NMM_NODE_GUARDING Function Library COB.LIB Function symbol Purpose The function calls the monitoring of all initialized CANopen nodes. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. AUTO_RE- BOOL TRUE: The monitored node is auto- START matically set to operational after a guarding error.
Page 65
NMM_SET_PREOPERATIONAL Function Library COB.LIB Function symbol Purpose Sets an individual node or the whole network to the "pre- operational" state. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE All initialized nodes:...
Page 66
NMM_SET_OPERATIONAL Function Library COB.LIB Function symbol Purpose Sets an individual node or the whole network to the "operational" state. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed FALSE: The function is not processed NODE BYTE All initialized nodes: Initialized node:...
Page 67
NMM_SET_PREPARED Function Library COB.LIB Function symbol Purpose Sets an individual node or the whole network to the state "prepared". Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE All initialized nodes: Initialized node:...
Page 68
NMM_GET_NODE_STATE Function Library COB.LIB Function symbol Purpose Returns the network status of a CANopen node. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE All initialized nodes: Initialized node: 1 ...
Page 69
NMM_RESET_NODE Function Library COB.LIB Function symbol Purpose Resets the application and communication parameters for one or all nodes to the default values. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE All initialized nodes:...
Page 70
NMM_RESET_COMM Function Library COB.LIB Function symbol Purpose Resets the communication parameters for one or all nodes to the default values. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE All initialized nodes:...
Page 71
PDO_INI_SEND_SYNC_OBJ Function Library COB.LIB Function symbol Purpose Initializes the PDO SYNC object for the synchronous scanning of I/O data. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. Function outputs, none Description PDO_INI_SEND_SYNC_OBJ initializes the SYNC object for the synchronous scanning of data in the CANopen network (also...
Page 72
PDO_SEND_SYNC_OBJ Function Library COB.LIB Function symbol Purpose Sends the synchronization object. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. Function outputs Name Data type Description RESULT BOOL TRUE: The function was processed successfully.
Page 73
(NODE), the error code (VALUE) and the error register (REGISTER). In addition, the DATA output provides the manufacturer-specific node information. For the I/O modules from ifm electronic you are for example informed of a wire break or short circuit at the outputs. page 73...
Page 74
SDO_READ Function Library COP.LIB Function symbol Purpose Reads the SDO with the specified indexes from the node. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE Node number WORD Index in the object directory SUBIDX...
Page 75
The input ENABLE controls the execution of the function. But since with each call of the function the data array is transferred, the function is a load for the plc cycle even in case of ENABLE=FALSE. This is why SDO_READ should be skipped if the function is not utilized.
Page 76
SDO_WRITE Function Library COP.LIB Function symbol Purpose Writes the SDO with the specified indexes to the node. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NODE BYTE Node number WORD Index in the object directory SUBIDX...
Page 77
The input ENABLE controls the execution of the function. But since with each call of the function the data array is transferred, the function is a load for the plc cycle even in case of ENABLE=FALSE. This is why SDO_WRITE should be skipped if the function is not utilized.
(source code NMT_MSTR.PRO). The other functions are specially used for the configuration and evaluation of the I/O modules from ifm electronic. With the function SLAVE_8_CONFIG the programmer can directly set the node configuration of the inputs and outputs via the application software or read it from a selected node.
Page 79
The last position of the word address describes the connection of the node no. 1 - 8 (0 - 7), the second and third position the node number 1 - 32 (1 - 20 hex). As standard, the predefined address area is rated for 32 I/O modules. Basic program structure To utilize the I/O modules in a control application the following program structure can be used.
Page 80
COP_MSTR_BOOTUP Function Library NMT_MSTR.LIB Function symbol Purpose Initializes the plc module as CANopen NMT master and all connected I/O nodes. Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NO_NODE BYTE Number of the connected nodes without...
Page 81
COP_MSTR_MAIN Function Library NMT_MSTR.LIB Function symbol Purpose Cyclically generates the SYNC object and monitors the connected nodes Parameters Function inputs Name Data type Description ENABLE BOOL TRUE: The function is processed. FALSE: The function is not processed. NO_NODE BYTE Number of the connected nodes without NMT master SYNC_TIME TIME Time between two SYNC objects for the...
Page 82
Via the function input AUTO_OPERATIONAL the automatic restart of a node can be selected after a guarding error. If AUTO_OPERATIONAL is set to TRUE, the corresponding node is set again to the mode OPERATIONAL after removal of the disturbance. Thus it directly participates again in the PDO exchange (I/O data are read and written).
Page 83
SLAVE_8_CONFIG Function Library CRxxxx.LIB Function symbol Purpose Sets parameters for or reads the configuration of an I/O module. Parameters Function inputs Name Data type Description NODE_ID BYTE Node number CHANNEL_1 BYTE Configuration parameter for channel 1 0 = OFF, 1 = binary input CHANNEL_2 BYTE Configuration parameter for channel 2...
Page 84
8 Description The function SLAVE_8_CONFIG sets or reads the I/O configuration parameters of the 8-channel modules from ifm. The requested configuration is set with the parameters. To check the execution of the function the inputs READ or WRITE should remain set until the function output CFG_RESULT has the value 1.
Page 85
Description With the function SLAVE_8_WORK the I/O data for the 8- channel modules from ifm are updated. To do so, this function must be called once for each node in the program cycle. In the first program cycle the input INIT must additionally be set to TRUE once.
Page 87
PWM in the ecomat R 360 PWM is an abbreviation for Pulse Width Modulation. In the field of controllers for mobile and robust applications it is mainly used for triggering proportional valves (PWM valves). Furthermore, an analog output voltage can be generated from the pulse-width modulated output signal by adding (accessory) a PWM output.
Page 88
PWM or PWM100 Depending on the application and the requested resolution you can choose between the functions PWM and PWM100 when programming the application. If the application requires a high accuracy and resolution, the more technical PWM function is used rather than the PWM100. If the implementation time is to be kept low and if there are no high demands with regard to accuracy the function PWM100 can be used.
Page 89
Calculating the RELOAD value The reload value of the internal PWM counter is calculated as follows based on the input DIV64: DIV64 = 0: f = 10.00 MHz / Reload DIV64 = 1: f = 156.25 kHz / Reload The input DIV64 has to be set to 0 or 1 depending on whether a high or a low PWM frequency is required.
Page 90
Calculation of the RELOAD value The reload value of the internal PWM counter is calculated as follows based on the input DIV64: DIV64 = 0: f = 2.50 MHz / (10000 Hex - Reload) DIV64 = 1: f = 156.25 kHz / (10000 Hex - Reload) The input DIV64 has to be set to 0 or 1 depending on whether a high or a low PWM frequency is required.
Page 91
The function PWM_DITHER has to be initialised once for each PWM output with DELTA selected individually. The dither frequency can be different for channels 0...3, it has to be the same for channels 4...7. Current measurement of PWM channels The current of the coil can be measured via the analog inputs integrated in the controller.
Page 92
Function Library CRxxxx.LIB Function symbol Purpose The function is used to initialise and parameterise the PWM outputs. Parameter Function inputs Name Data type Description INIT BOOL TRUE: PWM output is initialised FALSE: PWM is allocated new values RELOAD WORD value to define the PWM frequency DIV64 BOOL CPU cycle / 64...
Page 93
The RELOAD value has to be the same for channels 4...7. The functions PWM and PWM100 must not be mixed. The PWM frequency (and thus the RELOAD value) is internally limited to 10 kHz. The input DIV64 has to be set to 0 or 1 depending on whether a high or low PWM frequency is required (see page 89/90).
Page 94
PWM100 Funktion Library CRxxxx.LIB Function symbol Purpose The function is used to initialised and parameterise the PWM outputs. Parameter Function inputs Name Data type Description INIT BOOL TRUE: PWM100 is initialised FALSE: PWM100 is allocated new values FREQUENCY WORD PWM frequency in Hz CHANNEL BYTE current PWM channel/output...
Page 95
While the program is running INIT must be set to FALSE. The function is called up and the new PWM value is transferred. The value is accepted if input CHANGE = TRUE. The current of the initialised PWM channel can be measured via the function FAST_ANALOG.
Page 96
FAST_ANALOG Function Library CRxxxx.LIB Function symbol Purpose The function allows the PWM synchronous detection of an analog value. The result is an average value over a PWM frequency period. Parameter Function inputs Name Data type Description PWM_ BYTE monitored PWM channel CHANNEL ANALOG_ BYTE...
Fast counters in the ecomat R 360 The controller ecomat R 360 has a total of 8 fast inputs which can process input frequencies up to 50 kHz. Apart from measuring the frequency at the inputs FRQ0...FRQ3 the inputs ENC0 to ENC3 can also be used to evaluate encoders (counter functions) with a maximum frequency of 10 kHz.
Page 98
FREQUENCY Function Library CRxxxx.LIB Function symbol Purpose The function FREQUENCY measures the signal frequency at the defined channel. Parameter Function inputs Name Data type Description INIT BOOL TRUE: FREQUENCY is initialised FALSE: frequency measurement active CHANNEL BYTE input number (0 ... 3) TIMEBASE TIME time basis Function output...
Page 99
INC_ENCODER Function Library CRxxxx.LIB Function symbol Purpose Up/down counter to evaluate encoders Parameter Function inputs Name Data type Description INIT BOOL TRUE: INC_ENCODER is initialised FALSE: counter is active CHANNEL BYTE number of the input pair (0 ... 3) PRESET_ WORD preset counter value VALUE...
Other functions in the ecomat R 360 9.1. Software reset SOFTRESET Function Library CRxxxx.LIB Function symbol Purpose The function SOFTRESET restarts the controller completely. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is processed FALSE: function is not processed Function outputs, none Description SOFTRESET carries out a complete restart of the controller.
9.2. Save data in memory and read Automatic saving of data The controller ecomat R 360 offers the possibility to save data (BOOL, BYTE, WORD, DWORD) in a remanent flash memory. When the supply voltage drops off the data backup is started automatically, if the data are saved in the flag range MB0...BM239.
Page 103
MEMCPY Function Library CRxxxx.LIB Function symbol Purpose The function MEMCPY enables the writing and reading of different data types directly in the memory. Parameter Function inputs Name Data type Description DWORD address of target variable DWORD address of source variable WORD number of data bytes Function outputs, none...
Page 104
E2WRITE Function Library CRxxxx.LIB Function symbol Purpose The function E2WRITE writes a data block in the serial EEPROM. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed Function outputs Name Data type Description RESULT BYTE...
Page 105
E2READ Function Library CRxxxx.LIB Function symbol Purpose The function E2READ reads a data block from a serial EEPROM. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed Function outputs Name Data type Description RESULT BYTE...
9.3. Use of the serial interface SERIAL_TX Function Library CRxxxx.LIB Function symbol Purpose Transfers a data byte via the serial RS232 interface. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: transfer released FALSE: transfer blocked DATA BYTE byte date to be transferred Function outputs, none Description SERIAL_TX transfers the data byte DATA via the serial...
Page 107
SERIAL_RX Function Library CRxxxx.LIB Function symbol Purpose Reads a received data byte from the serial receiving buffer. Parameter Function inputs Name Data type Description CLEAR BOOL TRUE: receiving buffer is deleted FALSE: no data can be stored in buffer Function output Name Data type Description BYTE...
Page 108
SERIAL_PENDING Function Library CRxxxx.LIB Function symbol Purpose The function determinates the number of the data bytes saved in the serial receiving buffer. Parameter Function inputs, none Function output Name Data type Description NUMBER WORD number of received data bytes Description SERIAL_PENDING determinates the number of data bytes received in the receiving buffer.
Page 109
ISO 9141 interface The serial interface can also be used as diagnostic interface to ISO 9141. Via the system flag ISO_DIRECTION you can switch between 'Send data' and 'Receive data'. The ISO interface is a special type of serial interface for communicating with diagnostic interfaces in the vehicle.
9.4. Reading the system time TIMER_READ Function Library CRxxxx.LIB Function symbol Purpose The current system time is read in seconds. Parameter Function inputs, none Function output Name Data type Description TIME Current system time in seconds Description When the supply voltage is applied a time cycle is generated in the unit and is counted up in a register.
Page 111
TIMER_US_READ Function Library CRxxxx.LIB Function symbol The current system time is read in µseconds. Parameter Parameter Function inputs, none Function output Name Data type Description DWORD Current system time in µseconds TIME_US Description When the supply voltage is applied a time cycle is generated in the unit and is counted up in a register.
9.5. Processing of variables NORM Function Library CRxxxx.LIB Function symbol Purpose Norms a value within set limits to a value with new limits Parameter Function inputs Name Data type Description WORD output value WORD bottom limit input value range WORD upper limit input value range WORD bottom limit output value range...
10. Closed-loop control functions Closed-loop control is a process in which the variable to be controlled (controlled variable x) is permanently monitored and compared with the reference variable (or preset value). The result of this comparison influences the controlled variable for adjustment to the reference variable.
Page 114
Controlled systems without compensation Controlled systems with an amplification factor to infinite are called controlled systems without compensation because of their integrating behaviour. It means that the controlled variable continuously grows after a change of the variable or due to interference.
10.1. Adjustment rule for a controller The adjustment process by Ziegler and Nickols is of advantage in a closed control loop in the case of controlled systems with unknown time constant. Adjustment rule The controller is first operated as a pure P system. The rate time TV is set to 0 and the reset time is set to a very high value (ideally to ∞) for a slow system.
Page 116
DELAY Function Library CRxxxx.LIB Function symbol Purpose Delays the output of the input value by the time T (delay variable). Parameter Function input Name Data type Description WORD input value TIME delay time Function output Name Data type Description WORD input value delayed by the time T Description The function DELAY is used to delay an input value by the time T.
Page 117
Function Library CRxxxx.LIB Function symbol Purpose Controlled system with first order delay Parameter Function inputs Name Data type Description WORD input value TIME delay time Function output Name Data type Description WORD variable Description The function PT1 is a proportional system with one time constant.
Page 118
Function Library CRxxxx.LIB Function symbol Purpose PID controller Parameter Function inputs Name Data type Description WORD actual value WORD preset value XMAX WORD maximum value of the preset value BYTE constant of the P component (/10) TIME reset time (I component) BYTE proportional part of the D component (/10) TIME...
Page 119
A reference variable is internally added to the value of the manipulated variable: Y = Y + 65536 - (XS / XMAX * 65536). Variable y has the following time characteristics. Typical step response of a PID controller page 119...
Page 120
Recommended adjustment: • Select TN according to the time response of the system (fast system = small TN, slow system = big TN) • Increase KP slowly step by step up to a value at which no oscillation will occur. •...
Page 121
Example PI controller in a simulated system. SO = FALSE. The example shows that overshooting as well as a control range spread occur. The signal is 'in steps' due to the small controlled variable. SO = TRUE Overshooting does not occur. page 121...
Page 122
Example Rotational speed control via PID controller Features: • double control range spread • self-optimisation • adaptation of the controller output Y to a PWM function module • TN was adapted to the relatively slow behavour of the system (centrifugal mass!) •...
Page 123
Example P controller This P controller consists of a 2-point controller with PT1 feeback and a subsequent PT1 element. The controlled system is simulated. This controller is particularly robust and is thus suited for difficult system. Please note the intended natural oscillation of the controller caused by its internal feedback.
Page 124
Function Library CRxxxx.LIB Function symbol Purpose synchro-controller Parameter Function input Name Data type Description WORD actual value channel 1 WORD actual value channel 2 WORD preset value = reference variable XMAX WORD maximum value of the preset value BYTE constant of the P share (/10) TIME reset time (I share) BYTE...
Page 125
The manipulated variable for the higher actual value is incrased, the variable for the smaller actual value corresponds to the reference variable. Reference variable = 65536 - (XS / XMAX * 65536). page 125...
11. Functions of the ecomat tdm R 360 The ecomat tdm R 360 is a programmable dialogue unit with graphics capabilities for displaying data, text, graphics and messages. The functions described below do not deal with the programming of the units, but present the necessary functions for exchanging data with the control system ecomat R 360.
Page 128
Function groups The functions can be subdivided in the following groups: • data exchange, TDM_DATA_TRANSFER TDM_CONFIG variable definition TDM_READ_INTERN of preset and actual TDM_WRITE_INTERN values • setting and TDM_PICTURE TDM_MESSAGE resetting of plc TDM_REFRESH pictures and messages • polling and TDM_CONTROL_STATUS_REPORT TDM_REQUEST_STATUS evaluation of unit...
11.1. Data exchange and variable definition TDM_CONFIG Function Library TDM.LIB Function symbol Purpose The function serves to define those data objects (variables) during initialisation which are to be shown in the tdm R 360. Parameter Function inputs Name Data type Description ENABLE BOOL...
Page 130
RESULT shows if the function call was successful. Preset and target values from the controller can only be shown in the display after a one-time successful function call for each variable to be exchanged. page 130...
TDM_DATA_TRANSFER Function Library TDM.LIB Function symbol Purpose This function handles the complete data exchange between the tdm R 360 and the controller module. Parameter Function inputs Name Data type Description INIT BOOL TRUE: function initialisation FALSE: cyclic function call Function outputs, none Description TDM_DATA_TRANSFER is responsible for the complete communication between the display and the controller.
TDM_READ_INTERN Function Library TDM.LIB Function symbol Purpose The function reads an internal tdm R 360 variable. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed HANDLE WORD designation (number) of the internal variable in the tdm R 360 Function outputs Name...
TDM_WRITE_INTERN Function Library TDM.LIB Function symbol Purpose The function writes an internal variable to the tdm R 360. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed HANDLE WORD designation (number) of the internal variable in the tdm Function outputs Name...
11.2. Setting and resetting of pictures and messages TDM_PICTURE Function Library TDM.LIB Function symbol Purpose The function sets or resets a plc picture.. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed NUMBER BYTE tdm picture number...
TDM_MESSAGE Function Library TDM.LIB Function symbol Purpose The function sets or resets a message. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed NUMBER BYTE tdm message number BOOL TRUE: message is displayed (set) FALSE: message is not displayed (reset) Function outputs, none Description...
TDM_REFRESH Function Library TDM.LIB Function symbol Purpose The function refreshes the current status of the pictures and messages between controller and display. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed Function outputs, none Description The currently set plc pictures and messages are no longer...
11.3. The unit status and the LEDs TDM_CONTROL_STATUS_REPORT Function Library TDM.LIB Function symbol Purpose The function activates or deactivates the automatic status report of the tdm R 360. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed BOOL TRUE:...
Page 138
TDM_REQUEST_STATUS Function Library TDM.LIB Function symbol Purpose The function requests the current status report of the tdm R 360. Parameter Function input Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed MODE BYTE value for selecting the feedback parameters Function outputs, none Description The status report provides the application software with all the...
TDM_REPORT_STATUS Function Library TDM.LIB Function symbol Purpose The function shows the current status report of the tdm R 360.. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed RESET BOOL TRUE: sets output RECEIVED to FALSE Function outputs Name...
TDM_REPORT_KEYDATA Function Library TDM.LIB Function symbol Purpose The function shows the current keyboard status of the tdm R 360. Parameter Function input Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed RESET BOOL TRUE: sets output RECEIVED ro FALSE Function outputs...
Page 141
Description function TDM_REPORT_KEYDATA polled cyclically. It transfers the current key and LED status. TA0 ... TA7 provide the key/LED status in bytes (e.g. bit- oriented). With CTRL you select the key/LED groups to be polled. For the individual values please refer to the tdm R 360 manual. CTRL always returns...
TDM_LED Function Library TDM.LIB Function symbol Purpose The function activates or deactivates the tdm LEDs. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed CONTROL BYTE control parameter for setting / resetting the LEDs NUMBER BYTE...
TDM_SINGLE_LED_ON_OFF Function Library TDM.LIB Function symbol Purpose The function activates or deactivates a single tdm LED. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed BOOL TRUE: LED switched on FALSE: LED switched off NUMBER BYTE individual LED number...
11.4. Unit control TDM_PARAM Function Library TDM.LIB Function symbol Purpose The function monitors and transfers the unit parameters to the basic setting of the display. Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed BYTE parameter code VALUE...
TDM_RESET Function Library TDM.LIB Function symbol Purpose The function resets all unit parameters of the tdm R 360 to the basic setting Parameter Function inputs Name Data type Description ENABLE BOOL TRUE: function is executed FALSE: function is not executed Function outputs, none Description The display is restarted.
Annex 1 . Address allocation ecomat R 360 Annex 1.1. Complete overview Address Symbol Description %IX0.00-%IX0.07 Inputs (byte %IB0, word %IW0) %IX0.08-%IX0.15 Inputs (byte %IB1, word %IW0) %IX0.16-%IX0.23 Inputs (byte %IB2, word %IW1) %IX0.24-%IX0.31 Inputs (byte %IB3, word %IW1) %IX0.32-%IX0.39 Inputs (byte %IB4;...
Page 148
Address Symbol Description Flag bit* TEXT_MODE CAN communication compact display (FALSE) Flag bit* TEXT_KEY_F1 Function key F1 compact display Flag bit* TEXT_KEY_F2 Function key F2 compact display Flag bit* TEXT_KEY_F3 Function key F3 compact display Flag bit* TEXT_KEY_ESC ESC key compact display Flag bit* TEXT_KEY_LEFT Key arrow-LEFT compact display...
Annex 1.5. The flag range in the ecomat R 360 Contents Flag address Comment %MW 4096 I/O and system data do not write %MW 3968 TX - PDOs 64 bytes TX-PDOs %MW 2032 RX - PDOs 64 bytes RX-PDOs %MW 2000 %MB 1329 slave Data range for...
Annex 1.6. CANopen unit interface ecomat R 360 • The unit is classified and marked in unit class "Programmable Device" in accordance with CiA DS 405. • 1 server SDO and the 4 default PDOs are set up in accordance with CiA DS 401. The default Identifiers are allocated in accordance with the "predefined connection set".
Annex 1.7. Object list of the ecomat R 360 Annex 1.7.1. Data range communication profile, index 1000 to 1FFF Index S-Idx Name Type Default Description 1000 device type u32, ro 0x195 Prof. 405; programmable unit 1001 error register Bit coded to prof. 301; supports: 0b0000 0000 no error 0b0000 0001 generic error...
Page 155
Index S-Idx Name Type Default Description • I/O module does not 1014 COB ID Emergcy u32 rw 0x40000080 +Node ID respond to external EMCY Message (Bit 31 = 0) • I/O module generates EMCY Message (Bit 30 = 1) • 11 Bit ID (Bit 29 = 0) •...
Page 156
Index S-Idx Name Type Default Description 1405 Receive PDO 6 0x02 number of entries RX PDO 6 • PDO is valid (Bit 31 = 0) COB ID u32 rw 0x385 • CAN ID of 6 RX PDOs Trans Type 0xFF permissible values as for RX PDO1 1406...
Page 157
Index S-Idx Name Type Default Description 1603 Mapping Receive PDO 4 u32 ro 0x04 number of implemented application objects Index in u32 ro 0x5830 01 in 5830 SIdx 01, 1 word object directory received data RX PDO 4 Index in u32 ro 0x5830 02 in 5830 SIdx 02, 2...
Page 158
Index S-Idx Name Type Default Description 1800 Transmit PDO 1 0x02 Number of entries TX PDO 1 • PDO is valid (Bit 31 = 0) COB ID u32 rw 0x180 + • CAN ID of 1 Node ID TX PDOs •...
Page 159
Index S-Idx Name Type Default Description 1A00 Mapping Transmit PDO 1 u32 ro 0x04 number of implemented application objects Index in u32 ro 0xA100 01 in A100 SIdx 01, 1 word object directory transmitted data TX PDO 1 Index in u32 ro 0xA100 02 in A100 SIdx 02, 2...
Page 160
Index S-Idx Name Type Default Description 1A05 Mapping Transmit PDO 6 u32 ro 0x04 number of implemented application objects Index in u32 ro 0xA105 01 in A105 SIdx 01. 1 word object directory transmitted data TX PDO 6 Index in u32 ro 0xA105 02 in A105 SIdx 02, 2...
Annex 1.7.2. Range of manufacturer-specific data, index 2000 to 5FFF Index S-Idx Name Type Default Description 2000 Retain Data dom. rw Maximum 256 Byte data stored in the retain marker range between %MW0 ... %MW127. 20F0 Setting Node ID 0x20 Node ID with which the I/O module in the CANopen network is addressed.
Need help?
Do you have a question about the ecomat 100 R 360 Series and is the answer not in the manual?
Questions and answers