Coder Social home page Coder Social logo

Comments (5)

plcpeople avatar plcpeople commented on August 25, 2024

What type or Siemens part number of S7 PLC are you connecting to?

My first guess from that output would be that it's a 300 type and you should use slot 2 instead of slot 1.

from nodes7.

dlbrown06 avatar dlbrown06 commented on August 25, 2024

Closer - I'm just trying to read an item and display it's value to console.log

[919,883304001] Initiate Called - Connecting to PLC with address and parameters:
[919,884208285] { port: 102, host: '10.2.202.145', rack: 0, slot: 2 }
[919,886065128] Connection cleanup is happening
[919,900610458 10.2.202.145 S2] Attempting to connect to host...
[919,908272737 10.2.202.145 S2] TCP Connection Established to 10.2.202.145 on port 102
[919,908350279 10.2.202.145 S2] Will attempt ISO-on-TCP connection
[919,913547538 10.2.202.145 S2] ISO-on-TCP Connection Confirm Packet Received
[919,918113432 10.2.202.145 S2] Received PDU Response - Proceeding with PDU 240 and 2 max parallel connections.
undefined

Process finished with exit code 0

from nodes7.

dlbrown06 avatar dlbrown06 commented on August 25, 2024

Looks like the problem I was having was here upon connection:

if (typeof(err) !== "undefined") {
        // We have an error.  Maybe the PLC is not reachable.  
        console.log(err);
        process.exit();
    }

initiateConnection returns a callback with no parameters defined, so it is failing out here when it actually was connected.

I worked around it by changing if (typeof(err) !== "undefined") { to if (err) { so undefined is still a falsey

from nodes7.

plcpeople avatar plcpeople commented on August 25, 2024

Is it working for you now? Slot 2 seems to work better.

from nodes7.

dlbrown06 avatar dlbrown06 commented on August 25, 2024

Yeah... big fail on my part. I noticed you even did the due diligence to comment it within the code... :/

But yes, its working now. Thank you for contributing this great node module to the community.

from nodes7.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.