Synapticon EtherCAT Model
=========================

Wrapper library for EtherCAT Slave Information (ESI) data structure parsed with Jsonix.

Install
-------

```
$ npm install ecatmod
```

Usage
-----

```javascript
const fs = require('fs');
const ecatmod = require('ecatmod');

const contents = fs.readFileSync('esi.xml', 'utf8');
const esi = ecatmod.unmarshalEsiString(contents);
ecatmod.applyToEsi(esi);
```

Sample ESI files
----------------

[https://github.com/synapticon/ecatapi/tree/master/public/esi](https://github.com/synapticon/ecatapi/tree/master/public/esi)

Development
-----------

```sh
$ git pull https://github.com/synapticon/ecatmod
$ cd ecatmod
$ npm run watch
```

Grunt command watches files for changes in src and specs directories and then runs linter and tests and builds documentation.

How to reformat and reindent profile JSON files:

```sh
$ npm -g install js-beautify
$ js-beautify --config .vscode/formatter.json -r src/profiles/SNCN.json
```

Documentation
-------------

[https://synapticon.github.io/ecatmod](https://synapticon.github.io/ecatmod)
