ethercatcoe.h
Go to the documentation of this file.
00001 /*
00002  * Simple Open EtherCAT Master Library 
00003  *
00004  * File    : ethercatcoe.h
00005  * Version : 1.3.0
00006  * Date    : 24-02-2013
00007  * Copyright (C) 2005-2013 Speciaal Machinefabriek Ketels v.o.f.
00008  * Copyright (C) 2005-2013 Arthur Ketels
00009  * Copyright (C) 2008-2009 TU/e Technische Universiteit Eindhoven 
00010  *
00011  * SOEM is free software; you can redistribute it and/or modify it under
00012  * the terms of the GNU General Public License version 2 as published by the Free
00013  * Software Foundation.
00014  *
00015  * SOEM is distributed in the hope that it will be useful, but WITHOUT ANY
00016  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
00017  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00018  * for more details.
00019  *
00020  * As a special exception, if other files instantiate templates or use macros
00021  * or inline functions from this file, or you compile this file and link it
00022  * with other works to produce a work based on this file, this file does not
00023  * by itself cause the resulting work to be covered by the GNU General Public
00024  * License. However the source code for this file must still be made available
00025  * in accordance with section (3) of the GNU General Public License.
00026  *
00027  * This exception does not invalidate any other reasons why a work based on
00028  * this file might be covered by the GNU General Public License.
00029  *
00030  * The EtherCAT Technology, the trade name and logo “EtherCAT” are the intellectual
00031  * property of, and protected by Beckhoff Automation GmbH. You can use SOEM for
00032  * the sole purpose of creating, using and/or selling or otherwise distributing
00033  * an EtherCAT network master provided that an EtherCAT Master License is obtained
00034  * from Beckhoff Automation GmbH.
00035  *
00036  * In case you did not receive a copy of the EtherCAT Master License along with
00037  * SOEM write to Beckhoff Automation GmbH, Eiserstraße 5, D-33415 Verl, Germany
00038  * (www.beckhoff.com).
00039  */
00040 
00046 #ifndef _ethercatcoe_
00047 #define _ethercatcoe_
00048 
00049 #ifdef __cplusplus
00050 extern "C"
00051 {
00052 #endif
00053 
00055 #define EC_MAXODLIST   1024
00056 
00058 #define EC_MAXOELIST   256
00059 
00060 /* Storage for object description list */
00061 typedef struct 
00062 {
00064    uint16  Slave;
00066    uint16  Entries;
00068    uint16  Index[EC_MAXODLIST];
00070    uint16  DataType[EC_MAXODLIST];
00072    uint8   ObjectCode[EC_MAXODLIST];
00074    uint8   MaxSub[EC_MAXODLIST];
00076    char    Name[EC_MAXODLIST][EC_MAXNAME+1];
00077 } ec_ODlistt;
00078 
00079 /* storage for object list entry information */
00080 typedef struct 
00081 {
00083    uint16 Entries;
00085    uint8  ValueInfo[EC_MAXOELIST];
00087    uint16 DataType[EC_MAXOELIST];
00089    uint16 BitLength[EC_MAXOELIST];
00091    uint16 ObjAccess[EC_MAXOELIST];
00093    char   Name[EC_MAXOELIST][EC_MAXNAME+1];
00094 } ec_OElistt;
00095 
00096 #ifdef EC_VER1
00097 void ec_SDOerror(uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode);
00098 int ec_SDOread(uint16 slave, uint16 index, uint8 subindex,
00099                       boolean CA, int *psize, void *p, int timeout);
00100 int ec_SDOwrite(uint16 Slave, uint16 Index, uint8 SubIndex,
00101     boolean CA, int psize, void *p, int Timeout);
00102 int ec_RxPDO(uint16 Slave, uint16 RxPDOnumber , int psize, void *p);
00103 int ec_TxPDO(uint16 slave, uint16 TxPDOnumber , int *psize, void *p, int timeout);
00104 int ec_readPDOmap(uint16 Slave, int *Osize, int *Isize);
00105 int ec_readPDOmapCA(uint16 Slave, int *Osize, int *Isize);
00106 int ec_readODlist(uint16 Slave, ec_ODlistt *pODlist);
00107 int ec_readODdescription(uint16 Item, ec_ODlistt *pODlist);
00108 int ec_readOEsingle(uint16 Item, uint8 SubI, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00109 int ec_readOE(uint16 Item, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00110 #endif
00111 
00112 void ecx_SDOerror(ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIdx, int32 AbortCode);
00113 int ecx_SDOread(ecx_contextt *context, uint16 slave, uint16 index, uint8 subindex,
00114                       boolean CA, int *psize, void *p, int timeout);
00115 int ecx_SDOwrite(ecx_contextt *context, uint16 Slave, uint16 Index, uint8 SubIndex,
00116     boolean CA, int psize, void *p, int Timeout);
00117 int ecx_RxPDO(ecx_contextt *context, uint16 Slave, uint16 RxPDOnumber , int psize, void *p);
00118 int ecx_TxPDO(ecx_contextt *context, uint16 slave, uint16 TxPDOnumber , int *psize, void *p, int timeout);
00119 int ecx_readPDOmap(ecx_contextt *context, uint16 Slave, int *Osize, int *Isize);
00120 int ecx_readPDOmapCA(ecx_contextt *context, uint16 Slave, int *Osize, int *Isize);
00121 int ecx_readODlist(ecx_contextt *context, uint16 Slave, ec_ODlistt *pODlist);
00122 int ecx_readODdescription(ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist);
00123 int ecx_readOEsingle(ecx_contextt *context, uint16 Item, uint8 SubI, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00124 int ecx_readOE(ecx_contextt *context, uint16 Item, ec_ODlistt *pODlist, ec_OElistt *pOElist);
00125 
00126 #ifdef __cplusplus
00127 }
00128 #endif
00129 
00130 #endif


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