jisotalo / ads-client

Unofficial Node.js ADS library for connecting to Beckhoff TwinCAT automation systems using ADS protocol.
https://jisotalo.fi/ads-client/
MIT License
76 stars 18 forks source link

Version 2 - Optional Ams_NetId #108

Closed Hopperpop closed 5 days ago

Hopperpop commented 1 year ago

To read CoE data from an EtherCat master over ads, you need to use another AMS_NetId than the one you use for setting up the route. Standard the first EtherCat master is assigned x.x.x.x.2.1. The raw read-write-read/write commands should have an additional optional Ams_NetId argument to make it possible to send commands to other ads-devices like an EtherCat master.

Does this make sense? Or is this already possible in another way?

jisotalo commented 1 year ago

Hi @Hopperpop!

That certainly would be one option. I remember connecting to EtherCAT devices by creating the route manually to StaticRoutes.xml. I need to test this.

jisotalo commented 1 year ago

I will look into this during development of v2 version.

jisotalo commented 5 days ago

In version 2, every method has optional parameter targetOpts (targetOpts: Partial<AmsAddress> = {}), that allows providing amsNetId and/or adsPort. This way it's easily possible to connect different ports with the same connection.