mathiask88 / node-snap7

node.js wrapper for snap7
MIT License
163 stars 59 forks source link

GetAgBlockInfo() not working #24

Closed Yaro96 closed 7 years ago

Yaro96 commented 7 years ago

I tried to use this function to get the DB size on a Siemens s7-300, using the callback it doesn't enter into it at all. Without the callback it just returns "false" with no errors. getSize.txt

mathiask88 commented 7 years ago

The function is working for me. As a side note: Returning in the callback function (return res.MC7Size;) will not return the value for getDBLength() 😉

Yaro96 commented 7 years ago

In my case, it doesn't enter in the callback at all, it doesn't even print "I'm here!"

mathiask88 commented 7 years ago

Are you sure that the client gets connected at all? AFAIK 300er are on slot 1 and not 2.

Yaro96 commented 7 years ago

Yes, I'm sure. It works perfectly with other functions and the Snap7 demo client. It doesn't pop any connection errors and if I put a console.log just before the GetAgBlockInfo(), it prints.

mathiask88 commented 7 years ago

If I can't reproduce your error I don't know how I can help you. Can you try your script with the snap7 demo server? And maybe post your node.js and node-snap7 versions?

Yaro96 commented 7 years ago

I figured it out, it was an asyncrous request problem. Sorry for bothering you.

mathiask88 commented 7 years ago

Good to hear, that you found it. No problem :)