Skip to content

Instantly share code, notes, and snippets.

@RReverser
Last active July 21, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RReverser/bf31bfd30a09362c95a78894a73d359b to your computer and use it in GitHub Desktop.
Save RReverser/bf31bfd30a09362c95a78894a73d359b to your computer and use it in GitHub Desktop.
'use strict';
var jBinary = require('jbinary');
var FLGTypeSet = {
'jBinary.all': ['array', 'LOG_T'],
'jBinary.littleEndian': true,
STEP_T: {
tempSp: 'float',
tempRamp: 'float',
humpSp: 'float',
time: 'TIME_T'
},
TIME_T: {
hour: 'int16',
min: 'int8',
type: 'int8'
},
DATE_T: {
day: 'int8',
month: 'int8',
year: 'int16'
},
LOG_T: {
time: 'TIME_T', // time of log
date: 'DATE_T', // date of log
temp: 'float', // chamber temperature
tempSp: 'float', // temperature set point
tmpRamp: 'float', // temperature ramp
hum: 'float', // chamber humidity
humSp: 'float', // humidity set point
light: 'uint8', // chamber light
fan: 'uint8', // chamber fan
_align1: ['skip', 2],
tmpMax: 'float', // maximum temperature allowed
tmpMin: 'float', // minimum temperature allowed
humMax: 'float', // maximum humidity allowed
humMin: 'float', // minimum humidity allowed
roomTemp: 'uint8', // room temperature
_align2: ['skip', 1],
alarmStatus: 'uint16' // alarm status (refer to alarm mask defines)
}
}
jBinary.load('10.FLG', FLGTypeSet, function(err, binary) {
console.log(binary.readAll());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment