Lely core libraries
2.3.4
|
Go to the documentation of this file.
29 #define CO_GW_NUM_NET 127
32 #define CO_GW_PROT_HI 2
35 #define CO_GW_PROT_LO 0
38 #define CO_GW_SRV_SDO_UP 0x11
41 #define CO_GW_SRV_SDO_DN 0x13
44 #define CO_GW_SRV_SET_SDO_TIMEOUT 0x14
47 #define CO_GW_SRV_SET_RPDO 0x21
50 #define CO_GW_SRV_SET_TPDO 0x22
53 #define CO_GW_SRV_PDO_READ 0x23
56 #define CO_GW_SRV_PDO_WRITE 0x24
59 #define CO_GW_SRV_RPDO 0x25
62 #define CO_GW_SRV_NMT_START 0x31
65 #define CO_GW_SRV_NMT_STOP 0x32
68 #define CO_GW_SRV_NMT_ENTER_PREOP 0x33
71 #define CO_GW_SRV_NMT_RESET_NODE 0x34
74 #define CO_GW_SRV_NMT_RESET_COMM 0x35
77 #define CO_GW_SRV_NMT_NG_ENABLE 0x36
80 #define CO_GW_SRV_NMT_NG_DISABLE 0x37
83 #define CO_GW_SRV_NMT_HB_ENABLE 0x38
86 #define CO_GW_SRV_NMT_HB_DISABLE 0x39
89 #define CO_GW_SRV_EC 0x3a
92 #define CO_GW_SRV_EMCY 0x42
95 #define CO_GW_SRV_INIT 0x51
98 #define CO_GW_SRV_SET_HB 0x54
101 #define CO_GW_SRV_SET_ID 0x55
104 #define CO_GW_SRV_EMCY_START 0x56
107 #define CO_GW_SRV_EMCY_STOP 0x57
110 #define CO_GW_SRV_SET_CMD_TIMEOUT 0x58
113 #define CO_GW_SRV_SET_BOOTUP_IND 0x59
116 #define CO_GW_SRV_SET_NET 0x61
119 #define CO_GW_SRV_SET_NODE 0x62
122 #define CO_GW_SRV_GET_VERSION 0x63
125 #define CO_GW_SRV_SET_CMD_SIZE 0x64
128 #define CO_GW_SRV_LSS_SWITCH 0x81
131 #define CO_GW_SRV_LSS_SWITCH_SEL 0x82
134 #define CO_GW_SRV_LSS_SET_ID 0x83
137 #define CO_GW_SRV_LSS_SET_RATE 0x84
140 #define CO_GW_SRV_LSS_SWITCH_RATE 0x85
143 #define CO_GW_SRV_LSS_STORE 0x86
146 #define CO_GW_SRV_LSS_GET_LSSID 0x87
149 #define CO_GW_SRV_LSS_GET_ID 0x88
152 #define CO_GW_SRV_LSS_ID_SLAVE 0x89
155 #define CO_GW_SRV_LSS_ID_NON_CFG_SLAVE 0x8a
158 #define CO_GW_SRV_SDO 0x93
161 #define CO_GW_SRV__LSS_SLOWSCAN 0x101
164 #define CO_GW_SRV__LSS_FASTSCAN 0x102
167 #define CO_GW_SRV__SYNC 0x103
170 #define CO_GW_SRV__TIME 0x104
173 #define CO_GW_SRV__BOOT 0x105
176 #define CO_GW_IEC_BAD_SRV 100
179 #define CO_GW_IEC_SYNTAX 101
182 #define CO_GW_IEC_INTERN 102
185 #define CO_GW_IEC_TIMEOUT 103
188 #define CO_GW_IEC_NO_DEF_NET 104
191 #define CO_GW_IEC_NO_DEF_NODE 105
194 #define CO_GW_IEC_BAD_NET 106
197 #define CO_GW_IEC_BAD_NODE 107
200 #define CO_GW_IEC_NG_OCCURRED 200
203 #define CO_GW_IEC_LG_OCCURRED 201
206 #define CO_GW_IEC_HB_RESOLVED 202
209 #define CO_GW_IEC_HB_OCCURRED 203
212 #define CO_GW_IEC_ST_OCCURRED 204
215 #define CO_GW_IEC_BOOTUP 205
218 #define CO_GW_IEC_CAN_PASSIVE 300
221 #define CO_GW_IEC_CAN_BUSOFF 301
224 #define CO_GW_IEC_CAN_OVERFLOW 303
227 #define CO_GW_IEC_CAN_INIT 304
230 #define CO_GW_IEC_CAN_ACTIVE 305
233 #define CO_GW_IEC_PDO_INUSE 400
236 #define CO_GW_IEC_PDO_LEN 401
239 #define CO_GW_IEC_LSS 501
242 #define CO_GW_IEC_LSS_ID 502
245 #define CO_GW_IEC_LSS_RATE 503
248 #define CO_GW_IEC_LSS_PARAM 504
251 #define CO_GW_IEC_LSS_MEDIA 505
254 #define CO_GW_IEC_NO_MEM 600
257 #if !defined(__cplusplus) || LELY_NO_CXX
349 #define CO_GW_REQ_SDO_DN_SIZE offsetof(struct co_gw_req_sdo_dn, val)
384 co_unsigned32_t
map[0x40];
388 #define CO_GW_REQ_SET_RPDO_SIZE offsetof(struct co_gw_req_set_rpdo, map)
415 co_unsigned32_t
map[0x40];
419 #define CO_GW_REQ_SET_TPDO_SIZE offsetof(struct co_gw_req_set_tpdo, map)
450 co_unsigned64_t
val[0x40];
454 #define CO_GW_REQ_PDO_WRITE_SIZE offsetof(struct co_gw_req_pdo_write, val)
725 #define CO_GW_CON_SDO_UP_SIZE offsetof(struct co_gw_con_sdo_up, val)
746 co_unsigned64_t
val[0x40];
750 #define CO_GW_CON_PDO_READ_SIZE offsetof(struct co_gw_con_pdo_read, val)
847 co_unsigned64_t
val[0x40];
851 #define CO_GW_IND_RPDO_SIZE offsetof(struct co_gw_ind_rpdo, val)
987 co_unsigned16_t net, co_unsigned16_t rate,
void *data);
992 void *__co_gw_alloc(
void);
993 void __co_gw_free(
void *ptr);
995 void __co_gw_fini(
struct __co_gw *gw);
1104 #endif // !LELY_CO_GW_H_
int srv
The service number.
void * data
A pointer to user-specified data.
co_unsigned16_t net
The network-ID.
co_unsigned32_t product_code
The product code.
co_unsigned16_t net
The network-ID.
co_unsigned16_t net
The network-ID.
co_unsigned8_t prot_hi
The protocol version (high number).
co_unsigned16_t idx
The object index.
co_unsigned8_t node
The node-ID.
int srv
The service number (CO_GW_SRV_EC).
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
co_unsigned32_t n
The command size (in bytes).
The parameters of a CANopen gateway 'Configure SDO time-out' request.
co_unsigned16_t num
The PDO number.
void * data
A pointer to user-specified data.
co_unsigned16_t gt
The guard time (in milliseconds).
int srv
The service number (CO_GW_SRV_RPDO).
co_unsigned16_t net
The network-ID.
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
co_unsigned32_t cobid
The COB-ID.
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
size_t size
The size of this struct (in bytes).
size_t size
The size of this struct (in bytes).
co_unsigned16_t net
The network-ID.
int srv
The service number.
int srv
The service number (CO_GW_SRV_SDO_UP).
unsigned cs
A flag indicating whether "boot-up event received" commands should be forwarded (1) or not (0).
int srv
The service number (CO_GW_SRV__SYNC).
co_unsigned32_t len
The length of the value (in bytes).
co_unsigned32_t nbyte
The transferred bytes.
unsigned int up
The transfer direction: download (0) or upload (1).
The parameters of a CANopen gateway 'LSS configure bit-rate' request.
void co_gw_rate_func_t(co_unsigned16_t net, co_unsigned16_t rate, void *data)
The type of a CANopen gateway 'set bit timing' function, invoked when a baudrate switch is needed aft...
co_unsigned32_t ac
The SDO abort code (0 on success).
size_t size
The size of this struct (in bytes).
int iec
The internal error code (0 on success).
void * data
A pointer to user-specified data.
co_unsigned32_t ac
The SDO abort code (0 on success).
co_unsigned8_t gw_class
The gateway class.
size_t size
The size of this struct (in bytes).
void co_gw_destroy(co_gw_t *gw)
Destroys a CANopen gateway.
co_unsigned16_t num
The PDO number.
co_unsigned16_t net
The network-ID.
co_unsigned8_t n
Number of mapped objects in PDO.
int srv
The service number (CO_GW_SRV_LSS_ID_SLAVE).
co_unsigned8_t node
The node-ID.
The common parameters of a CANopen gateway request.
int srv
The service number (CO_GW_SRV_SDO).
co_gw_t * co_gw_create(void)
Creates a new CANopen gateway.
The parameters of a CANopen gateway 'LSS inquire node-ID' confirmation.
co_unsigned16_t net
The network-ID.
void * data
A pointer to user-specified data.
int srv
The service number (CO_GW_SRV_EMCY_START or CO_GW_SRV_EMCY_STOP).
void co_gw_set_rate_func(co_gw_t *gw, co_gw_rate_func_t *func, void *data)
Sets the callback function invoked when a baudrate switch is needed after an 'Initialize gateway' com...
co_unsigned16_t net
The network-ID.
int srv
The service number (CO_GW_SRV_PDO_WRITE).
The common parameters of a CANopen gateway network-level request.
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
size_t size
The size of this struct (in bytes).
co_unsigned16_t ec
The emergency error code.
size_t size
The size of this struct (in bytes).
co_unsigned32_t ac
The SDO abort code (0 on success).
size_t size
The size of this struct (in bytes).
char es
The error status (in the range ['A'..'O'], or 0 on success).
The parameters of a CANopen gateway 'LSS switch state selective' request.
int co_gw_send_func_t(const struct co_gw_srv *srv, void *data)
The type of a CANopen gateway send callback function, invoked by a gateway when an indication or conf...
void * data
A pointer to user-specified data.
The parameters of a CANopen gateway 'RPDO received' indication.
co_unsigned8_t bitidx
The bit timing index.
The parameters of a CANopen gateway 'Set heartbeat producer' request.
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
int timeout
The SDO timeout (in milliseconds).
co_unsigned8_t cnt
The SYNC counter.
int iec
The internal error code (0 on success).
struct co_id id
The LSS address.
co_unsigned8_t subidx
The object sub-index.
The parameters of a CANopen gateway 'CiA 301 progress indication download' indication.
size_t size
The size of this struct (in bytes).
co_unsigned8_t bitidx
The bit timing index (in the range [0..9]).
int srv
The service number (CO_GW_SRV__LSS_SLOWSCAN or CO_GW_SRV__LSS_FASTSCAN).
int srv
The service number (CO_GW_SRV_PDO_READ).
co_unsigned16_t net
The network-ID.
co_unsigned8_t node
The node-ID.
The parameters of a Lely-specific gateway 'LSS Slowscan/Fastscan' request.
co_unsigned8_t n
Number of mapped objects in PDO.
co_unsigned8_t node
The node-ID.
co_unsigned16_t net
The network-ID.
co_unsigned16_t type
The data type.
size_t size
The size of this struct (in bytes).
int srv
The service number (CO_GW_SRV_SET_SDO_TIMEOUT).
co_unsigned16_t delay
The delay (in milliseconds).
void * data
A pointer to user-specified data.
The parameters of a CANopen gateway 'Read PDO' confirmation.
co_unsigned16_t ms
The heartbeat time (in milliseconds).
co_unsigned16_t net
The network-ID.
co_unsigned16_t net
The network-ID.
The parameters of a CANopen gateway 'Read PDO' request.
int co_gw_init_net(co_gw_t *gw, co_unsigned16_t id, co_nmt_t *nmt)
Registers a CANopen network with a gateway.
The parameters of a CANopen gateway 'SDO download' request.
co_unsigned8_t cs
The command specifier (one of 0x5a, 0x5b, 0x5c or 0x5d).
co_unsigned8_t prot_lo
The protocol version (low number).
size_t size
The size of this struct (in bytes).
co_unsigned32_t map[0x40]
An array of objects to be mapped.
int srv
The service number (CO_GW_SRV_GET_VERSION).
co_unsigned16_t net
The network-ID.
co_unsigned16_t net
The network-ID.
The parameters of a CANopen gateway 'SDO upload' confirmation.
co_unsigned64_t val[0x40]
An array of object values.
co_unsigned16_t net
The network-ID.
co_unsigned32_t revision
The revision number.
co_unsigned16_t num
The PDO number.
co_unsigned16_t net
The network-ID.
co_unsigned32_t ac
The SDO abort code (0 on success).
The parameters of a CANopen gateway 'LSS identify remote slave' request.
int srv
The service number (CO_GW_SRV_SET_RPDO).
void * data
A pointer to user-specified data.
The common parameters of a CANopen gateway confirmation.
int srv
The service number (CO_GW_SRV_SET_CMD_TIMEOUT).
co_unsigned16_t net
The network-ID.
The parameters of a CANopen gateway 'LSS activate new bit-rate' request.
int srv
The service number (CO_GW_SRV_SET_BOOTUP_IND).
co_unsigned64_t val[0x40]
An array of object values.
co_unsigned16_t net
The network-ID.
void * data
A pointer to user-specified data.
size_t size
The size of this struct (in bytes).
int iec
The internal error code (0 on success).
co_unsigned8_t bitsel
The bit timing selector.
size_t size
The size of this struct (in bytes).
co_unsigned16_t type
The data type.
size_t size
The size of this struct (in bytes).
int co_gw_recv(co_gw_t *gw, const struct co_gw_req *req)
Receives and processes a request with a CANopen gateway.
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
void * data
A pointer to user-specified data.
co_unsigned8_t id
The node-ID.
co_unsigned32_t serial_nr
The serial number.
int srv
The service number (CO_GW_SRV_INIT).
uint_least8_t val[1]
The (first byte in the) value.
co_unsigned32_t id
The LSS number.
co_unsigned8_t sync
The SYNC start value.
int srv
The service number.
The parameters of a CANopen gateway 'Enable node guarding' request.
struct co_id lo
The lower bound of the LSS address.
co_unsigned8_t st
The state of the node, or 0 in case of a boot-up event.
co_unsigned16_t net
The network-ID.
co_unsigned8_t mode
0 for waiting state, 1 for configuration state.
The parameters of a CANopen gateway 'Boot-up forwarding' request.
void * data
A pointer to user-specified data.
size_t size
The size of this struct (in bytes).
The parameters of a CANopen gateway 'Start heartbeat consumer' request.
int co_gw_fini_net(co_gw_t *gw, co_unsigned16_t id)
Unregisters a CANopen network with a gateway.
co_unsigned8_t ltf
The lifetime factor.
co_unsigned32_t cobid
The COB-ID.
int srv
The service number (CO_GW_SRV_SET_TPDO).
size_t size
The size of this struct (in bytes).
The parameters of a CANopen gateway 'Initialize gateway' request.
size_t size
The size of this struct (in bytes).
co_unsigned16_t ms
The heartbeat time (in milliseconds).
The parameters of a CANopen gateway 'Start/Stop emergency consumer' request.
The parameters of a CANopen gateway 'Inquire LSS address' confirmation.
struct co_id id_2
In case of an LSS Slowscan request, the upper bound of the LSS address; in case of an LSS Fastscan re...
int srv
The service number (CO_GW_SRV_LSS_SET_RATE).
int srv
The service number (CO_GW_SRV__TIME).
uint_least8_t val[1]
The (first byte in the) value.
The parameters of a CANopen gateway 'Inquire LSS address' request.
The parameters of a Lely-specific gateway 'Synchronization event received' indication.
co_unsigned8_t n
Number of mapped objects in PDO.
co_unsigned8_t er
The error register.
co_unsigned8_t node
The node-ID.
co_unsigned8_t trans
The transmission type.
size_t size
The size of this struct (in bytes).
size_t size
The size of this struct (in bytes).
The parameters of a CANopen gateway 'Write PDO' request.
void * data
A pointer to user-specified data.
The parameters of a CANopen gateway 'Get version' confirmation.
co_unsigned8_t n
Number of mapped objects in PDO.
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
A CANopen NMT master/slave service.
co_unsigned16_t num
The PDO number.
co_unsigned8_t node
The node-ID.
The parameters of a Lely-specific gateway 'Boot slave process completed' indication.
co_unsigned16_t num
The PDO number.
co_unsigned16_t num
The PDO number.
void co_gw_set_send_func(co_gw_t *gw, co_gw_send_func_t *func, void *data)
Sets the callback function used to send indications and confirmations from a CANopen gateway.
size_t size
The size of this struct (in bytes).
int iec
The internal error code (0 on success).
int srv
The service number.
co_unsigned16_t net
The network-ID.
int srv
The service number (CO_GW_SRV_LSS_SWITCH_SEL).
size_t size
The size of this struct (in bytes).
The parameters of a CANopen gateway 'Configure TPDO' request.
void * data
A pointer to user-specified data.
co_unsigned16_t idx
The object index.
void co_gw_get_send_func(const co_gw_t *gw, co_gw_send_func_t **pfunc, void **pdata)
Retrieves the callback function used to send indications and confirmations from a CANopen gateway.
co_unsigned8_t node
The node-ID.
co_unsigned16_t net
The network-ID.
size_t size
The size of this struct (in bytes).
co_unsigned32_t vendor_id
The vendor-ID.
co_unsigned16_t net
The network-ID.
co_unsigned8_t subidx
The object sub-index.
void * data
A pointer to user-specified data.
co_unsigned16_t net
The network-ID.
The parameters of a CANopen gateway 'Configure RPDO' request.
co_unsigned8_t node
The node-ID.
The parameters of a CANopen gateway 'Emergency event received' indication.
int srv
The service number (CO_GW_SRV_EMCY).
void * data
A pointer to user-specified data.
co_unsigned8_t n
Number of mapped objects in PDO.
co_unsigned64_t val[0x40]
An array of object values.
size_t size
The size of this struct (in bytes).
const char * co_gw_iec2str(int iec)
Returns a string describing an internal error code.
int iec
The internal error code (0 on success).
The parameters of a CANopen gateway 'Set command time-out' request.
int iec
The internal error code (0 on success).
int srv
The service number (CO_GW_SRV_SDO_DN).
The parameters of a CANopen gateway 'Set command size' request.
size_t size
The size of this struct (in bytes).
co_unsigned32_t ac
The SDO abort code (0 on success).
co_unsigned16_t net
The network-ID.
co_unsigned8_t node
The node-ID.
co_unsigned16_t net
The network-ID.
co_unsigned16_t net
The network-ID.
co_unsigned8_t st
The the state of the node (including the toggle bit).
The parameters of a CANopen gateway 'LSS switch state global' request.
co_unsigned16_t net
The network-ID.
int iec
The internal error code (0 on success).
co_unsigned16_t inhibit
The inhibit time.
int srv
The service number (CO_GW_SRV_LSS_GET_LSSID).
co_unsigned16_t event
The event timer.
int srv
The service number (CO_GW_SRV_PDO_READ).
size_t size
The size of this struct (in bytes).
co_unsigned32_t ac
The SDO abort code (0 on success).
void * data
A pointer to user-specified data.
struct co_id hi
The upper bound of the LSS address.
int srv
The service number (CO_GW_SRV__BOOT).
void * data
A pointer to user-specified data.
int srv
The service number.
void * data
A pointer to user-specified data.
int srv
The service number (CO_GW_SRV_SET_HB).
size_t size
The size of this struct (in bytes).
size_t size
The size of this struct (in bytes).
size_t size
The size of this struct (in bytes).
void * data
A pointer to user-specified data.
The common parameters of a CANopen gateway service.
int srv
The service number (CO_GW_SRV__LSS_SLOWSCAN or CO_GW_SRV__LSS_FASTSCAN).
int iec
The internal error code (0 on success).
The parameters of a Lely-specific gateway 'Time stamp event received' indication.
void * data
A pointer to user-specified data.
size_t size
The size of this struct (in bytes).
size_t size
The size of this struct (in bytes).
co_unsigned16_t net
The network-ID.
co_unsigned32_t _size
The Lely-specific total value size (in bytes).
co_unsigned8_t node
The node-ID.
void * data
A pointer to user-specified data.
int srv
The service number (CO_GW_SRV_SDO_UP).
void * data
A pointer to user-specified data.
int srv
The service number (CO_GW_SRV_SET_CMD_TIMEOUT).
co_unsigned32_t ac
The SDO abort code (0 on success).
int srv
The service number (CO_GW_SRV_NMT_NG_ENABLE).
int srv
The service number (CO_GW_SRV_LSS_GET_ID).
void * data
A pointer to user-specified data.
void * data
A pointer to user-specified data.
size_t size
The size of this struct (in bytes).
co_unsigned8_t msef[5]
The manufacturer-specific error code.
The parameters of a Lely-specific gateway 'LSS Slowscan/Fastscan' confirmation.
void * data
A pointer to user-specified data.
int srv
The service number (CO_GW_SRV_LSS_SWITCH_RATE).
size_t size
The size of this struct (in bytes).
The parameters of a CANopen gateway 'SDO upload' request.
co_unsigned16_t net
The network-ID.
co_unsigned32_t cobid
The COB-ID.
int srv
The service number (CO_GW_SRV_NMT_HB_ENABLE).
struct timespec ts
The absolute time.
int timeout
The command timeout (in milliseconds).
size_t size
The size of this struct (in bytes).
co_unsigned16_t net
The network-ID.
void * data
A pointer to user-specified data.
The parameters of a CANopen gateway 'Error control event received' indication.
co_unsigned32_t len
The length of the value (in bytes).
co_unsigned8_t trans
The transmission type.
int srv
The service number (CO_GW_SRV_LSS_SWITCH).
struct co_id id_1
In case of an LSS Slowscan request, the lower bound of the LSS address; in case of an LSS Fastscan re...
size_t size
The size of this struct (in bytes).
co_unsigned32_t map[0x40]
An array of objects to be mapped.
void * data
A pointer to user-specified data of the SDO upload/download request.
struct co_id id
The LSS address of the slave to be configured.
The common parameters of a CANopen gateway node-level request.
void co_gw_get_rate_func(const co_gw_t *gw, co_gw_rate_func_t **pfunc, void **pdata)
Retrieves the callback function invoked when a baudrate switch is needed after an 'Initialize gateway...
int srv
The service number (CO_GW_SRV_LSS_GET_LSSID).