Beckhoff / ADS

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

Problems after online change #63

Closed pillh closed 5 years ago

pillh commented 6 years ago

I do have Problems after an online Change wehre I add a variable to the PLC. It seems that the system does not update the internal variable offsets and therefore there is a communication loss between the PLC Task and the ADS Server on the PLC.

I do have a TC3 PLC (CX9020-115) and an embedded Linux used for visalization.

On the Linux panel i do get the variable info by reading the group ADSIGRP_SYM_INFOBYNAMEEX. Those handles I use for multiple reads - which usually do work perfectly. Also I added callbacks for changes in the PLC-state and symboltable. If any change takes place, I will clear my internal table containing the ADSIGRP_SYM_INFOBYNAMEEX Information and read it again from the PLC.

The problem is that

  1. I do not get a callback thet the symboltable/PLC state has changed
  2. even if I clear the internal Information manually / restart the Client progam / reboot the Client the ADS Information will be wrong. It seems the the communication between the PLC and the ADS server is lost, because I do get "old" not changing data instead of my life values. It only helps if I restart the PLC.

I've already made a ticket at the standard Support (BTS-5931) . Unfortunately they think the problem is related to the LINUX ADS client.

pbruenn commented 6 years ago

Just for the record: I am not an expert on ADS. For me and for this open source library all the ADS "commands" (indexgroup/offsets) are completely transparent. That said, here is what I think:

  1. Either the notifications are not send by TwinCAT or not recognized by AdsLib. Can you attach Wireshark and look if the notifications are send to the wire?
  2. I am not sure about the inner workings of the PLC but I would expect it to recover if you completely restart the client. If you are able to link your application or a small reproducer against TcAdsDll.dll, it should help Beckhoff support to understand your problem better.