Closed planetixin closed 2 years ago
Should be require('st-ethernet-ip')
.To show the actual error add a catch()
to the end of the PLC.connect()
function. reply back what you get.
const {Controller, Tag, TagList} = require('st-ethernet-ip');
const PLC = new Controller();
const tagList = new TagList();
PLC.connect('address ip', 0).then(async () => {
await PLC.getControllerTagList(tagList);
console.log(tagList);
}).catch(e => { console.log(e) } );
something like that? { generalStatusCode: 5, extendedStatus: [ 0 ] }. now it doesn't want to work even without anything inside PLC.connect('ip adress', 0).then(async () => {})
That error is Request Path destination unknown: Probably instance number is not present
Are you connected to the ethernet port on the controller or a card plugged into a slot?
Also double check IP address and check controller properties on the security tab that you don't have the communications restricted.
What model of PLC is it?
I pinged that address ip and everything is fine. PLC model is Intel(R) 82579LM Gigabit Network Connection.
PLC models that this library is compatible with are Compactlogix and Controllogix from Allen Bradley. I believe Intel(R) 82579LM Gigabit Network Connection is not a PLC
Current Behavior
returns: node:436) UnhandledPromiseRejectionWarning: #
Expected Behavior
it should get tag list from PLC.
Possible Solution (Optional)
Context
const {Controller, Tag, TagList} = require('ethernet-ip');
const PLC = new Controller(); const tagList = new TagList();
PLC.connect('address ip', 0).then(async () => { await PLC.getControllerTagList(tagList); console.log(tagList);
});
Steps to Reproduce (for bugs only)
1. 2. 3. 4.
Your Environment
npm list
- e.g. 1.0.6):node --version
- e.g. 9.8.0):