Home

MICROCANOPEN CLASSIC USER MANUAL

image

Contents

1. The CiA recommends to NOT use node guarding All new implementations should use the heartbeat mechanism instead The functionality is provided here for completeness define USE EMCY I If set to 1 the device can generate CANopen emergency messages Emergencies can either be triggered by the application or by the CANopen stack for example if a RPDO received has an invalid length Hdefine NR EMCY CONSUMERS 0 This value defines if the emergency consumer functionality is provided If this define is set to0 the emergency consumer functionality is disabled If unequal zero it defines the maximum number of emergency messages that can be monitored The emergency consumer configuration values are stored in the process image also see section Configuration of the process image define NR HB CONSUMERS 0 This value defines if the heartbeat consumer functionality is provided If this define is set to0 the heartbeat consumer functionality is disabled If unequal zero it defines the maximum number of nodes that can be monitored The heartbeat consumer configuration values are stored in the process image also see section Configuration of the process image define NR OF SDO CLIENTS 0 If set to a value other than zero the local node implements as many SDO client channels as indicated by this number The theoretical limit for the number of SDO client channels is 127 Each channel requires at least 11 bytes of RAM to st
2. table is used to define the parameters for RPDO1 the second for RPDO2 and so on Each table entry consists of the COB ID and the transmission type used for the RPDO The macro RPDO COM ENTRY is provided to simplify the entries made into the table The RPDO COM ENTRY macro RPDO COM ENTRY CANID TTYPE DUMMY DUMMY The CANID specifies the default 11 bit CAN message ID used by this RPDO If set to zero the default from the pre defined connection set of CANopen is used TTYPE is a byte with the CANopen RPDO transmission type Typically a default of FEh manufacturer specific or FFh device profile specific is used The DUMMY values are currently not used leave at zero Note MicroCANopen Classic currently does not support RTR transmission or 29 bit CAN message identifiers TPDO COMMUNICATION PARAMETERS The grPDOCom table This table is an array of structures containing the communication parameters for the TPDOs Transmit Process Data Objects The number of entries in this table must match the global define settings for NR OF TPDOS The first entry in the table is used to define the parameters for TPDO1 the second for TPDO2 and so on Each table entry consists of the COB ID and the transmission type used for the TPDO The macro TPDO COM ENTRY is provided to simplify the entries made into the table The TPDO COM ENTRY macro TPDO COM ENTRY CANID TTYPE INHIBITT EVENTT The CANID specifies the default 11 bit CAN message ID used by
3. 8 bit and most 16 bit processor architectures with limited resources When set to OXFFFF the process image can be up to 65535 bytes big all variables with offset information are of type UNSIGNED 16 NOTE the define TTABLE SIZE is set to UNSIGNED8 or UNSIGNED 16 in accordance to the value specified in TABLE_MAXSIZE define PROC_IMG_SIZE 96 This value specifies the total size of the process image in bytes It must not exceed the value TABLE MAXSIZE NMT SERVICE SETTINGS OF CCO_CFG H define AUTOSTART 0 If set to I the device directly goes into the operational state after the boot up without waiting for the NMT Master This is required in master less networks where no NMT Master is present to generate the NMT Master Message define BOOTUP_TIMEOUT 10000 This value specifies for how many milliseconds the CANopen node will try to transmit the initial boot up message before giving up and going into the fatal error state Failure to transmit the boot up message typically comes from an incorrect bit rate setting or if the node is currently the only node on the network nobody acknowledges the boot up message Hdefine USE NODE GUARDING 0 MicroCANopen Classic always implements production of the Heartbeat protocol In addition Node Guarding may be enabled to be backward compatible with older 33 THE MICROCANOPEN CLASSIC PROTCOL STACK equipment not capable of handling heartbeats To enable Node Guarding set USE NODE GUARDING to 1
4. 99 The file content is organized by lines Lines starting with a semi colon or a slash are regarded comment and are ignored So are all spaces line feed and return characters All data values are in hexadecimal using capitalized letters for the letters A through F Additional characters like Ox or h are not allowed If multiple bytes are used for a data value for example UNSIGNED16 or UNSIGNED32 the byte ordering is Little Endian lower significant byte s first Entries in the Setup File Each entry section starts with a line containing a label in square brackets All labels use upper case letters only for example NODE This section contains a list of all labels defined Note that the label length is kept short to simplify processing for embedded microcontrollers The line or lines following a label contain the data values for that entry In the current version all entries must be in the setup file exactly in the order specified here Entry COPTSK The first line MUST start with the 8 characters COPTSK followed by a line with one byte identifying the file format Currently only format B8 is supported It is recommended to add a comment behind this byte to identify the configuration and a generation timestamp for example COPTSK B8 For MyEncoder generated on 18 AUG 03 by John Doe This comment line is the ONLY comment line that will also be stored into the non
5. SDO response command specifier Index of the Object Dictionary entr TT Subindex of the Object Dictionary ent Data bytes to be send in the response The last entry in this list must consist of 8 bytes with the value FFh Example COD 4300100091010F00 430810004C585858 4F18100003000000 4318100141534501 431810024C58794D 4318100350000100 4F00600006000000 4F00620004000000 EE EEE PE EEE PEE PEF The example contains the SDO responses for the following Object Dictionary entries 1000 00 returns OOOFO191h 1008 00 returns 5858584Ch XXXL 1018 00 returns 03h 1018 01 returns 01455341h 1018 02 returns 4D79584Ch 46 THE MICROCANOPEN CLASSIC PROTCOL STACK 1018 03 returns 00010005h 6000 00 returns 06h 6200 00 returns 04h Entry RWOD This entry contains the list of Object Dictionary entries that address data in the process image Each entry in this list has 5 bytes Name Description Index of the Object Dictionary entr FEE EE Subindex of the Object Dictionary entr Access and This byte contains the access type and length length information for this Object Dictionary entry for details see next table Offset to a location in the process image where the data for this Object Dictionary entry is stored NOTE In basic implementations the offset is a 1 byte value in extended implementations a 2 The first 2 bytes specify the Index and the 3 byte the Subind
6. configured slave can be started to switch into regular CANopen mode and enter pre operational or operation mode Optionally the LSS Master can also switch the network to a new final CAN baudrate to use CONFIGURATION The LSS Slave implementation in MicroCANopen Classic is transparent to the user The code module Iss slv c has to be included in the project and LSS slave mode has to be activated in cco_cfg h see LSS SETTINGS OF CCO_CFG H After reset the node switches into LSS mode and waits for LSS commands from the LSS master The LSS master is responsible for setting the slave node s Node ID and starts the node The slave node then automatically switches into the configured CANopen startup NMT state either pre operational or operational see define AUTOSTART 0 The LSS Addresses of all nodes have to be unique in order for LSS to work The data for the Identity Object OD entry 1018h is set in cco_cfg h in the following defines all are UNSIGNED32 values define OD VENDOR ID define OD PRODUCT CODE define OD REVISION define OD S ERIAL 50
7. depending on the RTOS or interrupt structure used in the application 3 Chip and Compiler Specific Directory Name CHIP_COMPILER src This directory contains the source files that are chip architecture and compiler specific This includes all handlers for hardware peripherals of a chip CAN Timer NVOL Memory like EEPROM or Flash File Module ccohw h Driver for CAN peripheral or interface and timer handling ccohw_CHIP c also implement CAN receive interrupt and timer interrupt nvolhw h Non volatile memory access functions only needed if NVOL nvolhw_CHIP support is enabled c main_CHIP c Main module for stand alone operation of MicroCANopen Classic 4 Compiler Management Directory Name CHIP_COMPILER This directory contains all files and subdirectories generated by the compiler project files make files object files executables maps etc MYNODE EXAMPLE CONFIGURATION AND APPLICATION This manual uses the simple example application MyNode that implements a CANopen node producing two analog temperature values Temp1 and Temp2 of type INTEGER 16 and two digital values ButttonsI and Buttons2 of type UNSIGNEDS reporting the state of some input buttons and switches The node consumes two digital values LEDs and LEDs2 of type UNSIGNED8 used to switch some indication lights This example uses TPDO1 Transmit Process Data Object 1 to transmit the button values every 100 milliseconds and TPDO2 to transmit the tem
8. task management MicroCANopen Classic core module Object Dictionary Access implements the access to the Object Dictionary data tables Service Data Object handling ES Process Data Object handling man Implements configuration storage in non volatile memory nvol c xnmt h xnmt c Iss h Iss slv c Implements extended NMT services such as heartbeat consumption Implementation of Layer Settings Services 2 Application Configuration Directory Name src usercfg APPLICATIONNAME This directory contains the files and modules configuring the CANopen node implemented These files need to be modified or generated for each particular application The default examples provided are src usercfg mynode and src usercfg ds401 a Device Profile DS401 compatible implementation of a generic I O device Additional examples may be available upon request File Module cco_cfg h img NAME h CANopen functionality configuration CANopen features supported can be enabled disabled via define Definition of symbolic offsets for locations in the process image uod NAME c Contents of the CANopen Object Dictionary and default configuration of the PDOs ccocb NAME Call back module implements all the call back functions c from CANopen stack to the application tsk_NAME c Task management module that controls with which priority which CANopen function is executed this must be modified THE MICROCANOPEN CLASSIC PROTCOL STACK
9. than zero It notifies the application of the result of a previously sent SDO request Called void CCOCB SDO Response Received UNSIGNED8 channel UNSIGNED8 sdoerr UNSIGNEDS channel The SDO channel number for which this is a reponse UNSIGNEDS sdoerr SDO error ok status value CCOCB SDO Response Received CHANNEL SDOERR 26 THE MICROCANOPEN CLASSIC PROTCOL STACK Passed The CHANNEL number identifies the SDO Client channel for which this is a response This is a channel for which an SDO Request was sent previously The SDOERR value returned can be one of the following SDOERR_WRITEOK The previously made write attempt is confirmed SDOERR_READOK The previously made read attempt is completed the data is now available SDOERR_ABORT An SDO Abort message was received SDOERR_UNKNOWN The response received is unknown SDOERR_TIMEOUT The previously made access attempt timed out the mode addressed did not reply Returned Nothing The CCOCB_RPDO_Received function This function notifies the application of an RPDO received Called void CCOCB RPDO Received UNSIGNED16 PDONr UNSIGNEDS len UNSIGNEDS pData UNSIGNED16 PDONr The RPDO number in range from I to 512 UNSIGNEDS len Length of RPDO 1 to 8 bytes UNSIGNEDS pData Pointer to the PDO data received CCOCB RPDO Received PDONR LEN PDATA Passed The PDONR is in the range of 1 to 512 and indicates the PDO number of the received RPDO The LEN v
10. the CANopen default COB IDs from the pre defined connection set should be used The transmission type is FFh The first RPDO has 4 Object Dictionary entries mapped The mapped entries are the first 4 Object Dictionary entries listed in the RWOD section The second RPDO has 2 entries mapped They are the 5 and 6 entries listed in RWOD 44 THE MICROCANOPEN CLASSIC PROTCOL STACK Entry TPDO This entry contains the communication and mapping parameters for each TPDO used The number of data fields must be matching Nr of TPDOs value used in the entry NODE The first data field contains 7 bytes for each TPDO holding the communication parameters The first 2 bytes set the COB ID the next 2 bytes the inhibit time the next 2 bytes the event time and the 7 byte the transmission type COB ID TPDO COB ID leave at zero to use default 3 4 Inhibit Time The TPDO Inhibit Time in 100s of microseconds 5 6 The TPDO Event Time in milliseconds 7 Transmission TPDO transmission type typically FEh or FFh Type The second data field contains 9 bytes for each TPDO holding the mapping parameters The first byte of each entry specifies the number of entries mapped Allowed values are 0 through 8 The following entries identify the Object Dictionary entry mapped using a single byte The byte is the offset that the mapped Object Dictionary entry has in the RWOD section Unused bytes must be set to FFh Fa Nr Name Description a
11. the SOFTWARE including but not limited to any images photographs animations video audio music text and applets incorporated into the SOFTWARE any accompanying printed materials and any copies of the SOFTWARE are owned by ESA The SOFTWARE is protected by copyright laws and international treaty provisions Therefore you must treat the SOFTWARE like any other copyrighted material All copyright notices this license header comments and similar statements include with this distribution of the SOFTWARE must remain in the source code at all times No claim must be made as to the ownership of the SOFTWARE THIS SOFTWARE AND ALL ACCOMPANYING FILES DATA AND MATERIALS ARE DISTRIBUTED AS IS AND WITH NO WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED Good data processing procedure dictates that any program be thoroughly tested with non critical data before relying on it The user must assume the entire risk of using the program THIS DISCLAIMER OF WARRANTY CONSTITUTES A ESSENTIAL PART OF THE AGREEMENT THE MICROCANOPEN CLASSIC PROTCOL STACK IN NO EVENT SHALL ESA OR ITS PRINCIPALS SHAREHOLDERS OFFICERS EMPLOYEES AFFILIATES CONTRACTORS SUBSIDIARIES OR PARENT ORGANIZATIONS BE LIABLE FOR ANY INCIDENTAL CONSEQUENTIAL OR PUNITIVE DAMAGES WHATSOEVER RELATING TO THE USE OF THE SOFTWARE OR YOUR RELATIONSHIP WITH ESA IN ADDITION IN NO EVENT DOES ESA AUTHORIZE YOU TO USE THE SOFTWARE IN APPLICATIONS OR SYSTEMS WHERE THE SOFTWA
12. these contain the 1000 00 Device Type entry the 1018 xx Identity Objects and some Number of Entries type entries with a Subindex of zero Each entry in this list has 8 bytes that directly contain the 8 bytes used in a CAN message with an expedited SDO response to a read upload request The macros SDO REPLY and SDO REPLY4 are provided to ease the generation of the 8 byte entries The last entry must be 8 times OxFF to indicate the end of the table The current implementation does not require that the entries are sorted in any way The SDO_REPLY macro This macro generates the 8 byte SDO response required for a read upload request from an Object Dictionary entry with a constant entry SDO_REPLY INDEX SUBINDEX LENGTH VALUE INDEX is the 16 bit Index of the Object Dictionary entry SUBINDEX is the 8 bit Subindex of the Object Dictionary entry LENGTH is the length of the Object Dictionary entry in bytes and must be in the range of to 4 VALUE is the value of the Object Dictionary entry It must be defined as a 32 bit value even if LENGTH is less than 4 bytes In that case the unused bytes must be set to zero The Object Dictionary entry 1000h 00h with a value of 00030191h can be generated by SDO_REPLY 0x1000 0x00 4 0x00030191L The SDO REPLY4 macro This macro generates the 8 byte SDO response required for a read upload request from an Object Dictionary entry with a constant entry of 4 bytes with an 14
13. 7 1 byte at offset 7 System Entries define PIO RPDO DUMMY 8 4 bytes at offset 8 define PIO HEARTBEAT 12 2 bytes at offset 12 define PIO ERROR REGISTER 14 1 byte at offset 14 OBJECT DICTIONARY CONFIGURATION Although working with CANopen EDS and DCF files is the standard procedure for many CANopen configuration tools many embedded CANopen nodes require a specific default configuration that a node should use if not configured through a CANopen configuration tool or by a CANopen Configuration Manager In MicroCANopen Classic the default configuration is setup via tables typically implemented in a file called uod xxx c UOD stands for User Object Dictionary file If non volatile memory support and configurationis enabled these tables can 13 THE MICROCANOPEN CLASSIC PROTCOL STACK be stored in non volatile memory such as EEPROM or FLASH memory allowing for an implementation that can easily be configured via a configuration file The tables gODConstTable and gODRWTable define the contents of the Object Dictionary The tables g RPDOCom gTPDOCom gRPDOMap and gTPDOMap define the PDO communication and mapping parameters CONSTANT EXPEDITED OBJECT DICTIONARY ENTRIES The gODConstTable table The table gODConstTable is an array of bytes that contains a list of SDO responses for SDO requests to constant read only entries in the object dictionary limited to 4 bytes or less Typically
14. ANT EXPEDITED OBJECT DICTIONARY ENTRIES esse sesse sees 14 VARIABLE EXPEDITED AND MAPPABLE OBJECT DICTIONARY ENTRIES doo TEN 15 VARIABLE GENERIC NON MAPPABLE OBJECT DICTIONARY ENTRIES 16 RPDO COMMUNICATION PARAMETERS ee sesse esse ese ee ee ee ee ee ee ee ee ee ee ee ee 17 TPDO COMMUNICATION PARAMETERS sesse ese ese ese ees ees ee ee ese see ee ee 17 PDO MAPPING PARAMETER S ai 18 MYNODE CONFIGURATION EXAMPLE sesse ese ese ese ese ese eene ee ee ee ee ee ee ee ee ee 18 CANOPEN APIFUNCTIONS sa sd 21 TkeCEO it CANopen Tun cum el lis 21 The CCO Read Process Data function rresnrrrorrrrnrrrenrernrrrenrrrnnrrerrernsrerrrerrrnsseenn 21 The ECO Write Process Data TICA Grand 22 CANOPEN API CALL BACK FUNCTIONS sesse esse ee esse ee ee ee ee ee ee ee ee ee 23 The CCOCB NMT Change Tc a 23 The CCOCB Data Received neon is al ee GN ee 24 The CEOCB SYNE Received fimeton AE Ee EG N EA Re ee 25 The CCOCB EMEY Received TUNGHOM ss De se Ie Ge ke EG ee es Ge Ee 25 TheECOCB Fatal Error HEL ON ia Sd 25 THE MICROCANOPEN CLASSIC PROTCOL STACK The CCOCB TX Error UOC teca 26 The CCOCB SDO Response Received function for SDO Clients sesse see 26 The CCOCB RPDO Received TINGHON iese ee SE Se Re DS EG ee Se ee AG 2T CANOPEN API EXTENDED FUNCTIONS esse esse sesse sesse es ss se ed ee ee esse ek de ee 28 The XNMT Transmit NMT Msg function eee sesse ee se ee ee Re AR ee ee 28 The XNMT Process HB Check Tel 29 The XNMT I
15. AXSIZE TABLE MAXSIZE TABLE MAXS Li INITIALIZE TPDO COMMUNICATION PARAMETERS PDO COM PARAM gTPDOCOMINR OF TPDOS TPDO1 Default CAN ID enable ttype 255 0 inhibit time 100ms event time TPDO COM ENTRY 0x000 0 255 0 100 TPDO2 Default CAN ID enable ttype 255 0 inhibit time 250ms event time TPDO COM ENTRY 0x000 0 255 0 250 y TPDO MAPPING INFORMATION UNSIGNED16 gTPDOMap 8 NR OF TPDOS TPDOL Map OD entries from table gODTable map 3rd and 4th element of gODTable Nr of entries Map OD entries 2 2 3 TABLE MAXSIZE TABLE MAXSIZE TABI LE MAXSIZE TABLE MAXSIZE TABLE MAXSIZE TABLE MAXS ZE TPDO2 Map OD entries from table gODTable map 1st and 2nd element of gODTable Nr of entries Map OD entries 2 0 1 TABLE MAXSIZE TABLE MAXSIZE TABI LE MAXSIZE TABLE MAXSIZE TABLE MAXSIZE TABLE MAXS ZE 20 THE MICROCANOPEN CLASSIC PROTCOL STACK CANOPEN API FUNCTIONS This section lists all the functions that can be called by the application program The CCO Init CANopen function The CCO Init CANopen function re Jinitializes the CANopen protocol stack It needs to be called during system initialization It may also be called tore initialize the CANopen stack for e
16. DUMM 0x0007 0x00 4 ODWR WMAP PIO RPDO DUMMY OxFF y OBJECT DICTI OD_PROCESS_DATA 1 0 1 Digitial Inputs OD ENTI OD ENTI 2 3 Analog Inputs OD ENT OD ENT 4 5 Digital Outputs OD ENTRY 0x6200 0x01 1 0 OD ENTRY 0x6200 0x02 1 0 System entries OD ENTRY 0x1001 0x00 1 0 OD ENTRY 0x1017 0x00 2 0 OD ENTRY 0x0005 0x00 140 OD ENTRY OD ENTRY LASTODENTRY Er se 1 0x00000002L ONARY TABLE FOR RD WR ENTRIES ENTRY gODRWTable RY 0x6000 0x01 1 0DRD RMAP PIO Buttonsl RY 0x6000 0x02 1 0DRD RMAP PIO Buttons2 RY 0x6401 0x01 2 ODRD RMAP PIO Templ RY 0x6401 0x02 2 ODRD RMAP PIO Temp2 DRD ODWR WMAP PIO LEDs1 DRD ODWR WMAP PIO LEDS2 DRD PIO_ERROR_REGISTER DRD ODWR PIO HEARTBEAT DWR WMAP PIO RPDO DUMMY Y 19 THE MICROCANOPEN CLASSIC PROTCOL STACK INITIALIZE RPDO COMMUNICATION PARAM ETERS PDO COM PARAM TMEM FAR gRPDOCOm NR OF RPDOS RPDO1 Default node ID Transmission Type 255 no timer PDO COM ENTRY 0x000 255 0 0 Li RPDO MAPPING INFORMATION TTABLE SIZE TMEM FAR gRPDOMap 9 NR OF RPDOS RPDOL map 5th and 6th element of gODTable Nr of entries Map OD entries 2 4 5 TABLE MAXSIZE TABLE MAXSIZE TABLE MAXSIZE ZE TABLE M
17. Ent PIO HEARTBEAT 2 1017h 00h Producer Heartbeat Time PIO ERROR REGISTER 1 1001h 00h Error Register PIO RPDO DUMMY 0001h 0007h 00h Data types for dummy mapping PIO_GUARDTIME 100Ch 00h Node Guard Time PIO_GUARDFACTOR 100Dh 00h Node Guard Life Time Factor PIO HBCONSUMER BASE 4 Cons 1016h xxh Heartbeat Consumer PIO EMCYCONSUMER BASE 4 Cons 1028h xxh Emergency Consumer Note 1 Dummy mapping is used when not all data bytes contained in a process data message received are needed All unused unwanted bytes will be written to the area reserved for dummy mapping HEARTBEAT CONSUMER FUNCTIONALITY If heartbeat consumption 1016h xx is implemented the Object Dictionary entries for the consumer are also stored in the process image The required storage format is a 4 byte value for each heartbeat consumer entry The define value in file img xxx h PIO HBCONSUMER BASE defines the base address offset of where this array is stored in the process image The define value NR OF HB CONSUMERS defines the number of heartbeat consumer channels provided The required storage space in the process image is 4 times NR OF HB CONSUMERS A value of 0 turns off this feature EMERGENCY CONSUMER FUNCTIONALITY If emergency consumption 1028h xx is implemented the Object Dictionary entries for the consumer are also stored in the process image The required storage format is a 4 byte value for each emergency consumer entr
18. NDED FUNCTIONALITY TASKS esse sesse esse sees ese ss ge des Gee ss si se se se de ss ese ed dee 41 XNMT Process HB Checa rec laa 41 ANMT SDO Handle Clima lei 41 SETUP FILE FOR NON VOLATILE MEMORY esse esse ee esse ee es ee ee ee ee ees ee ee ee ee 42 SETUP FILE FORMA Vi 42 Estres in the Setup PE sa Nede 42 EN OPNE 42 Entry ID aaa 43 Entry NOD Plat dd BEE Re EE 43 Entry RPDO Arr 44 Entry TED SE OR AE E ER ON a 45 Entry POE 46 Entry RWOD Lia a did 47 Entry LIMON A eae E 48 A EE AE EN EE 49 SETUP FILEDOWNLOA Dic ii 49 LAYER SETTING SERVICES LESS iss ss obese eise ger ese be eg oer ese ek coa 50 CONFIGURATION ie ES EN EG ES Ge Ge GE OD EE cl 50 THE MICROCANOPEN CLASSIC PROTCOL STACK THE MICROCANOPEN CLASSIC PROTOCOL STACK The MicroCANopen Classic protocol stack implements the CiA CAN in Automation user s and manufacturer s group standard DS301 CANopen Application Layer and Communication Profile version 4 02 and parts of the standard DSP302 CANopen Framework for CANopen Managers and Programmable CANopen Devices version 3 21 The examples included are in accordance to the standard DS401 CANopen Device Profile for Generic I O Modules version 2 1 RTOS USAGE MicroCANopen Classic supports both the operation with and without a real time operating system RTOS When used without an RTOS the main functions tasks must either be called frequently from within the main loop or must be called from interrupt ser
19. NR OF SDO CLIENTS The values INDEX and SUBINDEX specify the Object Dictionary entry that is to be read LEN and DAT are return values The addresses passed in LEN and DAT will be written to After the function call these locations will contain pointers to a length and a data value Once a SDO Response is received the length will indicate the length of the data received maximum of 4 bytes in current implementation and data will contain the data received NOTE The data is NOT available until the call back function CCOCB_SDO Response Received is called with the appropriate parameters Returned TRUE if the SDO Request was placed into the transmit queue FALSE if the transmit queue is full and the SDO request could not be queued for transmission The XNMT SDO Client Write Expedited function This function transmits an Expedited SDO Write Download Request using one of the SDO client channels The channel must have been previously initialized with a call to XNMT Init SDO Client The function does NOT wait for the response If a SDO response comes in the application is informed via the call back function CCOCB SDO Response Received that the access was confirmed or denied Called UNSIGNEDS XNMT SDO Client Write Expedited UNSIGNEDS channel UNSIGNED 16 index UNSIGNEDS subindex UNSIGNED8 len UNSIGNED8 dat SIGNEDS channel SDO channel number JNSIGNED16 index Object Dictionary Index to read JNSIGNED8 subinde
20. Nr of Entries Number of mapping entries for this TPDO 9 Mapping Mapping entries each byte refers to an entry or 17 starting at 0 in the list of Object Dictionary entries RWOD NOTE In extended implementations each mapping entry has 2 bytes low byte first Example TPDO 0000F401FAOOFF 0000C800E803FF 020607FFFFFFFFFFFF 020809FFFFFFFFFFFF The example is for Nr of TPDOs being two The COB IDs selected are zero meaning the CANopen default COB IDs from the pre defined connection set should be used The inhibit times are 01F4h 500d for the first and 00C8h 200d 45 THE MICROCANOPEN CLASSIC PROTCOL STACK for the second TPDO The event times are 00FA 250d for the first and 03E8 1000d for the second TPDO Both TPDOs have 2 Object Dictionary entries mapped The mapped entries for the first TPDO are the 7 and 8 Object Dictionary entries listed in the RWOD section The second TPDO use the 9 and 10 entries listed in RWOD Entry COD This entry contains a list of SDO responses for SDO requests to constant read only entries in the object dictionary Typically these contain the 1000 00 Device Type entry the 1018 xx Identity Objects and the Number of Entries type entries with a Subindex of zero Each entry in this list has 8 bytes that directly contain the 8 bytes used in a CAN message with an expedited SDO response to a read upload request Byte Nr Name Description 4 les
21. RE S FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO RESULT IN A SIGNIFICANT PHYSICAL INJURY OR IN LOSS OF LIFE ANY SUCH USE BY YOU IS ENTIRELY AT YOUR OWN RISK AND YOU AGREE TO HOLD ESA HARMLESS FROM ANY CLAIMS OR LOSSES RELATING TO SUCH UNAUTHORIZED USE This Agreement is the complete statement of the Agreement between the parties on the subject matter and merges and supersedes all other or prior understandings purchase orders agreements and arrangements This Agreement shall be governed by the laws of the State of California Exclusive jurisdiction and venue for all matters relating to this Agreement shall be in courts and for a located in the State of California and you consent to such jurisdiction and venue All rights of any kind in the SOFTWARE which are not expressly granted in this License are entirely and exclusively reserved to and by ESA THE MICROCANOPEN CLASSIC PROTCOL STACK TABLE OF CONTENTS TABLE OE CONE a Ge De Ge gs 4 THE MICROCANOPEN CLASSIC PROTOCOL STACK esse esse ee ee ese ese ee ee ee see ee 8 RTOS USAGE prs 8 CANOPEN DOCUMENTATION see 8 FILE AND DIRECTORY STRUCTURE ut 8 MYNODE EXAMPLE CONFIGURATION AND APPLICATION sesse ee 10 APPLICATION INTERFACE caia 11 THE PROCESS IMAGE da ad dedo 11 CONFIGURATION OF THE PROCESS IMAGE sesse esse see see ese ee ee ee ee ee ee ee ee ee 11 MY NODE EXAMPLE spes 13 OBJECT DICTIONARY CONFIGURATION cccesesseseeseeneceeceeceeeeeeeseceaeeeneeeeeens 13 CONST
22. SYNC This task is started upon reception of the CANopen SYNC signal for this node and checks if any TPDOs now need to be triggered for transmission Depending on the number of TPDOs this task can get too long to execute at this highest priority level and might need to get moved to a lower level PDO Handle RPDO This task is started upon reception of a RPDO message and copies the received data into the process image To where exactly the data is copied depends on the RPDO mapping parameter settings 39 THE MICROCANOPEN CLASSIC PROTCOL STACK MicroCANopen Classic implements this mapping process very efficiently executed in less than 100 microseconds on many 16 bit architectures so that it can be directly executed at this highest priority level MEDIUM PRIORITY LEVEL FOR TIMER RELATED TASKS TSK_TIMER A regular timer interrupt is the default trigger event for all medium priority interrupts Besides maintaining the overall timer tick this interrupt can also be used to check if any real time sensitive timestamps expired The function TSK Timer of module tsk_NAME c is executed with every timer interrupt It must be ensured that the total execution time of tasks executed at this level does not exceed the run time of the timer Per default the following task is executed at this priority level PDO Handle TPDO TIMER This tasks checks if any TPDOs are now due for triggering the transmission In order to keep the execution time
23. THE MICROCANOPEN CLASSIC PROTCOL STACK ASCII interpretation This simplifies the generation of 32 bit Object Dictionary entries whose contents is not interpreted as a 32 bit value but as 4 characters SDO_REPLY4 INDEX SUBINDEX CHAR1 CHAR2 CHAR3 CHAR4 INDEX is the 16 bit Index of the Object Dictionary entry SUBINDEX is the 8 bit Subindex of the Object Dictionary entry CHARI through CHAR4 contain the 4 characters stored at this Object Dictionary entry VARIABLE EXPEDITED AND MAPPABLE OBJECT DICTIONARY ENTRIES The gODT able table This table is an array of structures that defines Object Dictionary entries whose data is located in the process image and that can be mapped into PDOs Process Data Objects All Object Dictionary entries that can be mapped to a PDO or need to be shared with the application via the process image must be defined in this table The macro OD_ ENTRY can be used to simplify entries into this table The last entry must use the macro LASTODENTRY to indicate the end of the table The current implementation does not require that the entries are sorted in any way The OD_ENTRY macro OD ENTRY INDEX SUBINDEX TLINFO OFFSET INDEX is the 16 bit Index of the Object Dictionary entry SUBINDEX is the 8 bit Subindex of the Object Dictionary entry TLINFO is an 8 bit value that defines access type and length of the Object Dictionary entry The TLINFO value can be generated by adding up the length of the Object Dict
24. THE MICROCANOPEN CLASSIC PROTCOL STACK EN en Holum EMBEDDED SYSTEMS ACADEMY MICROCANOPEN CLASSIC USER MANUAL Revision 251 for Version 1 16 of MicroCANopen Classic THE MICROCANOPEN CLASSIC PROTCOL STACK MICROCANOPEN CLASSIC COMMERCIAL LICENSE EMBEDDED SYSTEMS ACADEMY INC For MicroCANopen Classic V1 16 You should carefully read the following terms and conditions before using this software Unless you have a different license agreement signed by Embedded Systems Academy Inc ESA your use of this copy of MicroCANopen Classic the SOFTWARE indicates your acceptance of this license If you do not agree to any of the terms of this License then do not use this copy of the SOFTWARE If the SOFTWARE is used for a project that is rented leased sold or otherwise traded a COMMERCIAL PROJECT then this commercial license is required to use the SOFTWARE If the SOFTWARE is used to develop knowledge of CANopen for a COMMERCIAL PROJECT then this commercial license is required This license is not free TO USE THIS LICENSE YOU MUST PURCHASE A LICENSE FOR MICROCANOPEN CLASSIC FROM WWW CANOPENSTORE COM PEAK SYSTEM TECHNIK GMBH OR ONE OF IT S DISTRIBUTORS Installation and Use You may install and use an unlimited number of copies of the SOFTWARE Reproduction and Distribution You may not reproduce and distribute copies of the SOFTWARE without written permission of ESA All title and copyrights in and to
25. TPDO trigger events may include COS Change Of State detection with using the inhibit time define USE RTR TRIGGER 0 If USE RTR TRIGGER is set to 1 TPDO trigger events include triggering via so called remote requests RTR is a feature provided by CAN however the CiA recommends to NOT use this feature It is provided here for completeness only define DYNAMIC PDO COM 1 If DYNAMIC PDO COM ss set to 1 the PDO communication parameters are configurable through the CANopen network If set to 0 they are hard coded and cannot change during operation define DYNAMIC PDO MAP I If DYNAMIC PDO MAP is set to 1 the PDO mapping parameters are configurable through the CANopen network If set to 0 they are hard coded and cannot change during operation 35 THE MICROCANOPEN CLASSIC PROTCOL STACK OBJECT DICTIONARY SETTINGS OF CCO_CFG H define USE NVOL STORE 0 If set to 1 the device supports storing the current configuration into non volatile memory This is implemented using the Object Dictionary entries 1010h Store Parameters and 1011h Restore Default Parameters Only the Subindex 1 for storing and restoring ALL parameters is implemented The Object Dictionary entries 1020h Verify Configuration can be used to date and times stamp the configuration define USE NVOL CFG 0 If set to 1 the device supports storage of the entire Object Dictionary in non volatile memory instead of a hard coded configuration in f
26. age CCOCB EMCY Received CHANNEL PERR Passed The value for CHANNEL is in the range of 1 to NR OF EMCY CONSUMERS and identifies the consumer channel on which this emergency was received The PERR pointer points to an array of 8 UNSIGNEDS values containing the 8 data bytes of the emergency message Returned Nothing The CCOCB Fatal Error function This indication signals the application that the CANopen stack ran into a fatal error situation and needs to be reset or re initialized to start operation again Called 25 THE MICROCANOPEN CLASSIC PROTCOL STACK void CCOCB Fatal Erro UNSIGNED16 errorcode UNSIGNED16 ERRORCODE 16 bit error code CCOCB Fatal Error ERRORCODE Passed The ERRORCODE is an internal 16 bit error code Returned Nothing The CCOCB_TX Error function This indication signals the application that the CANopen stack ran into a CAN message transmit overrun situation A message could not be added to the transmit buffer as the transmit buffer was full Called void CCOCB TX Error UNSIGNED16 ErrCode UNSIGNED 16 ERRCODE 16 bit error code CCOCB TX Error ERRCODE Passed The ERRCODE indicates the type of CAN message that could not be transmitted TXLOST PDO TXLOST SDO or TXLOST HB TPSO SDO or heartbeat Returned Nothing The CCOCB SDO Response Received function for SDO Clients This function is only available if SDO Clients are enabled by setting NR OF SDO CLIENTS to a value other
27. alue is in the range of 1 to 8 depending on the length of the data received PDATA is a pointer to the data received Returned Nothing 21 THE MICROCANOPEN CLASSIC PROTCOL STACK CANOPEN API EXTENDED FUNCTIONS This section lists all functions considered extended functionality They typically require that certain define values are set to enable the functionality requested The XNMT_Transmit_NMT_Msg function This function generates the NMT master message Note that only the CANopen NMT Master is allowed to transmit this message Called UNSIGNED8 XNMT Transmit NMT Msg UNSIGNED8 nmt cmd UNSIGNEDS node id UNSIGNEDS nmt cmd the CANopen NMT command UNSIGNEDS node id the CANopen node id of the receiving node XNMT Transmit NMT Msg NMTCMD NODEID Passed The value for NMTCMD indicates which NMT state was requested by the NMT Master The following define values can be used NMT MSG OP 0x01 Go into operational state NMT_MSG_STOP 0x02 Go into operational state NMT_MSG_PREOP 0x80 Go into preoperational state NMT_MSG_RNODE 0x81 Reset Node NMT_MSG_RAPP 0x82 Reset Application The value NODEID can be set to zero if this command is for ALL CANopen slaves on the netork or it can be set to an individual node ID in the range of I to 127 to only address the command to a single node Returned TRUE if the message was queued for transmission FALSE if the transmit queue is full and the message
28. at which priority level at default For applications with specific real time requirements additional priority levels may be added or the existing priority may be modified All these tasks are collected centrally in the module tsk_NAME c to simplify the task control It must be noted that modifications of the priority levels may drastically change the overall performance of the CANopen implementation In worst case this may stop the device from functioning HIGHEST PRIORITY LEVEL FOR CAN MESSAGE RECEPTION TSK_CANMSG_RX CAN message reception is handled at the highest priority level to ensure that all messages received are properly handled specifically the NMT Master control messages such a commands to start or stop operation needs to be processed at a high priority level The function TSK CANMsg Rx of module tsk_NAME c is executed upon the reception of a CAN message typically called directly from the CAN receive interrupt service routine Depending on the priority level of the CAN message received it either directly executes a task to work on the message received or it starts a task at a lower priority level to process the message later Per default the following tasks are executed at this priority level CCO Handle NMT Request This task handles the reception of a NMT Master message that contains operation commands such as starting or stopping operation It should always execute at a very high priority level PDO Handle TPDO
29. ation to which the requested process data should be copied The caller must ensure that the buffer at the destination locations is large enough to hold the number of data bytes requested LENGTH defines the number of data bytes requested OFFSET defines the location of the requested data within the process image If set to zero the data is located at the first byte of the process image Returned NROFBYTES contains the number of bytes actually copied to the destination buffer If zero no data was copied because the requested offset was out of range The CCO Write Process Data function This function is used to write data to the process image Called UNSIGNED16 CCO Write Process Data UNSIGNED16 offset UNSIGNED8 length UNSIGNED8 pSource UNSIGNED16 OFFSET offset to data location in the process image UNSIGNED8 LENGTH length of the data UNSIGNEDS PSOURCE source pointer from which the data is copied UNSIGNED8 NROFBYTES return value number of bytes actually copied NROFBYTES CCO WRITE PROCESS DATA OFFSET LENGTH PSOURC E 22 THE MICROCANOPEN CLASSIC PROTCOL STACK Passed OFFSET defines the location of the target data within the process image If set to zero the data is located at the first byte of the process image LENGTH defines the number of data bytes to be copied PSOURCE is a source pointer to the location from which the process data should be copied Returned NROFBYTES contains t
30. ault data for the process image During initialization of the CANopen Task this data will be copied to the process image The length of this data field must be identical to the length of the process image specified in the NODE entry Example PIMG 0011223344556677 8899AABBCCDDEEFF 0011223344556677 8899AABBCCDDEEFF 48 THE MICROCANOPEN CLASSIC PROTCOL STACK Entry CHK This entry contains an optional 16 bit checksum low byte first of ALL visible ASCII characters in this file All visible ASCII characters in the range of 32d 20h to 126d 7eh are added up overflows carried over to the high byte Example CHK 0326 The checksum of all visible characters in this file is 2603h 9731d SETUP FILE DOWNLOAD If the define USE NVOL is set to one an additional Object Dictionary entry is generated that accepts a segmented SDO download transfer write Per default this entry is 1F50h 02h In order to protect an existing configuration from accidental overwrite a password needs to be written first to that entry to enable it for the download of the setup file Per default this password is Init For downloading any CANopen configuration tool that supports download of files can be used Step 1 Execute a download write to 1F50h 02h of the device typically selected via the Node ID with the data Init Step 2 Execute a download write to 1F50h 02h of the devi
31. ce typically selected via the Node ID with the data being the setup file Step 3 Send a NMT Reset Node command to the device typically selected via the Node ID 49 THE MICROCANOPEN CLASSIC PROTCOL STACK LAYER SETTING SERVICES LSS The Layer Setting Services CIA DS305 allow an unconfigured network slave nodes have no node IDs final baudrate not set to start up A full explanation of the mechanism used is beyond the scope of this document but can be found in DS305 from the CIA www can cia com The basic mechanism is as follows In a network that uses LSS on startup all nodes have to use LSS LSS is a state outside of any CANopen NMT state pre operational operational etc which means that none of the regular CANopen services and objects will work Instead there is a limited set of LSS commands that the LSS master uses to identify the slaves By doing a binary search across the ranges of possible LSS Addresses the LSS master is able to narrow down the range of LSS Adresses where a slave still responds to the point where the range is just one single LSS Address the LSS slave is identified This requires the slave nodes to have different LSS Addresses The LSS Address consists of the data normally accessible through Object Dictionary entry 1018h the Identity Object which contains Vendor ID Product Code Revision Number and Serial Number Once an LSS slave is identified the master can configure it s Node ID A
32. could not be added 28 THE MICROCANOPEN CLASSIC PROTCOL STACK The XNMT_Process_HB_Check function When heartbeat consumer functionality is enabled this function verifies if a timeout occurred with any of the heartbeats consumed Called UNSIGNEDS XNMT Process HB Check VOID XNMT Process HB Check VOID Passed Nothing Returned Zero if no heartbeat timeout was detected If unequal zero the return value is the node ID number of the node whose heartbeat was lost The XNMT Init SDO Client function This function initializes a single SDO Client channel It must be called before the channel can be used This function may also be called again if an existing SDO channel should be re configured Called UNSIGNED8 XNMT Init SDO Client UNSIGNED8 channel UNSIGNED32 canid request UNSIGNED32 canid response UNSIGNEDS channel SDO channel number in range of 1 to NR OF SDO CLIENTS UNSIGNED32 canid request CAN message ID used for the SDO request UNSIGNED32 canid response CAN message ID used for the SDO response UNSIGNED8 XNMT Init SDO Client UNSIGNED8 channel UNSIGNED32 canid request UNSIGNED32 canid response XNMT Init SDO Client CHANNEL CANIDREO CANIDRESP 29 THE MICROCANOPEN CLASSIC PROTCOL STACK Passed The value for CHANNEL indicates the SDO Client channel to be re initialized It must be in the range of 1 to NR OF SDO CLIENTS CANIDREQ specifies the CAN message ID used fo
33. e expense of a higher RAM requirement for the filter array LSS SETTINGS OF CCO CFG H define USE LSS USE LSS NONE The default is USE LSS NONE which disables all LSS support for this node When set to USE LSS SLAVE the LSS slave functionality is active for this node and the module Iss slv c must be included in the project USE LSS MASTER sets this node up to act as an LSS Master and the module Iss mas c must be included in the project Note This module is optional and not part of the standard package of MicroCANopen Classic Hdefine LSS LEVEL LSS LEVEL COMP Specifies the compatibility level used for the LSS mechanism on either master or slave side LSS LEVEL COMP is using LSS exactly as specified in CiA DS305 Since full LSS is not highly efficient and can take a long time to execute MicroCANopen Classic offers the option to optimize the LSS mechanism Important This is for closed CANopen networks only Devices that need to be certified always have to use LSS LEVEL COMP LSS LEVEL RANGES assumes that the LSS master knows Product Code and Vendor ID of the slaves and they are not to be used in the LSS Identify and Switch commands LSS_LEVEL_MINIMAL acts like LSS_LEVEL_RANGES but in addition the revision numbers of the slave nodes are also not used Only the serial numbers are used used to search identify and configure the slave nodes This further minimizes the network traffic necessary during LSS but it requires all slave nodes in t
34. ex of the Object Dictionary entry The 4 byte contains the length information combined with access type bits The bits in this byte are used as follows Description Bit 0 2 Length of the data in this Object Dictionary entry Must be in the range of 1 through 4 Reserved If set SDO read upload access is allowed If set SDO write download access is allowed If set this entry can be mapped to a PDO Bit 7 If bit 6 is set this bit specifies the direction of the mapping If 0 the entry can be mapped to a TPDO only If 1 the entry can be mapped to a RPDO only The 5 byte indicated the offset to the data in the process image that belongs to this Object Dictionary entry The last entry in this list must consist of 5 bytes with the value FFh 47 THE MICROCANOPEN CLASSIC PROTCOL STACK Example RWOD 0060015100 0060025101 0060035102 0060045103 0060055104 0060065105 006201 F106 006202F108 006203F108 006204F109 FFFFFFFFFE The Object Dictionary entries specified by this example are 6000 01 read only TPDO mapping 1 byte of process image at offset 0 6000 02 read only TPDO mapping 1 byte of process image at offset 1 through 6000 06 read only TPDO mapping 1 byte of process image at offset 5 6200 01 read write RPDO mapping 1 byte of process image at offset 6 through 6200 04 read write RPDO mapping 1 byte of process image at offset 9 Entry PIMG This entry contains the def
35. fault bit rate of 125kbps a default node ID of 40h 64d a process image size of 01h 32d in basic implementations 2 RPDOs and 2 TPDOs 43 THE MICROCANOPEN CLASSIC PROTCOL STACK Entry RPDO This data entry contains the communication and mapping parameters for each RPDO used The number of data fields must be matching the Nr of RPDOs value used in the entry NODE The first data field contains 3 bytes for each RPDO holding the communication parameters The first 2 bytes set the COB ID and the 3 byte the transmission type 1 COB ID RPDO COB ID leave at zero to use default Type The second data field contains 9 bytes for each RPDO holding the mapping parameters The first byte of each entry specifies the number of entries mapped Allowed values are 0 through 8 The following entries identify the Object Dictionary entry mapped using a single byte The byte is the offset that the mapped Object Dictionary entry has in the RWOD section Unused bytes must be set to FFh Byte Nr Name Description Nr of Entries Number of mapping entries for this RPDO 2 9 Mapping Mapping entries each byte refers to an entry or 17 starting at 0 in the list of Object Dictionary entries RWOD NOTE In extended implementations each ing entry has 2 bytes low byte first Example RPDO 0000FF 0000FF 0400010203FFFFFFFF 020405FFFFFFFFFFFF The example is for Nr of RPDOs being two The COB IDs selected are zero meaning
36. he macro LASTODGENTRY to indicate the end of the table The current implementation does not require that the entries are sorted in any way The OD GENTRY macro OD GENTRY INDEX SUBINDEX ACCESS LENGTH POINTER INDEX is the 16 bit Index of the Object Dictionary entry SUBINDEX is the 8 bit Subindex of the Object Dictionary entry ACCESS is an 8 bit value that defines the access type of the Object Dictionary entry Tthe following status bits are allowed e if the entry is readable via SDO requests add ODRD e if the entry is writable via SDO requests add ODWR LENGTH defines the number of bytes stored in this Object Dictionary entry The maximum number supported by this implementation is 65 535 bytes POINTER defines the location of the data for this Object Dictionary entry in the processor s memory This generic pointer may point to any memory location available to the processor The fictitious Object Dictionary entry 2010h 01h containing a 16 byte string called char myString 16 and that supports both read and write accesses is defined as follows OD_GENTRY 0x2010 0x01ODRD ODWR 16 myString 16 THE MICROCANOPEN CLASSIC PROTCOL STACK RPDO COMMUNICATION PARAMETERS The gRPDOCom table This table is an array of structures containing the communication parameters for the RPDOs Receive Process Data Objects The number of entries in this table must match the global define settings for NR OF RPDOS The first entry in the
37. he network to have unique serial numbers LSS LEVEL SMART enables the Smart LSS extension to DS305 as proposed by the Embedded Networking Society www embeddednetworking com used with permission Smart LSS uses normally unused CAN message identifiers during LSS to speed up the auto detection and configuration process significantly It also introduces commands to inquire for Product Code and Vendor ID of the slave nodes define LSS SAVE NODELIST 0 For LSS masters only If non volatile support is available USE NVOL CFG 1 and LSS SAVE NODELIST is set to 1 the LSS master stores a list of nodes detected during LSS in non volatile memory On following startups the LSS 37 THE MICROCANOPEN CLASSIC PROTCOL STACK master looks for changes in the network If it hasn t changed the LSS master can configure and start the network very quickly For a description of the lss_slv c module see chapter LAYER SETTING SERVICES LSS DEBUGGING SETTINGS OF CCO_CFG H define CHECK PARAMETERS I Is set to 1 additional code is generated that does plausibility checks upon entry of code functions such as checking if parameters are within the allowed range If a parameter is out of range a call to CCOCB Fatal Error is executed HARDWARE SETTINGS OF CCOHW H define PROCIMG LITTLEENDIAN I All data formats in CANopen are specified to be in Little Endian format low byte comes first in multiple byte variables and per default this storage fo
38. he number of bytes actually copied to the process image If zero no data was copied because the requested offset was out of range CANOPEN API CALL BACK FUNCTIONS This section lists all call back functions that can be called by the CANopen protocol stack They indicate important CANopen events to the application The CCOCB NMT Change function This function is called whenever the CANopen protocol stack receives the NMT Network Management Master message typically requesting a change in the operating state Called void CCOCB NMT Change UNSIGNED8 NMTState UNSIGNEDS NMTSTATE the CANopen NMT state CCOCB NMT STATE NMTSTATE Passed The value for NMTSTATE indicates which NMT state was requested by the NMT Master It can be one of the following values 00h Initializing sent after receiving the I command 04h CANopen NMT state stopped entered 05h CANopen NMT state operational entered 7Fh CANopen NMT state pre operational entered 8lh An NMT Master message was received requesting to reset the entire CANopen node the application should reset itself 82h An NMT Master message was received requesting to reset the CAN communication interface the application should re initialize the CANopen protocol stack Returned Nothing 23 THE MICROCANOPEN CLASSIC PROTCOL STACK The CCOCB Data Received function This function is called after MicroCANopen Classic has copied data to the process image This fu
39. ile uod NAME c The configuration can be uploaded and or downloaded via a selected Object Dictionary entry default is 1F50h 002h The configuration file format is described in the Appendix define USE SEGMENTED SDO 0 If set to 1 the device supports Object Dictionary entries that are bigger than 4 bytes SDO transfers to or from these Object Dictionary entries are automatically segmented The Object Dictionary entries accessible via segmented transfer are defined in a separate table see chapter Object Dictionary Configuration for more details OPTIONAL CALL BACK SETTINGS OF CCO_CFG H Hdefine USE CB DATA RECEIVED 0 If set to 1 the call back function CCOCB Data Received is called when process data in an Object Dictionary entry changed define USE CB RPDO 0 If set to 1 the call back function CCOCB RPDO Received is called upon receiving an RPDO HARDWARE SETTINGS OF CCO CFG H Hdefine USE RX SWBUF 0 Set to 1 in order to use SW receive filters and a receive queue for CAN The module CANSW C must be included in the project in this case This mode is not available on all CAN controllers 36 THE MICROCANOPEN CLASSIC PROTCOL STACK define EXTENDED RX FILTER 0 Enables or disables the extended software filters if USE RX SWBUF is set to 1 If set to 0 disabled a maximum of 255 receive filters is supported If set to 1 the maximum is 2048 to allow every single 11 bit CAN identifier to be received at th
40. ionary entry must be in the range of 1 to 4 and the following status bits e if the entry is readable via SDO requests add ODRD e if the entry is writable via SDO requests add ODWR e if the entry can be mapped to a TPDO add RMAP e if the entry can be mapped to a RPDO add WMAP Note that an entry can be both readable and writable but it may only be mappable in one direction either RMAP or WMAP but not both OFFSET defines the location of the data for this Object Dictionary entry in the process image If set to 3 the data is located starting at the 4 byte in the process image 15 THE MICROCANOPEN CLASSIC PROTCOL STACK The Object Dictionary entry 6200h 01h containing a one byte value that supports both read and write accesses but that can only be mapped to a RPDO and whose data is located in the 8 byte of the process image is defined as follows OD_ENTRY 0x6200 0x01 1 ODRD ODWR WMAP 7 VARIABLE GENERIC NON MAPPABLE OBJECT DICTIONARY ENTRIES The gODGenericTable table NOTE This functionality is only available if the define USE SEGMENTED SDO is set to 1 This table is an array of structures that defines Object Dictionary entries whose data can be located anywhere in the processors memory and that can be of any size up to 65 535 bytes It should be noted that these entries cannot be mapped into PDOs Process Data Objects The macro OD GENTRY can be used to simplify entries into this table The last entry must use t
41. mapped to the PDO MYNODE CONFIGURATION EXAMPLE For the MyNode example the file odu_mynode c contains include cco h include img mynode h implement the process image UNSIGNED8 gProcImg PROC IMG SIZE OBJECT DICTIONARY TABLE FOR CONST READ ONLY ENTRIES BYTE gODConstTable 1000h 00 Device Type SDO REPLY 0x1000 0x00 4 OD_DEVICE TYPE 1018h 00 Identity Object Number of Entries 4 SDO REPLY 0x1018 0x00 1 0x00000004L 1018h 01 Identity Object Vendor ID SDO_REPLY 0x1 18 0x01 4 OD VENDOR ID o 18 THE MICROCANOPEN CLASSIC PROTCOL STACK 18h 02 Identity 101 SDO REPLY 0x1018 0x02 8h 03 Identity 101 SDO REPLY 0x1018 0x03 8h 04 Identity SDO REPLY 0x1018 0x04 Object Product Code 4 OD PRODUCT CODE Object Revision 4 OD REVISION Object Serial 4 OD SERIAL 6000h 00 Number of SDO REPLY 0x6000 0x00 6200h 00 Number o E digital IN bytes 2 1 0x00000002L digital OUT bytes 2 SDO REPLY 0x6200 0x00 6401h 00 Number o 1 0x00000002L analog IN words 2 SDO REPLY 0x6401 0x00 Last Entry 0x0006 0x00 2 ODWR WMAP PIO RPDO
42. minimal only one TPDO is checked per execution LOWEST PRIORITY LEVEL FOR BACKGROUND TASKS TSK PROCESS STACK The function TSK Process Stack of module tsk_NAME c is continuously called in the background task main while 1 loop executing the lowest priority tasks Per default the following tasks are executed at this priority level CCO Handle EMCY This tasks checks if any emergencies occurred and need to be transmitted CCO Handle NMTSlave This task handles the production of the heartbeat and the responses to node guarding requests It should always execute at the lowest priority level as these tasks should be the first to be delayed when performance limits are reached A delay of the heartbeats or node guarding responses is a very good indication for a device reaching its performance limits CCO_Handle_SDO This tasks handles SDO requests and issues the appropriate SDO responses As SDO transfer is never real time critical it should always execute at the lowest priority level 40 THE MICROCANOPEN CLASSIC PROTCOL STACK PDO_Update_TPDO_Data This tasks updates the TPDO data buffers by copying the required process data from the process image to the transmit buffers for all enabled TPDOs Which data bytes are copied to where depend on the TPDO mapping parameter settings The idea is to constantly update the transmit buffers in the background If needed by the application this task can be moved to a higher priority to m
43. nction is called for both processed RPDOs as well as executed SDO write requests to process data Called void CCOCB Data Received UNSIGNEDS length TTABLE SIZE offset CCOCB Data Received LENGTH OFFSET Passed The value for LENGTH is the size of the mapped entry in bytes as specified in the Object Dictionary table The OFFSET value is the offset into the Process Image array for the mapped entry as specified in the Object Dictionary table Returned Nothing 24 THE MICROCANOPEN CLASSIC PROTCOL STACK The CCOCB SYNC Received function This function signals the receipt of the CANopen SYNC message for this device Synchronous RPDO data previously received and copied to the process image may now be applied to the application Per default configuration see section TASK MANAGEMENT tsk NAME c synchronous TPDO data transmission will be triggered after execution of this call back function Called void CCOCB SYNC Received void CCOCB SYNC Received Passed Nothing Returned Nothing The CCOCB EMCY Received function This function is only available when emergency consumer functionality is enabled It is then called upon reception of an emergency if the emergency is configured for reception via 1028h 00h Called void CCOCB EMCY Received UNSIGNED8 channel UNSIGNEDS pErr UNSIGNED8 CHANNEL the emergency consumer channel number UNSIGNEDS PERR a pointer to the 8 data bytes of the emergency mess
44. nit SDO Chent finehonsus te 29 The XNMT SDO Client Read finCHOR s esse iss eed sn se Se sees eek ee We seed 30 The XNMT SDO Client Write Expedited funcHON iese esse esse ee ee Re 31 CANOPEN CODE CONFIGURATION ees a at s 33 TABLE SIZE SETTINGS OF CO CFG Hussain 33 define TABLE MAXSLZE OFF ii aria 33 deline PROG IMG SIZE O a aaa 33 NMT SERVICE SETTINGS OF CCO CFG H eemsereenssnsensennenvesnesnsensensensensssnssennssnnssen 33 detime AUTOSTAR TU e date 33 define BOOTUP TIMEOUT 10000 ri eder 33 define USE NODE GUARDING Dota 33 defing USE EMCY Ls A vate A A 34 defirie NR EMCY CONSUMERS 0 ses sein ee vee Gie ic 34 detine NR HB CONSUMERS O iaa aa ias 34 detine NR OF SDO CEIENTS Dioni rana 34 define SDO REQUEST TIMEOUT 100 rerorrrrnrenrennrrrrrrernerreennensensersersessersersernee 34 Pde time GENERATE MED a oi 34 PDOSSETTINGS OF CCO CFG Horrores eeit ainia 35 define NR OE RPDOS A ia 35 define NR OF TP DOS GR 35 defme USE SYNE LA 35 detine USE EVENT TIME Lugo aa 35 deline USE INHIBTE TIME Mira A tout 35 define USE RIR TRIGGER 0 ERAS GE OE Ge Ge IN 35 defme DYNAMIC PDO COM DE Re EG Ae a 35 deline DYNAMIC PDO MAP d i Ee oe ee Oe ee Ge ee ke ee ee 35 THE MICROCANOPEN CLASSIC PROTCOL STACK OBJECT DICTIONARY SETTINGS OF CCO CFG H ees sesse ese ese ese ee ee ee ee ee 36 define USE NVOL STORE Dic dida 36 detine USE NVOL CFO Gasser 36 detine USE SEGMENTED SDO Os et ese ee dens Gee Ke AD dee eg Rd eg gee
45. ore channel configuration information Hdefine SDO REQUEST TIMEOUT 100 This value specifies the timeout used for SDO requests in milliseconds If after sending an SDO request no SDO response is received within the timeout the request is aborted and an SDO Abort message is generated define GENERATE NMT 0 If set to 1 the local CANopen node implemented by this code will produce the NMT Master message start all nodes The function XNMT Transmit NMT Msg is provided for the application if this value is set to 1 34 THE MICROCANOPEN CLASSIC PROTCOL STACK PDO SETTINGS OF CCO_CFG H define NR_OF_RPDOS 4 This value defines the number of RPDOs Receive Process Data Objects implemented The value range may be from 0 to 512 This number defines the maximum number of RPDOs supported not necessarily the number of RPDOs currently used or configured define NR OF TPDOS 4 This value defines the number of TPDOs Transmit Process Data Objects implemented The value range may be from 0 to 512 This number defines the maximum number of TPDOs supported not necessarily the number of TPDOs currently used or configured define USE SYNC I If USE SYNC is set to 1 the TPDOs and TPDOs support synchronized transmission define USE EVENT TIME I If USE EVENT TIME is set to 1 TPDO trigger events may include using the event timer periodic transmission every X milliseconds define USE INHIBIT TIME I If USE INHIBIT TIME is set to 1
46. ore frequently update the transmit buffers However if this function is used with inhibit time and COS detection this function checks if there was a Change Of State in the data 1t has quite some code to execute If moved to a higher priority level it must be ensured that it does not occupy all of the available CPU performance EXTENDED FUNCTIONALITY TASKS XNMT Process HB Check This task is only available if the CONSUME HEARTBEATS functionality is enabled It loops through all heartbeat consumer channels and checks if any channel had a timeout occurrence if a heartbeat previously received was lost If a heartbeat is lost the task returns the node ID of the first node it finds as recently being lost XNMT_SDO_Handle_Client This task is only available if the NR OF SDO CLIENTS are set to unequal zero This task verifies if an SDO Request Timeout occurred for any of the SDO channels If a timeout occurred the SDO Request is aborted and an SDO Abort message gets generated With each call to the task only one SDO channel gets checked 41 THE MICROCANOPEN CLASSIC PROTCOL STACK SETUP FILE FOR NON VOLATILE MEMORY The file format is adapted from the CANopen APT recommedation of the Embedded Networking Society www embeddednetworking com used with permission SETUP FILE FORMAT The setup file is an ASCII text file with the default ending of txt or cfg to allow simple editing with any text editors 66
47. perature values every 250 milliseconds The LED values are received in RPDO1 Receive Process Data Object 1 10 THE MICROCANOPEN CLASSIC PROTCOL STACK APPLICATION INTERFACE Both shared data memory and function calls are used to implement an interface between MicroCANopen Classic the application program A process image array of bytes is used as shared memory that can be accessed from both MicroCANopen Classic as well as from the application program The process image contains all process data variables that are communicated via CANopen as well as application specific configuration data Several access functions are provided to allow the application program to read or write data from or to the process image THE PROCESS IMAGE In order to offer a generic method for addressing and exchanging the data communicated via CANopen the data is organized into a process image which is implemented as an array of bytes The maximum length PROC_IMG_SIZE of that array 1s either FFh or FFFFh depending on the maximum value defined for TABLE_MAXSIZE and the type defined for TTABLE SIZE in file cco_cfg h A single variable of the process image can be addressed by specifying an offset and a length The offset specifies where in the process image the first byte of a variable is stored and the length specifies how many bytes are used to store the variable The offset may have a value from 0 to TABLE_MAXSIZE 1 Using an offset of TABLE_MAXSIZE indicates
48. r sending SDO requests To address the default SDO channel of a specific node this must be set to 600h plus the node ID of the addressed node CANIDRESP specifies the CAN message ID used for receiving the SDO responses To receive the responses from a default SDO channel of a specific node this must be set to 580h plus the node ID of the addressed node Returned TRUE if the channel initialization was successful FALSE if the channel initialization failed The XNMT SDO Client Read function This function transmits an SDO Read Upload Request using one of the SDO client channels The channel must have been previously initialized with a call to XNMT Init SDO Client The function does NOT wait for the response If a SDO response comes in the application is informed via the call back function CCOCB SDO Response Received that the data is now available Called UNSIGNEDS XNMT SDO Client Read UNSIGNEDS channel UNSIGNED16 index UNSIGNED8 subindex UNSIGNED8 len UNSIGNEDS8 dat UNSIGNED8 channel SDO channel number UNSIGNED 16 index Object Dictionary Index to read UNSIGNEDS subindex Object Dictionary Subindex to read UNSIGNED8 len Return Ptr to length UNSIGNED8 dat Return Ptr to data XNMT SDO Client Read CHANNEL INDEX SUBINDEX LEN DAT 30 THE MICROCANOPEN CLASSIC PROTCOL STACK Passed CHANNEL defines the SDO Client channel used for the request and must be in the range from I to
49. rmat is also adapted for the process image In case the Big Endian format is preferable for a particular application this define needs to be set to zero define USE LED 0 If set to 1 code is generated to switch a CANopen run green and error LED red as suggested by the CiA standard DR303 3 Additional macros are defined to control switching the LEDs on and off define TIMERTICK 16 This setting defines the width of the timer tick used The allowed values are 16 and 32 Ifa 16 bit timer tick is used it needs to be incremented by one every milliseconds and the maximum run time measurable with the timer is Ox7FFE milliseconds about 32 seconds If a 32 bit timer is used it needs to be incremented by one every 100 microseconds or by two every 200 microseconds or by 3 every 300 microseconds etc define TTIMER UNSIGNEDI6 This setting defines the type of the timer tick It needs to be UNSIGNED16 for the 16 bit timer or UNSIGNED32 for the 32 bit timer define MAX_TIMER_RUN 0x7FFF This setting defines the maximum run time for 16 bit timer for example used by the heartbeat producer time or TPDO event time Ifa 16 bit timer tick is used this value cannot exceed 0x7FFF otherwise OxFFFF is allowed 38 THE MICROCANOPEN CLASSIC PROTCOL STACK TASK MANAGEMENT The examples delivered with MicroCANopen Classic are pre configured using three different task priority levels This section describes which tasks are handled
50. s 36 OPTIONAL CALL BACK SETTINGS OF CCO CFG H ee esse sesse see see ee ese ese ee ee 36 define USE CB DATA RECEIVED Os Se eb ee ee N ie ee gee 36 Fdefine USE CB RPDO fen 36 HARDWARE SETTINGS OF CCO CFG H emreseesventesvserennrensensssnsennsennssnsssenerssnssnnssen 36 detine USE AR SWBUF Da az 36 define EXTENDED RX FILTER Di sa 37 LSS SETTINGS OF CCO ER das 37 detine USE LSS USE ESS NONE oia dad 37 define LSS LEVEL LESS LEVEL COMP vean dica 37 define LSS SAVE NODELISE Di in cdas 37 DEBUGGING SETTINGS OF CCO CEG His daa 38 deline CHECK PARAMETERS Lui id 38 HARDWARE SETTINGS OF CCOHW H sesse esse sis sek ee ss ee ss Ge ee sd ees ed ees ede sg ee ee 38 define PROCIMG LITTLEENDIAN iss he ere ese iio 38 detiie USE LED uses 38 define TIMER TIEK Via e tos 38 dehine TTIMER UNSIGNED Iasoni ske ceiba dieron 38 define MAX TIMER RUN OX7FFF cccescsssesceeseeeeeeceeceseeaeesecaecaeceeeeeeeeseneeaes 38 TASK MANAGEMEN Tu AS 39 HIGHEST PRIORITY LEVEL FOR CAN MESSAGE RECEPTION TSK CANMS O Ree 30 ECO Handle NMT REUS ee 39 PHO Handle TPDO SYN same 39 PDO Hode APDO E Ee EE a ta a 39 MEDIUM PRIORITY LEVEL FOR TIMER RELATED TASKS TSK_TIMER 40 PDO Handle TPDO TIMER a ia 40 LOWEST PRIORITY LEVEL FOR BACKGROUND TASKS TSK PROCESS STACK ni a 40 THE MICROCANOPEN CLASSIC PROTCOL STACK CCO Handle EMO Y 2 ES De N Ge ean 40 COO Handle NUSA 40 ECO Handle DO dardos 40 PDO Update TPDO Dita iia 41 EXTE
51. that the offset is invalid or unused If numeric values are stored in multiple byte variables then the default format is CANopen compatible Little Endian the lower bytes are stored at the lower offset If required by the application the data storage format in the process image can be changed to Big Endian by setting the define PROCIMG_LITTLEENDIAN in file ccohw h to zero CONFIGURATION OF THE PROCESS IMAGE Where exactly which variable is located in the process image is part of the CANopen node configuration process that needs to be done by the designer programmer of the CANopen node The CANopen configuration process also includes assigning an Object Dictionary Index and Subindex to each variable and to configure the PDOs Process Data Objects containing one or multiple process data variables To simplify accessing the process image and to allow for easy re configuration of process images it is recommended to use define statements to define the offsets to the individual variables in the process image These should be defined in the file img xxx h that can be included to all code modules requiring access to the process image 11 THE MICROCANOPEN CLASSIC PROTCOL STACK Besides the process data the process image also stores some vital configuration and system data like the CANopen error register or the heartbeat time The following system entries must be provided in the process image define Name I Bytes Object Dictionary
52. this TPDO If set to zero the default from the pre defined connection set of CANopen is used TTYPE is a byte with the CANopen TPDO transmission type Typically a default of FEh manufacturer specific or FFh device profile specific is used 17 THE MICROCANOPEN CLASSIC PROTCOL STACK INHIBITT defines the default inhibit time used by the corresponding TPDO The inhibit time is defined in multiples of 100 microseconds and can be in the range from zero to 65535 EVENTT defines the default event time used by the corresponding TPDO The event time is defined in multiples of milliseconds and can be in the range from zero to 65535 Note MicroCANopen Classic currently does not support RTR transmission or 29 bit CAN message identifiers PDO MAPPING PARAMETERS The gRPDOMap and gTPDOMap tables For each PDO these tables contain the mapping parameters The number of entries in each table must match the global define settings for NR OF RPDOS and NR OF TPDOS For each PDO the table contains 9 entries the number of items variables mapped and then 8 entries allowing for a maximum of 8 Object Dictionary entries being mapped into the PDO Unused entries must have all bits set to indicate that these entries are unused A single entry consists of an index into the gODTable table A value of zero indicates that the first entry of the array gODTable is mapped to the PDO A value of 3 indicates that the fourth entry of the array gODTable is
53. vice routines such as a timer interrupt or a CAN receive interrupt Ifused with an RTOS several functions executing the main function blocks of MicroCANopen Classic can be integrated into the RTOS CANOPEN DOCUMENTATION It is assumed that programmers using MicroCANopen Classic have a general understanding about how CANopen works In addition they should either have access to the CANopen specification or a CANopen book such as Embedded Networking with CAN and CANopen www CANopenBook com The MicroCANopen Classic manual does not explain regular CANopen features functions and terms FILE AND DIRECTORY STRUCTURE The directory structure used by MicroCANopen Classic separates the files used into four major groups It is recommended to maintain this structure and to adopt 1t for the grouping of source files in the project settings and layouts as supported by most compiler systems 1 Common Shared Directory Name src shared This directory contains all files implementing the core features of the CANopen protocol In order to allow easy future updates upgrades and to ensure that the code remains CANopen conformant these files should not be modified by the end user THE MICROCANOPEN CLASSIC PROTCOL STACK File Module Content FR CANopen Application Programming Interface definitions api h tsk h cco h CCO C oda h oda c sdo h sdo c pdo h pdo c nvol h Definition of functions and tasks controlled by the
54. volatile memory allowing for additional identification 42 THE MICROCANOPEN CLASSIC PROTCOL STACK Entry ID This is the 4 byte identification value The first two bytes contain a manufacturer specific identification for this particular CANopen Task first byte contains low byte and second byte contains high byte Values from FOOOh to FFFFh are reserved and should not be used The remaining two bytes contain a version number with the third byte being a minor version number and the fourth byte the major version number Entry NODE This data field contains a data record with the basic setup information for the CANopen Task Name Description Bps Default CAN bit rate Same contents as used for the function CCO Init CANopen 2 Node ID Default CANopen node ID Same contents as used for the function CCO Init CANopen Process The size of the process image used by the CANopen 4 5 Image Size Task Value of 0 to 15 Basic value 1 16 Exception In case of 1111b the size is 255 bytes Extended value 1 1024 Note max image size is 16384 bytes Nr of RPDOs The number of RPDOs used by the CANopen Task ls Nr of TPDOs The number of TPDOs used by the CANopen Task ll Functionality Each bit in this entry can disable enable a certain CANopen functionality in the CANopen Task such as allowing dynamic PDO mapping or not Usage is manufacturer specific Example NODE 044001020200 The example selects a de
55. x Object Dictionary Subindex to read INSIGNEDS len Length of data JNSIGNEDS dat Pointer to data XNMT SDO Client Write Expedited CHANNEL INDEX SUBINDEX LEN DAT e EE a Z E 31 THE MICROCANOPEN CLASSIC PROTCOL STACK Passed CHANNEL defines the SDO Client channel used for the request and must be in the range from I to NR OF SDO CLIENTS The values INDEX and SUBINDEX specify the Object Dictionary entry that is to be written to LEN and DAT specify the data that should be written to the selected Object Dictionary entry LEN may be in the range of 1 to 4 and DAT accordingly points to 1 to 4 data bytes Returned TRUE if the SDO Request was placed into the transmit queue FALSE if the transmit queue is full and the SDO request could not be queued for transmission 32 THE MICROCANOPEN CLASSIC PROTCOL STACK CANOPEN CODE CONFIGURATION The file cco cfg h contains the define settings that configure and enable specific CANopen code functionality The settings in ccohw h define hardware related settings TABLE SIZE SETTINGS OF CCO_CFG H define TABLE MAXSIZE UxFF This define specifies the maximum length of all OD tables number of entries in gODConstTable gODTable and gODSegTable and the process image number of bytes When set to OxFF an UNSIGNEDS data type can be used to access the arrays and to store location addresses in the process image This setting is recommended for all
56. xample to force a reset of the CANopen communication task s Called UNSIGNED8 CCO Init CANopen UNSIGNEDS bps UNSIGNED8 nodeid UNSIGNEDS BPS desired CAN bit rate UNSIGNEDS NODEID desired CANopen node ID UNSIGNED8 STATUS return value STATUS CCO Init CANopen BPS NODEID Passed BPS selects the desired CAN bit rate to be used The following values are allowed use default or pre defined bit rate use 10 kbps use 20 kbps use 50 kbps use 125 kbps use 250 kbps use 500 kbps use 800 kbps use 1 000 kbps NODEID is the CANopen node ID to be used by this CANopen node The allowed value range is 0 to 127 If 0 is selected MicroCANopen Classic will use the default or pre configured node ID CO AD 4 bh Y N KF Oo Returned STATUS is set to TRUE if the function executed successfully else it is set to FALSE The CCO_Read_Process_Data function This function is used to read data from the process image 21 THE MICROCANOPEN CLASSIC PROTCOL STACK Called UNSIGNED16 CCO Read Process Data UNSIGNEDS pDest UNSIGNED8 length UNSIGNED 16 offset UNSIGNEDS8 PDEST destination pointer to where the data is copied UNSIGNED8 LENGTH length of the data UNSIGNED 16 OFFSET offset to data location in the process image UNSIGNEDS NROFBYTES return value number of bytes actually copied NROFBYTES CCO_READ PROCESS DATA PDEST LENGTH OFFSET Passed PDEST is a destination pointer to the loc
57. y The define value in file img xxx h PIO EMCYCONSUMER BASE defines the base address offset 12 THE MICROCANOPEN CLASSIC PROTCOL STACK of where this array is stored in the process image The define value NR OF EMCY CONSUMERS defines the number of heartbeat consumer channels provided The required storage space in the process image is 4 times NR OF EMCY CONSUMERS A value of 0 turns off this feature ACCESSING THE PROCESS IMAGE Although an application program could directly access the data in the process image it is strongly recommended to use the access functions provided by MicroCANopen Classic The functions CCO Read Process Data and CCO Write Process Data ensure both data integrity and consistency by implementing resource locking MYNODE EXAMPLE When implementing a CANopen node with MicroCANopen Classic the variables communicated via the network need to be assigned to the process image For the MyNode example the following assignment is chosen defined in file img mynode h Size of process image define PROC IMG SIZE 16 reserve 16 bytes Definition of Process Image Offsets PIO define PIO Tempi 0 1 word at offset 0 define PIO Temp2 2 1 word at offset 2 define PIO Buttonsl 4 1 byte at offset 4 define PIO Buttons2 5 1 byte at offset 5 define PIO LEDs1 6 1 byte at offset 6 define PIO LEDs2

Download Pdf Manuals

image

Related Search

Related Contents

Deutsch: English: Deutsch: English:    MODE D`EMPLOI Remarques préalables : Ce classeur comprend    Benutzerhandbuch - Instructions Manuals  SECTION 1 - Switch On - AS Catering Supplies  転送遮断情報伝送装置  Artista Disco  Philips Ecomoods Wall light 16909/87/16  

Copyright © All rights reserved.
Failed to retrieve file