Closed turnerpeterk closed 5 years ago
Yes, this could be the "next" packet sent from PLC. Are there any active notifications set on your device?
Not that I know of, but the PLC is periodically sending out empty packets with Command ID 4 - can this be turned off?
(Also - thanks for this repo. I've found it very useful!)
I've had an occasional issue where pyads never receives a response after setting a variable, and times out.
ReadAmsPacketFromSocket
reads all data from Socket, generates a packet, and appends any additional bytes as data. The additional bytes could be another packet, so this is lost. In the example below, the "dropped" packet specifies data length 0, but still has data. This data is actually another packet which was never received properly.This PR updates pyads to only return packets of length specified in AMS header, and any additional data is cached in
self.response
for use the next timeReadAmsPacketFromSocket
is called.