|
typedef struct ec_soe | ec_soe_t |
| SoE mailbox struct type.
|
|
typedef struct PACKED ec_soe_idn_attribute | ec_soe_idn_attribute_t |
| ServoDrive attributes of an IDN.
|
|
|
void | ec_soe_init (ec_t *pec, osal_uint16_t slave) |
| initialize SoE structure
|
|
void | ec_soe_deinit (ec_t *pec, osal_uint16_t slave) |
| deinitialize SoE structure
|
|
void | ec_soe_enqueue (ec_t *pec, osal_uint16_t slave, pool_entry_t *p_entry) |
| Enqueue SoE message received from slave.
|
|
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.
|
|
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_generate_mapping (ec_t *pec, osal_uint16_t slave) |
| Generate sync manager process data mapping via soe.
|
|
This modules contains EtherCAT SoE mailbox functions.
◆ ec_soe_element
ServoDrive elements of an IDN.
Enumerator |
---|
EC_SOE_DATASTATE | idn data state
|
EC_SOE_NAME | idn name
|
EC_SOE_ATTRIBUTE | idn attributes
|
EC_SOE_UNIT | idn unit
|
EC_SOE_MIN | idn minimum value
|
EC_SOE_MAX | idn maximum value
|
EC_SOE_VALUE | idn value
|
EC_SOE_DEFAULT | idn data/default
|
◆ ec_soe_deinit()
void ec_soe_deinit |
( |
ec_t * |
pec, |
|
|
osal_uint16_t |
slave |
|
) |
| |
deinitialize SoE structure
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
◆ ec_soe_enqueue()
Enqueue SoE message received from slave.
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
[in] | p_entry | Pointer to pool entry containing received mailbox message from slave. |
◆ ec_soe_generate_mapping()
int ec_soe_generate_mapping |
( |
ec_t * |
pec, |
|
|
osal_uint16_t |
slave |
|
) |
| |
Generate sync manager process data mapping via soe.
This calculates the sync managers size according to the slave's ServoDrive configuration. Therefore it reads IDN 16 and IDN 24 to calculate the sync manager 2/3 sizes.
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
- Return values
-
EC_OK | SoE transfer was successfull. |
EC_ERROR_MAILBOX_TIMEOUT | Got timeout waiting for message. |
EC_ERROR_MAILBOX_NOT_SUPPORTED_SOE | No SoE support on slave's mailbox. |
EC_ERROR_MAILBOX_OUT_OF_WRITE_BUFFERS | No more free write buffer available. |
◆ ec_soe_init()
void ec_soe_init |
( |
ec_t * |
pec, |
|
|
osal_uint16_t |
slave |
|
) |
| |
initialize SoE structure
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
◆ ec_soe_read()
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.
This reads all ID number elements from given EtherCAT slave's drive number. This function enables read access to the ServoDrive dictionary on SoE enabled devices. The call to ec_soe_read is a synchronous call and will block until it's either finished or aborted.
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
[in] | atn | AT number according to ServoDrive Bus Specification. In most cases this will be 0, if you are using a multi-drive device this may be 0,1,... . |
[in] | idn | ID number according to ServoDrive Bus Specification. IDN's in range 1...32767 are described in the Specification, IDN's greater 32768 are manufacturer specific. |
[in,out] | elements | ServoDrive elements according to ServoDrive Bus Specification. |
[in,out] | buf | Buffer for where to store the answer. |
[in,out] | len | Length of buf , see 'buf' descriptions. Returns length of answer. |
- Return values
-
EC_OK | SoE transfer was successfull. |
EC_ERROR_MAILBOX_TIMEOUT | Got timeout waiting for message. |
EC_ERROR_MAILBOX_NOT_SUPPORTED_SOE | No SoE support on slave's mailbox. |
EC_ERROR_MAILBOX_OUT_OF_WRITE_BUFFERS | No more free write buffer available. |
◆ ec_soe_write()
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.
This writes all ID number elements from given EtherCAT slave's drive number. This function enables write access to the ServoDrive dictionary on SoE enabled devices. The call to ec_soe_read is a synchronous call and will block until it's either finished or aborted.
- Parameters
-
[in] | pec | Pointer to ethercat master structure, which you got from ec_open. |
[in] | slave | Number of ethercat slave. this depends on the physical order of the ethercat slaves (usually the n'th slave attached). |
[in] | atn | AT number according to ServoDrive Bus Specification. In most cases this will be 0, if you are using a multi-drive device this may be 0,1,... . |
[in] | idn | ID number according to ServoDrive Bus Specification. IDN's in range 1...32767 are described in the Specification, IDN's greater 32768 are manufacturer specific. |
[in] | elements | ServoDrive elements according to ServoDrive Bus Specification. |
[in] | buf | Buffer with values to write to the given idn . |
[in] | len | Length of buf . |
- Return values
-
EC_OK | SoE transfer was successfull. |
EC_ERROR_MAILBOX_TIMEOUT | Got timeout waiting for message. |
EC_ERROR_MAILBOX_NOT_SUPPORTED_SOE | No SoE support on slave's mailbox. |
EC_ERROR_MAILBOX_OUT_OF_WRITE_BUFFERS | No more free write buffer available. |