Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
513 stars 194 forks source link

dev-ooi: different AmsPort for symbol/index access #39

Closed pbruenn closed 7 years ago

pbruenn commented 7 years ago

Moved from #35: xift wrote: And now a problem I ran into when playing around a little: My test PLC project has several inputs and outputs. Application port is the usual 851 and the tasks symbol port is 350. Here is the problem. When I read or write arrays by name I have to use the application port and when I use index group and index offset I need to use the symbol port. I basically have to set up two separate AdsClient instances for that. It is highly inconvenient and the error message when using the wrong port (1793) is too cryptic to easily spot the mistake.

To visualize the problem: image

How can we solve that? 1) Add symbolPort to the AdsClient constructor 2) New GetAdsVariable parameter: GetAdsVariable(symbolPort, indexGroup, indexOffset)

pbruenn commented 7 years ago

If it is easy enough to group your AdsVariables accordingly, I would go with the first solution. Just to prevent adding these symbolPort, to each GedAdsVariable() call.

pbruenn commented 7 years ago

Merge was done with commit e50e03029a71e729c488a642c347369f69574db1