rllib  1
rlcanopenstructs.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlcanopen.cpp - description
3  -------------------
4  begin : Tue March 03 2004
5  copyright : (C) 2004 by Marc Br�tigam, Christian Wilmes, R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 
18 
19 #ifndef CanOpenStructsH
20 #define CanOpenStructsH
21 
22 
23 #define DIRECTION_RECEIVE 0
24 #define DIRECTION_TRANSMIT 1
25 
26 
27 
28 #define RECEIVE_PDO_MAPPING_STARTADRESS 0x1600
29 #define RECEIVE_PDO_MAPPING_MAXADRESS 0x17FF
30 #define TRANSMIT_PDO_MAPPING_STARTADRESS 0x1A00
31 #define TRANSMIT_PDO_MAPPING_MAXADRESS 0x1BFF
32 #define MAX_NODES 127
33 #define MAX_SDO_BUFFERSIZE 246
34 
35 
36 
38 #define CAN_TASK 3
39 #define USER_AT_HOST 16
40 #define CMDCODE_GET_CONFIGURATION 15
41 #define CMDCODE_SDO_UPDOWNLOAD 74
42 #define CMDCODE_Node_Diag 66
43 #define CMD_NMT_Module_Protocol 96
44 
46 #define CMD_NMT_START_REMOTE_NODE 1
47 #define CMD_NMT_STOP_REMOTE_NODE 2
48 #define CMD_NMT_ENTER_PREOPERATIONAL 128
49 #define CMD_NMT_RESET_NODE 129
50 #define CMD_NMT_RESET_COMMUNICATION 130
51 
52 #define TASK_TFC_READ 1
53 #define TASK_TFC_WRITE 2
54 #define RESPONSE_CODE_GET_CONFIGURATION 15
55 
56 #define DATA_DIRECTION_MASK 0x30
57 #define DIRECTION_INPUT 0x10
58 #define DIRECTION_OUTPUT 0x20
59 
61 #define ERRCODE_NOERROR 0
62 #define ERRCODE_INVALID_NODEID -2
63 #define ERRCODE_INVALID_PDOID -3
64 #define ERRCODE_PDOSND_FAIL -4
65 #define ERRCODE_INVALID_MAPID -5
66 #define ERRCODE_INVALID_RLTYPE -6
67 #define ERRCODE_PDORCV_FAIL -7
68 
70 #define COLDSTART 2
71 #define WARMSTART 3
72 #define BOOTSTART 4
73 
76 {
78  unsigned short mappingId;
79 
81  int etype;
82 
85 
87  unsigned short position;
88 
90  unsigned short length;
91 } ;
92 
93 
94 
96 struct rlCanPDO
97 {
99  short bPDODirection;
100 
102  unsigned char bPDOSize;
103 
105  unsigned char bDataPosition;
106 
108  unsigned short usPDOAddress;
109 
111  QPtrVector<rlCanMapping> mappingList;
112 
115 };
116 
117 
118 
119 #endif
120 
unsigned short mappingId
the mapping ID determines the mapping object within the PDO (1 to n)
unsigned short usPDOAddress
fixes the PDO position in the card memory
short bPDODirection
1 = receive PDO / 2 = send PDO [indicate by PDO No]
unsigned short position
its position in within the 8Byte
unsigned char bPDOSize
size of a PDO / max 8 Bytes
mapping object which is part of the mappinglist of a PDO
unsigned char bDataPosition
if only one bit is set in a PDO, this value shows its position
int mappingOvAdress
the adress of object directory of the node where the mapping is placed
int etype
its current type (int32, float, char, ...)
int canopentype
its current canoptentype (int24, int40, int48, ...)
PDO object which is part of one of the two pdo lists in the node class.
unsigned short length
length of mappend object in bits
QPtrVector< rlCanMapping > mappingList
this list contains all mapping information of a PDO