Trace functionality updated.

This commit is contained in:
Janez 2016-04-04 14:04:47 +02:00
parent 614735bc60
commit 851d9e0245
8 changed files with 974 additions and 65 deletions

Binary file not shown.

View File

@ -0,0 +1,405 @@
/*
* CANopen Object Dictionary.
*
* This file was automatically generated with CANopenNode Object
* Dictionary Editor. DON'T EDIT THIS FILE MANUALLY !!!!
* Object Dictionary Editor is currently an older, but functional web
* application. For more info see See 'Object_Dictionary_Editor/about.html' in
* <http://sourceforge.net/p/canopennode/code_complete/ci/master/tree/>
* For more information on CANopen Object Dictionary see <CO_SDO.h>.
*
* @file CO_OD.c
* @author Janez Paternoster
* @copyright 2010 - 2016 Janez Paternoster
*
* This file is part of CANopenNode, an opensource CANopen Stack.
* Project home page is <https://github.com/CANopenNode/CANopenNode>.
* For more information on CANopen see <http://www.can-cia.org/>.
*
* CANopenNode is free and open source software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Following clarification and special exception to the GNU General Public
* License is included to the distribution terms of CANopenNode:
*
* Linking this library statically or dynamically with other modules is
* making a combined work based on this library. Thus, the terms and
* conditions of the GNU General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this library give
* you permission to link this library with independent modules to
* produce an executable, regardless of the license terms of these
* independent modules, and to copy and distribute the resulting
* executable under terms of your choice, provided that you also meet,
* for each linked independent module, the terms and conditions of the
* license of that module. An independent module is a module which is
* not derived from or based on this library. If you modify this
* library, you may extend this exception to your version of the
* library, but you are not obliged to do so. If you do not wish
* to do so, delete this exception statement from your version.
*/
#include "CO_driver.h"
#include "CO_OD.h"
#include "CO_SDO.h"
/*******************************************************************************
DEFINITION AND INITIALIZATION OF OBJECT DICTIONARY VARIABLES
*******************************************************************************/
/***** Definition for RAM variables *******************************************/
struct sCO_OD_RAM CO_OD_RAM = {
CO_OD_FIRST_LAST_WORD,
/*1001*/ 0x0,
/*1002*/ 0x0L,
/*1003*/ {0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1010*/ {0x3L},
/*1011*/ {0x1L},
/*2100*/ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
/*2103*/ 0x0,
/*2104*/ 0x0,
/*2107*/ {0x3E8, 0x0, 0x0, 0x0, 0x0},
/*2108*/ {0},
/*2109*/ {0},
/*2110*/ {0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L},
/*2120*/ {0x5, 0x1234567890ABCDEFLL, 0x234567890ABCDEF1LL, 12.345, 456.789, 0},
/*2130*/ {0x3, {'-', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0, 0x0L},
/*2400*/ 0x0,
/*2401*/{{0x6, 0x0L, 0L, 0L, 0L, 0, 0x0L},
/*2402*/ {0x6, 0x0L, 0L, 0L, 0L, 0, 0x0L}},
/*6000*/ {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
/*6200*/ {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
/*6401*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
/*6411*/ {0, 0, 0, 0, 0, 0, 0, 0},
CO_OD_FIRST_LAST_WORD,
};
/***** Definition for EEPROM variables ****************************************/
struct sCO_OD_EEPROM CO_OD_EEPROM = {
CO_OD_FIRST_LAST_WORD,
/*2106*/ 0x0L,
/*2112*/ {1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L},
CO_OD_FIRST_LAST_WORD,
};
/***** Definition for ROM variables *******************************************/
struct sCO_OD_ROM CO_OD_ROM = { //constant variables, stored in flash
CO_OD_FIRST_LAST_WORD,
/*1000*/ 0x0L,
/*1005*/ 0x80L,
/*1006*/ 0x0L,
/*1007*/ 0x0L,
/*1008*/ {'C', 'A', 'N', 'o', 'p', 'e', 'n', 'N', 'o', 'd', 'e'},
/*1009*/ {'3', '.', '0', '0'},
/*100A*/ {'3', '.', '0', '0'},
/*1014*/ 0x80L,
/*1015*/ 0x64,
/*1016*/ {0x0L, 0x0L, 0x0L, 0x0L},
/*1017*/ 0x3E8,
/*1018*/ {0x4, 0x0L, 0x0L, 0x0L, 0x0L},
/*1019*/ 0x0,
/*1029*/ {0x0, 0x0, 0x1, 0x0, 0x0, 0x0},
/*1200*/{{0x2, 0x600L, 0x580L}},
/*1400*/{{0x2, 0x200L, 0xFF},
/*1401*/ {0x2, 0x300L, 0xFE},
/*1402*/ {0x2, 0x400L, 0xFE},
/*1403*/ {0x2, 0x500L, 0xFE}},
/*1600*/{{0x2, 0x62000108L, 0x62000208L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1601*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1602*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1603*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L}},
/*1800*/{{0x6, 0x180L, 0xFF, 0x64, 0x0, 0x0, 0x0},
/*1801*/ {0x6, 0x280L, 0xFE, 0x0, 0x0, 0x0, 0x0},
/*1802*/ {0x6, 0x380L, 0xFE, 0x0, 0x0, 0x0, 0x0},
/*1803*/ {0x6, 0x480L, 0xFE, 0x0, 0x0, 0x0, 0x0}},
/*1A00*/{{0x2, 0x60000108L, 0x60000208L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1A01*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1A02*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L},
/*1A03*/ {0x0, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L, 0x0L}},
/*1F80*/ 0x0L,
/*2101*/ 0x30,
/*2102*/ 0xFA,
/*2111*/ {1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L},
/*2301*/{{0x8, 0x64L, 0x1, {'T', 'r', 'a', 'c', 'e', '1', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, {'r', 'e', 'd', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0x60000108L, 0x1, 0x0, 0L},
/*2302*/ {0x8, 0x0L, 0x0, {'T', 'r', 'a', 'c', 'e', '2', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, {'g', 'r', 'e', 'e', 'n', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0x0L, 0x0, 0x0, 0L}},
CO_OD_FIRST_LAST_WORD
};
/*******************************************************************************
STRUCTURES FOR RECORD TYPE OBJECTS
*******************************************************************************/
/*0x1018*/ const CO_OD_entryRecord_t OD_record1018[5] = {
{(void*)&CO_OD_ROM.identity.maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.identity.vendorID, 0x85, 4},
{(void*)&CO_OD_ROM.identity.productCode, 0x85, 4},
{(void*)&CO_OD_ROM.identity.revisionNumber, 0x85, 4},
{(void*)&CO_OD_ROM.identity.serialNumber, 0x85, 4}};
/*0x1200*/ const CO_OD_entryRecord_t OD_record1200[3] = {
{(void*)&CO_OD_ROM.SDOServerParameter[0].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.SDOServerParameter[0].COB_IDClientToServer, 0x85, 4},
{(void*)&CO_OD_ROM.SDOServerParameter[0].COB_IDServerToClient, 0x85, 4}};
/*0x1400*/ const CO_OD_entryRecord_t OD_record1400[3] = {
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[0].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[0].COB_IDUsedByRPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[0].transmissionType, 0x0D, 1}};
/*0x1401*/ const CO_OD_entryRecord_t OD_record1401[3] = {
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[1].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[1].COB_IDUsedByRPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[1].transmissionType, 0x0D, 1}};
/*0x1402*/ const CO_OD_entryRecord_t OD_record1402[3] = {
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[2].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[2].COB_IDUsedByRPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[2].transmissionType, 0x0D, 1}};
/*0x1403*/ const CO_OD_entryRecord_t OD_record1403[3] = {
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[3].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[3].COB_IDUsedByRPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOCommunicationParameter[3].transmissionType, 0x0D, 1}};
/*0x1600*/ const CO_OD_entryRecord_t OD_record1600[9] = {
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[0].mappedObject8, 0x8D, 4}};
/*0x1601*/ const CO_OD_entryRecord_t OD_record1601[9] = {
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[1].mappedObject8, 0x8D, 4}};
/*0x1602*/ const CO_OD_entryRecord_t OD_record1602[9] = {
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[2].mappedObject8, 0x8D, 4}};
/*0x1603*/ const CO_OD_entryRecord_t OD_record1603[9] = {
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.RPDOMappingParameter[3].mappedObject8, 0x8D, 4}};
/*0x1800*/ const CO_OD_entryRecord_t OD_record1800[7] = {
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[0].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[0].COB_IDUsedByTPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[0].transmissionType, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[0].inhibitTime, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[0].compatibilityEntry, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[0].eventTimer, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[0].SYNCStartValue, 0x0D, 1}};
/*0x1801*/ const CO_OD_entryRecord_t OD_record1801[7] = {
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[1].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[1].COB_IDUsedByTPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[1].transmissionType, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[1].inhibitTime, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[1].compatibilityEntry, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[1].eventTimer, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[1].SYNCStartValue, 0x0D, 1}};
/*0x1802*/ const CO_OD_entryRecord_t OD_record1802[7] = {
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[2].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[2].COB_IDUsedByTPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[2].transmissionType, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[2].inhibitTime, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[2].compatibilityEntry, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[2].eventTimer, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[2].SYNCStartValue, 0x0D, 1}};
/*0x1803*/ const CO_OD_entryRecord_t OD_record1803[7] = {
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[3].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[3].COB_IDUsedByTPDO, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[3].transmissionType, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[3].inhibitTime, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[3].compatibilityEntry, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[3].eventTimer, 0x8D, 2},
{(void*)&CO_OD_ROM.TPDOCommunicationParameter[3].SYNCStartValue, 0x0D, 1}};
/*0x1A00*/ const CO_OD_entryRecord_t OD_record1A00[9] = {
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[0].mappedObject8, 0x8D, 4}};
/*0x1A01*/ const CO_OD_entryRecord_t OD_record1A01[9] = {
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[1].mappedObject8, 0x8D, 4}};
/*0x1A02*/ const CO_OD_entryRecord_t OD_record1A02[9] = {
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[2].mappedObject8, 0x8D, 4}};
/*0x1A03*/ const CO_OD_entryRecord_t OD_record1A03[9] = {
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].numberOfMappedObjects, 0x0D, 1},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject1, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject2, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject3, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject4, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject5, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject6, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject7, 0x8D, 4},
{(void*)&CO_OD_ROM.TPDOMappingParameter[3].mappedObject8, 0x8D, 4}};
/*0x2120*/ const CO_OD_entryRecord_t OD_record2120[6] = {
{(void*)&CO_OD_RAM.testVar.maxSubIndex, 0x06, 1},
{(void*)&CO_OD_RAM.testVar.I64, 0xBE, 8},
{(void*)&CO_OD_RAM.testVar.U64, 0xBE, 8},
{(void*)&CO_OD_RAM.testVar.R32, 0xBE, 4},
{(void*)&CO_OD_RAM.testVar.R64, 0xBE, 8},
{0, 0x0E, 0}};
/*0x2130*/ const CO_OD_entryRecord_t OD_record2130[4] = {
{(void*)&CO_OD_RAM.time.maxSubIndex, 0x06, 1},
{(void*)&CO_OD_RAM.time.string[0], 0x06, 30},
{(void*)&CO_OD_RAM.time.epochTimeBaseMs, 0x8E, 8},
{(void*)&CO_OD_RAM.time.epochTimeOffsetMs, 0xBE, 4}};
/*0x2301*/ const CO_OD_entryRecord_t OD_record2301[9] = {
{(void*)&CO_OD_ROM.traceConfig[0].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.traceConfig[0].size, 0x8D, 4},
{(void*)&CO_OD_ROM.traceConfig[0].axisNo, 0x0D, 1},
{(void*)&CO_OD_ROM.traceConfig[0].name[0], 0x0D, 30},
{(void*)&CO_OD_ROM.traceConfig[0].color[0], 0x0D, 20},
{(void*)&CO_OD_ROM.traceConfig[0].map, 0x8D, 4},
{(void*)&CO_OD_ROM.traceConfig[0].format, 0x0D, 1},
{(void*)&CO_OD_ROM.traceConfig[0].trigger, 0x0D, 1},
{(void*)&CO_OD_ROM.traceConfig[0].threshold, 0x8D, 4}};
/*0x2302*/ const CO_OD_entryRecord_t OD_record2302[9] = {
{(void*)&CO_OD_ROM.traceConfig[1].maxSubIndex, 0x05, 1},
{(void*)&CO_OD_ROM.traceConfig[1].size, 0x8D, 4},
{(void*)&CO_OD_ROM.traceConfig[1].axisNo, 0x0D, 1},
{(void*)&CO_OD_ROM.traceConfig[1].name[0], 0x0D, 30},
{(void*)&CO_OD_ROM.traceConfig[1].color[0], 0x0D, 20},
{(void*)&CO_OD_ROM.traceConfig[1].map, 0x8D, 4},
{(void*)&CO_OD_ROM.traceConfig[1].format, 0x0D, 1},
{(void*)&CO_OD_ROM.traceConfig[1].trigger, 0x0D, 1},
{(void*)&CO_OD_ROM.traceConfig[1].threshold, 0x8D, 4}};
/*0x2401*/ const CO_OD_entryRecord_t OD_record2401[7] = {
{(void*)&CO_OD_RAM.trace[0].maxSubIndex, 0x06, 1},
{(void*)&CO_OD_RAM.trace[0].size, 0xBE, 4},
{(void*)&CO_OD_RAM.trace[0].value, 0xA6, 4},
{(void*)&CO_OD_RAM.trace[0].min, 0xBE, 4},
{(void*)&CO_OD_RAM.trace[0].max, 0xBE, 4},
{0, 0x06, 0},
{(void*)&CO_OD_RAM.trace[0].triggerTime, 0xBE, 4}};
/*0x2402*/ const CO_OD_entryRecord_t OD_record2402[7] = {
{(void*)&CO_OD_RAM.trace[1].maxSubIndex, 0x06, 1},
{(void*)&CO_OD_RAM.trace[1].size, 0xBE, 4},
{(void*)&CO_OD_RAM.trace[1].value, 0xA6, 4},
{(void*)&CO_OD_RAM.trace[1].min, 0xBE, 4},
{(void*)&CO_OD_RAM.trace[1].max, 0xBE, 4},
{0, 0x06, 0},
{(void*)&CO_OD_RAM.trace[1].triggerTime, 0xBE, 4}};
/*******************************************************************************
OBJECT DICTIONARY
*******************************************************************************/
const CO_OD_entry_t CO_OD[CO_OD_NoOfElements] = {
{0x1000, 0x00, 0x85, 4, (void*)&CO_OD_ROM.deviceType},
{0x1001, 0x00, 0x36, 1, (void*)&CO_OD_RAM.errorRegister},
{0x1002, 0x00, 0xB6, 4, (void*)&CO_OD_RAM.manufacturerStatusRegister},
{0x1003, 0x08, 0x8E, 4, (void*)&CO_OD_RAM.preDefinedErrorField[0]},
{0x1005, 0x00, 0x8D, 4, (void*)&CO_OD_ROM.COB_ID_SYNCMessage},
{0x1006, 0x00, 0x8D, 4, (void*)&CO_OD_ROM.communicationCyclePeriod},
{0x1007, 0x00, 0x8D, 4, (void*)&CO_OD_ROM.synchronousWindowLength},
{0x1008, 0x00, 0x05, 11, (void*)&CO_OD_ROM.manufacturerDeviceName[0]},
{0x1009, 0x00, 0x05, 4, (void*)&CO_OD_ROM.manufacturerHardwareVersion[0]},
{0x100A, 0x00, 0x05, 4, (void*)&CO_OD_ROM.manufacturerSoftwareVersion[0]},
{0x1010, 0x01, 0x8E, 4, (void*)&CO_OD_RAM.storeParameters[0]},
{0x1011, 0x01, 0x8E, 4, (void*)&CO_OD_RAM.restoreDefaultParameters[0]},
{0x1014, 0x00, 0x85, 4, (void*)&CO_OD_ROM.COB_ID_EMCY},
{0x1015, 0x00, 0x8D, 2, (void*)&CO_OD_ROM.inhibitTimeEMCY},
{0x1016, 0x04, 0x8D, 4, (void*)&CO_OD_ROM.consumerHeartbeatTime[0]},
{0x1017, 0x00, 0x8D, 2, (void*)&CO_OD_ROM.producerHeartbeatTime},
{0x1018, 0x04, 0x00, 0, (void*)&OD_record1018},
{0x1019, 0x00, 0x0D, 1, (void*)&CO_OD_ROM.synchronousCounterOverflowValue},
{0x1029, 0x06, 0x0D, 1, (void*)&CO_OD_ROM.errorBehavior[0]},
{0x1200, 0x02, 0x00, 0, (void*)&OD_record1200},
{0x1400, 0x02, 0x00, 0, (void*)&OD_record1400},
{0x1401, 0x02, 0x00, 0, (void*)&OD_record1401},
{0x1402, 0x02, 0x00, 0, (void*)&OD_record1402},
{0x1403, 0x02, 0x00, 0, (void*)&OD_record1403},
{0x1600, 0x08, 0x00, 0, (void*)&OD_record1600},
{0x1601, 0x08, 0x00, 0, (void*)&OD_record1601},
{0x1602, 0x08, 0x00, 0, (void*)&OD_record1602},
{0x1603, 0x08, 0x00, 0, (void*)&OD_record1603},
{0x1800, 0x06, 0x00, 0, (void*)&OD_record1800},
{0x1801, 0x06, 0x00, 0, (void*)&OD_record1801},
{0x1802, 0x06, 0x00, 0, (void*)&OD_record1802},
{0x1803, 0x06, 0x00, 0, (void*)&OD_record1803},
{0x1A00, 0x08, 0x00, 0, (void*)&OD_record1A00},
{0x1A01, 0x08, 0x00, 0, (void*)&OD_record1A01},
{0x1A02, 0x08, 0x00, 0, (void*)&OD_record1A02},
{0x1A03, 0x08, 0x00, 0, (void*)&OD_record1A03},
{0x1F80, 0x00, 0x8D, 4, (void*)&CO_OD_ROM.NMTStartup},
{0x2100, 0x00, 0x36, 10, (void*)&CO_OD_RAM.errorStatusBits[0]},
{0x2101, 0x00, 0x0D, 1, (void*)&CO_OD_ROM.CANNodeID},
{0x2102, 0x00, 0x8D, 2, (void*)&CO_OD_ROM.CANBitRate},
{0x2103, 0x00, 0x8E, 2, (void*)&CO_OD_RAM.SYNCCounter},
{0x2104, 0x00, 0x86, 2, (void*)&CO_OD_RAM.SYNCTime},
{0x2106, 0x00, 0x87, 4, (void*)&CO_OD_EEPROM.powerOnCounter},
{0x2107, 0x05, 0xBE, 2, (void*)&CO_OD_RAM.performance[0]},
{0x2108, 0x01, 0xB6, 2, (void*)&CO_OD_RAM.temperature[0]},
{0x2109, 0x01, 0xB6, 2, (void*)&CO_OD_RAM.voltage[0]},
{0x2110, 0x10, 0xFE, 4, (void*)&CO_OD_RAM.variableInt32[0]},
{0x2111, 0x10, 0xFD, 4, (void*)&CO_OD_ROM.variableROMInt32[0]},
{0x2112, 0x10, 0xFF, 4, (void*)&CO_OD_EEPROM.variableNVInt32[0]},
{0x2120, 0x05, 0x00, 0, (void*)&OD_record2120},
{0x2130, 0x03, 0x00, 0, (void*)&OD_record2130},
{0x2301, 0x08, 0x00, 0, (void*)&OD_record2301},
{0x2302, 0x08, 0x00, 0, (void*)&OD_record2302},
{0x2400, 0x00, 0x3E, 1, (void*)&CO_OD_RAM.traceEnable},
{0x2401, 0x06, 0x00, 0, (void*)&OD_record2401},
{0x2402, 0x06, 0x00, 0, (void*)&OD_record2402},
{0x6000, 0x08, 0x76, 1, (void*)&CO_OD_RAM.readInput8Bit[0]},
{0x6200, 0x08, 0x3E, 1, (void*)&CO_OD_RAM.writeOutput8Bit[0]},
{0x6401, 0x0C, 0xB6, 2, (void*)&CO_OD_RAM.readAnalogueInput16Bit[0]},
{0x6411, 0x08, 0xBE, 2, (void*)&CO_OD_RAM.writeAnalogueOutput16Bit[0]},
};

