Comments (5)
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.
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.
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.
Is it working for you now? Slot 2 seems to work better.
from nodes7.
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)
- Question: How to check the connection status?
- force output to activate a relay HOT 1
- Not working with nuxt HOT 1
- Need help for tags / address associations G120C drive HOT 12
- [Question] Read boolean value from DB HOT 1
- boolen write problem ??? HOT 11
- Read single item HOT 3
- Address conversion HOT 1
- TCP ECCONRESET HOT 11
- ECONNRESET Nodered HOT 1
- Reading big offsets
- readAllItems and writeItems stopped when is waiting HOT 1
- support for 64 bit data type
- Server functionality
- ISOonTCP RFC 1006 telergrams
- Reading NC Variables from Sinumerik 840d
- Optimized block access HOT 1
- I want to know how to use the 'values' to vue component's data HOT 1
- Tries to connect to a PLC with wrong IP address, never returns error, always tries to reconnect
- Question: MPI over Serial HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodes7.