0.2.6 • Published 2 years ago

ljmmm-parse v0.2.6

Weekly downloads
8
License
MIT
Repository
github
Last release
2 years ago

ljmmm-parse

LabJack Modbus Map Markup language parser micro-library for Node.js.

Installation

npm install ljmmm-parse

Usage

var ljmmm_parse = require('ljmmm-parse');

/**
 * Logs
 * [
 *     {name: 'Test0', address: 0, type: 'UINT32'},
 *     {name: 'Test1', address: 2, type: 'UNIT32'},
 *     {name: 'Another0', address: 0, type: 'UINT32'},
 *     {name: 'Another1', address: 2, type: 'UNIT32'}
 * ]
**/
ljmmm_parse.expandLJMMMEntries(
    [
        {name: 'Test#(0:1)', address: 0, type: 'UINT32'},
        {name: 'Another#(0:1)', address: 0, type: 'UINT32'}
    ]
    function (err) { console.log(err); },
    function (expandedEntries) { console.log(expandedEntries); }
);

/**
 * Logs
 * [
 *     {name: 'Test0', address: 0, type: 'UINT32'},
 *     {name: 'Test1', address: 2, type: 'UNIT32'}
 * ]
**/
ljmmm_parse.expandLJMMMEntry(
    {name: 'Test#(0:1)', address: 0, type: 'UINT32'},
    function (err) { console.log(err); },
    function (expandedEntries) { console.log(expandedEntries); }
);

// Logs ['Test0', 'Test1', 'Test2']
ljmmm_parse.expandLJMMMName(
    'Test#(0:2)',
    function (err) { console.log(err); },
    function (expandedNames) { console.log(expandedNames); }
);

/**
 * Also available:
 * 
 * ljmmm_parse.expandLJMMMEntriesSync(listOfEntries);
 * ljmmm_parse.expandLJMMMEntrySync(entry);
**/

License and Copyright

LabJack Corp, 2013
Sam Pottinger, 2013

Released under the MIT license.

Background and motivation

To standardize MODBUS map specification, LabJack developed LJMMM or LabJack Modbus Map Markup (see ljm_constants). To support software targeting LabJack devices written in Node, this library supports the interpretation of LJMMM fields.

Testing

Requires rewire (npm install rewire) and nodeunit (npm install nodeunit).

nodeunit ljmmm_test.js

Development environment and standards

This project maintains 80% code coverage at minimum and conforms to both jsDoc and Google JavaScript style guidelines.

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

8 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

10 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago