Giter Site home page Giter Site logo

kubabuda / eeprom_generator Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 10.0 517 KB

SOES EEPROM Generator and Slave Stack Code generation tool for EtherCAT devices using SOES library

Home Page: https://kubabuda.github.io/EEPROM_generator/

License: Other

HTML 3.51% JavaScript 93.27% CSS 3.22%
esi ethercat ethercat-slave ethercat-slave-information soes simple-opensource-ethercat-slave

eeprom_generator's Introduction

This is basic code generator tool for EtherCAT devices, using SOES library.

It is available online, here

You can configure:

  • ESC (Ethercat Slave Chip)
  • OD (CANopen Object Dictionary) entries
  • PDO mappings (which OD objects are mapped in TX, RX datagrams)

Tool generates consistent data across C sources, ESI file and EEPROM content.

It also backs up your current project in localstorage. You can save project to JSON file on your hard drive, restore from it later, and download all files at once.

Limitations

  • Only single, non-dynamic PDO is supported for TX and RX respectively
  • Some data types might not be supported

If you need more, RT-Labs offers professional IDE - EtherCAT SDK, and training.

Development

Pull requests welcome.

Source code is intentionally keept in plain Javascript files so that build system like webpack or even web server is not needed. The only dependency is web browser, that should future proof it.

Unit tests are using Jasmine.

OD structure

OD is keept as JSON object. Expected data format:

{
    '1000': { otype: OTYPE.VAR, dtype: DTYPE.UNSIGNED32, name: 'Device Type', value: 0x1389 },
    '1008': { otype: OTYPE.VAR, dtype: DTYPE.VISIBLE_STRING, name: 'Device Name', data: '' },
    '1009': { otype: OTYPE.VAR, dtype: DTYPE.VISIBLE_STRING, name: 'Hardware Version', data: '' },
    '100A': { otype: OTYPE.VAR, dtype: DTYPE.VISIBLE_STRING, name: 'Software Version', data: '' },
    '1018': { otype: OTYPE.RECORD, name: 'Identity Object', items: [
        { name: 'Max SubIndex' },
        { name: 'Vendor ID', dtype: DTYPE.UNSIGNED32, value: 600 },
        { name: 'Product Code', dtype: DTYPE.UNSIGNED32 },
        { name: 'Revision Number', dtype: DTYPE.UNSIGNED32 },
        { name: 'Serial Number', dtype: DTYPE.UNSIGNED32, data: '&Obj.serial' },
    ]},
    '1C00': { otype: OTYPE.ARRAY, dtype: DTYPE.UNSIGNED8, name: 'Sync Manager Communication Type', items: [
        { name: 'Max SubIndex' },
        { name: 'Communications Type SM0', value: 1 },
        { name: 'Communications Type SM1', value: 2 },
        { name: 'Communications Type SM2', value: 3 },
        { name: 'Communications Type SM3', value: 4 },
    ]},
}   

OD model for generator has 4 sections:

  • sdo, not mapped to PDOs
  • txpdo, mapped to TXPDO (SM3). Expected format (for OTYPE VAR):
{
    '6000': { otype: OTYPE.VAR, dtype: DTYPE.UNSIGNED32, name: 'TXPDO', value: 0x1389, pdo_mappings: ['tx'] },
}
  • rxpdo, same as above, but pdo_mappings: ['rx']
  • mandatory objects. These are added at code gen stage, with values populated form UI controls.

Code generation copies all values into single OD, adds PDO mappings and SM assignments.

PDO mappings

Currently single, non-dynamic PDO is supported for TX and RX respectively.

Diff binary files visually in Bash (works in git bash too)

diff <(xxd et1100.bin) <(xxd lan9252.bin)

Binary file comparison tool for Windows: VBinDiff

VBinDiff et1100.bin  lan9252.bin

Disclaimer

The EtherCAT Technology, the trade name and logo "EtherCAT" are the intellectual property of, and protected by Beckhoff Automation GmbH.

eeprom_generator's People

Contributors

kubabuda avatar sirop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eeprom_generator's Issues

Length of string/VISIBLE_STRING

Hi, thanks for open-sourcing this great tool!

I have a question about defining strings in PDOs. How to define the length of a VISIBLE_STRING variable in PDOs? What is its default size?

Thanks!

Support of 64 bit data

Hello, this repo helps me a lot and many thank for sharing such an awesome project!

I wonder if it is possible to use 64-bit data, e.g. uint64_t, real64. If it's possible, could you provide me with some hints and notes about modifying this generator?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.