Unable to read from Control Logix PLC
See original GitHub issueUnable to read anything from a control logic PLC. Unable to display controller properties, unable to read a tag value.
Current Behavior
When connecting to PLC, an UnhandledPromiseRejectionWarning is given. I am able to ping the PLCs IP. (EN2TR card) I am able to go online with Studio 5000 programming software. PLC is in Run mode.
Expected Behavior
Connection to PLC should complete, and plc properties would be written to console
Steps to Reproduce
- Download current version of Node and install. node-v9.9.0-x64
- Create a project directory and install node-ethernet-ip (“npm install ethernet-ip --save”)
- Create plc01.js file with sample connection code
- Run node plc01.js
- Receive error on console
Your Environment
- Package version (Use
npm list
- e.g. 1.0.6): ethernet-ip@1.1.0 dateformat@3.0.3 - Node Version (Use
node --version
- e.g. 9.8.0): v9.9.0 - Operating System and version: Windows 7 - SP1 - x64
- Controller Type (eg 1756-L83E/B): 1756-L75
- Controller Firmware (eg 30.11): 28.012
4 slot rack, plc is in slot 0. EN2TR cards in slot 1 and slot 2. Slot 3 is open.
Error output
(node:14792) UnhandledPromiseRejectionWarning: #<Object> (node:14792) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:14792) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Test Code
const { Controller } = require("ethernet-ip");
const PLC = new Controller();
// Controller.connect(IP_ADDR[, SLOT])
// NOTE: SLOT = 0 (default) - 0 if CompactLogix
PLC.connect("10.115.45.55", 0).then(() => {
console.log("Connected to PLC!");
console.log(PLC.properties);
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Yup! All working now
ahhhh, yep this is definitely related to #1. The
readWallClock
method in the connect method is causing the issue, apparently this feature only works with the latest rockwell releases (e.g. L8 series controllers). We will update the code soon and release a patch today. @patrickjmcd or myself will update the thread once the changes are live. Thanks for helping to track this down =].