chwiede / pyads

Beckhoff ADS implementation for python
MIT License
49 stars 14 forks source link

Cannot connect if AMS NetID's first 4 octets are not equal to ipv4 IP #6

Closed evanmj closed 8 years ago

evanmj commented 8 years ago

The NetID is initially seeded from the IP in TwinCAT, so if a PLC has 192.168.1.10, when you install TwinCAT, the NetID will become 192.168.1.10.1.1.

The relation ends there, and it is up to the ADS router to translate NetID <-> IP after that.

Many times, our machines change IPs, but the NetIDs are already being used for inter-PLC communication and so on....

Maybe this is a feature request, but it would be nice to be able to (optionally) specify the IP to connect to if the PLC's IP does not match the first four octets of the AMS NetID.

Feel free to close as "won't fix", but I'm just getting started with this code and it seems like a few people might not realize the differences between an IP and NetID

chwiede commented 8 years ago

Maybe this could be solved in class AdsConnection. There's already a property for target ip, but it's generated automatically from ams id. An additional argument in ctor could solve the problem, but i cannot test this at the moment. Feel free to fork and send me a pull request.

2016-04-27 20:41 GMT+02:00 evanmj notifications@github.com:

The NetID is initially seeded from the IP in TwinCAT, so if a PLC has 192.168.1.10, when you install TwinCAT, the NetID will become 192.168.1.10.1.1.

The relation ends there, and it is up to the ADS router to translate NetID <-> IP after that.

Many times, our machines change IPs, but the NetIDs are already being used for inter-PLC communication and so on....

Maybe this is a feature request, but it would be nice to be able to (optionally) specify the IP to connect to if the PLC's IP does not match the first four octets of the AMS NetID.

Feel free to close as "won't fix", but I'm just getting started with this code and it seems like a few people might not realize the differences between an IP and NetID

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/chwiede/pyads/issues/6

ccatterina commented 8 years ago

Hi, this feature could also be usefull to me, tomorrow i will do some tests and i'll send you the pull request.

evanmj commented 8 years ago

Thanks, I'll add it if @ccatterina does not get to it.

chwiede commented 8 years ago

Closed with #7 - thanks to @ccatterina

evanmj commented 8 years ago

Thank you!