node-omron-fins icon indicating copy to clipboard operation
node-omron-fins copied to clipboard

express API implementation

Open side105 opened this issue 8 years ago • 2 comments

I'm not sure if this is the rigth place for a question... can anyone help me with using this wonderful library in a express api


const express = require('express'); const router = express.Router(); var fins = require('../lib/index');

var client = fins.FinsClient(9600, '172.16.103.125');//plc address

router.get('/', (req, res) => { res.send('data from PLC');//here I'd like to send back to the client the values from the PLC });

side105 avatar May 04 '17 14:05 side105

in the meantime I expanded the MemoryAreas with the most common used. It works!

module.exports.MemoryAreas = {
    'E' : 0xA0,//Extended Memories
    'C' : 0xB0,//CIO
    'W' : 0xB1,//Work Area
    'H' : 0xB2,//Holding Bit
    'A' : 0xB3,//Auxiliary Bit
    'D' : 0x82//Data Memories
};

waiting for your reply... many thanks

side105 avatar May 04 '17 15:05 side105

@side105 Thank you for the extra memory areas, I wouldn't get/set the physical inputs/outputs without C area.

ceremcem avatar Aug 19 '17 21:08 ceremcem