Beckhoff Twincat Manual
Beckhoff Twincat Manual
Table of Contents
Table of Contents 2
Beckhoff TwinCAT Driver 4
Overview 5
External Dependencies 5
Device Setup 6
Symbolic Settings 7
Setting Up an AMS Remote Connection 9
Performance Optimization 15
Adding SYSTEMINFO Global Variables to a TwinCAT PLC Project 17
Address Descriptions 19
Symbolic Tag Based Addressing 19
Tag Scope 19
Addressing Atomic Data Types 20
Ordering of TwinCAT Array Data 22
Error Descriptions 23
Error Codes 23
Address Validation 25
Address <address> is out of range for the specified device or register. 25
Array size is out of range for address <address>. 25
Data type <type> is not valid for device address <address>. 25
Device Address <address> contains a syntax error. 25
Automatic Tag Database Generation Error Messages 26
Unable to generate a tag database for device <device name>. Reason: Beckhoff TwinCAT ADS DLL
necessary for import is not loaded. 26
Unable to generate a tag database for device <device name>. Reason: Device is not responding. 26
Unable to generate a tag database for device <device name>. Reason: Device returned error code
<#>. 26
Unable to generate a tag database for device <device name>. Reason: Memory allocation error. 27
Driver Error Messages 27
Unable to import from Beckhoff TwinCAT ADS Communication driver. 27
Unable to load Beckhoff TwinCAT ADS Communication driver. 27
Unable to open a communication port on the ADS router. 27
Device Status Error Messages 28
Device <Device name> is not responding. 28
Monitoring the global variable <tag address> on device <device name> to update symbol information
when a change is detected. 28
Unable to gather runtime information for device <device name>. Reason: <reason>. 29
Unable to perform Beckhoff compatibility on device <device name> due to memory allocation error. 29
Unable to synchronize with configuration file <file name> on device <device name> due to memory
allocation error. 29
www. kepware.com
Beckhoff TwinCAT Driver 3
Unable to read tag <tag address> on device <device name>. Requesting symbol information for each
transaction. 29
Read Error Messages 30
Unable to read tag <address> on device <device name>. Actual data type is not compatible with tag of
type <data type>. 30
Unable to read tag <address> on device <device name>. Address bounds exceeded. 30
Unable to read tag <address> on device <device name>. Beckhoff TwinCAT ADS DLL necessary for
runtime is not loaded. 30
Unable to read tag <address> on device <device name>. Error Code <#>. 31
Unable to read tag <address> on device <device name>. Memory allocation error. 31
Unable to read tag <address> on device <device name>. Runtime file is not valid. 31
Unable to read tag <address> on device <device name>. Symbol not found in file. 31
Unable to read tag <address> on device <device name>. Tag data size of <size> bytes(s) exceeds
actual data size of <size> byte(s). 32
Unable to read tag <address> on device <device name>. Tag does not meet filtering requirements. 32
Write Error Messages 32
Unable to write to tag <address> on device <device name>. Actual data type is not compatible with tag
of type <data type>. 32
Unable to write to tag <address> on device <device name>. Address bounds exceeded. 33
Unable to write to tag <address> on device <device name>. Beckhoff TwinCAT ADS DLL necessary for
runtime is not loaded. 33
Unable to write to tag <address> on device <device name>. Error Code <#>. 33
Unable to write to tag <address> on device <device name>. Memory allocation error. 33
Unable to write to tag <address> on device <device name>. Runtime file is not valid. 34
Unable to write to tag <address> on device <device name>. Symbol not found in file. 34
Unable to write to tag <address> on device <device name>. Tag access is Read Only 34
Unable to write to tag <address> on device <device name>. Tag data size of <size> bytes(s) exceeds
actual data size of <size> byte(s). 34
Unable to write to tag <address> on device <device name>. Tag does not meet filtering requirements. 35
Technical Notes 36
TwinCAT Memory Warning. 36
TwinCAT Time Slice Notes 36
Index 37
www. kepware.com
4 Beckhoff TwinCAT Driver
CONTENTS
Overview
What is the Beckhoff TwinCAT Driver?
Device Setup
How do I configure a device for use with this driver?
Address Descriptions
How do I reference a data location in a Beckhoff TwinCAT device?
Error Descriptions
What error messages does the Beckhoff TwinCAT Driver produce?
Technical Notes
Where can I find technical notes for the Driver?
www. kepware.com
Beckhoff TwinCAT Driver 5
Overview
The Beckhoff TwinCAT Driver is specifically designed to communicate with a Beckhoff TwinCAT software system.
The Beckhoff TwinCAT software system turns any compatible PC into a real-time controller with a multi-PLC
system, NC axis control, programming environment, and operating station. TwinCAT replaces conventional PLC
and NC/CNC controllers (as well as operating devices) with the following:
Note: This driver has external dependencies. The Beckhoff TwinCAT ADS Communication Library is required on
the same computer as the OPC server. To get the necessary files, download and install the free "Minimum Install"
available from Beckhoff.
TwinCAT I/O – Universal I/O Interface For All Common Field Buses
Many PC fieldbus cards from various manufacturers are supported. It is possible to operate more than one
fieldbus card per PC. Master and slave functionality is supported, depending on the selected fieldbus card. The
fieldbus cards can be configured and diagnosed conveniently via the TwinCAT System Manager. TwinCAT I/O
includes the TwinCAT real-time system for operating the fieldbuses and a DLL interface to application programs.
TwinCAT PLC
TwinCAT PLC was conceived as a pure software PLC. It allows up to four virtual PLC CPUs on one PC, with each
running up to four separate user tasks. TwinCAT PLC includes both the programming environment and the
Runtime system. Under the CE operating system and the embedded operating systems for the series BX and BC
controllers, only TwinCAT Runtime is available. Program modifications are implemented via network-capable
powerful communication with the Runtime system.
External Dependencies
This driver has external dependencies. The Beckhoff TwinCAT ADS Communication Library is required on the
same computer as the OPC server. To get the necessary files, download and install the free "Minimum Install"
available from Beckhoff.
The TwinCAT Automation Device Specification (ADS) is a medium-independent protocol for transmissions within
TwinCAT. As of this version, the files are available from the Beckhoff website under Download | Software |
TwinCAT 3 | TC1xxx | Runtime | TC1000 | TC3.1 ADS.
www. kepware.com
6 Beckhoff TwinCAT Driver
Device Setup
Communication Protocol
ADS API
Supported Devices
Beckhoff TwinCAT PLC
BC9xxx Coupler Controller
BX9xxx Coupler Controller
Request Timeout
This parameter specifies the amount of time that the driver will wait for a response from the device before giving
up and going on to the next request. Long timeouts will only affect performance if a device is not responding. The
valid range is 100 to 30000 milliseconds. The default setting is 1000 milliseconds.
Retry Attempts
This parameter specifies the number of times that the driver will retry a message before giving up and going on
to the next message. The valid range is 1 to 10. The default setting is 3 retries.
Device IDs
The Device ID is a specific ADS-AMS Net ID. Every PC on the network can be uniquely identified by a TCP/IP
address. The ADS-AMS Net ID is an extension of the TCP/IP address and identifies a TwinCAT message router,
such as "192.168.100.10.1.1". TwinCAT message routers exist on every TwinCAT PC and on every Beckhoff
BCxxxx bus controller.
Important: On Windows Vista and above, User Account Control (UAC) must be turned off before a remote
connection may be configured with the Beckhoff TwinCAT Remote Manager Utility. If the remote connection is
created before UAC is disabled, the configuration settings will be created in an incorrect location (resulting in
poor performance).
Note: For more information about the AMS messaging protocol, please consult Beckhoff's help documentation.
Port Number
The ADS devices in a TwinCAT message router are uniquely identified by a number referred to as the ADS-PortNr.
For more information, refer to table below.
Note: Users must allow the TCP port number 48898 (AMS port 801) on the firewall if planning to connect
remotely to an ADS/AMS router. If not, the system will not work reliably and may stop.
www. kepware.com
Beckhoff TwinCAT Driver 7
1. A Dynamic Tag is created in the client with Native as its assigned data type.
2. A Static Tag is created in the server with Default as its assigned data type.
Symbolic Settings
Import Method
The generated server tags are based on the tags defined in the Beckhoff TwinCAT device. There are two database
import methods that can be used to create a tag database: Upload Symbols from Device and Upload Symbols from
File.
l Upload Symbols from Device: This feature retrieves the tags directly from the controller over the same
Ethernet connection used for data access.
Note: At this time, tags and symbols can only be uploaded from a TwinCAT soft PLC. They cannot be
uploaded from a hardware BC/BX controller.
l Upload Symbols from File: This feature requires that, when creating the tag database from an import
file, the import file be a .tpy file generated from the Beckhoff TwinCAT PLC Control software.
l Symbol File: This parameter specifies the exact location of the .tpy file from which tags will be imported.
BC9xxx and BX9xxx models must include this file for a Runtime database.
l Auto-Synchronize With Symbol File Changes: This feature updates the Runtime database
automatically when the file has been modified.
Caution: Checking Auto-Synchronize will reflect changes to the Runtime, regardless of whether or not
the new configuration has been pushed down to the device. Users should ensure that the device is using
the same .tpy file as loaded in the server project; otherwise, inaccurate data could be obtained.
Notes:
1. Tag database changes will not appear in the server until Automatic Tag Generation is performed.
2. The BC9xxx and BX9xxx models only support database creation from a .tpy file.
www. kepware.com
8 Beckhoff TwinCAT Driver
l When disabled (default) and importing from a .tpy file, all text (names and addresses) are forced into
upper case.
l When enabled and importing from a .tpy file, mixed-case text is preserved.
l When importing directly from a TwinCAT-2 PLC, all text is upper case, regardless of this setting.
l When enabled and importing directly from a TwinCAT-3 PLC, mixed-case text is preserved.
l When disabled (default) and importing directly from a TwinCAT-3 PLC, names contain mixed case, but
addresses are in upper case.
Combination Usage
Each of the comments described above can be combined for greater control over the filtering and assignment of
OPC Read/Write item properties.
www. kepware.com
Beckhoff TwinCAT Driver 9
Only Import Variables Marked for OPC + Respect OPC Read/Write Item Properties
Variables will only be imported and visible during Runtime if "OPC:1" is defined in the comment field. Upon being
imported, corresponding tags will be assigned the appropriate Read/Write access rights.
Only Import Variables Marked for OPC + Filter + Respect OPC Item Properties
A variable with this comment will only be imported and visible during Runtime if "OPC:1" is defined in the
comment field and if the filter string found in the comment section matches the filter set in Device Properties.
Corresponding tags will be assigned Read/Write access rights once they are imported.
1. Install the Beckhoff TwinCAT Automation Device Specification (ADS) Communication Library,
which is available online from Beckhoff.
3. Beckhoff TwinCAT constructs the AMS Net ID from the TCP/IP address of the local PC by default, and uses
an extension of ".1.1". The AMS Net ID can, however, be chosen freely. In this example, the PC that is
running the OPC server has an IP address of "192.168.100.10." The Beckhoff device has an IP address of
"192.168.100.20".
www. kepware.com
10 Beckhoff TwinCAT Driver
Note: This procedure must be repeated for all remote TwinCAT PLCs. The host computer must be added
in the same way as the remote computers on each of the remote computers.
www. kepware.com
Beckhoff TwinCAT Driver 11
7. Next, click on the TwinCAT System Service icon located in the toolbar's notification area. Then, select
Router | Change AMS NetID.
8. Verify that the Local Computer AMS Net ID listed matches the one defined above. If the configuration
has changed, restart the computer.
1. To start, click on the TwinCAT system service icon located within the toolbar's notification area. Then,
select Properties.
www. kepware.com
12 Beckhoff TwinCAT Driver
3. In AMS Net ID, read or modify the desired AMS Net Identifier. The TwinCAT installation constructs the
AMS Net ID from the TCP/IP address of the local PC by default, and uses an extension of .1.1 (as if it were
a sub-net mask for field buses, target bus controllers, and so forth). The AMS Net ID can, however, be
freely chosen.
Note: When an ADS device's services are called on in the network, its AMS Net ID must be known. By
inserting the target PC, TwinCAT can establish the connection between the TCP/IP address of the target
PC and the AMS Net ID of the target message router address.
4. The remote computers must be known to each other to create an AMS connection between multiple
computers. To do so, click TwinCAT | Properties | AMS Router. The AMS Net ID is composed of the
TCP/IP of the local computer plus the suffix .1.1. The AMS Net ID is based on the TCP/IP address, but the
relationship is not entirely fixed.
www. kepware.com
Beckhoff TwinCAT Driver 13
Note: Each computer participating in communications must have an entry in the AMS Router Utility's
Remote Computers section for every other computer that is also participating in communications.
Note: For more information about the AMS messaging protocol, refer to Beckhoff's documentation.
www. kepware.com
14 Beckhoff TwinCAT Driver
1. To start, open the Device Properties for the device in which tags will be generated.
2. Select the Database Settings tab, and then select Create tag database from device.
4. Then, select the Options tab and make the desired changes.
5. Select the Database Creation tab and utilize as instructed in Database Creation Settings.
Note: At this time, tags and symbols can only be uploaded from a TwinCAT soft PLC. They cannot be
uploaded from a hardware BC/BX controller.
Note: All tags, including global and program, are imported and expanded according to their data type.
2. If using a TwinCAT 2 PLC, click Project | Clean All. If using a TwinCAT 3 PLC, click Build | Clean
Solution.
3. Then, if using a TwinCAT 2 PLC, click Project | Build. If using a TwinCAT 3 PLC, click Build | Build
Solution.
Notes:
1. The program does not generate the .tpy file again until the project is cleaned; however, the .tpy always
regenerates when the project is rebuilt.
2. The .tpy file is located in the same directory as the PLC project.
1. To start, open the Device Properties for the device in which tags will be generated.
2. Select the Database Settings tab, and then select Create tag database from import file.
3. Enter or browse for the location of the .tpy file that was previously created.
5. Then, select the Options tab and make the desired changes.
6. Select the Database Creation tab and utilize as instructed in Database Creation Settings.
Note: Online tag generation for PLC projects that contain Step-Transitions produce Boolean tags for each step,
describing the state as active or inactive. Offline generation does not produce Step-Transition tags.
www. kepware.com
Beckhoff TwinCAT Driver 15
Performance Optimization
Optimizing Communications
With any programmable controller there are unique ways for optimizing system throughput, and the Beckhoff
TwinCAT Driver is no different from the rest. The Beckhoff TwinCAT Driver is designed to optimize reads and
writes. For tags of all data types, requests are grouped into a single transaction. This provides drastic
improvement in performance over single tag transaction. The only limitation is on the number of tags that can fit
in a single transaction.
If the Beckhoff TwinCAT Driver could only define one single channel, then the example shown above would be the
only option available; however, the driver can define up to 100 channels. Using multiple channels distributes the
data collection workload by simultaneously issuing multiple requests to the network. An example of how the same
application may appear when configured using multiple channels to improve performance is shown below.
www. kepware.com
16 Beckhoff TwinCAT Driver
Each device has now been defined under its own channel. In this
new configuration, a single path of execution is dedicated to the
task of gathering data from each device. If the application has 100
or fewer devices, it can be optimized exactly how it is shown here.
The performance will improve even if the application has more
than 100 devices. While 100 or fewer devices may be ideal, the
application will still benefit from additional channels. Although by
spreading the device load across all channels will cause the server
to move from device to device again, it can now do so with far
fewer devices to process on a single channel.
www. kepware.com
Beckhoff TwinCAT Driver 17
Including the "onlineChangeCount" variable in a PLC will allow the server project to access PLC variables using
tag handles. Without it, the server must use fully qualified Symbolic information strings in each tag read. The
number of bytes in a Symbolic information string can be several times larger than the number of bytes in a tag
handle. For more information on adding the "onlineChangeCount" variable, refer to the instructions below.
Note: The following example applies to TwinCAT development environment version 2.11, and describes how to
include the SYSTEMINFO variables in a TwinCAT PLC project where the target system is a PC controller. It
assumes there is a pre-existing PLC project. The Tc2_System library is now part of the standard TwinCAT 3 PLC
template; however, the library must be added if it is not already listed in the TwinCAT 3 PLC project's Library
Manager to prevent using fully qualified symbolic information strings each time tag data is accessed.
2. Next, locate and open the Resources tab at the bottom of the Object Organizer. Then, expand the
Resources tree and double-click on Library Manager.
Note: The Library Manager should be displayed in the TwinCAT PLC Control's work area. All libraries that
are attached to a PLC project will be listed in the top left of the Library Manager. New projects should only
have the "STANDARD.LIB" library attached.
3. To add another library, right-click in the open area beneath "STANDARD.LIB" and select Additional
Library. Then, locate and double-click on PlcSystem.lib.
Note: The top left of the Library Manager should now display "PlcSystem.lib".
4. Return to the Library Manager. Then, select PlcSystem.lib and open the Data Types tab.
5. Next, open the SystemDataTypes folder and select the SYSTEMINFOTYPE structure. The variable
"onlineChangeCount" should be included within the Library Manager.
7. In the Resources tree, open the Global Variables folder. Then, double-click on the Global_Variables
icon. At this point, the variable "onlineChangeCount" should appear as an element of structure
"SystemInfo" in the work area.
Important: The "SystemInfo" structure will only be displayed within "Global_Variables" after the user
has logged in to the TwinCAT PLC Control.
www. kepware.com
18 Beckhoff TwinCAT Driver
Note: For a description of TwinCAT-platform specific data types, refer to TwinCAT Data Types.
www. kepware.com
Beckhoff TwinCAT Driver 19
Address Descriptions
The following table summarizes the valid addressing formats in the server.
Address
Notation Example Notes
Format
Standard <tag name> tag_1 Tag cannot be an array
Array <array tag name> tag_1 [2, 58, Dimension Range=1 to 3
Element [dim1, dim2, dim3] 547]
Element Range=0 to 65535
tag_1 [0,3]
String <tag name>/<string tag_1/4 Length Range=1 to 65535
length>
The number of characters to read/write equals the
string length.
Note: For information on how elements are referenced for 1, 2 and 3 dimensional arrays, refer to Ordering of
Array Data.
Tag Scope
Global tags are Beckhoff TwinCAT variables that have global scope in the controller. Any program or task can
access the global tags, which use the following notation:
. <tag name>
Program Tags
Program tags are identical to global tags, except that a program tag's scope is local to the program it is defined
in. Program tags follow the same addressing rules and limitations as global tags. The only difference is that
program tags are prefixed with the following notation:
For example, Beckhoff TwinCAT variable "tag_1" in program "prog_1" would be addressed as "prog_1.tag_1" in
a Client/Server Tag address.
www. kepware.com
20 Beckhoff TwinCAT Driver
Note: These are a few of the many addressing possibilities involving structures. These are shown here only to
provide an introduction to structure addressing. For more information, refer to the Beckhoff TwinCAT
documentation.
Atomic Array
Client/Server Standard String
Data Type Element
BOOL Data Type Boolean Boolean
Tag Example BOOLTAG BOOLARR
[0]
SINT/USINT Data Type Byte, Char Byte, Char String
Tag Example SINTTAG SINTARR SINTARR[0]/4
[0] String length cannot be longer than the array
length minus the element position.
INT/UINT Data Type Word, Short Word,
Tag Example INTTAG Short
INTARR[0]
DINT/UDINT Data Type DWord, Long DWord,
Tag Example DINTTAG Long
DINTARR
[0]
REAL Data Type Float Float
Tag Example REALTAG REALARR
[0]
LREAL* Data Type Double Double
Tag Example LREALTAG LREALARR
[0]
TIME Data Type DWord, Long DWord,
Tag Example TIMETAG Long
TIMEARR
[0]
STRING Data Type String String
Tag Example STRINGTAG/80 STRINGARR
[1]/80
www. kepware.com
Beckhoff TwinCAT Driver 21
www. kepware.com
22 Beckhoff TwinCAT Driver
www. kepware.com
Beckhoff TwinCAT Driver 23
Error Descriptions
The following categories of messages may be generated. Click on a link for a list of messages.
Address Validation
Automatic Tag Database Generation Error Messages
Driver Error Messages
Device Status Messages
Read Error Messages
Write Error Messages
Error Codes
The following sections define error codes that may be encountered in the event log of the server. Refer to the
Event Log section within the Server Options chapter of the server help file for detailed information on how the
event logger works.
www. kepware.com
24 Beckhoff TwinCAT Driver
www. kepware.com
Beckhoff TwinCAT Driver 25
Address Validation
The following error/warning messages may be generated. Click on the link for a description of the message.
Possible Cause:
A tag address that has been specified dynamically references a location that is beyond the range of supported
locations for this device.
Solution:
Verify that the address is correct; if it is not, re-enter it in the client application.
Possible Cause:
A tag address that has been specified statically is requesting an array size that is too large.
Solution:
Re-enter the address in the client application to specify a smaller value for the array or a different starting point.
Possible Cause:
A tag address that has been specified statically has been assigned an invalid data type.
Solution:
Modify the requested data type in the client application.
Possible Cause:
A tag address that has been specified statically contains one or more of the following errors:
www. kepware.com
26 Beckhoff TwinCAT Driver
2. The address is invalid according to the address format and underlying controller tag data type.
Solution:
Re-enter the address in the client application.
Unable to generate a tag database for device <device name>. Reason: Beckhoff TwinCAT ADS DLL
necessary for import is not loaded.
Unable to generate a tag database for device <device name>. Reason: Device is not responding.
Unable to generate a tag database for device <device name>. Reason: Device returned error code
<#>.
Unable to generate a tag database for device <device name>. Reason: Memory allocation error.
Possible Cause:
The driver was unable to load the TcAdsDll.dll, which is necessary for communications with the Beckhoff
TwinCAT AMS message router and database generation. The process has been aborted.
Solution:
Verify that the Beckhoff TwinCAT Automation Device Specification (ADS) Communication library is installed on the
same computer as the OPC server.
Unable to generate a tag database for device <device name>. Reason: Device
is not responding.
Error Type:
Warning
Possible Cause:
2. The named device may have been assigned an incorrect AMS Net ID address.
3. Device CPU work load is too high and has caused the process to be aborted.
Solution:
2. Verify that the AMS Net ID address given to the named device matches that of the actual device.
3. If this error occurs frequently, decrease the tag group scan rate to reduce the work load on the PLC CPU.
4. Increase the cycle time interval under Task Configurations in TwinCAT PLC Control.
Unable to generate a tag database for device <device name>. Reason: Device
returned error code <#>.
Error Type:
www. kepware.com
Beckhoff TwinCAT Driver 27
Warning
Possible Cause:
The cause depends on the error code(s) returned. The process has been aborted.
Solution:
The solution depends on the error code(s) returned.
See Also:
Error Codes
Unable to generate a tag database for device <device name>. Reason: Memory
allocation error.
Error Type:
Warning
Possible Cause:
The memory required for database generation could not be allocated. The process was aborted.
Solution:
Close any unused applications and/or increase the amount of virtual memory. Then, try again.
Possible Cause:
A software component that is necessary for communications with the Beckhoff TwinCAT AMS message router
cannot be loaded from the TcAdsDll.dll library.
Solution:
Verify that the latest version of the Beckhoff TwinCAT Automation Device Specification (ADS) Communication
Library is installed on the same computer as the OPC server. Then, restart the computer if required.
Possible Cause:
The driver was unable to load the TcAdsDll.dll, which is necessary for communications with the Beckhoff
TwinCAT AMS message router.
Solution:
Verify that the Beckhoff TwinCAT Automation Device Specification (ADS) Communication Library is installed on
the same computer as the OPC server.
Possible Cause:
www. kepware.com
28 Beckhoff TwinCAT Driver
A connection could not be established to the TwinCAT message router due to an invalid router configuration. The
Beckhoff TwinCAT Automation Device Specification (ADS) Communication Library is not configured correctly.
Solution:
Follow the steps described in Setting Up an AMS Remote Connection.
Result:
1. If the tag was being read, then the Read operation will not be performed and the tag will be invalidated.
2. If the tag was being written, then the Write operation for the given tag will not occur.
Possible Cause:
2. The named device may have been assigned an incorrect AMS Net ID address.
4. The response from the device took longer to receive than the amount of time specified in the "Request
Timeout" device setting.
Solution:
2. Verify that the AMS Net ID address given to the named device matches that of the actual device.
3. If this error occurs frequently, decrease the tag group scan rate to reduce the work load on the PLC CPU.
4. Increase the cycle time interval under Task Configurations in TwinCAT PLC Control.
5. Increase the Request Timeout setting so that the entire response can be handled.
Possible Cause:
The TwinCAT PLC is configured with the global variable ".SYSTEMINFO.ONLINECHANGECOUNT," which contains
the number of online changes that have been made since the last complete download. The driver will monitor this
variable along with all item handles to determine whether it is necessary to refresh the symbol information.
Solution:
N/A.
www. kepware.com
Beckhoff TwinCAT Driver 29
Possible Cause:
The cause depends on the error reason returned.
Solution:
The solution depends on the error reason returned.
See Also:
Error Codes
Possible Cause:
The memory required for device tags to meet Beckhoff compatibility could not be allocated.
Solution:
Close any unused applications and/or increase the amount of virtual memory. Then, restart the server and try
again.
Possible Cause:
The memory required to synchronize with .tpy Runtime file could not be allocated. The original uploaded file will
continue to be used.
Solution:
Close any unused applications and/or increase the amount of virtual memory. Then, restart the server and try
again.
Possible Cause:
The TwinCAT PLC is not configured with the global variable ".SYSTEMINFO.ONLINECHANGECOUNT," which
contains the number of online changes that have been made since the last complete download. When this
variable does not exist in the PLC, the driver will request symbol information for each transaction.
Solution:
To reduce the symbol request transactions, add the ".SYSTEMINFO.ONLINECHANGECOUNT" global variable to the
TwinCAT PLC project. The driver will then be able to monitor the global variable and will only request symbol
information when its value changes (or when an item has an invalid handle).
See Also:
Adding SYSTEMINFO Global Variables to a TwinCAT PLC Project
www. kepware.com
30 Beckhoff TwinCAT Driver
Unable to read tag <address> on device <device name>. Actual data type is not compatible with
tag of type <data type>.
Unable to read tag <address> on device <device name>. Address bounds exceeded.
Unable to read tag <address> on device <device name>. Beckhoff TwinCAT ADS DLL necessary for
runtime is not loaded.
Unable to read tag <address> on device <device name>. Error Code <#>.
Unable to read tag <address> on device <device name>. Memory allocation error.
Unable to read tag <address> on device <device name>. Runtime file is not valid.
Unable to read tag <address> on device <device name>. Symbol not found in file.
Unable to read tag <address> on device <device name>. Tag data size of <size> bytes(s) exceeds
actual data size of <size> byte(s).
Unable to read tag <address> on device <device name>. Tag does not meet filtering requirements.
Unable to read tag <address> on device <device name>. Actual data type is
not compatible with tag of type <data type>.
Error Type:
Warning
Possible Cause:
Solution:
2. Contact Technical Support so that support can be added for this type.
Note:
The data type of a item in the server should match the data type for the controller address that it references.
Possible Cause:
The controller's tag size is smaller than the requested data size.
Solution:
Ensure that the requested data size matches the address size in the controller.
Possible Cause:
The driver was unable to load the TcAdsDll.dll, which is necessary for communications with the Beckhoff
TwinCAT AMS message router.
Solution:
Verify that the Beckhoff TwinCAT Automation Device Specification (ADS) Communication Library is installed on
the same computer as the OPC server.
www. kepware.com
Beckhoff TwinCAT Driver 31
Unable to read tag <address> on device <device name>. Error Code <#>.
Error Type:
Warning
Possible Cause:
2. TwinCAT does not support a read command for error code 1793 and TwinCAT version 2.10 (Build 909) or
older.
Solution:
2. For error code 1793 and TwinCAT version 2.10 (Build 909) or older, users should update TwinCAT to the
latest version. For instructions on how to do so, contact Beckhoff.
See Also:
Error Codes
Possible Cause:
The memory required for the read request could not be allocated.
Solution:
Close any unused applications and/or increase the amount of virtual memory. Then, restart the server and try
again.
Unable to read tag <address> on device <device name>. Runtime file is not
valid.
Error Type:
Warning
Possible Cause:
Solution:
1. Ensure that there is a valid .tpy file loaded into the project.
2. In TwinCAT PLC Control, rebuild the project and load the new .tpy file into the project.
Unable to read tag <address> on device <device name>. Symbol not found in
file.
Error Type:
Warning
Possible Cause:
The tag <address> cannot be found in the .tpy file.
www. kepware.com
32 Beckhoff TwinCAT Driver
Solution:
1. Ensure that the correct .tpy file is loaded into the project .
Unable to read tag <address> on device <device name>. Tag data size of
<size> bytes(s) exceeds actual data size of <size> byte(s).
Error Type:
Warning
Possible Cause:
A read request for the specified tag failed because the controller's tag data type is smaller than the requested
data type.
Solution:
Change the tag's data type size to a size that is smaller than or equal to the ones available on the controller.
Unable to read tag <address> on device <device name>. Tag does not meet
filtering requirements.
Error Type:
Warning
Possible Cause:
A read request on tag <address> does not meet the filtering requirements defined on the controller.
2. The filter string entered does not match the string defined on the controller.
Solution:
Ensure that the controller is filtering the tag. Then, correct the filter string spelling.
Unable to write to tag <address> on device <device name>. Actual data type is not compatible with
tag of type <data type>.
Unable to write to tag <address> on device <device name>. Address bounds exceeded.
Unable to write to tag <address> on device <device name>. Beckhoff TwinCAT ADS DLL necessary
for runtime is not loaded.
Unable to write to tag <address> on device <device name>. Error Code <#>.
Unable to write to tag <address> on device <device name>. Memory allocation error.
Unable to write to tag <address> on device <device name>. Runtime file is not valid.
Unable to write to tag <address> on device <device name>. Symbol not found in file.
Unable to write to tag <address> on device <device name>. Tag access is read only.
Unable to write to tag <address> on device <device name>. Tag data size of <size> bytes(s)
exceeds actual data size of <size> byte(s).
Unable to write to tag <address> on device <device name>. Tag does not meet filtering
requirements.
Unable to write to tag <address> on device <device name>. Actual data type
is not compatible with tag of type <data type>.
Error Type:
Warning
Possible Cause:
www. kepware.com
Beckhoff TwinCAT Driver 33
Solution:
2. Contact Technical Support so that support can be added for this type.
Note:
The data type of a item in the server should match the data type for the controller address that it references.
Possible Cause:
The controller's tag size is smaller than the requested data size.
Solution:
Ensure that the requested data size matches the address size in the controller.
Possible Cause:
The driver was unable to load the TcAdsDll.dll, which is necessary for communications with the Beckhoff
TwinCAT AMS message router.
Solution:
Verify that the Beckhoff TwinCAT Automation Device Specification (ADS) Communication Library is installed on
the same computer as the OPC server.
Unable to write to tag <address> on device <device name>. Error Code <#>.
Error Type:
Warning
Possible Cause:
2. TwinCAT does not support a write command for error code 1793 and TwinCAT version 2.10 (Build 909) or
older.
Solution:
2. For error code 1793 and TwinCAT version 2.10 (Build 909) or older, users should update TwinCAT to the
latest version. For instructions on how to do so, contact Beckhoff.
See Also:
Error Codes
www. kepware.com
34 Beckhoff TwinCAT Driver
Warning
Possible Cause:
The memory required for the write request could not be allocated.
Solution:
Close any unused applications and/or increase the amount of virtual memory. Then, restart the server and try
again.
Possible Cause:
Solution:
1. Ensure that there is a valid .tpy file loaded into the project.
2. In TwinCAT PLC Control, rebuild the project and load the new .tpy file into the project.
Unable to write to tag <address> on device <device name>. Symbol not found
in file.
Error Type:
Warning
Possible Cause:
The tag <address> cannot be found in the .tpy file.
Solution:
1. Ensure that the correct .tpy file is loaded into the project .
Possible Cause:
The write request on tag <address> does not meet OPC properties as defined on the controller.
Solution:
Change the tag properties defined on the controller to Read/Write access.
Unable to write to tag <address> on device <device name>. Tag data size of
<size> bytes(s) exceeds actual data size of <size> byte(s).
Error Type:
Warning
Possible Cause:
www. kepware.com
Beckhoff TwinCAT Driver 35
A write request for the specified tag failed because the controller's tag data type is smaller than the requested
data type.
Solution:
Change the tag's data type size to a size that is smaller than or equal to the ones available on the controller.
Unable to write to tag <address> on device <device name>. Tag does not
meet filtering requirements.
Error Type:
Warning
Possible Cause:
A write request on tag <address> does not meet the filtering requirements defined on the controller.
2. The filter string entered does not match the string defined on the controller.
Solution:
Ensure that the controller is filtering the tag. Then, correct the filter string spelling.
www. kepware.com
36 Beckhoff TwinCAT Driver
Technical Notes
For more information on specific aspects of the Beckhoff TwinCAT PLC, refer to the Technical Notes listed below.
Note: The router memory size is set to 2048 KB by default. The size can be increased to a maximum of 32768
KB.
3. Double-click on Workspace.
5. The window on the right should now contain a Symbol Download box. Select Dynamic Symbols.
3. Double-click on Task Configuration, and then expand Task Configuration at the top of the middle
window.
4. Select Standard.
5. In the Task Attributes tab, change the Interval value within the Properties box.
www. kepware.com
Beckhoff TwinCAT Driver 37
Index
Error Codes 23
Error Descriptions 23
External Dependencies 5
Help Contents 4
Monitoring the global variable <tag address> on device <device name> to update symbol information when a
change is detected. 28
Performance Optimization 15
www. kepware.com
38 Beckhoff TwinCAT Driver
Tag Scope 19
Technical Notes 36
TwinCAT Memory Warning. 36
TwinCAT Time Slice Notes 36
Unable to gather runtime information for device <device name>. Reason: <reason>. 29
Unable to generate a tag database for device <device name>. Reason: Beckhoff TwinCAT ADS DLL necessary
for import is not loaded. 26
Unable to generate a tag database for device <device name>. Reason: Device is not responding. 26
Unable to generate a tag database for device <device name>. Reason: Device returned error code <#>. 26
Unable to generate a tag database for device <device name>. Reason: Memory allocation error. 27
Unable to import from Beckhoff TwinCAT ADS Communication driver. 27
Unable to load Beckhoff TwinCAT ADS Communication driver. 27
Unable to open a communication port on the ADS router. 27
Unable to perform Beckhoff compatibility on device <device name> due to memory allocation error. 29
Unable to read tag <address> on device <device name>. Actual data type is not compatible with tag of type
<data type>. 30
Unable to read tag <address> on device <device name>. Address bounds exceeded. 30
Unable to read tag <address> on device <device name>. Beckhoff TwinCAT ADS DLL necessary for runtime is
not loaded. 30
Unable to read tag <address> on device <device name>. Error Code <#>. 31
Unable to read tag <address> on device <device name>. Memory allocation error. 31
Unable to read tag <address> on device <device name>. Runtime file is not valid. 31
Unable to read tag <address> on device <device name>. Symbol not found in file. 31
Unable to read tag <address> on device <device name>. Tag data size of <size> bytes(s) exceeds actual
data size of <size> byte(s). 32
Unable to read tag <address> on device <device name>. Tag does not meet filtering requirements. 32
Unable to read tag <tag address> on device <device name>. Requesting symbol information for each
transaction. 29
Unable to synchronize with configuration file <file name> on device <device name> due to memory allocation
error. 29
Unable to write to tag <address> on device <device name>. Actual data type is not compatible with tag of
type <data type>. 32
Unable to write to tag <address> on device <device name>. Error Code <#>. 33
Unable to write to tag <address> on device <device name>. Address bounds exceeded. 33
Unable to write to tag <address> on device <device name>. Beckhoff TwinCAT ADS DLL necessary for
runtime is not loaded. 33
Unable to write to tag <address> on device <device name>. Memory allocation error. 33
Unable to write to tag <address> on device <device name>. Runtime file is not valid. 34
Unable to write to tag <address> on device <device name>. Symbol not found in file. 34
Unable to write to tag <address> on device <device name>. Tag access is Read Only 34
Unable to write to tag <address> on device <device name>. Tag data size of <size> bytes(s) exceeds actual
data size of <size> byte(s). 34
Unable to write to tag <address> on device <device name>. Tag does not meet filtering requirements. 35
www. kepware.com