libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
soe.h
Go to the documentation of this file.
1
13/*
14 * This file is part of libethercat.
15 *
16 * libethercat is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 3 of the License, or (at your option) any later version.
20 *
21 * libethercat is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with libethercat (LICENSE.LGPL-V3); if not, write
28 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
29 * Floor, Boston, MA 02110-1301, USA.
30 *
31 * Please note that the use of the EtherCAT technology, the EtherCAT
32 * brand name and the EtherCAT logo is only permitted if the property
33 * rights of Beckhoff Automation GmbH are observed. For further
34 * information please contact Beckhoff Automation GmbH & Co. KG,
35 * Hülshorstweg 20, D-33415 Verl, Germany (www.beckhoff.com) or the
36 * EtherCAT Technology Group, Ostendstraße 196, D-90482 Nuremberg,
37 * Germany (ETG, www.ethercat.org).
38 *
39 */
40
41#ifndef LIBETHERCAT_SOE_H
42#define LIBETHERCAT_SOE_H
43
44#include <libosal/types.h>
45#include <libosal/mutex.h>
46
47#include "libethercat/common.h"
48
56typedef struct ec_soe {
58 osal_mutex_t lock;
60
62typedef struct PACKED ec_soe_idn_attribute {
63 osal_uint32_t evafactor :16;
64 osal_uint32_t length :2;
65 osal_uint32_t list :1;
66 osal_uint32_t command :1;
67 osal_uint32_t datatype :3;
68 osal_uint32_t reserved1 :1;
69 osal_uint32_t decimals :4;
70 osal_uint32_t wp_preop :1;
71 osal_uint32_t wp_safeop :1;
72 osal_uint32_t wp_op :1;
73 osal_uint32_t reserved2 :1;
75
87
88#ifdef __cplusplus
89extern "C" {
90#endif
91
93
100void ec_soe_init(ec_t *pec, osal_uint16_t slave);
101
103
110void ec_soe_deinit(ec_t *pec, osal_uint16_t slave);
111
113
122void ec_soe_enqueue(ec_t *pec, osal_uint16_t slave, pool_entry_t *p_entry);
123
125
150int ec_soe_read(ec_t *pec, osal_uint16_t slave, osal_uint8_t atn, osal_uint16_t idn,
151 osal_uint8_t *elements, osal_uint8_t *buf, osal_size_t *len);
152
154
179int ec_soe_write(ec_t *pec, osal_uint16_t slave, osal_uint8_t atn, osal_uint16_t idn,
180 osal_uint8_t elements, osal_uint8_t *buf, osal_size_t len);
181
183
198int ec_soe_generate_mapping(ec_t *pec, osal_uint16_t slave);
199
200#ifdef __cplusplus
201}
202#endif
203
206#endif // LIBETHERCAT_SOE_H
207
ethercat master common stuff
int ec_soe_write(ec_t *pec, osal_uint16_t slave, osal_uint8_t atn, osal_uint16_t idn, osal_uint8_t elements, osal_uint8_t *buf, osal_size_t len)
Write elements of soe ID number.
int ec_soe_read(ec_t *pec, osal_uint16_t slave, osal_uint8_t atn, osal_uint16_t idn, osal_uint8_t *elements, osal_uint8_t *buf, osal_size_t *len)
Read elements of soe ID number.
void ec_soe_init(ec_t *pec, osal_uint16_t slave)
initialize SoE structure
ec_soe_element
ServoDrive elements of an IDN.
Definition soe.h:77
void ec_soe_enqueue(ec_t *pec, osal_uint16_t slave, pool_entry_t *p_entry)
Enqueue SoE message received from slave.
struct ec_soe ec_soe_t
SoE mailbox struct type.
void ec_soe_deinit(ec_t *pec, osal_uint16_t slave)
deinitialize SoE structure
struct PACKED ec_soe_idn_attribute ec_soe_idn_attribute_t
ServoDrive attributes of an IDN.
int ec_soe_generate_mapping(ec_t *pec, osal_uint16_t slave)
Generate sync manager process data mapping via soe.
@ EC_SOE_DEFAULT
idn data/default
Definition soe.h:85
@ EC_SOE_VALUE
idn value
Definition soe.h:84
@ EC_SOE_DATASTATE
idn data state
Definition soe.h:78
@ EC_SOE_NAME
idn name
Definition soe.h:79
@ EC_SOE_MIN
idn minimum value
Definition soe.h:82
@ EC_SOE_MAX
idn maximum value
Definition soe.h:83
@ EC_SOE_ATTRIBUTE
idn attributes
Definition soe.h:80
@ EC_SOE_UNIT
idn unit
Definition soe.h:81
ServoDrive attributes of an IDN.
Definition soe.h:62
osal_uint32_t command
IDN is command.
Definition soe.h:66
osal_uint32_t reserved1
for future use.
Definition soe.h:68
osal_uint32_t reserved2
for future use.
Definition soe.h:73
osal_uint32_t evafactor
Evalution factor .
Definition soe.h:63
osal_uint32_t length
IDN length.
Definition soe.h:64
osal_uint32_t decimals
If float, number of decimals.
Definition soe.h:69
osal_uint32_t wp_op
Write protect in OP.
Definition soe.h:72
osal_uint32_t wp_safeop
Write protect in SAFEOP.
Definition soe.h:71
osal_uint32_t datatype
Datatype according to ServoDrive Specification.
Definition soe.h:67
osal_uint32_t list
IDN is list.
Definition soe.h:65
osal_uint32_t wp_preop
Write protect in PREOP.
Definition soe.h:70
Definition soe.h:56
pool_t recv_pool
Mailbox received messages pool.
Definition soe.h:57
osal_mutex_t lock
Mailbox lock.
Definition soe.h:58
ethercat master structure
Definition ec.h:188
Pool queue entry.
Definition pool.h:67
the datagram pool itself
Definition pool.h:81