View File

@ -0,0 +1,471 @@
/*
* CANopen Object Dictionary.
*
* This file was automatically generated with CANopenNode Object
* Dictionary Editor. DON'T EDIT THIS FILE MANUALLY !!!!
* Object Dictionary Editor is currently an older, but functional web
* application. For more info see See 'Object_Dictionary_Editor/about.html' in
* <http://sourceforge.net/p/canopennode/code_complete/ci/master/tree/>
* For more information on CANopen Object Dictionary see <CO_SDO.h>.
*
* @file CO_OD.h
* @author Janez Paternoster
* @copyright 2010 - 2016 Janez Paternoster
*
* This file is part of CANopenNode, an opensource CANopen Stack.
* Project home page is <https://github.com/CANopenNode/CANopenNode>.
* For more information on CANopen see <http://www.can-cia.org/>.
*
* CANopenNode is free and open source software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Following clarification and special exception to the GNU General Public
* License is included to the distribution terms of CANopenNode:
*
* Linking this library statically or dynamically with other modules is
* making a combined work based on this library. Thus, the terms and
* conditions of the GNU General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this library give
* you permission to link this library with independent modules to
* produce an executable, regardless of the license terms of these
* independent modules, and to copy and distribute the resulting
* executable under terms of your choice, provided that you also meet,
* for each linked independent module, the terms and conditions of the
* license of that module. An independent module is a module which is
* not derived from or based on this library. If you modify this
* library, you may extend this exception to your version of the
* library, but you are not obliged to do so. If you do not wish
* to do so, delete this exception statement from your version.
*/
#ifndef CO_OD_H
#define CO_OD_H
/*******************************************************************************
CANopen DATA DYPES
*******************************************************************************/
typedef uint8_t UNSIGNED8;
typedef uint16_t UNSIGNED16;
typedef uint32_t UNSIGNED32;
typedef uint64_t UNSIGNED64;
typedef int8_t INTEGER8;
typedef int16_t INTEGER16;
typedef int32_t INTEGER32;
typedef int64_t INTEGER64;
typedef float32_t REAL32;
typedef float64_t REAL64;
typedef char_t VISIBLE_STRING;
typedef oChar_t OCTET_STRING;
typedef domain_t DOMAIN;
/*******************************************************************************
FILE INFO:
FileName: IO Example
FileVersion: -
CreationTime: 17:24:43
CreationDate: 2016-03-25
CreatedBy: JP
*******************************************************************************/
/*******************************************************************************
DEVICE INFO:
VendorName: CANopenNode
VendorNumber: 0
ProductName: CANopenNode
ProductNumber: 0
*******************************************************************************/
/*******************************************************************************
FEATURES
*******************************************************************************/
#define CO_NO_SYNC 1 //Associated objects: 1005, 1006, 1007, 2103, 2104
#define CO_NO_EMERGENCY 1 //Associated objects: 1014, 1015
#define CO_NO_SDO_SERVER 1 //Associated objects: 1200
#define CO_NO_SDO_CLIENT 0
#define CO_NO_RPDO 4 //Associated objects: 1400, 1401, 1402, 1403, 1600, 1601, 1602, 1603
#define CO_NO_TPDO 4 //Associated objects: 1800, 1801, 1802, 1803, 1A00, 1A01, 1A02, 1A03
#define CO_NO_NMT_MASTER 0
#define CO_NO_TRACE 2 //Associated objects: 2301, 2302, 2400, 2401, 2402
/*******************************************************************************
OBJECT DICTIONARY
*******************************************************************************/
#define CO_OD_NoOfElements 60
/*******************************************************************************
TYPE DEFINITIONS FOR RECORDS
*******************************************************************************/
/*1018 */ typedef struct{
UNSIGNED8 maxSubIndex;
UNSIGNED32 vendorID;
UNSIGNED32 productCode;
UNSIGNED32 revisionNumber;
UNSIGNED32 serialNumber;
} OD_identity_t;
/*1200[1] */ typedef struct{
UNSIGNED8 maxSubIndex;
UNSIGNED32 COB_IDClientToServer;
UNSIGNED32 COB_IDServerToClient;
} OD_SDOServerParameter_t;
/*1400[4] */ typedef struct{
UNSIGNED8 maxSubIndex;
UNSIGNED32 COB_IDUsedByRPDO;
UNSIGNED8 transmissionType;
} OD_RPDOCommunicationParameter_t;
/*1600[4] */ typedef struct{
UNSIGNED8 numberOfMappedObjects;
UNSIGNED32 mappedObject1;
UNSIGNED32 mappedObject2;
UNSIGNED32 mappedObject3;
UNSIGNED32 mappedObject4;
UNSIGNED32 mappedObject5;
UNSIGNED32 mappedObject6;
UNSIGNED32 mappedObject7;
UNSIGNED32 mappedObject8;
} OD_RPDOMappingParameter_t;
/*1800[4] */ typedef struct{
UNSIGNED8 maxSubIndex;
UNSIGNED32 COB_IDUsedByTPDO;
UNSIGNED8 transmissionType;
UNSIGNED16 inhibitTime;
UNSIGNED8 compatibilityEntry;
UNSIGNED16 eventTimer;
UNSIGNED8 SYNCStartValue;
} OD_TPDOCommunicationParameter_t;
/*1A00[4] */ typedef struct{
UNSIGNED8 numberOfMappedObjects;
UNSIGNED32 mappedObject1;
UNSIGNED32 mappedObject2;
UNSIGNED32 mappedObject3;
UNSIGNED32 mappedObject4;
UNSIGNED32 mappedObject5;
UNSIGNED32 mappedObject6;
UNSIGNED32 mappedObject7;
UNSIGNED32 mappedObject8;
} OD_TPDOMappingParameter_t;
/*2120 */ typedef struct{
UNSIGNED8 maxSubIndex;
INTEGER64 I64;
UNSIGNED64 U64;
REAL32 R32;
REAL64 R64;
DOMAIN domain;
} OD_testVar_t;
/*2130 */ typedef struct{
UNSIGNED8 maxSubIndex;
VISIBLE_STRING string[30];
UNSIGNED64 epochTimeBaseMs;
UNSIGNED32 epochTimeOffsetMs;
} OD_time_t;
/*2301[2] */ typedef struct{
UNSIGNED8 maxSubIndex;
UNSIGNED32 size;
UNSIGNED8 axisNo;
VISIBLE_STRING name[30];
VISIBLE_STRING color[20];
UNSIGNED32 map;
UNSIGNED8 format;
UNSIGNED8 trigger;
INTEGER32 threshold;
} OD_traceConfig_t;
/*2401[2] */ typedef struct{
UNSIGNED8 maxSubIndex;
UNSIGNED32 size;
INTEGER32 value;
INTEGER32 min;
INTEGER32 max;
DOMAIN plot;
UNSIGNED32 triggerTime;
} OD_trace_t;
/*******************************************************************************
STRUCTURES FOR VARIABLES IN DIFFERENT MEMORY LOCATIONS
*******************************************************************************/
#define CO_OD_FIRST_LAST_WORD 0x55 //Any value from 0x01 to 0xFE. If changed, EEPROM will be reinitialized.
/***** Structure for RAM variables ********************************************/
struct sCO_OD_RAM{
UNSIGNED32 FirstWord;
/*1001 */ UNSIGNED8 errorRegister;
/*1002 */ UNSIGNED32 manufacturerStatusRegister;
/*1003 */ UNSIGNED32 preDefinedErrorField[8];
/*1010 */ UNSIGNED32 storeParameters[1];
/*1011 */ UNSIGNED32 restoreDefaultParameters[1];
/*2100 */ OCTET_STRING errorStatusBits[10];
/*2103 */ UNSIGNED16 SYNCCounter;
/*2104 */ UNSIGNED16 SYNCTime;
/*2107 */ UNSIGNED16 performance[5];
/*2108 */ INTEGER16 temperature[1];
/*2109 */ INTEGER16 voltage[1];
/*2110 */ INTEGER32 variableInt32[16];
/*2120 */ OD_testVar_t testVar;
/*2130 */ OD_time_t time;
/*2400 */ UNSIGNED8 traceEnable;
/*2401[2] */ OD_trace_t trace[2];
/*6000 */ UNSIGNED8 readInput8Bit[8];
/*6200 */ UNSIGNED8 writeOutput8Bit[8];
/*6401 */ INTEGER16 readAnalogueInput16Bit[12];
/*6411 */ INTEGER16 writeAnalogueOutput16Bit[8];
UNSIGNED32 LastWord;
};
/***** Structure for EEPROM variables *****************************************/
struct sCO_OD_EEPROM{
UNSIGNED32 FirstWord;
/*2106 */ UNSIGNED32 powerOnCounter;
/*2112 */ INTEGER32 variableNVInt32[16];
UNSIGNED32 LastWord;
};
/***** Structure for ROM variables ********************************************/
struct sCO_OD_ROM{
UNSIGNED32 FirstWord;
/*1000 */ UNSIGNED32 deviceType;
/*1005 */ UNSIGNED32 COB_ID_SYNCMessage;
/*1006 */ UNSIGNED32 communicationCyclePeriod;
/*1007 */ UNSIGNED32 synchronousWindowLength;
/*1008 */ VISIBLE_STRING manufacturerDeviceName[11];
/*1009 */ VISIBLE_STRING manufacturerHardwareVersion[4];
/*100A */ VISIBLE_STRING manufacturerSoftwareVersion[4];
/*1014 */ UNSIGNED32 COB_ID_EMCY;
/*1015 */ UNSIGNED16 inhibitTimeEMCY;
/*1016 */ UNSIGNED32 consumerHeartbeatTime[4];
/*1017 */ UNSIGNED16 producerHeartbeatTime;
/*1018 */ OD_identity_t identity;
/*1019 */ UNSIGNED8 synchronousCounterOverflowValue;
/*1029 */ UNSIGNED8 errorBehavior[6];
/*1200[1] */ OD_SDOServerParameter_t SDOServerParameter[1];
/*1400[4] */ OD_RPDOCommunicationParameter_t RPDOCommunicationParameter[4];
/*1600[4] */ OD_RPDOMappingParameter_t RPDOMappingParameter[4];
/*1800[4] */ OD_TPDOCommunicationParameter_t TPDOCommunicationParameter[4];
/*1A00[4] */ OD_TPDOMappingParameter_t TPDOMappingParameter[4];
/*1F80 */ UNSIGNED32 NMTStartup;
/*2101 */ UNSIGNED8 CANNodeID;
/*2102 */ UNSIGNED16 CANBitRate;
/*2111 */ INTEGER32 variableROMInt32[16];
/*2301[2] */ OD_traceConfig_t traceConfig[2];
UNSIGNED32 LastWord;
};
/***** Declaration of Object Dictionary variables *****************************/
extern struct sCO_OD_RAM CO_OD_RAM;
extern struct sCO_OD_EEPROM CO_OD_EEPROM;
extern struct sCO_OD_ROM CO_OD_ROM;
/*******************************************************************************
ALIASES FOR OBJECT DICTIONARY VARIABLES
*******************************************************************************/
/*1000, Data Type: UNSIGNED32 */
#define OD_deviceType CO_OD_ROM.deviceType
/*1001, Data Type: UNSIGNED8 */
#define OD_errorRegister CO_OD_RAM.errorRegister
/*1002, Data Type: UNSIGNED32 */
#define OD_manufacturerStatusRegister CO_OD_RAM.manufacturerStatusRegister
/*1003, Data Type: UNSIGNED32, Array[8] */
#define OD_preDefinedErrorField CO_OD_RAM.preDefinedErrorField
#define ODL_preDefinedErrorField_arrayLength 8
/*1005, Data Type: UNSIGNED32 */
#define OD_COB_ID_SYNCMessage CO_OD_ROM.COB_ID_SYNCMessage
/*1006, Data Type: UNSIGNED32 */
#define OD_communicationCyclePeriod CO_OD_ROM.communicationCyclePeriod
/*1007, Data Type: UNSIGNED32 */
#define OD_synchronousWindowLength CO_OD_ROM.synchronousWindowLength
/*1008, Data Type: VISIBLE_STRING, Array[11] */
#define OD_manufacturerDeviceName CO_OD_ROM.manufacturerDeviceName
#define ODL_manufacturerDeviceName_stringLength 11
/*1009, Data Type: VISIBLE_STRING, Array[4] */
#define OD_manufacturerHardwareVersion CO_OD_ROM.manufacturerHardwareVersion
#define ODL_manufacturerHardwareVersion_stringLength 4
/*100A, Data Type: VISIBLE_STRING, Array[4] */
#define OD_manufacturerSoftwareVersion CO_OD_ROM.manufacturerSoftwareVersion
#define ODL_manufacturerSoftwareVersion_stringLength 4
/*1010, Data Type: UNSIGNED32, Array[1] */
#define OD_storeParameters CO_OD_RAM.storeParameters
#define ODL_storeParameters_arrayLength 1
#define ODA_storeParameters_saveAllParameters 0
/*1011, Data Type: UNSIGNED32, Array[1] */
#define OD_restoreDefaultParameters CO_OD_RAM.restoreDefaultParameters
#define ODL_restoreDefaultParameters_arrayLength 1
#define ODA_restoreDefaultParameters_restoreAllDefaultParameters 0
/*1014, Data Type: UNSIGNED32 */
#define OD_COB_ID_EMCY CO_OD_ROM.COB_ID_EMCY
/*1015, Data Type: UNSIGNED16 */
#define OD_inhibitTimeEMCY CO_OD_ROM.inhibitTimeEMCY
/*1016, Data Type: UNSIGNED32, Array[4] */
#define OD_consumerHeartbeatTime CO_OD_ROM.consumerHeartbeatTime
#define ODL_consumerHeartbeatTime_arrayLength 4
/*1017, Data Type: UNSIGNED16 */
#define OD_producerHeartbeatTime CO_OD_ROM.producerHeartbeatTime
/*1018, Data Type: OD_identity_t */
#define OD_identity CO_OD_ROM.identity
/*1019, Data Type: UNSIGNED8 */
#define OD_synchronousCounterOverflowValue CO_OD_ROM.synchronousCounterOverflowValue
/*1029, Data Type: UNSIGNED8, Array[6] */
#define OD_errorBehavior CO_OD_ROM.errorBehavior
#define ODL_errorBehavior_arrayLength 6
#define ODA_errorBehavior_communication 0
#define ODA_errorBehavior_communicationOther 1
#define ODA_errorBehavior_communicationPassive 2
#define ODA_errorBehavior_generic 3
#define ODA_errorBehavior_deviceProfile 4
#define ODA_errorBehavior_manufacturerSpecific 5
/*1200[1], Data Type: OD_SDOServerParameter_t, Array[1] */
#define OD_SDOServerParameter CO_OD_ROM.SDOServerParameter
/*1400[4], Data Type: OD_RPDOCommunicationParameter_t, Array[4] */
#define OD_RPDOCommunicationParameter CO_OD_ROM.RPDOCommunicationParameter
/*1600[4], Data Type: OD_RPDOMappingParameter_t, Array[4] */
#define OD_RPDOMappingParameter CO_OD_ROM.RPDOMappingParameter
/*1800[4], Data Type: OD_TPDOCommunicationParameter_t, Array[4] */
#define OD_TPDOCommunicationParameter CO_OD_ROM.TPDOCommunicationParameter
/*1A00[4], Data Type: OD_TPDOMappingParameter_t, Array[4] */
#define OD_TPDOMappingParameter CO_OD_ROM.TPDOMappingParameter
/*1F80, Data Type: UNSIGNED32 */
#define OD_NMTStartup CO_OD_ROM.NMTStartup
/*2100, Data Type: OCTET_STRING, Array[10] */
#define OD_errorStatusBits CO_OD_RAM.errorStatusBits
#define ODL_errorStatusBits_stringLength 10
/*2101, Data Type: UNSIGNED8 */
#define OD_CANNodeID CO_OD_ROM.CANNodeID
/*2102, Data Type: UNSIGNED16 */
#define OD_CANBitRate CO_OD_ROM.CANBitRate
/*2103, Data Type: UNSIGNED16 */
#define OD_SYNCCounter CO_OD_RAM.SYNCCounter
/*2104, Data Type: UNSIGNED16 */
#define OD_SYNCTime CO_OD_RAM.SYNCTime
/*2106, Data Type: UNSIGNED32 */
#define OD_powerOnCounter CO_OD_EEPROM.powerOnCounter
/*2107, Data Type: UNSIGNED16, Array[5] */
#define OD_performance CO_OD_RAM.performance
#define ODL_performance_arrayLength 5
#define ODA_performance_cyclesPerSecond 0
#define ODA_performance_timerCycleTime 1
#define ODA_performance_timerCycleMaxTime 2
#define ODA_performance_mainCycleTime 3
#define ODA_performance_mainCycleMaxTime 4
/*2108, Data Type: INTEGER16, Array[1] */
#define OD_temperature CO_OD_RAM.temperature
#define ODL_temperature_arrayLength 1
#define ODA_temperature_mainPCB 0
/*2109, Data Type: INTEGER16, Array[1] */
#define OD_voltage CO_OD_RAM.voltage
#define ODL_voltage_arrayLength 1
#define ODA_voltage_mainPCBSupply 0
/*2110, Data Type: INTEGER32, Array[16] */
#define OD_variableInt32 CO_OD_RAM.variableInt32
#define ODL_variableInt32_arrayLength 16
/*2111, Data Type: INTEGER32, Array[16] */
#define OD_variableROMInt32 CO_OD_ROM.variableROMInt32
#define ODL_variableROMInt32_arrayLength 16
/*2112, Data Type: INTEGER32, Array[16] */
#define OD_variableNVInt32 CO_OD_EEPROM.variableNVInt32
#define ODL_variableNVInt32_arrayLength 16
/*2120, Data Type: OD_testVar_t */
#define OD_testVar CO_OD_RAM.testVar
/*2130, Data Type: OD_time_t */
#define OD_time CO_OD_RAM.time
/*2301[2], Data Type: OD_traceConfig_t, Array[2] */
#define OD_traceConfig CO_OD_ROM.traceConfig
/*2400, Data Type: UNSIGNED8 */
#define OD_traceEnable CO_OD_RAM.traceEnable
/*2401[2], Data Type: OD_trace_t, Array[2] */
#define OD_trace CO_OD_RAM.trace
/*6000, Data Type: UNSIGNED8, Array[8] */
#define OD_readInput8Bit CO_OD_RAM.readInput8Bit
#define ODL_readInput8Bit_arrayLength 8
/*6200, Data Type: UNSIGNED8, Array[8] */
#define OD_writeOutput8Bit CO_OD_RAM.writeOutput8Bit
#define ODL_writeOutput8Bit_arrayLength 8
/*6401, Data Type: INTEGER16, Array[12] */
#define OD_readAnalogueInput16Bit CO_OD_RAM.readAnalogueInput16Bit
#define ODL_readAnalogueInput16Bit_arrayLength 12
/*6411, Data Type: INTEGER16, Array[8] */
#define OD_writeAnalogueOutput16Bit CO_OD_RAM.writeAnalogueOutput16Bit
#define ODL_writeAnalogueOutput16Bit_arrayLength 8
#endif

