node-omron-fins
node-omron-fins copied to clipboard
express API implementation
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 });
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 Thank you for the extra memory areas, I wouldn't get/set the physical inputs/outputs without C area.