此条问题内部查阅,暂时不要公开
问:
what the mean of 8191? there is not so many instances was created in target and what will cause this issue?
答:
- The number of ADS handles is limited to 8k.
- This is necessary because otherwise a blue screen can occur when the list is longer.
- Mostly this happens if someone is using an ADS FB inside a function (not a function block).
- Reason:
- We need a list of all ADS instances inside TwinCAT runtime.
- If a new ADS instance is used first time a place in the list is reserved for this instance.
- The place in the list is stored in the instance. So everytime the ADS instance is used it will first look into the list and see if on the reserved place is an answer from someone or not.
- If the ADS instance is used in a function the memory is always cleared when the function is called. Means: everytime the function is called the internal used ADS instance see that it has no number in the list and tries to get a new one.
- Means: after 8.000 call the limit is reached and the error message is thrown.
What to do:
- Check the customers project if functions are used with an ADS instance (ADS read, write, readwrite, file, …). Anything with ADS needs to be used from a FB instead of a function!
- If not à check if someone is deleting the memory of an ADS instance (via Memset or via pointer usage). This is of course not so easy to find.