View File

@ -2360,7 +2360,7 @@ DefaultValue=0
ParameterName=Value
ObjectType=7
DataType=0x0004
AccessType=ro
AccessType=rww
PDOMapping=1
DefaultValue=0
@ -2421,7 +2421,7 @@ DefaultValue=0
ParameterName=Value
ObjectType=7
DataType=0x0004
AccessType=ro
AccessType=rww
PDOMapping=1
DefaultValue=0

View File

@ -1604,7 +1604,7 @@
</li>
<li>
02 - Value:
<input addr="2401020004" format="I32" pf="rro" value="0"/>
<input addr="2401020004" format="I32" pf="rrw" value="0"/>
</li>
<li>
03 - Min:
@ -1616,7 +1616,7 @@
</li>
<li>
05 - Plot:
<input addr="2401050000" format="Dxx" pf="rro" value="0"/>
<input addr="2401050000" format="Sxx" pf="rro" value="0"/>
</li>
<li>
06 - Trigger time:
@ -1637,7 +1637,7 @@
</li>
<li>
02 - Value:
<input addr="2402020004" format="I32" pf="rro" value="0"/>
<input addr="2402020004" format="I32" pf="rrw" value="0"/>
</li>
<li>
03 - Min:
@ -1649,7 +1649,7 @@
</li>
<li>
05 - Plot:
<input addr="2402050000" format="Dxx" pf="rro" value="0"/>
<input addr="2402050000" format="Sxx" pf="rro" value="0"/>
</li>
<li>
06 - Trigger time:
@ -5850,7 +5850,7 @@
Color - color of the trace as a string (informative).
<br/>
<br/>
Map - Map to variable in object dictionary. Trace must be disabled, if mapping is written (Axis no set to 0).
Map - Map to variable in object dictionary, similar as PDO map(two bytes of index, one byte of subindex and 1 byte of bitlength. It's value will be copied to trace.value in case index and subindex are correct. If map index and subindex is zero, RPDO may be mapped to trace.value, for example. Valid values of map.bitlength is 08, 10 or 20 or 00, which indicates 8-bit, 16bit, 32-bit or default-size variable. Trace must be disabled, if mapping is written (Axis no set to 0).
<br/>
<br/>
Format - If first bit is zero, then value is used as signed integer otherwise as unsigned integer. If format is 0 or 1, text points are generated for time and value: "123;321\n140;345\n..." If format is 2 or 3, binary data is generated: 4-byte timestamp and 4-byte value. If format is 4 or 5, SVG path is generated: "M123,321H140V345...".
@ -6060,8 +6060,8 @@
<td>02</td>
<td>Value</td>
<td>INTEGER32</td>
<td>ro</td>
<td>TPDO</td>
<td>rw</td>
<td>optional</td>
<td>no</td>
<td>0</td>
<td/>
@ -6119,7 +6119,7 @@
Size - Number of current records in buffer.
<br/>
<br/>
Value - Latest value.
Value - Latest value. If traceConfig.map (index and subindex) is valid, then mapped variable will be copied here.
<br/>
<br/>
Min, Max - Minimum and maximum value.
@ -6182,8 +6182,8 @@
<td>02</td>
<td>Value</td>
<td>INTEGER32</td>
<td>ro</td>
<td>TPDO</td>
<td>rw</td>
<td>optional</td>
<td>no</td>
<td>0</td>
<td/>

View File

@ -794,7 +794,7 @@ Name - name of the trace as a string (informative).
Color - color of the trace as a string (informative).
Map - Map to variable in object dictionary. Trace must be disabled, if mapping is written (Axis no set to 0).
Map - Map to variable in object dictionary, similar as PDO map(two bytes of index, one byte of subindex and 1 byte of bitlength. It's value will be copied to trace.value in case index and subindex are correct. If map index and subindex is zero, RPDO may be mapped to trace.value, for example. Valid values of map.bitlength is 08, 10 or 20 or 00, which indicates 8-bit, 16bit, 32-bit or default-size variable. Trace must be disabled, if mapping is written (Axis no set to 0).
Format - If first bit is zero, then value is used as signed integer otherwise as unsigned integer. If format is 0 or 1, text points are generated for time and value: "123;321\n140;345\n..." If format is 2 or 3, binary data is generated: 4-byte timestamp and 4-byte value. If format is 4 or 5, SVG path is generated: "M123,321H140V345...".
@ -834,7 +834,7 @@ See also Trace config.
Size - Number of current records in buffer.
Value - Latest value.
Value - Latest value. If traceConfig.map (index and subindex) is valid, then mapped variable will be copied here.
Min, Max - Minimum and maximum value.
@ -843,7 +843,7 @@ Plot - SVG path generated from the values from circular buffer. For time axis is
Trigger time - If integer value passes 'TraceConfig-&gt;threshold', then time is recorded into this variable.</description>
<CANopenSubObject subIndex="00" name="max sub-index" objectType="7" dataType="05" accessType="ro" PDOmapping="no" defaultValue="6"/>
<CANopenSubObject subIndex="01" name="Size" objectType="7" dataType="07" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="02" name="Value" objectType="7" dataType="04" accessType="ro" PDOmapping="TPDO" defaultValue="0"/>
<CANopenSubObject subIndex="02" name="Value" objectType="7" dataType="04" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="03" name="Min" objectType="7" dataType="04" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="04" name="Max" objectType="7" dataType="04" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="05" name="Plot" objectType="7" dataType="0F" accessType="ro" PDOmapping="no" defaultValue="0"/>
@ -852,7 +852,7 @@ Trigger time - If integer value passes 'TraceConfig-&gt;threshold', then time is
<CANopenObject index="2402" name="Trace" objectType="9" subNumber="7" memoryType="RAM" disabled="true">
<CANopenSubObject subIndex="00" name="max sub-index" objectType="7" dataType="05" accessType="ro" PDOmapping="no" defaultValue="6"/>
<CANopenSubObject subIndex="01" name="Size" objectType="7" dataType="07" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="02" name="Value" objectType="7" dataType="04" accessType="ro" PDOmapping="TPDO" defaultValue="0"/>
<CANopenSubObject subIndex="02" name="Value" objectType="7" dataType="04" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="03" name="Min" objectType="7" dataType="04" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="04" name="Max" objectType="7" dataType="04" accessType="rw" PDOmapping="optional" defaultValue="0"/>
<CANopenSubObject subIndex="05" name="Plot" objectType="7" dataType="0F" accessType="ro" PDOmapping="no" defaultValue="0"/>

View File

@ -110,52 +110,79 @@ static const CO_trace_dataType_t dataTypes[] = {
/* Find variable in Object Dictionary *****************************************/
static void findVariable(CO_trace_t *trace) {
bool_t err = false;
uint16_t index;
uint8_t subIndex;
uint16_t entryNo;
uint16_t len;
uint8_t dataLen;
void *OdDataPtr = NULL;
int dtIndex = 0;
trace->dt = NULL;
trace->OD_variable = NULL;
/* get variable from mapping */
/* parse mapping */
index = (uint16_t) ((*trace->map) >> 16);
subIndex = (uint8_t) ((*trace->map) >> 8);
dataLen = (uint8_t) (*trace->map);
if((dataLen & 0x07) != 0) { /* data length must be byte aligned */
err = true;
}
dataLen >>= 3; /* in bytes now */
if(dataLen == 0) {
dataLen = 4;
}
/* find object in Object Dictionary */
entryNo = CO_OD_find(trace->SDO, index);
/* find mapped variable, if map available */
if(!err && (index != 0 || subIndex != 0)) {
uint16_t entryNo = CO_OD_find(trace->SDO, index);
/* Does object exist in OD? */
if(index >= 0x1000 && entryNo != 0xFFFF && subIndex <= trace->SDO->OD[entryNo].maxSubIndex) {
trace->OD_variable = CO_OD_getDataPointer(trace->SDO, entryNo, subIndex);
if(index >= 0x1000 && entryNo != 0xFFFF && subIndex <= trace->SDO->OD[entryNo].maxSubIndex) {
OdDataPtr = CO_OD_getDataPointer(trace->SDO, entryNo, subIndex);
}
if(trace->OD_variable != NULL) {
int dtIndex = 0;
if(OdDataPtr != NULL) {
uint16_t len = CO_OD_getLength(trace->SDO, entryNo, subIndex);
len = CO_OD_getLength(trace->SDO, entryNo, subIndex);
/* Get function pointers for correct data type */
/* first sequence: data length */
switch(len) {
case 1: dtIndex = 0; break;
case 2: dtIndex = 1; break;
case 4: dtIndex = 2; break;
default: trace->OD_variable = NULL; break;
}
/* second sequence: signed or unsigned */
if(((*trace->format) & 1) == 1) {
dtIndex += 3;
}
/* third sequence: Output type */
dtIndex += ((*trace->format) >> 1) * 6;
if(dtIndex < sizeof(dataTypes) / sizeof(CO_trace_dataType_t)) {
trace->dt = &dataTypes[dtIndex];
}
else {
trace->OD_variable = NULL;
if(len < dataLen) {
dataLen = len;
}
}
else {
err = true;
}
}
/* Get function pointers for correct data type */
if(!err) {
/* first sequence: data length */
switch(dataLen) {
case 1: dtIndex = 0; break;
case 2: dtIndex = 1; break;
case 4: dtIndex = 2; break;
default: err = true; break;
}
/* second sequence: signed or unsigned */
if(((*trace->format) & 1) == 1) {
dtIndex += 3;
}
/* third sequence: Output type */
dtIndex += ((*trace->format) >> 1) * 6;
if(dtIndex > (sizeof(dataTypes) / sizeof(CO_trace_dataType_t))) {
err = true;
}
}
/* set output variables */
if(!err) {
if(OdDataPtr != NULL) {
trace->OD_variable = OdDataPtr;
}
else {
trace->OD_variable = trace->value;
}
trace->dt = &dataTypes[dtIndex];
}
else {
trace->OD_variable = NULL;
trace->dt = NULL;
}
}
@ -198,10 +225,11 @@ static CO_SDO_abortCode_t CO_ODF_traceConfig(CO_ODF_arg_t *ODF_arg) {
findVariable(trace);
if(trace->OD_variable != NULL) {
*trace->lastValue = 0;
*trace->value = 0;
*trace->minValue = 0;
*trace->maxValue = 0;
*trace->triggerTime = 0;
trace->valuePrev = 0;
trace->readPtr = 0;
trace->writePtr = 0;
trace->enabled = true;
@ -364,7 +392,7 @@ static CO_SDO_abortCode_t CO_ODF_trace(CO_ODF_arg_t *ODF_arg) {
/* print last point */
if(!readPtrOverflowed && ODF_arg->lastSegment) {
v = *trace->lastValue;
v = trace->valuePrev;
t = trace->lastTimeStamp;
len = trace->dt->printPointEnd(s, freeLen, t, v);
s += len;
@ -394,7 +422,7 @@ void CO_trace_init(
uint8_t *format,
uint8_t *trigger,
int32_t *threshold,
int32_t *lastValue,
int32_t *value,
int32_t *minValue,
int32_t *maxValue,
uint32_t *triggerTime,
@ -413,14 +441,15 @@ void CO_trace_init(
trace->format = format;
trace->trigger = trigger;
trace->threshold = threshold;
trace->lastValue = lastValue;
trace->value = value;
trace->minValue = minValue;
trace->maxValue = maxValue;
trace->triggerTime = triggerTime;
*trace->lastValue = 0;
*trace->value = 0;
*trace->minValue = 0;
*trace->maxValue = 0;
*trace->triggerTime = 0;
trace->valuePrev = 0;
/* set trace->OD_variable and trace->dt, based on 'map' and 'format' */
findVariable(trace);
@ -441,20 +470,23 @@ void CO_trace_init(
/******************************************************************************/
void CO_trace_process(CO_trace_t *trace, uint32_t timestamp) {
if(trace->enabled) {
int32_t val;
val = trace->dt->pGetValue(trace->OD_variable);
if(*trace->lastValue != val) {
int32_t val = trace->dt->pGetValue(trace->OD_variable);
if(val != trace->valuePrev) {
/* Verify, if value passed threshold */
if((*trace->trigger & 1) != 0 && *trace->lastValue < *trace->threshold && val >= *trace->threshold) {
if((*trace->trigger & 1) != 0 && trace->valuePrev < *trace->threshold && val >= *trace->threshold) {
*trace->triggerTime = timestamp;
}
if((*trace->trigger & 2) != 0 && *trace->lastValue < *trace->threshold && val >= *trace->threshold) {
if((*trace->trigger & 2) != 0 && trace->valuePrev < *trace->threshold && val >= *trace->threshold) {
*trace->triggerTime = timestamp;
}
/* Write value and verify min/max */
*trace->lastValue = val;
if(trace->value != trace->OD_variable) {
*trace->value = val;
}
trace->valuePrev = val;
if(*trace->minValue > val) {
*trace->minValue = val;
}

View File

@ -113,9 +113,10 @@ typedef struct {
uint32_t lastTimeStamp; /**< Last time stamp. If zero, then last point contains last timestamp. */
void *OD_variable; /**< Pointer to variable, which is monitored */
const CO_trace_dataType_t *dt; /**< Data type specific function pointers. **/
int32_t valuePrev; /**< Previous value of value. */
uint32_t *map; /**< From CO_trace_init(). */
uint8_t *format; /**< From CO_trace_init(). */
int32_t *lastValue; /**< From CO_trace_init(). */
int32_t *value; /**< From CO_trace_init(). */
int32_t *minValue; /**< From CO_trace_init(). */
int32_t *maxValue; /**< From CO_trace_init(). */
uint32_t *triggerTime; /**< From CO_trace_init(). */
@ -139,7 +140,7 @@ typedef struct {
* @param Format Format of the plot. If first bit is 1, above variable is unsigned. For more info see Object Dictionary.
* @param trigger If different than zero, trigger time is recorded, when variable goes through threshold.
* @param threshold Used with trigger.
* @param lastValue Pointer to variable, which will show last value of the variable.
* @param value Pointer to variable, which will show last value of the variable.
* @param minValue Pointer to variable, which will show minimum value of the variable.
* @param maxValue Pointer to variable, which will show maximum value of the variable.
* @param triggerTime Pointer to variable, which will show last trigger time of the variable.
@ -159,7 +160,7 @@ void CO_trace_init(
uint8_t *format,
uint8_t *trigger,
int32_t *threshold,
int32_t *lastValue,
int32_t *value,
int32_t *minValue,
int32_t *maxValue,
uint32_t *triggerTime,