Home
Software Manual - SRDO Add-on moduleCANopen
Contents
1. kSrdoPMEvSctNotCheckedItIsInvalid SCT of a SRDO was not tested because is is switched off kSrdoPMEvSctNotCheckedNotOperational SCT of a SRDO was not tested because the node is not in OPERATIONAL kSrdoPMEvSrdokFrror found faulty SRDO send and receive SRDO kSrdoPMEvSrdoReceived a SRDO was received kSrdoPMEvSrdoTransmitted a SRDO has been sent Return kCopSuccessful The function was executed without error All other return codes are reserved Description The function is called by the SRDO module when certain program steps are processed The application can setup a logical monitoring of the program run This function is not called if in the configuration file copcfg h the Define SRDO_USE_PROGMONITOR is set to FALSE L 1077e_5 SYS TEC electronic GmbH 2013 35 Extension of the CANopen user layer tCopKernel PUBLIC AppProgMonEvent CCM DECL INSTANCE HDL tProgMonEvent Event p switch Event pi case kSrdoPMEvSctChecked s called for each Rx SRDO wPMonValue_g kPMonSctChecked break case kSrdoPMEvSctNotCheckedItIsTx s called for each Rx SRDO wPMonValue_g kPMonSctNotCheckedItIsTx break case kSrdoPMEvSctNotCheckedItIsInvalid s called for each switched off SRDO wPMonValue og kPMonSctNotCheckedItIsInvalid break case kSrdoPMEvSctNotCheckedNotOperational s called once for all SRDO
2. toggle Bit 6 and 7 bSrdoState 0xC0 else Safety Critical Error Ret CcmSetSrdoState bSrdoState wSrdoCommulndex_p if Ret kCopSuccessful return kCopSuccessful L 1077e_5 SYS TEC electronic GmbH 2013 33 Extension of the CANopen user layer 2 9 3 Function AppGfcEvent Syntax include lt cop h gt tCopKernel PUBLIC CCM _DECL_INSTANCE_HDL AppGfcE vent Parameter CCM_DECL_INSTANCE_HDL Instanz Handle Return kCopSuccessful The function was executed without error All other return codes are reserved Description The function is called by the SRDO module when a GFG message is received tCopKernel PUBLIC AppGfcEvent CCM DECL INSTANCE HDL process information according to the application for example change to intrinsically safe state return kCopSuccessful This function is not called if the configuration SRDO_USE_GFC is set to FALSE L 1077e_5 SYS TEC electronic GmbH 2013 34 Extension of the CANopen user layer 2 9 4 Function AppProgMonEvent Syntax include lt cop h gt tCopKernel PUBLIC CCM _DECL_INSTANCE_HDL_ AppProgMonE vent tProgMonEvent Event_p Parameter CCM_DECL_INSTANCE_HDL Instanz Handle Event_p Event of the executed program code kSrdoPMEvSctChecked SCT of a SRDO was tested kSrdoPMEvSctNotCheckedItIsTx SCT of a SRDO was not tested because it is a send SRDO
3. wPMonValue og kPMonSctNotCheckedNotOperational break case kSrdoPMEvSrdoError s called for faulty SRDO wPMonValue_g kPMonSrdoError break case kSrdoPMEvSrdoReceived is called for each received SRDO wPMonValue_g kPMonSrdoReceived break case kSrdoPMEvSrdoTransmitted is called for each sent SRDO wPMonValue_g kPMonSrdoTransmitted break default break return kCopSuccessful L 1077e_5 SYS TEC electronic GmbH 2013 36 Extension of the CANopen user layer 2 9 5 Function AppCbNmtEvent This function is called by the CANopen Stack when the NMT Statemachine is running and must contain different event calls of the SRDO module kNmtEvResetCommunication Notify variable fields by calling CcmStaticDefineSrdoVarFields for static mapping Initialisation of the SRDO communication parameter by calling CcmWriteObject with the respective parameters define all SRDOs in static SRDO modul Ret CcmStaticDefineSrdoVarFields 0x1301 amp SrdoNormalData m_abSrdoData 0 amp SrdolnversData m abSrdoData 0 if Ret kCopSuccessful write information direction into OD Ret CcmWriteObject if Ret kCopSuccessful set configuration bTemp OxA5 Ret CcmWriteObject if Ret kCopSuccessful kNmtEvEnterPreOperational 0x1301 1 amp bDirection 1 valid Ox13FE 0 amp bTemp 1 S
4. Parameter MCO_DECL_INSTANCE_PTR_ Pointer to instance wCommulndex_p Object index which contains the communication parameters of the SRDO in the object directory pSrdoEntry_p Must always be passed with 0 pwCrc_p Pointer to a WORD variable for receiving 16 Bit CRC within the calling function Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function calculates the checksum CRC CRC over a SRDO and returns it to the calling function The calculation is done also when the SRDO is turned off There is no comparison to the accuracy of the CRC The application can use this functionality via the API function CcmCalcSrdoCrc to update the CRC of a SRDOs when the configuring of a SRDOs on the application must be set new dynamically e g changing the COB ID depending on the node ID L 1077e_5 SYS TEC electronic GmbH 2013 54 Extension of the CANopen user layer 2 12 Function descriptions of the SRDOSTC module The following functions of the SRDO module are also implemented in the SRDOSTC module Their meanings and syntax can be taken from 2 11 Srdolnit SrdoAddinstance SrdoDeletelnstance SrdoNmtEvent SrdoSend SrdoProcess SrdoCheckConfig SrdoSendGfc SrdoGetState SrdoSetState SrdoGetCommuParam 2 12 1 Function SrdoStaticDefineVarFields Syntax include lt srdo h gt tCopKernel PUBLIC SrdoStatic
5. ccs Help Install Undate In the left part of the window change to C C gt PathEntry Variables Add tehere also a new entry with the button New and named it cop and add it to C systec cop BE Wr Preferences type filter text General 4 C C Appearance Build Console Debug Editor File Types Indexer Make Parser ccs Help Install Update Run Debug Team Code Formatter Managed Build PathEntry Variables wm PathEntry Variables dei e v PathEntry variables Defined PathEntry variables amp cop C systec cop New Remove Confirm your entry with OK L 1077e_5 SYS TEC electronic GmbH 2013 60 Reference environment TMDX570LS20SMDK Now import the project from the menu File gt Import Select in the following dialog under CCS the line Existing CCS CCE Eclipse Projects and confirm with Next F ve Import Select Imports existing CCS CCE Eclipse projects l d into workspace Select an import source type filter text E General amp C C 4 ccs 8 Existing CCS CCE Eclipse Projects E Legacy CCSv3 3 Projects Managed Build Macros cvs amp Team lt Back Next gt Finish In the following dialog select over Browse the path to the demo and then click Finish r ve Import CCS Eclipse Projects Select Existing CCS Eclipse Project Select
6. include lt srdo h gt tCopKernel PUBLIC SrdoDeletelnstance MCO_DECL_INSTANCE_PTR Parameter MCO_DECL_INSTANCE_PTR Pointer to the instance Return kCopSuccessful The function was executed without error Further return codes of the standard CANopen are possible Description This function deletes all generated communication objects of the stated instance and marks it as unused L 1077e_5 SYS TEC electronic GmbH 2013 44 Extension of the CANopen user layer 2 11 4 Function SrdoNmtEvent Syntax include lt srdo h gt tCopKernel PUBLIC MCO_DECL_INSTANCE_PTR_ SrdoNmtE vent tNmtEvent NmtEvent_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance NmtEvent_p a NMT event that occurred see L 1020 Return kCopSuccessful The function was executed without error Further return codes of the standard CANopen are possible Description The function processes a NMT event which was triggered via the NMT State Machine An event induces a change of the NMT node status For each node status the execution of the SRDO module is controlled L 1077e_5 SYS TEC electronic GmbH 2013 45 Extension of the CANopen user layer 2 11 5 Function SrdoSend Syntax include lt srdo h gt tCopKernel PUBLIC MCO_DECL_INSTANCE_PTR_ SrdoSend WORD wSrdoCommulndex_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance wSrdoCommulndex_p Object index of the communication parameters of the SRD
7. normall 0x20000108 inverti 0x21000108 normal2 0x20010110 invert2 0x21010110 normal3 0x20010210 rn 0x21010210 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 sequential number normali 0x00000000 inverti 0x00000000 normal2 0x00000000 invert2 0x00000000 normal3 0x00000000 invert3 0x00000000 normal 0x00000000 invert4 0x00000000 normal5 0x00000000 invert5 0x00000000 normal6 0x00000000 invert6 0x00000000 normal7 0x00000000 invert7 0x00000000 normals 0x00000000 inverts 0x00000000 L 1077e_5 SYS TEC electronic GmbH 2013 41 Extension of the CANopen user layer 2 11 Function descriptions of the SRDO module 2 11 1 Function Srdolnit Syntax include lt srdo h gt tCopKernel PUBLIC Srdolnit MCO_DECL_PTR_INSTANCE_PTR_ l tSrdolnitParam MEM plnitParam_p Parameter MCO_DECL_PTR_INSTANCE_PTR_ Pointer to the instance pointer plnitParam_p Pointer to the parameter structure for initializing the SRDO module instance Return kCopSuccessful The function was executed without error kCopSrdoGranularityMismatch The configured SRDO granularity is not supported Further return codes of the standard CANopen are not possible Description The function deletes the instance table and initializes the first instance by using function SrdoAddinstance The parameter structure tSrdolnitP
8. return return return Figure 9 Principle for sending SRDOs AppSrdoError L 1077e_5 SYS TEC electronic GmbH 2013 21 Extension of the CANopen user layer 2 8 1 1 Function CcmCheckSrdoConfig Syntax include lt cop h gt tCopKernelPUBLIC CcmCheckSrdoConfig CCM_DECL_INSTANCE_HDL_ WORD pwCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle pwCommulndex_p Pointer to a variable in which the function provides the communication index of the faulty SRDO in case of a faulty configuration Return kCopSuccessful The function was executed without error For more return codes see 2 11 7 Function SrdoCheckConfig Description The function calculates the checksum CRC for all going SRDO also deactivated SRDOs with direction 0 and compares them to the one configured in the OD If it identifies an error it sends back the error and the communication index of the faulty SRDO This function represents the API function for SrdoCheckConfig and calls it It is necessary to call this function as part of the diagnosis periodically in the diagnostic test interval If an error is detected and the entry Configuration Valid Index 0x13FE is valid OxA5 then has to be changed in the safe state Please note The function SrdoCheckConfig is called with the value OxA5 by the SRDO module when the entry Configuration Valid is written Index Ox13FE in the object directory L 1077e_5 SYS TEC ele
9. 9 1 6 E e eo EE 10 2 Extension of the CANopen user layel ceeeeeeeeeeeeeeeeeeeeeeeeeeees 12 2 1 Limitations of the harcdhware 12 2 2 Limitations of the software zus as 12 2 31 SOftWware ten IEN 13 2 4 Configuration of the software ENEE 14 2 5 Function of the SRDO module cccccceeecceceeseeeeeeeeeseeeeeeeeseaaeees 16 2 5 1 en e 16 2 5 2 Receiving SRDOS Anne ee 16 2 5 3 Sending and receipt signaling of SRDOS 17 2 5 4 Logical monitoring of program run of the SRDO module 17 2 6 Function of the SRDOSTC module 18 2 7 General program tun see 19 2 8 Extention of the CCM over 20 2 8 1 Function CeomSendSrdo AAA 20 2 8 1 1 Function CcmCheckSrdoConfig 22 2 8 2 Function CCMSENO GIG 33 una 23 2 8 3 Function ComGetSrdoState cccccceccececssesseeeeeseeeseeeeees 24 2 8 4 Function Cemetzrcdotztate een 25 2 8 5 Function CcmGetSrdoParam 2222222200002000000 RBB 26 2 8 6 Function CcmStaticDefineSrdoVarFields 28 2 8 7 Function ComCal SrdOCre xc sssccdccedesecccassssivivdsteivexznseicdndsixics 29 2 9 Functions in the application cccccccccecceeeeeeeeeeeeeeeeeeeeaaeeeeeeeeees 30 2 9 1 Function AppsrdoEvent zen ee 30 2 9 2 Function AppSrdoError nennen 32 E MN neg eelere TEE 34 2 9 4 Function AppProgMonEvent seeeaseennneeeeeeeesrnnnrrrrrreeenneen 35 2 9 5 Function App bhNmtEvent AANEREN 3
10. a 1 Byte Information Direction b 2 Byte Refresh Time SCT c 1 Byte SRVT d 4 Byte COB ID 1 e 4 Byte COB ID 2 Mapping parameter f 1 Byte Subindex 0 g1 1 Byte Subindex h1 4 Byte Mapping data 9128 1 Byte Subindex h128 4 Byte Mapping data The following polynom is used G x X X X 1 The start value for the CRC is 0x0000 L 1077e_5 SYS TEC electronic GmbH 2013 6 Basics Framework for Safety Relevant Communication 1 2 Configuration Valid To make an entire SRDO configuration valid a flag must be set to Index 0x13FE in the object dictionary This flag is automatically set to an unvalid configuration for every write access that is done to a safety relevant SRDO parameter After completing the configuration this flag must be set to a valid configuration Value the configuration is valid Other values the configuration is valid Table 5 Configuration Valid General procedure of a configuration 1 Writing all safety relevant parameters and the checksums 2 Reading back all safety relevant parameters and the checksums and comparison with the written parameters 3 Setting the configuration to valid This flag must be checked periodically by the application in the security cycle time As long as this flag is not valid the safe state must not be left 1 3 Global Fail Safe Command GFC To increase the response time in safety targeted systems a GFC is defined that consists of
11. The length of the SRDO chosen Mapping exceeds 64 Bit The SRDO error reported to the application was not processed correctly L 1077e_5 SYS TEC electronic GmbH 2013 57 Reference environment TMDX570LS20SMDK 3 Reference environment TMDX570LS20SMDK Texas Instruments provide the development board TMDX570LS20SMDK It serves as a reference environment for our safety extension For the handling of projects in our extension there are several things to consider This chapter describes all these things to help you get started with the project and the hardware 3 1 Installation of the development environment With the development kit TMDX570LS20SMDK you have received a CD with the Code Composer Studio development environment The safety demo was created and tested with version V4 2 3 Install the development software of this CD and continue with the installation of the CANopen software 3 2 Installation of the CANopen software The CANopen stack SO 877 must be installed first Start the installation from the SYS TEC electronic product CD autorun menu The version of the CANopen stack must necessarily be greater than or equal to V5 51 In an earlier version the project for the TMS570LS does not exist After the welcome screen accepting the license agreement and enter the user information you will see the following dialog box for entering the license key of our CANopen stack Bu j5 Setup CANopen Source Code V5 50 le ee Pe
12. The macro OBD_CREATE_SRDO_COMMU is used to define the communication parameter of the SRDO Macros OBD_xxx_SRDO_MAPP are used to define the mapping parameters of a SRDO An entry of a SRDO always starts with the macro OBD_BEGIN_SRDO_MAPP The different subindex entries are defined by macro Makro OBD_SUBINDEX_SRDO_MAPP The entry ends with OBD_END_SRDO_MAPP Since there is always the communication parameter and the mapping parameter that correspond to one SRDO it is important that for both the continuous numbers of the SRDO are set correctly ind Object index of the SRDO to be defined 0x1301 to 0x1340 and 0x1381 to 0x13C0 for the mapping num Continuous number from 0 to 63 for the corresponding entry in the table The first always gets assigned the continuous number 0 The following entries always get the next larger number of the previous entry For L 1077e_5 SYS TEC electronic GmbH 2013 38 Extension of the CANopen user layer dir sct srvt cob1 cob2 cnt sub name val example if the SRDOs 0x1301 0x1302 and 0x1305 are generated the SRDO 0x1301 gets a 0 the 01302 a 1 and the 0x1305 a 2 Information direction of the SRDO The value corresponds with the index 0x1301 to 0x1340 Subindex 1 Refresh Time SCT of the SRDO The value corresponds with index 0x1301 to 0x1340 Subindex 2 SRVT of the SRDO The value corresponds with index 0x1301 to 0x1340 Subindex 3 COB ID 1 of the SRDO this means CAN I
13. 15 SRDO_USE_PROGMONITOR 15 SRDO_USE_STATIC_MAPPING 14 CRE voi ge ee PA A 54 Debugging isrenrcuneriosinis irei 62 Function APpGfcEventi iiiaae 34 AppProgMonEvert 35 AppSrdoError ssssssseeeeeeeeneeeneee eena 32 Appzrdotvent neee 30 CemCheckSrdoCorfig 22 CemDefineVarTabf 18 CcmGetSrdoParam 26 CcmGetSrdoState 24 CemlnitCANOpen 20 CCMPYOCESS nn 20 COMSENdGEC eeennnnn 23 ComSetSrdoState 25 CcmStaticDefineSrdoVarField 18 CcmStaticDefineSrdoVarFields 28 CobProcessReceiveQueue 47 SrdoAddlnstance nnnnnnnnnnnanenenne 43 GrdoChecktC ong 48 SrdoDeletelnstance 44 SrdoGetCommuParam 52 SrdoGetMappParam sssesseeeneeeeee 53 SrdoGetState nnnnn 50 SOI Nit gege en 42 GrdohmtEvent 45 Grdobrocess nnnnnnnnnnnnnnnnnenenenenne 47 GrdoGend ees 46 SrdOSendG cccececcceeeeeeeesseeeees 49 SrdoSetState oo eee 51 SrdoStaticDefineVarFields 55 Funktion SrdoCalcSrdoCrec 20000 gt 54 GEG 2 rl 7 8 9 23 49 Installation CANopen ssssnnissnsssessnnnrensserrrnnnenssene 58 Limitations hardware 12 Limitations software ccccee 12 MACOS EE 38 MOMONG E
14. 17 NM T6V6nti ene ee eins 45 OBD_BEGIN_SRDO_CRG 39 OBD_BEGIN SRDO_MAPP 38 OBD_CREATE_SRDO_CFG_VALID 39 OBD_CREATE_SRDO_COMMU 38 OBD_CREATE_SRDO_GFC_PARAM38 OBD_END_SRDO_CRQC 39 OBD_END_SRDO_MAPP 38 OBD_SUBINDEX_SRDO_CRGC 39 OBD_SUBINDEX_SRDO_MAPP 38 Object dictionary e nn 38 Ee dl e DT 16 reference environmert 58 Restrictions static mapping 18 Return codes eaa ai 57 Safety CPU srani i aiai 10 SONGING WEE 16 software structure icsse 13 SRDO Initialization cece eee e esses 42 POCCIVING a a aT A AT 30 SENd NG arrinca aiaa 20 transmission eeennenneneeeeeneeennnnn 20 30 Transmlsslon cece cece sees eee ees 46 SRDOS EEN 18 Static Mapping nennen 18 Structure tSrdolnitParam 42 tSrdoMappParam 27 TMDX570LS20SMDK 58 Watchdog insirri 11 L 1077e_5 SYS TEC electronic GmbH 2013 64 Suggestions for Improvements Document CiA 304 Safety Framework Document number L 1077e_4 Edition October 2012 How would you improve this manual Have you found any mistake in this manual Page Sent in by Customer number Name Company Address Please submit to SYS TEC electronic GmbH Am Windrad 2 D 08468 Heinsdorfergrund GERMAN
15. CPU e g TMS570LS by Texas Instruments is recommended Sensor Actuator Figure 3 two channel hardware with CPU transceiver Sensor Actuator Figure 4 two channel hardware with two CPU s transceiver transceiver Sensor Actuator Figure 5 single channel hardware with Safety CPU SIL Safety Integrity Level L 1077e_5 SYS TEC electronic GmbH 2013 10 Furthermore the implementation of additional security checks in the software is recommended These are listed below Repeated calculation of a CRC on the program memory Repeated testing of the RAM used Use of Watchdog Evaluation of exceptions that can occur due to programming errors e g accesses to protected memory accesses to unaligned addresses etc The extension package SO 1059 already provides the following options for security tests in the software Calculating CRC over SRDO configuration Sending of SRDOs over two CAN messages with the normal and inverted data Monitoring the Safety Cycle Time SCT and Safety Related Validation Time SRVT as well as the inverted data for received SRDOs If an error occurs the software must always go into a safe mode for the switching outputs so that no living beings can be injured or other machines destroyed It is recommended to coordinate the structure of the hardware with the admissions office before starting wit
16. SRDOs SRDOs are directly sent from the application Therefore function CcmSrdoSend is used The Refresh Time is monitored in the application because only the application can assure that the normal and inverted datas are consistent before the CAN messages of a SRDO are sent It is important that the first sending must be held up by 0 5ms Nodeld after switching into the node state OPERATIONAL The change of the node state is communicated to the application in function AppCbNmtEvent 2 5 2 Receiving SRDOs Function SrdoProcess is in charge of receiving SRDOs This function must be called cyclically which is realized for function CcmProcess L 1077e_5 SYS TEC electronic GmbH 2013 16 Extension of the CANopen user layer 2 5 3 Sending and receipt signaling of SRDOs The sending and receipt is signaled to the application via two different ways One the one hand via the callback function of the application AppSrdoEvent and AppSrdoError and on the other hand via the state of a SRDO that is to be polled by the application It is read with CcmSrdoGetState and written with CcmSrdoSetState The state of a SRDO is bit coded in the following way TX SRDO xx00 xxxxb Sending was ok xx01l xxxxb Sending was incorrect xxll xxxxb SRDO was edited RX SRDO xx00 xxxxb Receipt was ok xx01 xxxxb Receipt was incorrect xxll xxxxb SRDO was edited SRDO ERROR 00xx xxxxb Reset value Olxx xxxxb Value prior to ca
17. a directory to search for existing CCS Eclipse projects a Select search directory C systec cop target TMDX570L5205SMDK no_os CodeComposerStudio demo_srdo_actor D Select archive file Discovered projects I CT demo_srdo_actor C systec cop target TMDX570LS20SMDK no_os CodeComposerStudio demo_srdo_actor Select All Deselect All E Copy projects into workspace e If all these steps have been carried out without problems the project can be re created L 1077e_5 SYS TEC electronic GmbH 2013 61 Reference environment TMDX570LS20SMDK 3 4 Debugging the Demo on the hardware Now connect the TMS570 Development Kit to the PC Just use the included USB cable and plug it on the top board into the USB mini jack labeled XDS100V2 Now Windows search for the device drivers of the Development Kit These device drivers were installed with the installation of the Texas Instruments CD After installing the device driver you can connect the power supply to the Development Kit In the scope of delivery of the Development Kit is a 12V power supply included Connect it to the jack on the top board next to the USB mini jack With right click on the project on the left side in the window in Code Composer Studio you can now choose from the context menu Debug As gt Debug Session On the very first time you must select the type of CPU choose TMS570LS20216SZWT After confirming the Code Composer p
18. mapping the SRDOs are already mapped in the OD The mapping cannot be modified by the application or the SDO Thus fewer CODE memory is needed TSRDO 1 CANopen Application CANopen OD normal Data BYTE m_bNormalDig1 BYTE m_bNormalDig3 BYTE m_bNormalDig4 BYTE m_bNormalDig2 WORD m_w NormalDig1 WORD m_w NormalDig2 0x2000 1 0x2000 2 0x2000 3 0x2000 4 0x2001 1 0x2001 2 0x2001 3 0x2001 4 CAN ID invers Data BYTE m_binversDig1 BYTE m_binversDig3 BYTE m_binversDig2 BYTE m_binversDig4 WORD m_w InversDig1 WORD m_w InversDig2 0x2100 1 0x2100 2 0x2100 3 0x2100 4 0x2101 1 0x2101 2 0x2101 3 0x2101 4 CAN ID Figure 7 Figure of variable fields The relation of SRDO variables in the application to data in the OD or to data in the CAN message is created via function CcmStaticDefineSrdoVarField The application must provide two times 8 connected data bytes maximum for each SRDO which means without fill bytes gt Struct Alignment 1 In this manual these data packages are called variable fields of a SRDO Mapping the variable fields in the OD takes place in the application by calling function CcmDefineVarTab or through macro OBD_SUBINDEX_RAM_EXTVAR see L 1024 in the OD To use the stat
19. the file obdcfg h is set at least to the number of receive and send SRDOs To ensure safety you can increase this number The OD Builder up to version V1 19 of the date of this notice can not be used to create object directory with SRDOs because the index objects between 0x1300 and Ox13FF use special macros not support by this version of the OD Builder If the number of SRDOs needs to be increased copy the corresponding objects in the file obdict h and adjust the object index resp the subindex see also chapter 2 10 1 and 2 10 2 If other objects needs to be extended or added you can create them in a temporary directory with the OD Builder and copy amp paste them to the actual file objdict h L 1077e_5 SYS TEC electronic GmbH 2013 12 Extension of the CANopen user layer 2 3 Software structure The SRDO module is integrated in the stack in parallel to the existing modules such as PDO or SDO Applikation CCM Main CCM DfPdo CCM Obj Instanztabelle SRDO SDOS SDOC LSS NMTS NMIM CCM Xxx Instanztabelle m COB CDRV Figure 6 General software structure The implementation contains two different SRDO modules Applikationsschicht CCM Schicht CANopen Stack CAN Treiber Schicht SRDO C This module contains the services to define and transmit SRDOs SRDOSTC C This module provides the same services as SRDO C but it concerns the realization of static SRDO mapping CCM
20. wCommulndex_p Index object contains the communication parameters of the SRDO in the object directory pwCrc_p Pointer to a WORD variable to return the 16 bit CRC in the calling function Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function calculates the checksum CRC over a SRDO and returns it to the calling function The calculation is done also when the SRDO is turned off There is no comparison to the accuracy of the CRC The application can use this function to update the CRC of a SRDOs if the configuration of SRDOs needs to be dynamically set new over the application eg changing the COB ID depending on the node ID This function represents the API function SrdoCalcSrdoCrc and calls it Note The validity check of the CRC that is the calculation of the CRC over the configuration data of a SRDO and comparison with the associated CRC in the index Ox13FF is made in the function CcmCheckSrdoConfig Example WORD wTestCrc Ret CcmCalcSrdoCrc 0x1301 amp wTestCrc if Ret kCopSuccessful goto Exit PRINTF1 Calculated CRC of SRDOl 0x 04X n wTestCrc L 1077e_5 SYS TEC electronic GmbH 2013 29 Extension of the CANopen user layer 2 9 Functions in the application Function of the application that are called by the SRDO module as callback function are called directly and not via function pointer as for
21. 5 Table 6 Table 7 Table 8 Table 9 Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Communication parameters for the first SRDO 3 Information Direction of a GRO 3 Set up of a COB ID for a SRDO asssisseseeesrerrrrrreeennee nn 4 Exemplary Mapping Table for the first SRDO 5 Gontiguration Valle ea 7 Global Fail Safe Command GE 7 Extension Broadcast Predefined Connection Set 8 Extension Peer to Peer Predefined Connection Set 8 SRDO entries in the object drechonm sesnseneeeeeeeeeee 9 SCHPINGIPIE 4 een 4 SRVT DING IIS eigen 4 two channel hardware with CHUTE 10 two channel hardware with two CPUe 10 single channel hardware with Safety CPU 10 General software structure sssssssssrrerseeeerrrrrrrrrrrrree 13 Figure of variable fieldS AAA 18 EE ele unt TEE 19 Principle for sending SRDOS en 21 Example of an OD with 2 SRDOS ssaassssnseeeseeeeseeenrrernne 41 L 1077e_5 SYS TEC electronic GmbH 2013 Introduction Introduction This manual is an extention of the CANopen User Manual L 1020 and describes the application layer of the SRDO module Section 1 provides some basic terms of the Safety Framework Section 2 explains the implementation and describes the user functions user interfaces and data structures L 1077e_5 SYS TEC electronic
22. 7 2 10 Object directory see al 38 2 10 1 Macros for safety objects AEN 38 2 10 2 Advice for MACTOS EE 40 2 11 Function descriptions of the SRDO module 42 2 11 1 Function Srdolnit EE 42 2 11 2 Function Srdo hddlnstance 43 2 11 3 Function SrdoDeletelnstance ccccccccceeeseeeeeeeeseeeeeeeees 44 2 11 4 Function SrdoNmtEvent 82 Ben 45 22112 leiere ee EE 46 2 11 6 Function SrdoProgess ui 47 2 11 7 Function SrdocCheck ong 48 2 11 8 Function SrdosendGiezz ss 49 L 1077e_5 SYS TEC electronic GmbH 2013 List of Contents 2 11 9 Function SIGOGELS a en 50 2 11 10 Function SrdoSetState cccccceeeeeeeeeeeeeeeeeeeeeeees 51 2 11 11 Function SrdoGetCommuParam 52 2 11 12 Function SrdoGetMappParam 53 2 11 13 Funktion Grdot aleGrdotne 44 54 2 12 Function descriptions of the SRDOSTC module 55 2 12 1 Function SrdoStaticDefineVarFields 55 2 13 Extended CANopen Return codes en 57 3 Reference environment TMDX570LS20SMDK cccceeeeeeeeeeeeeeeeees 58 3 1 Installation of the development environment 58 3 2 Installation of the CANopen software 58 3 3 Import of the safety demo in Code Composer Giudo 59 3 4 Debugging the Demo on the hardware ssssesseseenseennrrrrrreeenre enn 62 Index EE 64 L 1077e_5 SYS TEC electronic GmbH 2013 List of Figures and Tables Table 1 Table 2 Table 3 Table 4 Table
23. 74 Extension for dynamic Object Dictionary E S 1078 Extension for SDO Gateway E S 1081 Extension for DS 402 Current selection requires at least 14 5 MB of disk space a Ceci Follow any prompts in the setup After installing the extension of SO 877 SO 1059 will automatically be installed You need to enter another license key for SO 1059 r j3 Setup CANopen Safety V5 50 ko ez Personal Information S License Key Q Thank you for purchasing the SYS TEC CANopen Extension Package for Safety communication This setup assistant is going to install the latest version of the CANopen Safety software on your computer Please follow the l instructions given to proceed with the installation process 4 IMPORTANT This software is subject to any license terms presented electronically during installation and or any printed terms included with this package Therefore it is protected by a unique license key which has to be entered on installation process This lirenee_key ie valid for nne wear after nurchasinn the nradurt and ie license key 3 3 Import of the safety demo in Code Composer Studio When the installation of the CANopen stack and the safety expansion is completed you will find in C systec cop target TMDX570LS20SMDkK no_os Code Composer Studio demo_srdo_actor the demo for the actuator on the TMS570LS Development Kit Please make
24. CANopen user layer 2 8 4 Function CcmSetSrdoState Syntax include lt cop h gt tCopKernel PUBLIC CCM_DECL_INSTANCE_HDL_ CcmSetSrdoState BYTE SrdoState_p WORD wSrdoCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle SrdoState_p status to be set wSrdoCommulndex_p Object index which contains communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error For more return codes see 2 11 10 Function SrdoSetState Description The function writes the status of a SRDO For setup and usage of the status please see 2 5 3 L 1077e_5 SYS TEC electronic GmbH 2013 25 Extension of the CANopen user layer 2 8 5 Function CcmGetSrdoParam Syntax include lt cop h gt tCopKernel PUBLIC CCM_DECL_INSTANCE_HDL_ CcmGetSrdoParam WORD wSrdoCommulndex_p tSrdoCommuParam pSrdoCommuParam_p tSrdoMappParam pSrdoMappParam_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle wSrdoCommulndex_p Object index which contains communication parameters of the SRDO in the object directory pSrdoCommuParam_p Pointer to the structure in which the function copies the values for Information Direction and SCT pSrdoMappParam_p Pointer to the structure in which the function copies the values for Number of Mapped Objects and the pointers to the mapped variables Return kCopSuccessful The function was executed without error For mor
25. D wCommulndex_p void MEM pNormalData_p void MEM pInversData_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle wCommulndex_p Communication index of the SRDO in the OD for which variables shall be defined pNormalData_p Pointer to connected variable field which shall be linked or mapped with normal data of SRDO pInversData_p Pointer to a connected variable field which shall be linked or mapped with inverse data of the SRDO Return kCopSuccessful The function was executed without error For more return codes see 2 12 1 Function SrdoStaticDefineVarField Description This function defines the variable fields for a SRDO The application only modifies the variables via those variable fields When sending a SRDO those data bytes are copied from the variable field into the two CAN messages When receiving a SRDO the data bytes of the CAN messages are directly copied into the variable fields The function checks if the specified variable fields are conform with the variables to which the mapping in the OD points This function represents the API function for SrdoStaticDefineVarFields and calls it L 1077e_5 SYS TEC electronic GmbH 2013 28 Extension of the CANopen user layer 2 8 7 Function CcmCalcSrdoCrc Syntax include lt srdo h gt tCopKernel PUBLIC CcmCalcSrdoCre MCO_DECL_INSTANCE_PTR_ WORD wCommulndex_p WORD pwCrc_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance
26. DULE SRDO must be added If the SRDO module is activated function CcmlnitCANOpen executes the initialization of the SRDO module The appropriate SRDO function is also called in function CcmProcess In the following user functions of the SRDO module are described 2 8 1 Function CcmSendSrdo Syntax include lt cop h gt tCopKernel PUBLIC CCM_DECL_INSTANCE_HDL_ CcmSendSrdo WORD wSrdoCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle wSrdoCommulndex_p Object index of the communication parameter of the SRDO in the object directory Return kCopSuccessful The function was executed without error For more return codes see 2 11 5 Function SrdoSend Description The functions sends a SRDO specified via the communication index or it sends all SRDO if 0x0000 is specified as communication index Before a SRDO sends CAN messages all bits of the data are checked in terms of correct inverting If at least one bit is not correct inverted all CAN messages of a SRDO are not sent and the callback function APPSrdoError is called L 1077e_5 SYS TEC electronic GmbH 2013 20 Extension of the CANopen user layer CcmSendSrdo SrdoSend SrdoSendintern SrdoSend SrdoEncodeNormal operational es E y SrdoEncodelnvers config valid SrdoCheckData yes SrdoSearchTabEntry no data valid CdrvWriteMsg msg1 CdrvWriteMsg msg2 e AppSrdoEvent SrdoSendintern
27. DefineVarFields MCO_DECL_INSTANCE_PTR WORD wCommulndex_p void MEM pNormalData_p void MEM pInversData_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance wCommulndex_p Communication index of the SRDO in the OD whose variables shall not be defined pNormalData_p Pointer to a coherent variable field that shall be linked or mapped to the normal data of the SRDO pInversData_p Pointer to a coherent variable field that shall be linked or mapped to the inverse data of the SRDO Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist kCopSrdoErrorMapp The mapping of a SRDO is faulty kCopSrdoLengtExceeded The length of the SRDO chosen Mapping exceeds 64 Bit L 1077e_5 SYS TEC electronic GmbH 2013 55 Extension of the CANopen user layer Description This function defines variable fields for a SRDO The application only changes the variables via those variable fields When sending a SRDO those data byetes are copied from the variable field into the two CAN messages When receiving a SRDO the data bytes of the CAN messages are directly copied into the variable fields The function verifies if the stated variable fields correspond with the variables to which the mapping points in the OD L 1077e_5 SYS TEC electronic GmbH 2013 56 Extension of the CANopen user layer 2 13 Extended CANopen Return codes The CANopen Return codes
28. GmbH 2013 1 Basics Framework for Safety Relevant Communication 1 Basics Framework for Safety Relevant Communication The CiA Draft Standard Proposal 304 CANopen Framework for Safety Relevant Communication defines the CANopen Protocol extensions for the integration of safety relevant devices in CANopen networks The protocol allows for using safety targeted devices and non safety targeted devices in one CANopen network Safety functions are realized via specific communication objects the SRDOs safety relevant data objects With the CANopen Safety Protocol it is possible to directly connect safety targeted sensors and actuators A safety targeted control e g PLC safety monitor is not needed This enables the realization of logically comparable safety chains as in usual wired technology e g the emergency power off switch directly affects the safety relay The CiA 304 standard is integrated in the standard DIN EN 50325 5 2009 1 1 SRDO Safety Relevant Data Object The SRDO communication follows the producer consumer principle This means that there is a SRDO producer and one or several SRDO consumers A SRDO consists of two CAN telegrams The following rules apply to the generation of a SRDO 1 The CAN identifier of the two CAN telegrams differ at least in two bit locations The CAN identifier of the CAN telegram with normal data always is uneven The CAN identifier of the CAN telegram with inverted data alway
29. O in the object directory Return kCopSuccessful The function was executed without error kCopSrdoNmtError The action is not allowed in this NMT state kCopSrdolnvalidCfg The action was tried with a faulty SRDO configuration kCopSrdoNotExist The SRDO chosen does not exist kCopSrdoRxTxConflict It was tried to send a receive SRDO kCopSrdolnvalid The action was tried with a switched off SRDO More return codes of the standard CANopen are possible Description The function sends one SRDO that is stated via communication index or all SRDOs when 0x0000 is stated as communication index See also the related API Function CcmSendSrdo L 1077e_5 SYS TEC electronic GmbH 2013 46 Extension of the CANopen user layer 2 11 6 Function SrdoProcess Syntax include lt srdo h gt tCopKernel PUBLIC MCO_DECL_INSTANCE_PTR SrdoProcess Parameter MCO_DECL_INSTANCE_PTR Pointer to the instance Return kCopSuccessful The function was executed without error kCopSrdoNotHandledinApp The SRDO error reported to the application was not processed correctly Further return codes of the standard CANopen are possible Description The function is called instead of function CobProcessReceiveQueue It works on receiving CAN messages from the CANopen stack Receive SRDOs is given a preferential treatment In addition this function checks the SCT of all receiving SRDOs If the SCT is expired but received none of the two CAN messages of th
30. RDO may not be processed anymore save NMT status to evaluate this in the main loop bSrdoState kNotOperational kNmtEvEnterOperational read the actual SRDO parameter by calling CcmGetSrdoParameter SRDO must be processed save NMT status to evaluate this in the main loop CemGetSrdoParam 0x1301 amp SrdoCommuParam bSrdoState kEnterOperational L 1077e_5 SYS TEC electronic GmbH 2013 37 Extension of the CANopen user layer 2 10 Object directory Various safety relevant entries of the object directory are described in chapter 1 2 10 1 Macros for safety objects There are special macros for the different SRDO entries for the realisation in the CANopen Software Those are described in this chapter Please Note The OD builder at the time of this note version V1 19 can not generate the specific macros for the SRDOs Therefore you should not use this tool for the creation of the object directory Please read the chapter 2 2 Further information about the object directory is described in document L 1024 CANopen Object Directory Software Manual OBD_CREATE_SRDO_GFC_PARAM The macro OBD_CREATE_SRDO_GFC_PARAM is used to create entry Global Fail Safe Command Parameter Index 0x1300 The macro does not have parameters OBD_CREATE_SRDO_COMMU ind num dir sct srvt cob1 cob2 and OBD_BEGIN_SRDO_MAPP ind num cnt OBD_SUBINDEX_SRDO_MAPP ind sub num name val OBD_END_SRDO_MAPP ind
31. SRDO module If the SRDOs in the object directory sequentially implemented without gaps then this define can be left to FALSE In this case the SRDOs for the checks are referenced more quickly Are there some SRDOs missed in the object directory e g only SRDO2 with communication index 0x1301 is going to be implemented but SRDO1 with index 0x1301 is missing or SRDO1 and SRDO3 is going to be implemented but SRDO2 is missing then this define must be set to TRUE In this case the SRDOs are referenced by a search algorithm from which a higher runtime oft he softare results See also chapter 2 10 2 L 1077e_5 SYS TEC electronic GmbH 2013 14 Extension of the CANopen user layer SRDO_USE_GFC Value range Default Meaning FALSE TRUE FALSE If the GFC message is not needed in a project then the API functions CcmSendGfc and SrdoSendGfc and the object 0x1300 can be omitted for reasons of optimization In this case the Define SRDO_USE_GFC must be set to FALSE SRDO_USE_PROGMONITOR Value range Default Meaning FALSE TRUE FALSE Is a project of the Program Monitor not needed then it can be removed for reasons of program code optimization by set this define to FALSE The callback function AppProgMonEvent is not called in this case SRDO_CHECK_SRVT_BEFORE_1STRX Value range Default Meaning FALSE TRUE FALSE Should the SRVT also be monitored as the SCT cyclically by calling the SrdoProce
32. SRDO C User interface of the SRDO module L 1077e_5 SYS TEC electronic GmbH 2013 13 Extension of the CANopen user layer 2 4 Configuration of the software The software configuration is the same as in the standard CANopen stack also with the copcfg h file For SRDOs there are a few defines that are explained below Lack of these defines in the file copcfg h activate their default settings SRDO_USE_STATIC_MAPPING Value range FALSE TRUE Default FALSE Meaning If TRUE static mapping is used instead of dynamic mapping of the SRDOs The mapping then cannot be changed neither via SDO nor by the application during the runtime Instead of SRDO C SRDOSTC C file must the be used SRDO_USE_DUMMY_MAPPING Value range FALSE TRUE Default FALSE Meaning When using the dynamic SRDO mapping dummy objects can be mapped if this define is set to TRUE This allows for Receive SRDOs not having to implement any variable in the OD if these variables are not important for a CANopen node SRDO_GRANULARITY Value range 8 16 32 64 Default 8 Meaning This define determines the smallest resolution in bits of the variables of a SRDOs Does this define ist set to 8 then up to 8 normal and 8 inverse data can be mapped into a SRDO For value 16 the number halves to 4 normal and 4 inverse data etc SRDO_ALLOW_GAPS_IN_OD Value range FALSE TRUE Default FALSE Meaning This define is used to optimize the code requirements in
33. SYS TEC SO 1059 SRDO Add on module CANopen Source Code Add on for CiA 304 Safety Framework Software Manual Edition May 2013 SYS TEC electronic GmbH Am Windrad 2 08468 Heinsdorfergrund Deutschland Telefon 49 3765 38600 0 Fax 49 3765 38600 4100 Web www systec electronic com Mail info systec electronic com System House for Distributed Automation This manual includes descriptions for copyrighted products that are not explicitly indicated as such The absence of the trademark symbol does not infer that a product is not protected Additionally registered patents and trademarks are similarly not expressly indicated in this manual The information in this document has been carefully checked and is believed to be entirely reliable However SYS TEC electronic GmbH assumes no responsibility for any inaccuracies SYS TEC electronic GmbH neither guarantees nor accepts any liability whatsoever for consequential damages resulting from the use of this manual or its associated product SYS TEC electronic GmbH reserves the right to alter the information contained herein without prior notification and does not accept responsibility for any damages which might result Additionally SYS TEC electronic GmbH neither guarantees nor assumes any liability for damages arising from the improper usage or improper installation of the hardware or software SYS TEC electronic GmbH further reserves the right to alter the layout and or design o
34. Y Fax 49 0 3765 38600 4100 L 1077e_5 SYS TEC electronic GmbH Fehler Verweisquelle konnte nicht gefunden werden Suggestions for Improvements ae SYS TEC SYS TEC electronic GmbH Fehler Verweisquelle konnte nicht Best Nr L 1077e_5 gefunden werden Printed in Germany
35. a high priority CAN telegram CAN identifier 1 The GFC does not contain data and can be used by all participants Afterwards the initiating participant must send the corresponding SRDO The usage of GFC is optional It is event triggered and not safety relevant because there is no time monitoring For the GFC the entry Global Fail Safe Command parameter to Index 0x1300 is included in the object directory The following values are possible GFC is not supported GFC is supported Other values Table 6 Global Fail Safe Command GFC L 1077e_5 SYS TEC electronic GmbH 2013 7 Basics Framework for Safety Relevant Communication 1 4 Predefined Connection Set Forthe SRDO the Predefined Connection Set of CiA DS301 is extended as follows Broadcast objects Object Function COB ID Index in the code object directory GFC 0000 0x001 0x1300 Table 7 Extension Broadcast Predefined Connection Set Peer to Peer Objects Object Function COB ID normal COB ID inverse Index in the object code data data directory SRDO messages SRDO 0010 0x101 0x13F 0x102 0x140 0x1301 0x1340 Node ID 1 32 tx SRDO 0010 0x141 0x17F 0x142 0x180 0x1301 0x1340 Node ID 33 rx 64 Table 8 Extension Peer to Peer Predefined Connection Set L 1077e_5 SYS TEC electronic GmbH 2013 Basics Framework for Safety Relevant Communication 1 5 Ove
36. aram contains the parameters for initializing the instance and is setup as follows typedef struct if COP_MAX INSTANCES gt 1 void MEM m ObdInstance void MEM m CobInstance void MEM m CdrvInstance endif tSrdoTabParam m SrdoTabParam BYTE m bGranularity BYTE MEM m pbSrdoConfigValid tSrdolnitParam L 1077e_5 SYS TEC electronic GmbH 2013 42 Extension of the CANopen user layer 2 11 2 Function SrdoAddInstance Syntax include lt srdo h gt tCopKernel PUBLIC SrdoAddinstance MCO_DECL_PTR_INSTANCE_PTR_ tSrdolnitParam MEM pInitParam_p Parameter MCO_DECL_PTR_INSTANCE_PTR_ Pointer to the instance pointer plnitParam_p Pointer to the parameter structure for initializing the SRDO module instance Return kCopSuccessful The function was executed without error kCopSrdoGranularityMismatch The configured SRDO granularity is not supported Further return codes of the standard CANopen are possible Description This function adds a new instance to the SRDO module Therefore define COP_MAX_INSTANCES must be larger than 1 If there is no free entry available in the instance table the functions sends back en error The SRDO tables for this instance are initialized Chapter 2 11 1 contains the setup of the parameter structure tSrdolnitParam L 1077e_5 SYS TEC electronic GmbH 2013 43 Extension of the CANopen user layer 2 11 3 Function SrdoDeletelnstance Syntax
37. are defined in file errordef h Error code kCopSuccessful kCopSrdoNotExist kCopSrdoGranularityMismatch kCopSrdoCfgTimingError kCopSrdoCfgldError kCopSrdoCfgCrcError kCopSrdoNmtError kCopSrdolnvalidCfg kCopSrdolnvalid kCopSrdoRxTxConflict kCopSrdolllegalCanld kCopSrdoCanldAlreadyInUse kCopSrdoNotInOrder kCopSrdoSctTimeout kCopSrdoSrvtTimeout kCopSrdoCanldNotValid kCopSrdoDlicNotValid kCopSrdoErrorMapp kCopSrdoDataError kCopSrdoLengtExceeded kCopSrdoNotHandledinApp Description The function was executed without error The SRDO chosen does not exist The configured SRDO granularity is not supported The SRDO configuration is configuration SCT SRVT The SRDO configuration is faulty COB Ids faulty time The SRDO configuration is faulty CRC The action is not allowed in this NMT state The action was configuration The action was tried with a switched off SRDO tried with a faulty SRDO It was tried to send a receive SRDO The CAN Identifier is not valid The CAN Identifier is already being used The two CAN meassages of a SRDO have been received in the wrong order The SCT of a receive SRDO was exceeded The SRVT of a receive SRDO was exceeded At least on of the two received CAN Identifier of a SRDO is faulty At least on of the two received CAN message lenghts of the SRDO is faulty The mapping of a SRDO is faulty The data of the CAN messages of a SRDO is not inverse
38. ctronic GmbH 2013 22 Extension of the CANopen user layer 2 8 2 Function CcmSendGfc Syntax include lt cop h gt tCopKernel PUBLIC CCM_DECL_INSTANCE_HDL CcmSendGfc Parameter CCM_DECL_INSTANCE_HDL Instanz Handle Return kCopSuccessful The function was executed without error For more return codes see 2 11 8 Function SrdoSendGfc Description The function sends a GFC message It will be not available if the configuration of SRDO_USE_GFC is set to FALSE This function represents the API function for Function SrdoSendGfc and calls it The following SRDO must be transferred by the application via function CcmSendSrdo L 1077e_5 SYS TEC electronic GmbH 2013 23 Extension of the CANopen user layer 2 8 3 Function ComGetSrdoState Syntax include lt cop h gt tCopKernel PUBLIC CCM _DECL_INSTANCE_HDL_ CcmGetSrdoState BYTE pSrdoState_p WORD wSrdoCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle pSrdoState_p Pointer to which the functions copies the status wSrdoCommulndex_p Object index which contains communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error For more return codes see 2 11 9 Function SrdoGetState Description The function reads the status of a SRDO For setup and usage of the status please see 2 5 3 L 1077e_5 SYS TEC electronic GmbH 2013 24 Extension of the
39. d modified via the CAN bus by using service data objects SDO Index Subinde Object data Meaning x 0x1301 0 Number of the following entries 1 Information Definition if the SRDO is switched off 0 a Direction TSRDO 1 or a RSRDO 2 2 Refresh Time Distance between two transmissions of a SCT SRDO 3 SRVT Distance between the two CAN messages ofa SRDO 4 Transmission Type of transmission of the SRDO fix 254 Type 5 COB ID 1 CAN identifier normal data 6 COB ID 2 CAN identifier inverted data Table 1 Communication parameters for the first SRDO Information Direction Subindex 1 The Information Direction is used to determine if the SRDO is switched off or if it is used as send or receive SRDO The following values are possible Value Meaning the SRDO is switched off the SRDO is switched on as send SRDO the SRDO is switched on as receiver SRDO 0x03 OxFF Table 2 Information Direction of a SRDO L 1077e_5 SYS TEC electronic GmbH 2013 3 Basics Framework for Safety Relevant Communication Refresh Time SCT Subindex 2 The Refresh Time SCT sets the distance between two transmissions of a SRDO that is the distance between the first CAN messages of a SRDO For send SRDOs the parameter is the distance between two transmissions of the SRDO For receiver SRDOs this is the maximum time allowed between two transmissions of the SRDO for the SRDO to be valid Th
40. dentifier of the message that contains normal data The value corresponds with index 0x1301 to 0x1340 Subindex 5 COB ID 2 of the SRDO this means CAN Identifier of the message that contains inverse data The value corresponds with index 0x1301 to 0x1340 Subindex 6 Number of mapping entries of the SRDO The value corresponds with the object entry 0x1381 to 0x13C0 Subindex 0 Subindex of the mapping entry that is to be defined Object name Default value for the mapping data that must be accepted after Reset OBD_CREATE_SRDO_CFG_VALID The macro OBD_CREATE_SRDO_CFG_VALID is used to generate the entry Configuration Valid Index 0x13FE The macro does not have parameters OBD_BEGIN_SRDO_CRC cnt OBD_SUBINDEX_SRDO_CRC sub name OBD_END_SRDO_CRC The macros are used to define the object entries Safety Configuration Checksum Index 0x13FF cnt sub name Number of CRC table entries If the indexes 0x1301 to 0x1340 contain gaps CRC entries must be defined The nth SRDO corresponds with the nth subindex of the CRC Subindex of the CRC entry that is to be defined Object name L 1077e_5 SYS TEC electronic GmbH 2013 39 Extension of the CANopen user layer 2 10 2 Advice for macros Please note the objects in the object dictionary have to be created in ascending order otherwise the CANopen Stack is not able to detect the objects in the OD This means that the following macros must always be applied in t
41. e SRDOs then the function AppSrdoError is called with the error code kCopSrdoSctTimeout Is the constant SRDO_CHECK_SRVT_BEFORE_1STRX set to TRUE this function checks the SRVT of all SRDOs If only one of the two CAN messages was received and the SRVT has expired then the function AppSrdoError is called with the error code kCopSrdoSrvtTimeout This function is called cyclically Variations in terms of the timing of the SRDOs depend on this function The function SrdoProcess is called automatically by CcmProcess from CcmMain c once the SRDO is enabled in CCM_MODUL_INTEGRATION L 1077e_5 SYS TEC electronic GmbH 2013 47 Extension of the CANopen user layer 2 11 7 Function SrdoCheckConfig Syntax include lt srdo h gt tCopKernel PUBLIC MCO_DECL_INSTANCE_PTR_ SrdoCheckConfig WORD pwCommulndex_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance pwCommulndex_p Pointer to a variable in which the function stores the communication index of the faulty SRDO in case of faulty configuration Return kCopSuccessful The function was executed without error kCopSrdoCfgCrcError The SRDO configuration is faulty CRC Description The function calculates the check sum over all SRDO also deactivated SRDOs with Direction 0 and compares them to the check sum that is configured in the OD If it detects an error it sends back an error and the corresponding communication index of the faulty SRDO The fu
42. e return codes see 2 11 11 Function SrdoGetCommuParam and 2 11 12 Function SrdoGetMappParam Description The function reads the parameters of a SRDO needed in the application Those are the communication parameters Information Direction and SCT as well as the mapping parameters Number of Mapped Objects and the pointer to the mapped variables The function only completes the structures if the transferred pointer is not the null pointer Structure tSrdoMappParam only exists for dynamic mapping This function represents the APl function for SrdoGetCommuParam and the function SrdoGetMappParam and calls them L 1077e_5 SYS TEC electronic GmbH 2013 26 Extension of the CANopen user layer Structure tsrdoCommuParam is set up as follows typedef struct BYTE m bDirection direction of SRDO 0 invalid 1 Tx 2 Rx WORD m wSct refresh time SCT tSrdoCommuParam Structure tSrdoMappParam is set up as follows typedef struct BYTE m bNoOfMappedObjects Number of mapped objects void MEM m apMappedVariable SRDO MAX MAPPENTRIES array of pointers to the mapped variables tSrdoMappParam L 1077e_5 SYS TEC electronic GmbH 2013 27 Extension of the CANopen user layer 2 8 6 Function CcmStaticDefineSrdoVarFields The function only is available for static SRDO mapping Syntax include lt cop h gt tCopKernel PUBLIC CcmStaticDefineSrdoVarFields CCM_DECL_INSTANCE_HDL _ WOR
43. e specification is given in milliseconds SRDO SRDO SRDO refreshtime refreshime refreshime SCT berschritten Figure 1 SCT principle SRVT Subindex 3 The SRVT sets the maximum distance between the two CAN messages of a receiver SRDO which is the time between the message with normal data and the message with inverted data Send SRDOs are directly sent one after another The specification is given in milliseconds SRDO SRDO SRDO SRDO OOH NZZ SRVT berschritten Figure 2 SRVT principle Transmission Type Subindex 4 The Transmission Type sets the character of a SRDO transmission Only value 254 is valid This implies an asynchronous transfer see CiA DS301 COB IDs CAN identifier Subindex 5 and 6 COB IDs 1 and 2 support the identification and definition of the priority of a SRDO for bus accesses There may only be one sender prodcer for each CAN message but several receivers consumers Values between 0x101 0x180 are acceptable One SRDO always consists of two sequenced COB Ids whereas COB ID 1 is uneven and COB ID 2 is the subsequent ID Modifying the values is only possible if the SRDO is switched off which means subindex 1 Information Direction is set to 0 Bit 31 11 Bit 10 0 reserved 0 CAN Identifier Table 3 Set up of a COB ID for a SRDO L 1077e_5 SYS TEC electronic GmbH 2013 4 Basics Framework for Safety Relevant Communication 1 1 2 Mapping
44. f the hardware without prior notification and accepts no liability for doing so Copyright 2013 SYS TEC electronic GmbH All rights including those of translation reprint broadcast photomechanical or similar reproduction and storage or processing in computer systems in whole or in part are reserved No reproduction may occur without the express written consent from SYS TEC electronic GmbH contacts Direct Your local distributor Address SYS TEC electronic GmbH Am Windrad 2 D 08468 Heinsdorfergrund GERMANY Ordering 49 3765 38600 2110 information info systec electronic com Please find a list of our distributors under Technical 49 3765 38600 2140 support support systec electronic com www systec electronic com distributors Fax 49 3765 38600 4100 Website http www systec electronic com 5 Edition May 2013 L 1077e_5 SYS TEC electronic GmbH 2013 List of Contents Taligete 0 Mee 1 1 Basics Framework for Safety Relevant Communication 2 1 1 SRDO Safety Relevant Data Object nnseseeseeennrerereeenrrrnrrerene 2 1 1 1 Communication parameters of a SRDO 3 1 1 2 Mapping parameter of a GRO 5 n Er CRC Of a SRDO icons cudnt cores 6 12 Config ration Valld WEE T 1 3 Global Fail Safe Command GFC een 7 1 4 Predefined Connection Get kk 8 1 5 Overview safety targeted entries in the object directory
45. h the implementation L 1077e_5 SYS TEC electronic GmbH 2013 11 Extension of the CANopen user layer 2 Extension of the CANopen user layer This section explains the extension of the SYS TEC CANopen Stack user layer described in L 1020 Moreover it provides details about the data structures and API functions of the SYS TEC electronic GmbH specific implementation of the CANopen standard CiA DS 304 in the following called SRDO module The description contains the syntax of the functions the parameter the return value and explanations about the usage Section 2 13 explains the meaning of the return codes and the supported abort codes 2 1 Limitations of the hardware The usage of the SRDO module requires a CAN controller for which the chronological sequence of CAN messages on the CAN bus can be determined Currently the SRDO module is adjusted to the SJA1000 CAN controller of the company Phillips More CAN controllers will follow The number of high prioritized buffer entries of the CAN controller in file obdcfg h must be set to the minimum number of receive and send SRDO 2 2 Limitations of the software The SRDO module can only be operated with a particular configuration of the CAN driver To do this please put in the file copcfg h the following defines to the following values CDRV_USE_HIGHBUFF TRUE CDRV_USE_BASIC_CAN TRUE CDRV_USE_IDVALID TRUE The number of high priority buffer entries of the CAN controller in
46. he order listed below Macros for ommunication and mapping parameters can occur multiple times depending on how many SRDOs should be applied OBD_CREATE_SRDO_GFC_PARAM OBD_CREATE_SRDO_COMMW OBD_BEGIN_SRDO_MAPP OBD_CREATE_SRDO_CFG_VALID OBD_BEGIN_SRDO_CRC If several SRDOs are created in one OD it must be taken care that each SRDO has a consecutive number starting with 0 This number must be transferred to the macro OBD_CREATE_SRDO_COMMU as the second parameter to the macro OBD_BEGIN SRDO_MAPP also as second parameter and to the macro OBD_SUBINDEX_SRDO_MAPP as the third parameter The subsequent SRDO always gets the number inceased by one The number for the communication parameters of a SRDOs is always the same number as the corresponding mapping parameters Are the SRDOs in the object dictionary created with gaps then the define SRDO_ALLOW_GAPS_IN_OD in the file copcfg h must set to TRUE With gapes is meant that for example SRDO1 and SRDO3 are created in the OD but not SRDO2 In this case the number of SRDO1 would be 0 and SRDO3 would get the serial number 1 A definite assignment of communication index and sequential number is then no longer possible In order that the CANopen stack still can find the corresponding SRDO the stack must implement a different search algorithm which can lead to a higher running time Therefore please avoid such gaps in the object dictionary L 1077e_5 SYS TEC electron
47. ic GmbH 2013 40 Extension of the CANopen user layer OBD_SUBINDEX_SRDO_MAPP 0x138 OBD_SUBINDEX_SRDO MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 2 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD SUBINDEX SRDO MAPP X OBD END SRDO MAPP 0x1381 OBD BEGIN SRDO MAPP 0x1382 OBD_SUB NDEX_SRDO_MAPP 138 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP Sx136 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD END SRDO MAPP 0x1382 OBD_ CREATE SRDO CFG VALID OBD BEGIN SRDO CRC SRDO MAX SRDO IN OBD OBD SUBINDEX SRDO CRC 1 GE SRDO_ 1 0 OBD SUBINDEX_ SRDO_CRC 2 crc_SRDO_2 OBD_END SRDO CRC Figure 10 Example of an OD with 2 SRDOs 0 communication 0x101 0x102 0x103 0x104
48. ic SRDO mapping file SRDOSTC C must be mounted instead of file SRDO C Moreover define SRDO_USE_STATIC_MAPPING must be set to TRUE within file CopCfg h Restriction For CPUs that do not support uneven accesses to data types larger BYTE a mixed mapping of BYTE and WORD is not possible e g for example BYTE WORD BYTE But the following mapping is possible BYTE BYTE WORD L 1077e_5 SYS TEC electronic GmbH 2013 18 Extension of the CANopen user layer 2 7 General program run Initialisierung CANopen Stack CemlInitCANOpen Srdolnit SrdoAddInstance Durchlaufen der NMT Statemachine gt CemlnitConnectToNet SrdoNmtEvent CcmProcess Operational AppGfcEvent SrdoProcess AppProgMonEvent II AppSrdoEvent e a Srdo empfangen Refres abgelaufen AppSrdoError Time nein CcmSendSrdo Sichheitszyklus abgelaufen CemCheckSrdoConfig Programmiiber wachung OK Eigensicherer Zustand Figure 8 General program run L 1077e_5 SYS TEC electronic GmbH 2013 19 Extension of the CANopen user layer 2 8 Extention of the CCM layer File CCMMAIN C is extended for the integration of the SRDO module The SRDO module must be activated in file COPCFG H via define CCM MODULE INTEGRATION Therefore constant CCM MO
49. lling AppSrdoError 10xx xxxxb AppSrdoError must set this value The application must follow both ways Example for the receipt of aSRDO The SRDO module sets the state to receipt OK Afterwards the SRDO module calls function AppSrdoEvent This function checks if the state is set to receipt OK If this is not the case it is relevant to security The application must react Ifthe state is correct the status is set to SRDO was edited The state must also be checked for the application in the main loop It must always be in state SRDO was edited because otherwise it would indicate that the SRDO in function AppSrdoEvent was not edited This would be satefy critical With the implementation of the SRDO module we follow the philosophy that the safe state is taken only with the successful reception of the SRDOs If an error appears during the runtime the safe state is left 2 5 4 Logical monitoring of program run of the SRDO module A logical monitoring of the program run is integrated in the SRDO module Function AppProgMonEvent is called with the respective Event for different program steps The actual realization of the program run monitor takes place in the application function that is called L 1077e_5 SYS TEC electronic GmbH 2013 17 Extension of the CANopen user layer 2 6 Function of the SRDOSTC module The SRDOSTC module replaces the SRDO module for static SRDO mapping With the static SRDP
50. n does not exist Description The function reads the parameters of a SRDO that are necessary in the application Those are Information Direction and SCT See associated API function See associated API Function CcmGetSrdoParam L 1077e_5 SYS TEC electronic GmbH 2013 52 Extension of the CANopen user layer 2 11 12 Function SrdoGetMappParam Syntax include lt srdo h gt tCopKernel PUBLIC SrdoGetMappParam MCO_DECL_INSTANCE_PTR_ WORD wSrdoCommulndex_p tSrdoMappParam pSrdoMappParam_p Parameter MCO_DECL_INSTANCE_PTR _ Pointer to the instance wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory pSrdoCommuParam_p Pointer to the structure in which the function copies the values for the Number Of Mapped Objects and the Variable pointer Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function reads the mapping parameters of a SRDO that are necessary in the application Thos are Number of Mapped Objects and the Pointers to the mapped variables See associated API Function CcmGetSrdoParam L 1077e_5 SYS TEC electronic GmbH 2013 53 Extension of the CANopen user layer 2 11 13 Funktion SrdoCalcSrdoCrc Syntax include lt srdo h gt tCopKernel PUBLIC SrdoCalcSrdoCre MCO_DECL_INSTANCE_PTR_ WORD wCommulndex_p tSrdoTabEntry MEM pSrdoEntry_p WORD pwCrc_p
51. nction is called by the SRDO module upon writing the entry Configuration Valid Index Ox13FE in the object directory with value OxA5 See also the related API function CcmCheckSrdoConfig L 1077e_5 SYS TEC electronic GmbH 2013 48 Extension of the CANopen user layer 2 11 8 Function SrdoSendGfc Syntax include lt srdo h gt tCopKernel PUBLIC MCO_DECL_INSTANCE_PTR SrdoSendGfc Parameter MCO_DECL_INSTANCE_PTR Pointer to the instance Return kCopSuccessful The function was executed without error Further return codes of the standard CANopen are possible Description The function sends a GFC message It will not be available if the configuration SRDO_USE_GFC is set to FALSE See also the related API function CcmSendGfc L 1077e_5 SYS TEC electronic GmbH 2013 49 Extension of the CANopen user layer 2 11 9 Function SrdoGetState Syntax include lt srdo h gt tCopKernel PUBLIC MCO_DECL_INSTANCE_PTR_ SrdoGetState BYTE pSrdoState_p WORD wSrdoCommulndex_p Parameter MCO_DECL_INSTANCE_PTR _ Pointer to the instance pSrdoState_p Pointer to which the function copies the status wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function reads the status of a SRDO For setup and usage
52. ns on the right side Selct Necessary Sectors Only and press Apply L 1077e_5 SYS TEC electronic GmbH 2013 62 Reference environment TMDX570LS20SMDK r ve Debug Create manage and run configurations Edit the launch configuration settings Changes will take effect on the next launch SAX Ep7 type filter text Name demo_srdo_actor E C C Attach to Local Application E C C Local Application E C C Postmortem debugger DVT Control e Non Project Debug Session e Project Debug Session Ki demo_srdo_actor Generic Debugger Options Cortex R4 Disassembly Style Options TMS570L520216SZWT Flash Settings Main Debugger EISE Source Common Flash Settings E Enable Programming to OTP Memory Crystal Frequency MHz 16 0 Erase Options Entire Flash Necessary Sectors Only for Program Load Selected Sectors Only Bank 0 CH Pre r L 1077e_5 SYS TEC electronic GmbH 2013 63 Index Index Callback function 0ccccceeeeeeeeeees 30 CANopen saiety 59 CANopen stack 59 HEE E EEEE 20 ul eler 47 Certtficaton 10 CHECKSUM n eai aea i 22 54 Code Composer Studio 60 Configuration soseer ieiki nn 14 SRDO_ALLOW_GAPS_IN_OD 14 SRDO_CHECK_SRVT_BEFORE_1S DR CAE 15 SRDO_GRANULARITY 14 SRDO_USE_DUMMY_MAPPING 14 SRDO USE GFC aeaiiai
53. of the status see chapter 2 5 3 See associated API function Function CcmGetSrdoParam L 1077e_5 SYS TEC electronic GmbH 2013 50 Extension of the CANopen user layer 2 11 10 Function SrdoSetState Syntax include lt srdo h gt tCopKernel PUBLIC MCO_DECL_INSTANCE_PTR_ SrdoSetState BYTE SrdoState_p WORD wSrdoCommulndex_p Parameter MCO_DECL_INSTANCE_PTR _ Pointer to the instance SrdoState_p Status to be set wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function writes the status of a SRDO For setup and usage of the status see chapter 2 5 3 L 1077e_5 SYS TEC electronic GmbH 2013 51 Extension of the CANopen user layer 2 11 11 Function SrdoGetCommuParam Syntax include lt srdo h gt tCopKernel PUBLIC SrdoGetCommuParam MCO_DECL_INSTANCE_PTR_ WORD wSrdoCommulndex_p tSrdoCommuParam pSrdoCommuParam_p Parameter MCO D CL INSTIANCE PIR Pointer to the instance wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory pSrdoCommuParam_p Pointer to the structure in which the function copies the values for the Information Direction and SCT Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chose
54. parameter of a SRDO Mapping parameters describe the data content of a SRDO Mapping parameters are entries in the object directory Index 0x1381 0x13C0 One mapping entry is structured such as the mapping of a PDO see L 1020 But for the SRDO mapping one entry is always generated for normal data and followed by a corresponding entry for inverted data Index Sub Object data Meaning index 0x1381 0 8 Number of mapped entries 1 0x20000310 UNSIGEND16 to Index 0x2000 Subindex3 normal data 2 0x21000310 UNSIGEND16 to Index 0x2100 Subindex3 inverse data 3 0x20010108 UNSIGEND8 to Index 0x2001 Subindex1 normal data 4 0x21010108 UNSIGEND8 to Index 0x2101 Subindex1 inverse data 5 0x20010208 UNSIGEND8 to Index 0x2001 Subindex2 normal data 6 0x21010208 UNSIGEND8 to Index 0x2101 Subindex2 inverse data 7 0x20020620 REAL32 to Index 0x2002 Subindex6 normal data 8 0x21020620 REAL32 to Index 0x2102 Subindex6 inverse data Table 4 Exemplary Mapping Table for the first SRDO L 1077e_5 SYS TEC electronic GmbH 2013 5 Basics Framework for Safety Relevant Communication 1 1 3 CRC of a SRDO To check the validity of the parameters of a SRDO a CRC is calculated via the safety relevant data of each SRDO It is filed to Index 0x13FF in the object directory The number of the subindex complies with the number of the SRDO The following parameters go into the CRC Communication parameter
55. rograms the demo into the flash of the microcontroller and stops in the main function Inthe Debug window you can now control the program execution with the symbols Console Search Debug 7 D gt v sla RI o r er Eve i demo_srdo_actor Debug Texas Instruments XDS100v2 USB Emulator_0 CortexR4 Project Debug Session a Device gi Thread main Suspended 0 main at ex_srdo_actr c 370 0x00007510 1_c _int00 at sys_startup c 619 0x000108f8 vi Texas Instruments XDS100v2 USB Emulator_0 CortexR4 17 18 07 vi Texas Instruments XDS100v2 USB Emulator_0 CortexR4 CIO 17 18 07 Do you want to stop debugging then simply change the perspective back to C C Click in the upper right part of the Code Composer Studio on the icon next to debug The following Contex Menu C C will be offered con xX FEY XF Debug E D I C C m Other Now you are back to the Project Explorer of the Code Composer Studio The programming of the firmware in the flash takes a long time first the entire flash is erased Therefore you should change the debug options so that only the flash sectors will be erased which are used by the application Click with the right mouse button on the project and select the context menu Debug As gt Debug In the next dialog switch on the right side of the window click the tab sheet Target Select the line TMS570LS20216SZWT Flash Settings Now you can find the Erase Optio
56. rsonal Information e License Key be Thank you for purchasing the SYS TEC CANopen Protocol Stack Source Code a This setup assistant is going to installthe latest version ofthe CANopen Source Code software on your computer Please follow the instructions given to proceed with the installation process IMPORTANT This software is subject to any license terms presented electronically during installation and or any printed terms included with this package Therefore it is protected by a unique license key which has to be entered on installation process This lirenee_key ie valid for one wear after nurchasinn the nradurt and ie license key lt Back JL Net gt _ Cancel Enter the purchased license key and press Next In the following dialog select the demo projects Also select the software package SO 1059 from the CANopen extensions L 1077e_5 SYS TEC electronic GmbH 2013 58 Reference environment TMDX570LS20SMDK Setup CANopen Source Code V5 50 Select Components Which components should be installed Select the components you want to install clear the components you do not want to install Click Next when you are ready to continue Custom installation X Manuals deutsch 25MB Manuals english 2 3 MB E CANopen Extensions PA S 1059 Extension for safety communication according to DS 304 E S 1066 Extension for MPDO according to DS 301 5 10
57. rview safety targeted entries in the object directory Index Name Object Data type Attributs type 0x1300 GFC parameter var us rw 0x1301 1 SRDO communication record SRDO rw parameter parameter 0x1340 64 SRDO communication record SRDO rw parameter parameter 0x1341 Reserved 0x1380 Reserved 0x1381 1 SRDO mapping array u32 rw parameter 0x13C0 64 SRDO mapping array u32 rw parameter 0x13C1 reserved Ox13FD reserved Ox13FE Configuration Valid var u8 rw Ox13FF Safety Configuration array u16 rw Checksum Table 98 SRDO entries in the object directory L 1077e 5 SYS TEC electronic GmbH 2013 Basics Framework for Safety Relevant Communication 1 6 Certification The software package SO 1059 is an expansion pack for the CANopen Source Code SO 877 It cannot be certified as a single unit The certification requires a self contained unit with all the necessary software components Therefore the manufacturer of the device is always responsible for the certification The necessities for certification depends on the level of security which shall be achieved SIL 3 for example has a higher necessary requirements than SIL2 For SIL3 certification the hardware needs to be designed with two channels see Figure 3 and Figure 4 Lower requirements can be build with a single channel see Figure 5 For this purpose the use of a Safety
58. s is the subsequent even value 2 The data oft two CAN telegrams is redundant But the data of the second CAN telegram is inverted bit by bit 3 A SRDO is transferred periodically whereas the distance between two SRDOs is determined by the SCT safeguard cycle time 4 The distance between the two CAN telegrams of a SRDO may not exceed the SRVT safety relevant object validation time 5 The order of the two CAN telegrams of a SRDO must be maintained Firstly the actual data is transferred and secondly the inverted data is transferred The receiver checks the validity of a SRDO The time and logical sequence of the CAN telegrams of a SRDO is compared to an expected value Afterwards the user data is verified If errors are detected it is switched to the secure state of the assigned actuators The secure state is to be defined in dependence from the application of the device manufacturer and or user Features of SRDOs CAN identifier SCT SRVT mapping are stored in the object directory and checked for validity by a CRC 16 bit cyclic redundant check L 1077e_5 SYS TEC electronic GmbH 2013 2 Basics Framework for Safety Relevant Communication 1 1 1 Communication parameters of a SRDO The communication parameters of a SRDO define the transmission features and the COB IDs of a SRDO The communication parameters of a SRDO are entries in the object directory Index 0x1301 0x1340 They can be read and if allowe
59. ss function if only one of the two CAN messages of a SRDOs was received then this constant must be set to TRUE Is this constant set to FALSE then an error is detected at the earliest when the second CAN message was received after the SRVT or after the SCT has expired With TRUE an error is detected immediately after the SRVT L 1077e_5 SYS TEC electronic GmbH 2013 15 Extension of the CANopen user layer 2 5 Function of the SRDO module The SRDO module takes over the SRDO processing for dynamic SRDO mapping this means the mapping can be modified by the application or by the SDO during runtime Module SRDOSTC supports the static SRDO mapping For each SRDO a structure with all relevant data is generated to accelerate the SRDO processing Those structures are summarized in tables The SRDO tables are part of the object directory Each SRDO uses variables that must be created by the application beforehand During the mapping addresses in the SRDO are directed to the corresponding variables This means that there must be a variable for each mappable object Therefore when defining the object directory in file objdict h macro OBD_SUBINDEX_RAM_USERDEF or OBD_ SUBINDEX_RAM_USERDEF_RG must be used for the respective object The SRDO module checks the chosen parameters for each modification of the mapping If the object does not exist or if it does not have a variable of the application an errors is reported 2 5 1 Sending
60. sure that the files ccsproject cdtbuild cdtproject and project are not set to hidden in the directory Otherwise the project can not be imported to the Code Composer Studio Please remove the attribute hidden when it should be set Now start the Code Composer Studio You will be prompted to create a workspace Close this dialog by entering a directory of your choice L 1077e_5 SYS TEC electronic GmbH 2013 59 Reference environment TMDX570LS20SMDK In Code Composer Studio call up the menu Window gt Preferences Expand the menu on the left part of the window click General gt Workspace gt Linked Resources In the right window use the New button to create a new entry name cop and location C systec cop Please pay attention to the case sensitive At the end the dialog should look at as follows r w Preferences type filter text General Appearance Content Types Editors Keys Perspectives Search Web Browser Welcome Workspace Compare Patch Startup and Shutdown m Linked Resources r v V Enable linked resources Path variables specify locations in the file system may be specified relative to these path variables Defined path variables CCS_C2000_5_2 10_CG_ROOT C Program amp CCS_C2000_6_0_1_CG_ROOT C Program F amp CCS_TMS470_4 6_4_CG_ROOT C Program amp CCS_TMS470_4 9 0_CG_ROOT C Program Bui Lin Local History Id Order ked Resources C C
61. tCopKernel PUBLIC AppSrdoError CCM_DECL_INSTANCE_HDL_ WORD wSrdoCommulndex_p tCopKernel ErrorCode_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle wCommulndex_p Communication index of the SRDO in the OD ErrorCode_p Error code of the SRDO kCopSrdoSctTimeout The SCT of a receive SRDO was exceeded kCopSrdoSrvtTimeout The SRVT of a receive SRDO was exceeded kCopSrdoNotInOrder The two CAN meassages of a SRDO have been received in the wrong order kCopSrdoDataError The data of the CAN messages of a SRDO is not inverse More error codes are possible from the CDRV module Return kCopSuccessful The function was executed without error All other return codes are reserved L 1077e_5 SYS TEC electronic GmbH 2013 32 Extension of the CANopen user layer Description The function is called by the SRDO module if the transmission of a SRDO is incorrect receiving or sending The status of the SRDO must be taken care of in the function according to chapter 2 5 3 tCopKernel PUBLIC AppSrdoError CCM DECL INSTANCE HDL_ WORD wSrdoCommulndex_p tCopKernel BrrorCode p BYTE bSrdoState tCopKernel Ret Ret CcmGetSrdoState amp bSrdoState wSrdoCommulndex_p if Ret kCopSuccessful if bSrdoState amp 0x30 0x10 process information according to the application for example switch outputs of SRDO off Status SRDO bearbeitet on set bSrdoState 0x30
62. the rest in CANopen Consequently those functions must be available in the application and may not be renamed 2 9 1 Function AppSrdoEvent Syntax include lt cop h gt tCopKernel PUBLIC CCM_DECL_INSTANCE_HDL_ AppSrdoEvent WORD wSrdoCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instanz Handle wCommulndex_p Communication index of the SRDO in the OD Return kCopSuccessful The function was executed without error All other return codes are reserved Description The function is called by the SRDO module if the transmission of a SRDO is accurate receiving or sending The status of tne SRDO must be taken care of in the function according to chapter 2 5 3 L 1077e_5 SYS TEC electronic GmbH 2013 30 Extension of the CANopen user layer tCopKernel PUBLIC AppSrdoEvent WORD wSrdoCommulndex_p BYTE bSrdoState tCopKernel Ret Ret CcmGetSrdoState amp bSrdoState wSrdoCommulndex_p if Ret kCopSuccessful if bSrdoState amp 0x30 0x00 Sicherheitskritischer Fehler je nach Anwendung Information verarbeiten beispielsweise Ausg nge des SRDO einschalten Ret CcmSetSrdoState bSrdoState 0x30 wSrdoCommulndex_p if Ret kCopSuccessful return kCopSuccessful CCM_DECL_INSTANCE HDL L 1077e_5 SYS TEC electronic GmbH 2013 31 Extension of the CANopen user layer 2 9 2 Function AppSrdoError Syntax include lt cop h gt
Download Pdf Manuals
Related Search
Related Contents
Socket Mobile SoMo 650-E vMax™ Live ミラーキャビネッ ト Rexel Auto+ 60X TPC-1270 User Manual Copyright © All rights reserved.
Failed to retrieve file