jmmoser / node-drivers Goto Github PK
View Code? Open in Web Editor NEWIndustrial protocol drivers in node.js
License: MIT License
Industrial protocol drivers in node.js
License: MIT License
I tried running these two examples:
README
const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP('1.2.3.4');
const logix5000 = new CIP.Logix5000(tcpLayer);
console.log(await logix5000.readTag('tagname'));
Logix5000
const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP({ host: '1.2.3.4', port: 44818 });
const logix5000 = new CIP.Logix5000(tcpLayer);
(async () => {
try {
console.log(await logix5000.readTag('R03:9:I.Ch1Data'));
} catch(err) {
console.log(err);
}
await tcpLayer.close();
})();
And both examples when I run node script.js
I get this error:
const tcpLayer = new TCP({ host: '192.168.1.100', port: 44818 });
^
TypeError: TCP is not a constructor
Node version: 10.9.0.
const { Layers } = require('node-drivers');
const tcpLayer = new Layers.TCP({ host: '192.168.0.230', port: 44818 });
const eipLayer = new Layers.EIP(tcpLayer);
const cipPCCCLayer = new Layers.CIP.PCCC(eipLayer);
const pccc = new Layers.PCCC(cipPCCCLayer);
return this
$ node test1.js
{ message: 'Invalid parameter or invalid data',
info:
PCCCPacket {
command: 79,
transaction: 1,
data: ,
status:
{ code: 240,
extended: [Object],
description: 'Remote: Error code in the EXT STS byte' } } }
2.2779507836064226e-41
Note:
F8:1 has a value 1.00000
F8:2 has a value 2.00000
Any help please ?
Thanks,
Gary
Hello everybody
Somebody know if its works in micrologix?
Regards
Hi,
I've tried running the example below after installing node-drivers:
"Read/Write a tag from a PLC-5, SLC 5/03, or SLC 5/04 processor using PCCC embedded in CIP:"
However, I keep getting the following error:
console.log(await pccc.typedWrite('N10:47', 1000));
^^^^^
SyntaxError: missing ) after argument list
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
anyone have come across this issue?
Justin,
Questions
"node-drivers" use to work with a callback in the read Tag call.
Is this not possible any more?
I am not sure what "await" does. Does the node executive loop process other functions while waiting ?
Also, can "node-drivers" talk to a A/B Compact-Logix or Control-Logix PLC ?
If so, I see no examples of this. Seem like all the necessary low level code is in place for this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.