ethercatsoe.c File Reference

Servo over EtherCAT (SoE) Module. More...

#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include "ethercattype.h"
#include "nicdrv.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatsoe.h"
Include dependency graph for ethercatsoe.c:

Go to the source code of this file.

Data Structures

struct  PACKED
 SDO structure, not to be confused with EcSDOserviceT. More...

Typedefs

typedef struct PACKED ec_SoEt
 SoE (Servo over EtherCAT) mailbox structure.

Functions

void ec_SoEerror (uint16 Slave, uint16 idn, uint16 Error)
 Report SoE error.
int ec_SoEread (uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout)
 SoE read, blocking.
int ec_SoEwrite (uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout)
 SoE write, blocking.
int ec_readIDNmap (uint16 slave, int *Osize, int *Isize)
 SoE read AT and MTD mapping.

Detailed Description

Servo over EtherCAT (SoE) Module.

Definition in file ethercatsoe.c.


Typedef Documentation

typedef struct PACKED ec_SoEt

SoE (Servo over EtherCAT) mailbox structure.


Function Documentation

int ec_readIDNmap ( uint16  slave,
int *  Osize,
int *  Isize 
)

SoE read AT and MTD mapping.

SoE has standard indexes defined for mapping. This function tries to read them and collect a full input and output mapping size of designated slave.

Parameters:
[in] Slave = Slave number
[out] Osize = Size in bits of output mapping (MTD) found
[out] Isize = Size in bits of input mapping (AT) found
Returns:
>0 if mapping succesful.

Definition at line 343 of file ethercatsoe.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void ec_SoEerror ( uint16  Slave,
uint16  idn,
uint16  Error 
)

Report SoE error.

Parameters:
[in] Slave = Slave number
[in] idn = IDN that generated error
[in] Error = Error code, see EtherCAT documentation for list

Definition at line 82 of file ethercatsoe.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int ec_SoEread ( uint16  slave,
uint8  driveNo,
uint8  elementflags,
uint16  idn,
int *  psize,
void *  p,
int  timeout 
)

SoE read, blocking.

The IDN object of the selected slave and DriveNo is read. If a response is larger than the mailbox size then the response is segmented. The function will combine all segments and copy them to the parameter buffer.

Parameters:
[in] slave = Slave number
[in] driveNo = Drive number in slave
[in] elementflags = Flags to select what properties of IDN are to be transfered.
[in] idn = IDN.
[in,out] psize = Size in bytes of parameter buffer, returns bytes read from SoE.
[out] p = Pointer to parameter buffer
[in] timeout = Timeout in us, standard is EC_TIMEOUTRXM
Returns:
Workcounter from last slave response

Definition at line 111 of file ethercatsoe.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int ec_SoEwrite ( uint16  slave,
uint8  driveNo,
uint8  elementflags,
uint16  idn,
int  psize,
void *  p,
int  timeout 
)

SoE write, blocking.

The IDN object of the selected slave and DriveNo is written. If a response is larger than the mailbox size then the response is segmented.

Parameters:
[in] slave = Slave number
[in] driveNo = Drive number in slave
[in] elementflags = Flags to select what properties of IDN are to be transfered.
[in] idn = IDN.
[in] psize = Size in bytes of parameter buffer.
[out] p = Pointer to parameter buffer
[in] timeout = Timeout in us, standard is EC_TIMEOUTRXM
Returns:
Workcounter from last slave response

Definition at line 232 of file ethercatsoe.c.

Here is the call graph for this function:

Generated by  doxygen 1.6.3