Defines | Functions
ethercatconfig.c File Reference

Configuration module for EtherCAT master. More...

#include <stdio.h>
#include <string.h>
#include "ethercat_soem/osal.h"
#include "ethercat_soem/oshw.h"
#include "ethercat_soem/ethercattype.h"
#include "ethercat_soem/ethercatbase.h"
#include "ethercat_soem/ethercatmain.h"
#include "ethercat_soem/ethercatcoe.h"
#include "ethercat_soem/ethercatsoe.h"
#include "ethercat_soem/ethercatconfig.h"
Include dependency graph for ethercatconfig.c:

Go to the source code of this file.

Defines

#define EC_DEFAULTDOSM0   0x00010044
#define EC_DEFAULTMBXSM0   0x00010026
#define EC_DEFAULTMBXSM1   0x00010022
#define EC_PRINT(...)   do {} while (0)

Functions

int ecx_config_init (ecx_contextt *context, uint8 usetable)
int ecx_config_map_group (ecx_contextt *context, void *pIOmap, uint8 group)
int ecx_reconfig_slave (ecx_contextt *context, uint16 slave, int timeout)
int ecx_recover_slave (ecx_contextt *context, uint16 slave, int timeout)

Detailed Description

Configuration module for EtherCAT master.

After successful initialisation with ec_init() or ec_init_redundant() the slaves can be auto configured with this module.

Definition in file ethercatconfig.c.


Define Documentation

#define EC_DEFAULTDOSM0   0x00010044

standard SM0 flags configuration for digital output slaves

Definition at line 107 of file ethercatconfig.c.

#define EC_DEFAULTMBXSM0   0x00010026

standard SM0 flags configuration for mailbox slaves

Definition at line 103 of file ethercatconfig.c.

#define EC_DEFAULTMBXSM1   0x00010022

standard SM1 flags configuration for mailbox slaves

Definition at line 105 of file ethercatconfig.c.

#define EC_PRINT (   ...)    do {} while (0)

Definition at line 66 of file ethercatconfig.c.


Function Documentation

int ecx_config_init ( ecx_contextt context,
uint8  usetable 
)

Enumerate and init all slaves.

Parameters:
[in]context= context struct
[in]usetable= TRUE when using configtable to init slaves, FALSE otherwise
Returns:
Workcounter of slave discover datagram = number of slaves found

Definition at line 139 of file ethercatconfig.c.

int ecx_config_map_group ( ecx_contextt context,
void *  pIOmap,
uint8  group 
)

Map all PDOs in one group of slaves to IOmap.

Parameters:
[in]context= context struct
[out]pIOmap= pointer to IOmap
[in]group= group to map, 0 = all groups
Returns:
IOmap size

Definition at line 533 of file ethercatconfig.c.

int ecx_reconfig_slave ( ecx_contextt context,
uint16  slave,
int  timeout 
)

Reconfigure slave.

Parameters:
[in]context= context struct
[in]slave= slave to reconfigure
[in]timeout= local timeout f.e. EC_TIMEOUTRET3
Returns:
Slave state

Definition at line 1079 of file ethercatconfig.c.

int ecx_recover_slave ( ecx_contextt context,
uint16  slave,
int  timeout 
)

Recover slave.

Parameters:
[in]context= context struct
[in]slave= slave to recover
[in]timeout= local timeout f.e. EC_TIMEOUTRET3
Returns:
>0 if successful

Definition at line 1017 of file ethercatconfig.c.



ethercat_soem
Author(s): Arthur Ketels, M.J.G. van de Molengraft
autogenerated on Wed Aug 26 2015 11:32:40