Closed PLCHome closed 5 years ago
@Wolfskammer04 Configuration
Enable ADS on your PLC project. To do this click on your task and then enable the checkbox before Create symbols (if he is not disabled). In addition, you can still, under I/O Devices
click on Image and go to the ADS tab. Check the Enable ADS Server and also Create symbols. Download the new configuration and make sure you reboot your PLC. The reboot is only needed when you are using TwinCat 2.
Now add a static route to our Beckhoff PLC. The route should point to your server that will run the proxy application. It's also a good idea to add an extra static route that points to your local development device. This way you can test out the proxy from your development device too.
Attention
TwinCAT AMS Router doesn't allow multiple TCP connections from the same host. So when you use two AdsLib instances on the same host to connect to the same TwinCAT router, you will see that TwinCAT will close the first TCP connection and only respond to the newest. If you start the TwinCat System Manager and Node-Red ADS on the same PC at the same time, Node-Red will not run anymore. You can set up a second IPv4 on the PC and assign to this a ADS NET ID under Twincat
As ADS is transmitted over a TCP connection, there is no real time guarantee.
Hi ChrisHanuta, I did all the steps a several time, no success. Today I also tried to use node-ads only - in principe the same results. I planned to get in touch with Beckhoff, to find another tool to check if ADS is working properly.
I have a cx5020 and a cx1020 with tc2 it runs fine.
Do you work under windows or Linux with node? Are you working on a seperate system? Witch TC version on 3 the port is 851? Is the PC clear, no twincat running? Is the system manager on the PC down (this)? There are also problems running node on the PLC #8 . Is the PLC in RUN or config mode?
node runs on an embedded linux system in a NodeRED - container of the HARTING MICA (https://www.harting-mica.com/en). I can ping the PLC from there. BUT I also get these timeout errors using a nodejs with 'node-ads' under the connected Win7 PC, where VS2012 is running at.
I program it with TC3 under VS2012, Win7
I used the port 851,
Is the PC clear, no twincat running? - I don't understand, what means no TC running under TC3?
At least all 2 'Create Symblos' checkboxes are checked.
PLC is in RUN mode.
node runs on an embedded linux system in a NodeRED - container
There is also a node for NODE-RED: node-red-contrib-ads It uses a foke of this implementation
Is the PC clear, no twincat running?
The Twincat router in some Twincat versions breaks the connection when the System Manager is running on the system
Hi, I installed a brand new node-red-contrib-ads: I now get the following messages:
{ connectState: 2, connectStateText: "CONNECTED", adsState: 0, adsStateText: "INVALID" } 28.9.2018, 09:19:37node: e3105093.b7101msg : string[43] "Ads Register Notification live tick timeout" 28.9.2018, 09:19:37node: e3105093.b7101msg : string[41] "Ads Register Notification Sym Tab timeout" 28.9.2018, 09:19:37node: e3105093.b7101msg : string[29] "Error readDeviceInfo: timeout" 28.9.2018, 09:19:38node: e3105093.b7101msg : string[43] "Ads Register Notification live tick timeout" 28.9.2018, 09:19:39node: e3105093.b7101msg : string[41] "Ads Register Notification Sym Tab timeout" 28.9.2018, 09:19:40node: e3105093.b7101msg : string[29] "Error readDeviceInfo: timeout" 28.9.2018, 09:19:40node: 486c33cd.975f34 msg.payload : Object { connectState: 0, connectStateText: "DISCONNECTED", adsState: 0, adsStateText: "INVALID" }
so it seems to connect to the CX5020 but while connected I get a couple of timeout messages and what means adsStateText: "INVALID"?
Hi everyone,
read through your comments and I am facing a similar problem. My setup is a Beckhoff CX9020 running TwinCat 2 and I'm connecting from a Synology DS 215j hosted chroot environment in production and from a MacOS environment in development.
My setup worked fine using the old library (https://www.npmjs.com/package/ads). Then, for multi-read capabilities, I tried to upgrade to the new packages (https://www.npmjs.com/package/node-ads, https://www.npmjs.com/package/node-ads-api). Having nothing changed on the PLC side, I still was able to connect but also received the connection timeout.
I then went ahead and increased the timeout in node_modules/node-ads-api/lib in line 968:
` this.pending[this.invokeId] = {cb: options.cb, timeout: setTimeout(function () { delete this.pending[this.invokeId]
options.cb('timeout')
}.bind(this), 5000)}`
Right then, the setup worked again :-)
Please set the timeout over the options var ads = require('node-ads')
var options = { host: "10.0.0.2", amsNetIdTarget: "5.1.204.160.1.1", amsNetIdSource: "192.168.137.50.1.1", timeout: 100000 }
var client = ads.connect(options, function() { this.readDeviceInfo(function(err, result) { if (err) console.log(err) console.log(result) this.end() }) })
client.on('error', function(error) { console.log(error) })
Hello @roccomuso , I use a CX5020 for my trials and also have problems to connect. I tried a several times different combinations of Adresses NetIds and ports but no success. Here are the error messages I face: "Error ADS: Error: connect ECONNREFUSED 192.168.137.235:48898" "Error readDeviceInfo: timeout" "Ads Register Notification live tick timeout" "Ads Register Notification Sym Tab timeout"
the ECONNREFUSED message sometimes dissappears suddenly but also suddenly comes back without having made any config changes.
Originally posted by @Wolfskammer04 in https://github.com/roccomuso/node-ads/issues/1#issuecomment-424350988