Frequently Asked Questions on Beckhoff TwinCAT(Part5)

Q:PLC: Error no more ADS instances available (8191 are in use)! Run time stopped。

What the mean of 8191? there is not so many instances was created in target and what will cause this issue?


A: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.

Q: FB_FILEREAD treats 0x1A as an end-of-file marker.

A:When reading a txt file, if there is 0x1A (26, SUB) in the file, FB_FILEREAD will treat it as an end-of-file marker, resulting in the file not being read completely.

By setting the nMode in FB_FileOpen to FOPEN_MODEBINARY, you can read the entire file without encountering this issue.

Q:Due to conflicts in the address allocation for VAR_CONFIG, after running "clean_all", the TWINCAT_CONFIGURATION variable table disappears. What should I do?

A:Solution: Save the program to a different path and recompile. If a *.tpa file appears in the new path, it indicates that the address allocation has been successful.



Q: What should I do if I cannot add any more to a real data type after it reaches 65536?

A:The real data type cannot be incremented beyond 65536 + 0.03. This is a limitation of this data type, and it is recommended to use the lreal type for calculations. Here's an explanation of why this occurs:A:


real = float has a range of "-3.4E+38 to 3.4E+38". The FLOAT data type is used to store single-precision or double-precision floating-point numbers; floating-point numbers use the IEEE format. Single-precision floating-point values have 4 bytes, including a sign bit, an 8-bit binary exponent, and a 23-bit mantissa.

Since the trailing bits of real are 23 bits, it can display 24 bits of data, which equals the number of integer bits in binary plus the number of fractional bits in binary.

For example:

65536.003 = 10000000000000000.000000001100010010

There are 16 integer bits and 9 fractional bits, which exceeds 24 bits, so it is truncated.

65536.004 = 10000000000000000.000000010000011000

There are 16 integer bits and 8 fractional bits, which does not exceed 24 bits, so it is preserved.


Q: How to set up Global Task Config?

A:The Global Task Config setting was not available in previous TC3 versions. This setting is primarily related to vision processing. A brief introduction to the setup scenarios for this section is provided in the "TF7000-TF7300_TC3_Vision_en_V1.3" manual. Please refer to it for more information:


https://infosys.beckhoff.com/content/1033/tf7xxx_tc3_vision/10716825995.html?id=3902226470102874538

Q: Unresolved reference: 'FW_CHECKMEMORYAREA'
A:The version of TwinCAT 3 does not match the version of the program, and a library that is not supported for execution is being used. In actual testing, switching the software version using an RM patch still results in an error. It is necessary to add the libraries that are causing exceptions to the project piece by piece for testing.
Once you identify the problematic library, right-click on it and go to its properties to set the appropriate version.





Q: How can I display different colors for TwinCAT comment sections with two slashes and three asterisks?
A:Navigate to "tools" - "options" - "twincat" - "PLC Environment" - "syntax highlighting" - "comment".
For "comment", you can set the font and background colors for comments using either "//" or "(* ... *)".

For "Documentation comment", you can set the font and background colors for comments using "///".



Q: When installing TwinCAT3, a message appears saying "Please wait while Windows configures Beckhoff TwinCAT3 Type System."

A: If you encounter the error message below (TwinCAT 3 cannot be found on this system), please check if you have ticked the option to embed an existing VisualStudio in the system as the development environment in the previous pop-up window.

If you have not installed VS in the system before, please make sure to tick the option for XAEshell.



Q: "Beckhoff ';' expected instead of 'garbled text'"

A: This error message is caused by the presence of comments in the step names and transition conditions of the SFC (Sequential Function Chart) in TC2. In TC2, comments are effectively added to variable names as parentheses and asterisks, which are directly recognized as part of the variable name when converted to TC3 (including Chinese characters, which result in garbled text). To resolve this, you need to first remove all comments from the variable names in the TC2 program and then convert it to TC3.


Q: 'TwinCAT System' (1000): Debug: CSysService::MappedCreateFile

A: Solution: After deleting the USB device from the project, rescan the configuration, activate, and download. The error should no longer occur.


Q: Beckhoff license :No device was found for the systemID, and the authorization file request failed.

A: When sending the license request email, an error message is returned. Please refer to the image below to avoid making mistakes. When applying, please pay attention to the positions where you fill in the license ID and custom information. They must be filled in correctly, and the license ID corresponds to the actual order number.

When you open the generated reques file with a text editor, you can see "<PurchaseOrder>" as the order number and "<CustomerOrder>" as the customer information.


Q: The target visualization is not supported



A:For controllers in CE systems: When downloading TwinCAT 2 visualization programs, it should be noted that there are functional limitations for controllers in CE systems. For instance, functions such as trend and alarm lights are not available, which may lead to this error message.

https://infosys.beckhoff.com/content/1033/tcplchmice/11280267531.html?id=7418971478571109086


For non-CE system controllers: Please check the CE settings below and ensure that the checkbox is unchecked.


Like my work? Consider a donation! 👇