npm.io
2.2.11 • Published 7 months ago

ecatmod

Licence
ISC
Version
2.2.11
Deps
7
Size
11.6 MB
Vulns
16
Weekly
0

Synapticon EtherCAT Model

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

Install

$ npm install ecatmod

Usage

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

Development

$ 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:

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

Documentation

https://synapticon.github.io/ecatmod