Closed pbruenn closed 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.
Merge was done with commit e50e03029a71e729c488a642c347369f69574db1
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](https://cloud.githubusercontent.com/assets/1312047/18600967/a2ed6ae0-7c60-11e6-853c-3a3958b2fc02.png)
How can we solve that? 1) Add symbolPort to the AdsClient constructor 2) New GetAdsVariable parameter: GetAdsVariable(symbolPort, indexGroup, indexOffset)