Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
491 stars 193 forks source link

TwinCAT ADS Error code 1873(Hash table overflow).. #185

Closed AnandHegden closed 7 months ago

AnandHegden commented 1 year ago

Hi, Please could I know the reason for getting error code 1873 while registering the variable in TwinCAT ADS Communication and what is the possible way to solve the issue?

pbruenn commented 1 year ago

Without knowing more I would guess that you are registering too many variables

AnandHegden commented 1 year ago

Without knowing more I would guess that you are registering too many variables

added all required register only..but how to resolve it or any limitation on registering variable?

pbruenn commented 1 year ago

Without knowing more I would guess that you are registering too many variables

added all required register only..but how to resolve it or any limitation on registering variable?

Do you consider this more info? Sorry, I can't help you and I guess nobody else can, if you don't start telling us what you are doing.

AnandHegden commented 1 year ago

Please could I know what kind of information need?

AnandHegden commented 1 year ago

Hi, I am using TwinCAT 3.0 ADS Communication using for C++ MFC Application and used TcAdsDll API while registering the variable getting ADS comm error code 1873(Hash table overflow error)..Could you please know the reason and all possible ways to solve the issue?

chrisbeardy commented 8 months ago

@pbruenn

I have also started getting this issue, this happens when getting some variable handles. Does the Error code 1873 mean you are trying to acquire too many handles in one go, or just too many over the course of twincat running?

I have an application which is running 24/7, every say 60 seconds is will acquire handles, read the variables for 10 seconds, then release the handles. I only get this error every now and again which is odd as I would assume that as I am releasing the handles it should be ok. How does ADS respond if you try to acquire the handle to a variable you already have acquired a handle for, doe it creates another "reference" / hash table entry, i.e. could it be I am sometimes not releasing the handles?

How would I recover from this error? the only way I have found so far is rebooting the PLC.

pbruenn commented 8 months ago

Sorry, my knowledge ends when the TCP packet is send from the socket. The error is emitted by the ADS device on the other side so the meaning of 1873 depends on the specific ADS device. If it is a TwinCAT 2 or TwinCAT 3 PLC, please ask your Beckhoff support about the meaning. This is a generic problem and not related to this open source library, so they should be able to help you.

chrisbeardy commented 7 months ago

I have been doing some experimentation, and found the cause of the issue.

For your interest:

In my case, there was some very specific behaviour in the programming language (garbage collection in python) which meant that my notification handles were not being deleted as I expected. This means I have now solved my problem by making sure I actively delete my handle.

pbruenn commented 7 months ago

@chrisbeardy thanks for reporting back!