ethercatsoe.h
Go to the documentation of this file.
00001 /*
00002  * Simple Open EtherCAT Master Library 
00003  *
00004  * File    : ethercatsoe.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 _ethercatsoe_
00047 #define _ethercatsoe_
00048 
00049 #ifdef __cplusplus
00050 extern "C"
00051 {
00052 #endif
00053 
00054 #define EC_SOE_DATASTATE_B   0x01
00055 #define EC_SOE_NAME_B        0x02
00056 #define EC_SOE_ATTRIBUTE_B   0x04
00057 #define EC_SOE_UNIT_B        0x08
00058 #define EC_SOE_MIN_B         0x10
00059 #define EC_SOE_MAX_B         0x20
00060 #define EC_SOE_VALUE_B       0x40
00061 #define EC_SOE_DEFAULT_B     0x80
00062 
00063 #define EC_SOE_MAXNAME       60
00064 #define EC_SOE_MAXMAPPING    64
00065 
00066 #define EC_IDN_MDTCONFIG     24
00067 #define EC_IDN_ATCONFIG      16
00068 
00070 PACKED_BEGIN
00071 typedef struct PACKED
00072 {
00074    uint16     currentlength;
00076    uint16     maxlength;
00077    char       name[EC_SOE_MAXNAME];
00078 } ec_SoEnamet;
00079 PACKED_END
00080 
00082 PACKED_BEGIN
00083 typedef struct PACKED
00084 {
00086    uint16     currentlength;
00088    uint16     maxlength;
00089    union
00090    {   
00091       uint8   byte[8];
00092       uint16  word[4];
00093       uint32  dword[2];
00094       uint64  lword[1];
00095    };   
00096 } ec_SoElistt;
00097 PACKED_END
00098 
00100 PACKED_BEGIN
00101 typedef struct PACKED
00102 {
00104    uint16     currentlength;
00106    uint16     maxlength;
00107    uint16     idn[EC_SOE_MAXMAPPING];
00108 } ec_SoEmappingt;
00109 PACKED_END
00110 
00111 #define EC_SOE_LENGTH_1         0x00
00112 #define EC_SOE_LENGTH_2         0x01
00113 #define EC_SOE_LENGTH_4         0x02
00114 #define EC_SOE_LENGTH_8         0x03
00115 #define EC_SOE_TYPE_BINARY      0x00
00116 #define EC_SOE_TYPE_UINT        0x01
00117 #define EC_SOE_TYPE_INT         0x02
00118 #define EC_SOE_TYPE_HEX         0x03
00119 #define EC_SOE_TYPE_STRING      0x04
00120 #define EC_SOE_TYPE_IDN         0x05
00121 #define EC_SOE_TYPE_FLOAT       0x06
00122 #define EC_SOE_TYPE_PARAMETER   0x07
00123 
00125 PACKED_BEGIN
00126 typedef struct PACKED
00127 {
00129    uint32     evafactor   :16;
00131    uint32     length      :2;
00133    uint32     list        :1;
00135    uint32     command     :1;
00137    uint32     datatype    :3;
00138    uint32     reserved1   :1;
00140    uint32     decimals    :4;
00142    uint32     wppreop     :1;
00144    uint32     wpsafeop    :1;
00146    uint32     wpop        :1;
00147    uint32     reserved2   :1;
00148 } ec_SoEattributet;
00149 PACKED_END
00150 
00151 #ifdef EC_VER1
00152 int ec_SoEread(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout);
00153 int ec_SoEwrite(uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout);
00154 int ec_readIDNmap(uint16 slave, int *Osize, int *Isize);
00155 #endif
00156 
00157 int ecx_SoEread(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int *psize, void *p, int timeout);
00158 int ecx_SoEwrite(ecx_contextt *context, uint16 slave, uint8 driveNo, uint8 elementflags, uint16 idn, int psize, void *p, int timeout);
00159 int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize);
00160 
00161 #ifdef __cplusplus
00162 }
00163 #endif
00164 
00165 #endif


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