Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

express API implementation #7

Open
side105 opened this issue May 4, 2017 · 2 comments
Open

express API implementation #7

side105 opened this issue May 4, 2017 · 2 comments

Comments

@side105
Copy link

side105 commented May 4, 2017

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
Copy link
Author

side105 commented May 4, 2017

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

@ceremcem
Copy link
Contributor

ceremcem commented Aug 19, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants