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

Can't trigger Q1/Q2 #70

Open
stephanmae opened this issue Aug 6, 2020 · 0 comments
Open

Can't trigger Q1/Q2 #70

stephanmae opened this issue Aug 6, 2020 · 0 comments

Comments

@stephanmae
Copy link

Hi there,
I am trying to connect to S7 and open the Q1 on a logo. Therefore, I am writing one bit which should trigger the Q1 to open. But it does not work, connection succeedes, writing even succeeds, but the relais does not get closed:

Does anyone has an idea?

var snap7 = require('node-snap7');

var s7client = new snap7.S7Client();
s7client.ConnectTo('192.168.1.2', 0, 2, function(err) {
if(err)
return console.log(' >> Connection failed. Code #' + err + ' - ' + s7client.ErrorText(err));

// Read the first byte from PLC process outputs...
console.log('reading q1');
var read = s7client.ABRead(1, 1);
console.log(read);

// open
console.log('writing q1');
const buffer = new Buffer([0x01]);
var result = s7client.ABWrite(1, 1, buffer, function(err) {
    if(err)
        return console.log(' >> ABRead failed. Code #' + err + ' - ' + s7client.ErrorText(err));
    console.log(err);
});

console.log(result);
});

Many thanks!

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

No branches or pull requests

1 participant