Frequently Asked Questions on Beckhoff TwinCAT(Part2)

Q: 1801 Multi-task data access synchronization in the PLC


A:The ADS-based function block instance cannot be used in different tasks within a PLC. If the same instance is called by multiple tasks concurrently, an error ADSERR_DEVICE_INVALIDCONTEXT=0x709=1801 will be triggered.

To resolve this issue, ensure that the relevant instructions are only used within the same task. You can pass data to other tasks using input/output types. This allows for proper synchronization of data access across multiple tasks in the PLC.


https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_plc_intro/45844579955484184843.html&id=2972649925198044529


Q: When using TwinCAT 3 programming interface, the point (·) and arrow (→) icons appear unexpectedly, and spaces are replaced with special characters.How to address this issue?

Answer:When you encounter the issue of unexpected appearance of the point (·) and arrow (→) icons, as well as the replacement of spaces with special characters in TwinCAT 3 programming interface, the most likely cause is an unintended change in the software's settings.



Solution: Locate "Edit" in the menu bar at the top of the software, find "Advanced," and click on "View White Space."


Q:cpp compatible calls need a stack alignment of 4 bytes?
A:When making cpp compatible calls, a stack alignment of 4 bytes is required. This is due to the ARM architecture's alignment requirement, even if the data size is only 1 byte, it still occupies 4 bytes in the structure for alignment purposes.



https://infosys.beckhoff.com/content/1033/tcplccontrol/925634571.html?id=4438929717255469116


Proposed Solution: When encountering the need to switch between controllers with different CPU types, it is recommended to modify the alignment method in the properties when creating the structure.



https://tr.beckhoff.com.cn/mod/data/view.php?d=19&rid=2625

Q: Failed to download file(1804). Filename too long (max 32)
A:A customer was trying to perform a store and write authorization file operation on an EL6070 device using an authorization file provided by Germany. However, they encountered an error code 1804, indicating that the filename was too long, exceeding the maximum length limit of 32 characters.

Resolution:
To resolve this issue, the customer needed to modify the filename to be less than 32 characters, store it, and then activate the device. Once this was done, the authorization became effective.



Q:How to achieve microsecond-level timing (0.1ms, 0.05ms) using a timer function block?

A:The TON function block is sufficient for millisecond-level timing, for microsecond-level precision, you should utilize the LTON (Long Timer ON) function block. However, it's important to keep in mind that although LTON operates with nanosecond precision, its practical usage is limited by the PLC's TASK cycle, which has a minimum unit of 50 microseconds. This limitation needs to be considered when aiming for microsecond-level timing.

When using the LTON function block and encountering a compilation error stating "Expression expected instead of T#50" for the PT (Preset Time) pin, which expects a time format of LTIME, ensure that the value provided for the PT pin adheres to the expected LTIME format and is within the supported range. This typically involves providing a time value in the correct syntax and data type that is compatible with the LTIME format.


However, if the PT pin is filled in according to the TON format, a compilation error will occur, as shown in the following figure:





This is because the LTON function block requires a specific time format, such as LTIME#50us, to be entered before it can be used.




Q: How to convert the sample value of the Elm3xxx module?

A:The sample value range of this series of modules is typically: -8388608 to +8388607. However, please refer to the corresponding specifications in the product manual for specific details.

https://download.beckhoff.com/download/document/io/ethercat-terminals/elm3xxxen.pdf

Please note that there is a parameter called "sampling mode," which is set to Extended Range Mode by default and affects the resolution and corresponding sampling range. When performing conversions, make sure to adjust this parameter accordingly.

For example, in the case of the Elm3104-0020, the actual measurement range may vary for the same resolution depending on the different FSV (Full Scale Value) and Mode settings.





Q:How do I use the Event Viewer? How can I view detailed information about missing licenses using the Event Viewer?
A:When using TwinCAT 3 software, errors may sometimes occur due to missing licenses.


It often leads to an error message saying "Error starting TwinCAT system," but it does not clearly specify which specific license is missing.




In this case, you can use the Event Viewer to view specific information.

Here are the steps to follow:Find the TwinCAT icon in the taskbar, click on it, and locate "Tools". Expand the options and click on "Event Viewer" to open the tool.


After opening it, expand "Windows Logs" in the left pane of the Event Viewer, then click on "Applications" to find the error that occurred during the specific time frame. Note: You need to look for errors with a source of "TcSysSrv." After clicking on the error, detailed information will be displayed below, including information about the specific missing licenses.

Like my work? Consider a donation! 👇