A Python script to automate creation of supporting EtherCAT[1] files including SSI EEPROM, EtherCATInfo XML (ESI file), and certain related source and header files for the Beckhoff slave stack code[2].
mesicat accepts a .mesi file (Meta ESI) containing a description of the EtherCAT CoE dictionary and other stack configuration information. Make commands in this file then trigger the creation of sane defaults, SII EEPROM, XML files, and so forth. The .mesi file is inspired by the various IDL files used in web space (e.g. protobuf) and uses a C-like syntax to reduce cognitive overhead when developing slave code.
The C source and header files are generated using the mustache template language. Additional templates may be easily added to support generation of files for a master stack or other purpose.
The goal is to automate EtherCAT compliance to the extent practicable and provide a DRY (don't repeat yourself) automated build for the required files.
Requires Python 2.7, pyparsing and pystache. For Windows, a good approach is to install Python(x,y), then run easy_install pystache at a cmd prompt.
At present, no egg or setup support is included. Copy to target directory and run:
$ python mesicat.py my_project.mesi
Copyright (C) 2013 Dynamic Systems Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[1] Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®,and XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
[2] The Beckhoff Slave Stack Code is a product Beckhoff Automation GmbH. See ET9300 for more information
Hello,
I tried Revision: 21:1eda2f65ed31 on my linux mint computer and python2.7 has always thrown an error due to missing __call__ function. I solved this by just adding these and it worked. See file attached and make a diff. It would be nice if next version would include this. Please response.
Thanks
P.S.: Is it really a good idea to let create ecat_def.h automatically