IgH EtherCAT Master
1.6.2
|
Methods of an EtherCAT datagram. More...
Go to the source code of this file.
Functions | |
void | ec_datagram_init (ec_datagram_t *datagram) |
Constructor. More... | |
void | ec_datagram_clear (ec_datagram_t *datagram) |
Destructor. More... | |
void | ec_datagram_unqueue (ec_datagram_t *datagram) |
Unqueue datagram. More... | |
int | ec_datagram_prealloc (ec_datagram_t *datagram, size_t size) |
Allocates internal payload memory. More... | |
void | ec_datagram_zero (ec_datagram_t *datagram) |
Fills the datagram payload memory with zeros. More... | |
int | ec_datagram_aprd (ec_datagram_t *datagram, uint16_t ring_position, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT APRD datagram. More... | |
int | ec_datagram_apwr (ec_datagram_t *datagram, uint16_t ring_position, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT APWR datagram. More... | |
int | ec_datagram_aprw (ec_datagram_t *datagram, uint16_t ring_position, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT APRW datagram. More... | |
int | ec_datagram_armw (ec_datagram_t *datagram, uint16_t ring_position, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT ARMW datagram. More... | |
int | ec_datagram_fprd (ec_datagram_t *datagram, uint16_t configured_address, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT FPRD datagram. More... | |
int | ec_datagram_fpwr (ec_datagram_t *datagram, uint16_t configured_address, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT FPWR datagram. More... | |
int | ec_datagram_fprw (ec_datagram_t *datagram, uint16_t configured_address, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT FPRW datagram. More... | |
int | ec_datagram_frmw (ec_datagram_t *datagram, uint16_t configured_address, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT FRMW datagram. More... | |
int | ec_datagram_brd (ec_datagram_t *datagram, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT BRD datagram. More... | |
int | ec_datagram_bwr (ec_datagram_t *datagram, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT BWR datagram. More... | |
int | ec_datagram_brw (ec_datagram_t *datagram, uint16_t mem_address, size_t data_size) |
Initializes an EtherCAT BRW datagram. More... | |
int | ec_datagram_lrd (ec_datagram_t *datagram, uint32_t offset, size_t data_size) |
Initializes an EtherCAT LRD datagram. More... | |
int | ec_datagram_lwr (ec_datagram_t *datagram, uint32_t offset, size_t data_size) |
Initializes an EtherCAT LWR datagram. More... | |
int | ec_datagram_lrw (ec_datagram_t *datagram, uint32_t offset, size_t data_size) |
Initializes an EtherCAT LRW datagram. More... | |
int | ec_datagram_lrd_ext (ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory) |
Initializes an EtherCAT LRD datagram with external memory. More... | |
int | ec_datagram_lwr_ext (ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory) |
Initializes an EtherCAT LWR datagram with external memory. More... | |
int | ec_datagram_lrw_ext (ec_datagram_t *datagram, uint32_t offset, size_t data_size, uint8_t *external_memory) |
Initializes an EtherCAT LRW datagram with external memory. More... | |
void | ec_datagram_print_state (const ec_datagram_t *datagram) |
Prints the state of a datagram. More... | |
void | ec_datagram_print_wc_error (const ec_datagram_t *datagram) |
Evaluates the working counter of a single-cast datagram. More... | |
void | ec_datagram_output_stats (ec_datagram_t *datagram) |
Outputs datagram statistics at most every second. | |
const char * | ec_datagram_type_string (const ec_datagram_t *datagram) |
Returns a string describing the datagram type. More... | |
Variables | |
static const char * | type_strings [] |
Array of datagram type strings used in ec_datagram_type_string(). More... | |
Methods of an EtherCAT datagram.
Definition in file datagram.c.
void ec_datagram_init | ( | ec_datagram_t * | datagram | ) |
void ec_datagram_clear | ( | ec_datagram_t * | datagram | ) |
void ec_datagram_unqueue | ( | ec_datagram_t * | datagram | ) |
int ec_datagram_prealloc | ( | ec_datagram_t * | datagram, |
size_t | size | ||
) |
Allocates internal payload memory.
If the allocated memory is already larger than requested, nothing ist done.
datagram | EtherCAT datagram. |
size | New payload size in bytes. |
Definition at line 142 of file datagram.c.
void ec_datagram_zero | ( | ec_datagram_t * | datagram | ) |
Fills the datagram payload memory with zeros.
datagram | EtherCAT datagram. |
Definition at line 170 of file datagram.c.
int ec_datagram_aprd | ( | ec_datagram_t * | datagram, |
uint16_t | ring_position, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT APRD datagram.
datagram | EtherCAT datagram. |
ring_position | Auto-increment address. |
mem_address | Physical memory address. |
data_size | Number of bytes to read. |
Definition at line 181 of file datagram.c.
int ec_datagram_apwr | ( | ec_datagram_t * | datagram, |
uint16_t | ring_position, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT APWR datagram.
datagram | EtherCAT datagram. |
ring_position | Auto-increment address. |
mem_address | Physical memory address. |
data_size | Number of bytes to write. |
Definition at line 202 of file datagram.c.
int ec_datagram_aprw | ( | ec_datagram_t * | datagram, |
uint16_t | ring_position, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT APRW datagram.
datagram | EtherCAT datagram. |
ring_position | Auto-increment address. |
mem_address | Physical memory address. |
data_size | Number of bytes to write. |
Definition at line 223 of file datagram.c.
int ec_datagram_armw | ( | ec_datagram_t * | datagram, |
uint16_t | ring_position, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT ARMW datagram.
datagram | EtherCAT datagram. |
ring_position | Auto-increment address. |
mem_address | Physical memory address. |
data_size | Number of bytes to read. |
Definition at line 244 of file datagram.c.
int ec_datagram_fprd | ( | ec_datagram_t * | datagram, |
uint16_t | configured_address, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT FPRD datagram.
datagram | EtherCAT datagram. |
configured_address | Configured station address. |
mem_address | Physical memory address. |
data_size | Number of bytes to read. |
Definition at line 265 of file datagram.c.
int ec_datagram_fpwr | ( | ec_datagram_t * | datagram, |
uint16_t | configured_address, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT FPWR datagram.
datagram | EtherCAT datagram. |
configured_address | Configured station address. |
mem_address | Physical memory address. |
data_size | Number of bytes to write. |
Definition at line 290 of file datagram.c.
int ec_datagram_fprw | ( | ec_datagram_t * | datagram, |
uint16_t | configured_address, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT FPRW datagram.
datagram | EtherCAT datagram. |
configured_address | Configured station address. |
mem_address | Physical memory address. |
data_size | Number of bytes to write. |
Definition at line 315 of file datagram.c.
int ec_datagram_frmw | ( | ec_datagram_t * | datagram, |
uint16_t | configured_address, | ||
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT FRMW datagram.
datagram | EtherCAT datagram. |
configured_address | Configured station address. |
mem_address | Physical memory address. |
data_size | Number of bytes to write. |
Definition at line 340 of file datagram.c.
int ec_datagram_brd | ( | ec_datagram_t * | datagram, |
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT BRD datagram.
datagram | EtherCAT datagram. |
mem_address | Physical memory address. |
data_size | Number of bytes to read. |
Definition at line 365 of file datagram.c.
int ec_datagram_bwr | ( | ec_datagram_t * | datagram, |
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT BWR datagram.
datagram | EtherCAT datagram. |
mem_address | Physical memory address. |
data_size | Number of bytes to write. |
Definition at line 385 of file datagram.c.
int ec_datagram_brw | ( | ec_datagram_t * | datagram, |
uint16_t | mem_address, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT BRW datagram.
datagram | EtherCAT datagram. |
mem_address | Physical memory address. |
data_size | Number of bytes to write. |
Definition at line 405 of file datagram.c.
int ec_datagram_lrd | ( | ec_datagram_t * | datagram, |
uint32_t | offset, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT LRD datagram.
datagram | EtherCAT datagram. |
offset | Logical address. |
data_size | Number of bytes to read/write. |
Definition at line 425 of file datagram.c.
int ec_datagram_lwr | ( | ec_datagram_t * | datagram, |
uint32_t | offset, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT LWR datagram.
datagram | EtherCAT datagram. |
offset | Logical address. |
data_size | Number of bytes to read/write. |
Definition at line 444 of file datagram.c.
int ec_datagram_lrw | ( | ec_datagram_t * | datagram, |
uint32_t | offset, | ||
size_t | data_size | ||
) |
Initializes an EtherCAT LRW datagram.
datagram | EtherCAT datagram. |
offset | Logical address. |
data_size | Number of bytes to read/write. |
Definition at line 463 of file datagram.c.
int ec_datagram_lrd_ext | ( | ec_datagram_t * | datagram, |
uint32_t | offset, | ||
size_t | data_size, | ||
uint8_t * | external_memory | ||
) |
Initializes an EtherCAT LRD datagram with external memory.
datagram | EtherCAT datagram. |
offset | Logical address. |
data_size | Number of bytes to read/write. |
external_memory | Pointer to the memory to use. |
Definition at line 485 of file datagram.c.
int ec_datagram_lwr_ext | ( | ec_datagram_t * | datagram, |
uint32_t | offset, | ||
size_t | data_size, | ||
uint8_t * | external_memory | ||
) |
Initializes an EtherCAT LWR datagram with external memory.
datagram | EtherCAT datagram. |
offset | Logical address. |
data_size | Number of bytes to read/write. |
external_memory | Pointer to the memory to use. |
Definition at line 510 of file datagram.c.
int ec_datagram_lrw_ext | ( | ec_datagram_t * | datagram, |
uint32_t | offset, | ||
size_t | data_size, | ||
uint8_t * | external_memory | ||
) |
Initializes an EtherCAT LRW datagram with external memory.
datagram | EtherCAT datagram. |
offset | Logical address. |
data_size | Number of bytes to read/write. |
external_memory | Pointer to the memory to use. |
Definition at line 535 of file datagram.c.
void ec_datagram_print_state | ( | const ec_datagram_t * | datagram | ) |
Prints the state of a datagram.
Outputs a text message.
datagram | EtherCAT datagram |
Definition at line 557 of file datagram.c.
void ec_datagram_print_wc_error | ( | const ec_datagram_t * | datagram | ) |
Evaluates the working counter of a single-cast datagram.
Outputs an error message.
datagram | EtherCAT datagram |
Definition at line 594 of file datagram.c.
const char* ec_datagram_type_string | ( | const ec_datagram_t * | datagram | ) |
Returns a string describing the datagram type.
datagram | EtherCAT datagram. |
Definition at line 637 of file datagram.c.
|
static |
Array of datagram type strings used in ec_datagram_type_string().
Definition at line 58 of file datagram.c.