This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0.4.12 (Ubuntu 10.10) | |
--------------------- | |
After socket.close(): | |
rss=27.05 MB (-2.52 MB) heapUsed=2.10 MB (-2.00 MB) | |
After expensive op 2: | |
rss=40.84 MB (+30.37 MB) heapUsed=21.54 MB (+20.06 MB) | |
After 32.50s: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@ubuntu:/workspace/node/cwd# uname -a | |
Linux ubuntu 2.6.35-30-generic #61-Ubuntu SMP Tue Oct 11 15:29:15 UTC 2011 i686 GNU/Linux | |
root@ubuntu:/workspace/node/cwd# node -v | |
v0.8.11 | |
root@ubuntu:/workspace/node/cwd# node test-node.js | |
Test 1 | |
exec cmd = node cwd.js | |
exec cwd = undefined | |
FAILED (AS IT SHOULD) :> | |
expected process cwd = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SerialPort = require('serialport').SerialPort; | |
var modbus = require('h5.modbus'); | |
var serialPort = new SerialPort('COM8', { | |
baudRate: 9600 | |
}); | |
serialPort.write = function(data) | |
{ | |
console.log('TX:', data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SerialPort = require('serialport').SerialPort; | |
var serialPort = new SerialPort('COM8', { | |
baudRate: 9600 | |
}); | |
serialPort.on('open', function() | |
{ | |
var req = new Buffer([0xf5, 0x01, 0x00, 0x00, 0x00, 0x08, 0x28, 0xb8]); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modbus = require('h5.modbus'); | |
var master = modbus.createMaster(); | |
master.once('connected', function() | |
{ | |
var t1 = master.readHoldingRegisters(0, 9, { | |
interval: 2000 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modbus = require('h5.modbus'); | |
var master = modbus.createMaster(); | |
master.once('connected', writeRandomRegisters.bind(null, master)); | |
function writeRandomRegisters(master) | |
{ | |
var registerCount = Math.round(Math.random() * 9) + 1; | |
var registerData = new Buffer(registerCount * 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modbus = require('h5.modbus'); | |
var master = modbus.createMaster({ | |
// Unit used in transations that don't have an explicit `unit` option. | |
defaultUnit: 7 | |
}); | |
master.once('connected', writeRandomRegisters.bind(null, master)); | |
function writeRandomRegisters(master) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
const EV_KEY = 0x01; | |
const EV_TYPES = ['up', 'down', 'repeat']; | |
const EV_KEYS = { | |
'0': 'RESERVED', | |
'1': 'ESC', | |
'2': '1', | |
'3': '2', | |
'4': '3', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SerialPort = require('serialport').SerialPort; | |
var modbus = require('h5.modbus'); | |
var serialPort = new SerialPort('COM1', { | |
baudRate: 9600 | |
}); | |
serialPort.write = function(data) | |
{ | |
console.log('TX:', data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//var SerialPort = require('serialport').SerialPort; | |
var BufferQueueReader = require('h5.buffers').BufferQueueReader; | |
//var serialPort = new SerialPort(/* setup */); | |
var serialPort = new process.EventEmitter(); | |
var MODE_WAITING_FOR_FRAME = 0; | |
var MODE_READING_DATA = 1; | |
var REGISTER_LENGTH = 2; | |
var CHECKSUM_LENGTH = 2; |
OlderNewer