10/03 AN2700K27G Moeller GmbH, Bonn BU - Automation
Author: A. Lngen Xsystem@Moeller.net All brand and product names are trademarks or registered trademarks of the owner concerned. All rights reserved, including those of the translation. No part of these application notes may be reproduced in any form (printed, photocopy, microfilm or any other process) or processed, duplicated or distributed by means of electronic systems without the written permission of Moeller GmbH, Bonn.
Subject to modifications. XC100/XC200 Programmable Logic Control
Contents
1 CANopen master ........................................................................................................ 3 1.1 General ................................................................................................................ 3 1.2 Required libraries................................................................................................. 3 1.3 Notes concerning program generation................................................................. 4 1.4 Supervising CAN stations out of the IEC program............................................... 5 1.4.1 Information from the CAN stack.................................................................... 6 1.4.2 Change of the status of a CAN station with the CAN stack .......................... 9 1.4.3 Application of the CAN stack information Examples: .................................... 9 1.5 Behaviour of the CAN-Stack with multi-tasking applications.............................. 10 1.6 Functions not available...................................................................................... 10 2 CANopen Device ...................................................................................................... 11 2.1 General .............................................................................................................. 11 2.2 Required libraries............................................................................................... 11 2.3 Notes concerning program generation............................................................... 11 2.4 Functions not available...................................................................................... 13 3 CAN network variables ............................................................................................. 14 3.1 General .............................................................................................................. 14 3.2 Required libraries............................................................................................... 14 3.3 Notes concerning program generation............................................................... 14 3.4 Functions not available...................................................................................... 16 4 CAN direct access .................................................................................................... 17 4.1 General .............................................................................................................. 17 4.2 Required libraries............................................................................................... 17 4.3 Notes concerning program generation............................................................... 17 5 Multi-master functionality of the CAN Bus................................................................. 19 5.1 General .............................................................................................................. 19 5.2 Communication between multiple PLC's via CAN.............................................. 19 5.3 Multiple CAN master PLC's operate with their own station................................ 20 5.4 Multiple CAN master PLC'S operate with the same station ............................... 20 5.5 Functions not available...................................................................................... 20 6 Configuration/Trouble shooting in the CAN network ................................................. 21 6.1 Bus load calculation........................................................................................... 21 6.2 Reduction of bus load from CANopen stations .................................................. 22 6.3 Frequent faults and their remedies... ................................................................. 23
Moeller GmbH AN2700K27G 2
XC100/XC200 Programmable Logic Control
1 CANopen master 1.1 General It is possible to integrate a CANopen compatible station in the control configuration of the XC100/XC200 by the addition of a CAN master. This station is integrated using EDS files. The CAN master offers the possibility of starting a CANopen network and configuring, starting, monitoring and communicating with the stations on this network. Prerequisite for the use of a CAN master: - Stations on the CAN bus may only be configured by one CAN-Master and monitored by Nodeguarding. - CAN stations who intend to communicate with the CAN master must conform with the CANopen specifications and control must be established via a correct EDS file. 1.2 Required libraries - 3S_CANopenMaster.lib - 3S_CANopenManager.lib - 3S_CanDrv.lib
The 3S_CANopenDevice.lib may not be used when a CAN master is used.
Moeller GmbH AN2700K27G 3
XC100/XC200 Programmable Logic Control
1.3 Notes concerning program generation The following steps must be followed with the generation of a new CAN master project. 1) The 3S_CANopenMaster.lib is integrated under Resources/Library Manager. After the 3S_CANopenMaster.lib has been integrated, the 3S_CANopenManager.lib and the 3S_CanDrv.lib are automatically added. 2) Under Resources/PLC Configuration a control CAN master module can be added with the Add/Append subelement/CAN-Master button. 3) The following settings should be made in the CAN Parameter tab: - Baudrate : The baud rate to be used on the CAN net should be entered here. - Com. Cycle Period: The cycle time of a SYNC telegram to be sent from a master is to be entered here. Entering 0 means that no SYNC telegram is sent. - Sync. Window Length: Stations which support synchronous telegram transmission are initialised with the value entered here. - Sync.COB-ID: The COB-ID used for the SYNC telegram. - Node-Id: The CANopen Node-Id of the CAN master is entered here. The Node-Id may not be identical (collide) with the Node-Id of other stations. - Autostart checkbox: If this checkbox has been activated, all linked stations are started automatically if required. Exception: The activate is set for a station. If the Autostart checkbox is not activated or the activate checkbox is activated, the respective station must be started from the application program. The pCanOpenNode[Station].bManualStart command must be used for this purpose. - Support DSP301, V4.1 and DSP306: Leave this checkbox activated. - Heartbeat Master: This function is currently not supported. Leave the value at 0. 4) Via the CanMaster module, it is now possible to add the station to the CAN bus as sub- elements. These stations are made known to the CanMaster via an EDS file, which must be located in the standard directory for the configuration files ( \XSoft V2.3\Libary\plcconf\*.eds ). 5) Basic settings for the CAN station which has been added can be made using the CAN Parameter tab. - Node-Id: The CANopen Node-Id of the CAN station is entered here. This Node-Id must correspond with the Node-Id of the station physically available on the bus. - Write DCF: Generates a *.dcf file from the configuration data set for the station when it is activated. This file is generated every time a compile process for the project is generated. The name of the DCF file is comprised of the name of the EDS file and the appended Node-Id of the station.
Attention: It is not possible to create valid DCF files from XI/ON stations
Moeller GmbH AN2700K27G 4 XC100/XC200 Programmable Logic Control
- Create all SDOs: If this checkbox is activated, SDO's will be created for all entries stated in the EDS file in the range from 0x2000 to 0x5FFF, for which a default value exists. This setting should only be used when required as the amount of memory for the configuration of the station in the control increases. - Reset Node: If the checkbox is activated, a register is written with the initialisation of the station, which initiates a command which causes a RESET of the station after the next ResetNode. - Optional Device: A station which is marked in this manner is not necessary for the start of the other stations on the CAN network. As soon as a station is detected, it will be initialised and started. - Do not initialise A station marked in this manner is not automatically initialised or automatically started. The master sets the internal status of the station to operational. However, a manually actuated initialisation and start of the station is still possible. - Nodeguarding: Activates the monitoring functions for the station. - Guard COB-ID: Should not be changed. The entry 1793+$NodeID-1 must be used. - Guard time: Cycle time between issuing of two Guarding requests to the station. - Life time factor: A multiple of the Guard time after a Guarding error has been received, when no answer is received in response to the Guarding requests. - Heartbeat settings: Currently not supported and should not be used. - Emergency telegram: The setting should not be changed. 6) Sending and receiving properties of the station can be adjusted further via the PDO Mapping Send and PDO Mapping Receive as well as the Service Data Objects tabs. 7) The variables which have been made available by the stations via PDOs can be found at the CAN station under CAN Output and CAN Input.
1.4 Supervising CAN stations out of the IEC program
You can read in the following section, how CAN stations can be supervised by variables. The variables are created by the CAN stack. The monitoring is replaced in the future by functions, those are summarized in a diagnosis library. In the following program lines *** is to replace by the node number of the CAN station. (Not NodeID, see Base parameters - > node number)
Moeller GmbH AN2700K27G 5 XC100/XC200 Programmable Logic Control 1.4.1 Information from the CAN stack
- Status of the CAN stations in the CAN stack pCanOpenNode[***].nStatus; The variable shows the current status of the station. The following values are possible: -1: SENDE BOOTUP MESSAGE A Reset telegram was sent to the station. The station answers with a Bootup telegram Next state: 2. 0: UNDEFINED This state occurs: - after a RESET of the station and the Timeout of the RESET telegram - after the Timeout of the Nodeguarding monitoring 1: WAIT FOR BOOTUP MESSAGE This state occurs after sending the Bootup telegram. Terminate the state: - by exceeding the time (state = 0) - by receipt of the Bootup telegram (state = 2) 2: FIRST SDO INHIBITTIME In this state the station gets 500ms, in order to run through his internal bootup sequence (state = 3). 3: SEND CONFIG SDOs The CAN station is initialized by SDO telegrams from the CAN stack. The user enters the data for initialization with the program. With the question about the Device Type (Index: 0x1000, Subindex: 0) the state of the initialization can be determined. A valid initialization is indicated by the condition = 4, an invalid initialization has the state = 98. 4: SEND START MESSAGE A start remote node telegram starts the station if - the function Autostart was activated for the CAN master - a start instruction is executed by the user program (state = 5). 5: DEVICE OPERATIONAL The inputs and outputs of the stations can be worked on. With the function Nodeguarding the station is supervised. 97: SDO TRANSFER TIMED OUT There was no answer after transmitting a SDO Request. 98: INVALID DEVICE TYPE The Device type the equipment does not agree with the type from the EDS file. 99: NODEGUARDING TIMED OUT The Nodeguarding monitoring is not correct.
Moeller GmbH AN2700K27G 6 XC100/XC200 Programmable Logic Control - Status of the CAN stations during last monitoring pCanOpenNode[***].byLastState; This variable should be evaluated only with activated Nodeguarding. After the last Nodeguarding answer the station enters its status into the variable. 4: STOPPED 5: OPERATIONAL 127: PRE OPERATIONAL
- Actual error messages of the CAN stations The station enters the error messages, which it transferred in a Emergency Message, into the structure pCanOpenNode[***].EmcyMsg. If errors are registered into the data field, then the following information can be read:
- Byte 0-1: Emergency Error Code (CANopen error code: DS301 und DS40x (correspond to the profil of the station))
Moeller GmbH AN2700K27G 7 XC100/XC200 Programmable Logic Control
Error Code (hex)Meaning 00xx Error Reset or No Error 10xx Generic Error 20xx Current 21xx Current,device input side 22xx Current inside the device 23xx Current,device output side 30xx Voltage 31xx Mains Voltage 32xx Voltage inside the device 33xx Output Voltage 40xx Temperature 41xx Ambient Temperature 42xx Device Temperature 50xx Device Hardware 60xx Device Software 61xx Internal Software 62xx User Software 63xx Data Set 70xx Additional Modules 80xx Monitoring 81xx Communication 8110 CAN Overrun (Objects lost) 8120 CAN in Error Passive Mode 8130 Life Guard Error or Heartbeat Error 8140 recovered from bus off 8150 Transmit COB-ID collision 82xx Protocol Error 8210 PDO not processed due to length error 8220 PDO length exceeded 90xx External Error F0xx Additional Functions FFxx Device specific - Byte 2: Error register The error register can be read, independently of error telegrams of the station, by a SDO transfer onto index 0x1001, Subindex 0. Meaning:
Bit Meaning 0 generic error 1 Current 2 Voltage 3 temperature 4 communication error (overrun,error state) 5 device profile specific 6 Reserved (always 0) 7 manufacturer specific Moeller GmbH AN2700K27G 8 XC100/XC200 Programmable Logic Control
- byte 3 to 7: Manufacturer specific error Field Range for error messages of the manufacturer. For the interpretation of these bytes please read in the documentation of the equipment or contact the manufacturer.
1.4.2 Change of the status of a CAN station with the CAN stack
- Start of a station pCanOpenNode[***].NodeStart(); A station is started from the user program. - Stopping a station pCanOpenNode[***].NodeStop(); A station is stopped from the user program. - Reset of a station pCanOpenNode[***].NodeReset(); A station is reseted from the user program. - Shifting of the status of a station pCanOpenNode[***].SetNodeStatus(); The status of a station in the CAN stack is changed from the user program. See Status of the CAN stations in the CAN stack .
1.4.3 Application of the CAN stack information Examples:
Example: - Inquiry, which CAN station was started. If pCanOpenNode[***].nStatus = 5 Then (* the station is ready to receive data *) End_if
- Reaction to a Nodeguardingfehler. If pCanOpenNode[***].nStatus = 99 Then (* reaction of Nodeguarding errors *) End_if
Moeller GmbH AN2700K27G 9 XC100/XC200 Programmable Logic Control
- Evaluation of Emergency Messages of the CAN stations.
VAR struEmcyMsg: CanMessage; p_b_arEmcyManErrField: POINTER TO ARRAY [ 1..5 ] OF BYTE; p_bEmcyErrReg: POINTER TO BYTE; p_wEmcyErrCode: POINTER TO OF WORD; END_VAR
IF pCanOpenNode[***].EmcyMsg.Len < > 0 THEN (* copying the error message ---------------------------------------*) struEmcyMsg: = pCanOpenNode[***].EmcyMsg;
(* evaluating the error message here after the entry in the error register *) CASE p_bEmcyErrReg^ OF 0: ; 1: ; 3: ; default: ; (* reactions of error message *) END_CASE END_IF
1.5 Behaviour of the CAN-Stack with multi-tasking applications
In the XC200, CAN variables may only be used in an IEC-Task. The CAN-Stack does not have multi-tasking capability. Explanation: The CAN-Stack is accessed before each task where CAN variables are used. In a multi-tasking system, individual tasks can be interrupted as required depending on their priority. This behaviour can lead to an inconsistency of the CAN-Stack when it is accessed by a higher priority task, before the CAN-Stack is fully processed by the interrupted task. 1.6 Functions not available
- the monitoring with Heartbeat. - the transmission of boolschen variables with PDO?s. - the Forcen of CAN variables with the XSoft. - the production of DCF - files of XION - stations. - no own object listing of the CAN master block
Moeller GmbH AN2700K27G 10 XC100/XC200 Programmable Logic Control 2 CANopen Device 2.1 General The programmed control can be integrated as a station in a CANopen bus using the CAN device functionality. A CAN master is made known to a CAN device by the integration of its EDS file. The CAN device is started and configured by a CAN master. A CAN device can place or receive data PDO's on the bus. The data transfer with the CAN network is implemented in the CAN device via 4 freely usable RX - PDOs and 4 freely usable TX - PDOs. Larger quantities of data can be exchanged using SDOs. This SDO transfer can only be initiated by a CAN master, a CAN device is not able to initiate an SDO transfer of its own accord, as it simply acts as an SDO server. Further information is available in the AN2700K20 application note. 2.2 Required libraries - 3S_CANopenDevice.lib - 3S_CANopenManager.lib - 3S_CanDrv.lib The 3S_CANopenMaster.lib may not be used when a CAN device is used.
2.3 Notes concerning program generation The following steps must be followed with the generation of a new CAN device project. 1) The 3S_CANopenDevice.lib is integrated under Resources/Library Manager. After the 3S_CANopenDevice.lib has been integrated, the 3S_CANopenManager.lib and the 3S_CanDrv.lib are automatically added. 2) Under Resources/PLC Configuration a control CAN device module can be added with the Add/Append subelement/CAN-Device button. 3) The following settings should be made in the Base settings tab of the CAN Device: - The Generate EDS file checkbox should be activated. - The path and file name to be used for generation of the EDS file are to be entered in the Name of EDS file field. (In order to integrate the EDS file into the master PLC, the EDS file must be located in the directory for the configuration files, e.g.: /XSoft V23/Libary/PlcConf/*.eds)
Moeller GmbH AN2700K27G 11 XC100/XC200 Programmable Logic Control 4) The following settings should be made in the CAN settings tab of the CAN Device: - Enter the Node-Id of the CAN device. - Enter the baud rate of the CAN network - Enter Nodeguarding default values (can be changed in the initialisation phase by the NMT master. See section 2.3 sub-point 5.) - Heartbeat must remain deactivated, as this monitoring mechanism is currently not supported. 5) Variables which are to be transmitted via CAN are declared as IEC variables in the project. - The following IEC data types are permissible for variables which are to be mapped in PDOs: - BYTE - SINT - USINT - WORD - INT - UINT - DWORD - DINT - UDINT - REAL - In order to transfer large connected data packets via SDO access, ARRAYS of the above mentioned data types can be generated. 6) The variables to be sent must now be integrated into the object directory in the parameter manager. Proceed as follows... - In the XSoft, change to Resources/Parameter Manager on the Variables tab - A line in the parameter manager must be filled out for every variable/every parameter which is to be linked in the object directory (OD). - Index: valid entry from the index ranges - Subindex: valid entry from the index ranges (Caution... Subindex 0 is reserved and should not be used.) - Access: low/middle/high, no differentiation at the present time - Attribute: read-only/write-only/read-write, entry depending on the intended use via the CAN bus. Note: The write-only attribute is implemented but does not function as expected. Objects which possess this attribute can also generally be read. - Variable: Mark the field and search for the variable to be linked with the F2 function key. - Close the parameter manager. (Essential to accept the data.)
Moeller GmbH AN2700K27G 12 XC100/XC200 Programmable Logic Control 7) Change to Resources/PLC Configuration/CAN device to Default PDO mapping - The PDO's can now be assigned with the variables entered in the object directory. Send PDOs: Sends the CAN device onto the bus. Receive PDOs: These PDOs are read from the device. - Setting the properties of the added PDOs The COB-ID can be matched in the properties of the PDO's. Other settings should not be changed. 8) The EDS file is generated by compilation of the program. 9) To recognize an Nodeguarding error you must superwise the variable pCanOpenDev[0].bGuardError in the CAN DEVICE. This variable is set into the status TRUE, as long as an Nodeguarding error exist.
2.4 Functions not available
The generated EDS files do not meet the formal requirements of the CiA. It has been assured that the generated EDS files are correctly interpreted during integration in an XSoft project, if the device project has been created in accordance with the stipulations defined in section 3.3. The Heartbeat monitoring function is not available. Moeller GmbH AN2700K27G 13 XC100/XC200 Programmable Logic Control
3 CAN network variables 3.1 General CAN network variables can be used for data transfer between differing PLCs on the CAN network. This data transfer can occur between PLC's with 3S-CanStack (XC100/XC200), regardless of if these PLC's are additionally configured as a CAN master or as a CAN device.
Note: The use of network variables is a large load of the controller. You should only so many variables define as are needed for the project which can be provided.
Further information is available in the AN2700K19 application note. 3.2 Required libraries
Proceed as follows to create a project with network variables... 1) After the new project has been created, activate the Support network variables checkbox on the Network functionality tab in the Target Settings directory. 2) CAN must be entered in the Names of supported network interfaces field. (Activation of the checkbox has the effect that the next time the project is compiled - a folder called Networkmanagement implicit Variables CAN is generated under the Global variable list, - the following libraries are added to the library manager, 3S_CANopenManager.lib, 3S_CanopenMaster.lib, 3S_CANDrv.lib which should be verified. 3) A CAN master or a CAN device should be added in the PLC configuration. In this module, the required Baudrate must be entered on the CAN bus in the CAN parameters tab. (The internal CAN controller is configured and started by the addition of the CAN master/CAN device and setting of the baudrate. A CAN master/CAN device can be used for data transfer under CAN on the CAN bus parallel to the network variables. )
Moeller GmbH AN2700K27G 14 XC100/XC200 Programmable Logic Control 4) A further container for global variables can now be added with the Add object command in the Resources --> Global variables folder. - The name should be changed in the Global variable list under Properties. - The variable list is activated for the exchange of variables by pressing the Add network button. - CAN is entered as the Network type. - In the List identifier (COB-ID): the address of the first COB-ID to be used is entered. Caution : Depending on the number and size of the variables entered into the variable list, further COB-ID's are used for the transmission of network variables from the first COB-ID. (If the Pack variables checkbox is activated, an attempt is made to pack multiple variables into one COB-ID (max. 8 bytes), if the checkbox is not activated an individual COB-ID is required for every variable.) In order to avoid collisions of network variables with CANopen stations, it is recommended that you do the following. o COB-IDs 0x1 to 0x7F: For high-priority network variables. No collision with CANopen telegrams are to be expected in this range. o COB-IDs 0x640 to 0x67F: For low-priority network variables. COB-IDs in this range can only be used when no CANopen station with a Node-Id > 63 is used, otherwise collisions between the CANopen telegrams and network variables will result. - The checkboxes Transmit checksum and Acknowledgement have no significance for CAN network types and should remain deactivated. - An unequivocal direction of communication must be defined via the Read and Write checkboxes. - The Request on bootup and Answer bootup request have no function at the present time. - The required transmission type must be set for the Write communication direction. The Transmit each cycle transmission type with the Variable input field does not have a function for network variables under CAN. The Transmit on change transmission type initiates the transfer of a COB-ID as soon as a modification of the associated variable is detected. In the Minimum field, the minimum pause time which must be observed before a new transmission of the COB-ID, is entered. The Transmit each cycle transmission type initiates a cyclic change dependant transmission of the network variables. The value entered in the Interval field applies as the cycle time. A combination of Transmit each cycle with a high interval time and Transmit on change with an acceptable Minimum interval is recommended.
Moeller GmbH AN2700K27G 15 XC100/XC200 Programmable Logic Control 5) The variables to be sent are now entered in the variable list. The sequence and structure of the variable list in the sending PLC and receiving PLC must be identical. This can be achieved by exporting the variable list on a PLC before the project is compiled, and importing on the other PLC's before the project is compiled. Note: Only 8 data bytes can be sent for every COB-ID used. If more variables are entered than network variables, or if all the variables do not fit in the data range of the COB-ID which is still free, it will be entered in the next higher COB-ID. 3.4 Functions not available
- Transmit on event of network variables. - Request on bootup and Answer bootup requests. - Transmit checksum and Acknowledgement Moeller GmbH AN2700K27G 16 XC100/XC200 Programmable Logic Control
4 CAN direct access 4.1 General
Direct access enables data transfer via CAN without having to configure the PLC as a CAN master or CAN device. The functionality is provided by the XC100_SysLibCan.lib system library. Data can be exchanged using CAN via simple Read/Write functions. Four independent CAN ports with up to 16 CAN objects each can be opened. A filter function enables a pre-selection of the objects to be read. The transmission rate can also be set. An excellent knowledge of CAN is essential for the use of direct access on the CAN bus. 4.2 Required libraries
- XC100_sysLibCan.lib - 3S_CanDrv.lib 4.3 Notes concerning program generation
The XC100_sysLibCan.lib consists of 6 functions which are used as follows. - SysCanAddFilter Registers a COB-ID in a CAN driver for direct read access.
- SysCanControl Function for modification of the baud rate.
- SysCanOpen Opens one of a maximum of 4 possible CAN direct access connections.
- SysCanRead Supplies CAN telegrams registered for reading and which have been received from CAN drivers to the IEC program.
- SysCanRemoveFilter Removes the registration of a COB-ID for direct read access.
- SysCanWrite Writes a CAN telegram to the CAN driver.
Moeller GmbH AN2700K27G 17 XC100/XC200 Programmable Logic Control The use of direct access in an IEC program can appear as follows... The CAN controller is started by a CAN master or a CAN device module. In the start phase of the program, a CAN port is opened (SysCanOpen) and the COB-ID's to be received via the CAN port are registered (SysCanAddFilter). After the initialisation phase, the SysCanRead module is called at intervals (cycles) in order to collect the CAN telegrams which have been collected in the meantime by the controller. Messages can be placed on the CAN bus via the SysCanWrite module. If individual COB-IDs are no longer to be collected via direct access, they can be removed again from the receive list using the SysCanRemoveFilter. Moeller GmbH AN2700K27G 18 XC100/XC200 Programmable Logic Control
5 Multi-master functionality of the CAN Bus 5.1 General
The CANopen protocol has multi-master capabilities under certain circumstances, i.e. it is possible to operate multiple controls on a bus. The communication possibilities with multiple Moeller PLC'S on a bus will be briefly touched on in this section. However, operation of multiple PLC's on a physical bus requires a certain amount of co- ordination among one another in order to prevent a collision during data transfer. It is therefore essential that you have extensive knowledge of the CANopen data transfer process. 5.2 Communication between multiple PLC's via CAN
Three different variants are possible in order to exchange data between two (or more) PLC's.
1) One PLC is a CAN master and all other PLC's are CAN devices. Advantage: In the true sense, this is not actually a multi-master application as a CAN device can be seen as a passive station on a bus. Disadvantage: CAN device PLC's are not capable of administering a CANopen station.
2) Communication via network variables Advantage: Manageable handling of the data to be exchanged. Only minimal knowledge of bus structure is required. Communication can be implemented independently of an installed CAN master/CAN device. Disadvantage: Communication via network variables is only possible on PLC's with 3S_CAN-Stack (XC100/XC200). Automatic assignment of COB-IDs, commencing with the start COB-ID is difficult to grasp, and it is important to ensure that there are no collisions between different network variable folders or between CANopen telegrams.
3) Communication via direct access. Advantage: Direct access provides the greatest possible transparency for the CAN bus. Disadvantage: A very extensive knowledge of the CAN bus is required for direct access.
Moeller GmbH AN2700K27G 19 XC100/XC200 Programmable Logic Control 5.3 Multiple CAN master PLC's operate with their own station
It is possible to use multiple PLC's on a CAN bus. However, it is important to observe that a Node-Id is only assigned once on the network. If additional COB-IDs are used, it is essential to ensure that double assignment does not occur. (For example, for communication between the PLC's.) 5.4 Multiple CAN master PLC'S operate with the same station
Under certain circumstances, the information of a CAN station can be evaluated from multiple PLC's. It is important to ensure that the station is only initialised, started and monitored from one PLC. Even SDO access may only be undertaken by one station. Every additional PLC may only operate with the PDOs which are provided by the station. With these PLC's, the station is added to the PLC configuration, the Not initialised checkbox is activated and the values for Nodeguarding monitoring are set to 0. For TX - PDOs : The TX - PDOs sent by a station can be evaluated in multiple PLC's. For RX - PDOs : The following point is to be observed if data is to be sent to a station from multiple PLC's. Every RX-PDO may only be written from one PLC, every input of the station may only be written by one PLC. If multiple PLC's are to write to a station, a unique assignment of the PDOs and inputs must be made for the individual PLC's. 5.5 Functions not available
6 Configuration/Trouble shooting in the CAN network 6.1 Bus load calculation
In this section, a possibility for rough estimation of the bus load on the CAN bus will be shown. (XC200: If you use the Browser instruction canload, the bus load is calculated.)
1) Determination of an observation period (cycle time with which the PLC serves the CAN bus is possible) = 20 ms 2) Estimation of the number of CAN telegrams placed on the bus in the period under observation from all the stations connected to the CAN bus. Caution: As the CAN bus is an event-controlled bus, the connected stations will only place telegrams on the bus if the data of this station changes. The important factor is the average number of telegrams on the bus and not the maximum possible number of telegrams. 3) As a result of the average number of CAN telegrams and the selected baud rate, it is now possible to verify if transmission of this quantity of data on the bus is possible. Caution: The average capacity utilisation of the CAN bus should not permanently exceed 70%, i.e. transmission of the average number of CAN telegrams should be performed in approx. 70% of the period of time under observation.
Duration of the transfer of a CAN telegram depending on the quantity of user data:
Baud rate Maximum bus length Transmission time (0 data bytes/47 bits) Transmission time (4 data bytes/79 bits) Transmission time (8 data bytes/111 bits) 1 Mbit/s 25 m 47 s 79 s 111 s 800 kbit/s 50 m 59 s 99 s 139 s 500 kbit/s 100 m 94 s 158 s 222 s 250 kbit/s 250 m 188 s 316 s 444 s 125 kbit/s 500 m 376 s 632 s 888 s 100 kbit/s 600 m 470 s 790 s 1110 s 50 kbit/s 1000 m 0.94 ms 1.58 ms 2.22 ms 20 kbit/s 2500 m 2.35 ms 3.95 ms 5.55 ms 10 kbit/s 5000 m 4.7 ms 7.9 ms 11.1 ms
Caution: The details concerning the max. bus length are made in accordance with the CiA DSP 301 specification. The use of optocouplers is assumed for bus lengths exceeding 200 m. For bus lengths > 1000 m the use of repeaters or bridges may be necessary. Moeller GmbH AN2700K27G 21 XC100/XC200 Programmable Logic Control
6.2 Reduction of bus load from CANopen stations
If the actual loading of the CAN bus permanently exceeds 70%, it is advisable to try and remove the burden on the CAN bus. Here are a few settings which may be tried.
1) The simplest and most effective modification is an increase in the baud rate on the CAN bus. However, this modification limits the maximum bus length and may lead to the necessity for screening measures and the use of bus termination resistors (120). 2) On stations which transmit analog values, check to see if the respective manufacturer offers the option of a Delta setting, so that the station will only place a new message on the bus after an adjustable differential value has been detected. 3) When Asynchronous manufacturer specific or Asynchronous device profile specific are used, the loading on the bus can be controlled with the Inhibit Time and Event- Time checkboxes. Inhibit Time: The minimum time which must be between the transmission of a PDO and sending of the same PDO again. 4) The bus load of a station can also be matched by the master using the acyclic synchronous and cyclic synchronous transmission types. Acyclic synchronous: The station transmits a PDO when the data content has changed AND a SYNC telegram has been received from the master. Cyclic synchronous: The station sends a PDO when a SYNC telegram has been received from the master. ( After every n SYNC telegrams, whereby n is the input of Number of Syncs in the Attribute window of the PDO. The number of syncs are not supported by the XION and WinBlock modules.) Moeller GmbH AN2700K27G 22 XC100/XC200 Programmable Logic Control
6.3 Frequent faults and their remedies... Fault Possible cause Remedy No reaction on the CAN bus Libraries not linked Link the libraries Node-ID of the station incorrect Correct the Node-ID Not all stations set to same baud rate Check the set baud rates. No termination resistor present on the end of the bus Install a bus termination resistor (120) Not all linked CAN stations are present on the bus If a device is not present, set the Optional device checkbox.