Beckhoff TwinCAT Frequently Asked Questions (Part9)

Q: During OPC UA installation, an error occurred: Microsoft.NET framework ads-error 0x12A.

A:This error is due to the version requirements of the .NET framework for high-version functions: Version 4.3.44 of TF(TS)6100 requires at least version 4.5.2 of the framework to support the installation and configuration tools.

If you are installing it locally on the controller, please click "continue" first, and then proceed with the installation using a programming computer.

This component can be obtained from the Microsoft website.:https://dotnet.microsoft.com/download/dotnet-framework



Q: An error occurs in Twinsafe: "The saved IO TreeItem Objectid of the selected target system does not exist."


A: The error is caused by a change in the topological order of the safety master station, resulting in a mismatch between the Term ID in the lower diagram and the Physical device in the upper diagram.




Q: I purchased a TF6255 license for Beckhoff controllers and now I want to implement Modbus RTU Slave communication. What is the Modbus address corresponding to the custom MB0 in the program?

A: It corresponds to the HOLDING REGISTER area, and the starting address is: 16385.




Q: What is the function of the "AutoSave" setting in TwinCAT2 PLC Control? If the program is accidentally lost or damaged, can this feature be used to recover or retrieve the program?

A: By setting the Auto Save Interval (default is 10 minutes, minimum can be set to 1 minute), it ensures that the currently open program is automatically saved to a file with the same name but with an ".ads" extension. If the program is closed normally, this asd file will be automatically deleted. However, if the program is closed unexpectedly (such as due to a sudden power outage), this asd file will be preserved. When the program is opened next time, it will prompt whether to load the most recent automatically saved asd file content before the accident.

In some cases, the original program may be unable to open due to damage. In such situations, we can change the asd file extension to .pro(.prx) to open the automatically saved program content. Compared to the backup .bak file with the same name, the asd file recovers a version of the program content that is closer to the final edited version.

Q: How to encapsulate user-defined function blocks (userfb) in Twinsafe safety?



A: Encapsulating FB:

Method 1: Suitable for logic programs that have already been partially written and need to be encapsulated into an FB.
  1. Firstly, create the following logic in TwinSafeGroup1.sal:

  2. Right-click on the blank area of the program and select "User FB Handing" -> "Create"

    Select input/output interface in the pop-up window

  3. After completion, click OK, and you can see that the current program logic has been encapsulated into "uerFB1.ufb". If you need to rename the FB, follow these steps:



Method 2: Suitable for encapsulating an FB before writing the program

  1. Navigate to UserFBs and right-click to add a new one. Once added, you can then proceed to write the logic for the FB.

Q: Why does the program return 1 instead of 0 for expt(0, 1/2)?

A:The program interprets the value of 1/2 as 0, and any number raised to the power of 0 is 1.
You simply need to change 1/2 to 0.5, and the answer will become 1.
Q: How does TwinCAT automatically update EtherCAT (XML) description files?
A: When we scan Beckhoff's EtherCAT slaves, sometimes due to the newer module hardware version or firmware version, we may encounter a prompt similar to the following:

In this situation, we need to update the EtherCAT description file to allow TwinCAT to correctly identify the module. Here's how to automatically update the EtherCAT description file using TwinCAT (prerequisite: the computer has access to the internet):

TwinCAT 2: Follow the steps in the System Manager as shown in the figure below:


TwinCAT 3: Follow the steps as shown in the figure below


After completing the above steps, the EtherCAT description file will be automatically updated to the latest version. Remember to restart the SystemManager (TC2) or TwinCAT3 (TC3) to recognize the latest module.

You can see in the folder where the corresponding EtherCAT description file is located that previous files will be automatically compressed and backed up into a single file based on the date. If needed in the future, you can restore an old description file from this backup.

Like my work? Consider a donation! 👇