You have two options to register TwinCAT. The first option keygen in instalation visit video another option is in next video. TwinCAT Scope2. With the TwinCAT Scope 2 Beckhoff offers a graphical tool for signal analysis and data collection. Due to the separation of the data logger and viewer it is possible to show the signal processes of multiple systems in the field in a central Scope 2 view.
Sample Results From Member DownloadsDownload Name | Date Added | Speed |
---|---|---|
Twincat 2.11 | 17-Jun-2019 | 2,442 KB/s |
Twincat 2.11 | 17-Jun-2019 | 2,590 KB/s |
Twincat 2.11 Crack | 16-Jun-2019 | 2,510 KB/s |
Twincat 2.11 2019 | 14-Jun-2019 | 2,169 KB/s |
Twincat 2.11 [verified] | 14-Jun-2019 | 2,390 KB/s |
Twincat.2.11_10.Jun.2019.rar | 10-Jun-2019 | 2,778 KB/s |
Twincat 2.11 (2019) Retail | 09-Jun-2019 | 2,784 KB/s |
Zedload.com provides 24/7 fast download access to the most recent releases. We currently have 289,009 full downloads including categories such as: software, movies, games, tv, adult movies, music, ebooks, apps and much more. Our members download database is updated on a daily basis.
Take advantage of our limited time offer and gain access to unlimited downloads for FREE! That's how much we trust our unbeatable service. This special offer gives you full member access to our downloads. Click to the Zedload tour today for more information and further details to see what we have to offer.
Take advantage of our limited time offer and gain access to unlimited downloads for FREE! That's how much we trust our unbeatable service. This special offer gives you full member access to our downloads. Click to the Zedload tour today for more information and further details to see what we have to offer.
Download Search Tips
To improve search results for Twincat 2.11 try to exclude using words such as: serial, code, keygen, hacked, patch, warez, etc. Simplifying your search query should return more download results.
Many downloads like Twincat 2.11 may also include a crack, serial number, unlock code or keygen (key generator). If this is the case then it is usually made available in the full download archive itself.
Many downloads like Twincat 2.11 may also include a crack, serial number, unlock code or keygen (key generator). If this is the case then it is usually made available in the full download archive itself.
Copy & Paste Links
Crack in this context means the action of removing the copy protection from software or to unlock features from a demo or time-limited trial. There are crack groups who work hard in order to unlock software, games, etc. If you search for Twincat 2.11 Crack, you will often see the word 'crack' amongst the results which means it allows you to unlock the full version of the software product.
![Twincat Twincat](/uploads/1/2/5/7/125701350/514825220.gif)
![Twincat 2 vs twincat 3 Twincat 2 vs twincat 3](/uploads/1/2/5/7/125701350/112848113.jpg)
What is a Serial?
Serial means a unique number or code which identifies the license of the software as being valid. All retail software uses a serial number or key of some form. A serial number can also be referred to as an Activation Code or CD Key. When you search for Twincat 2.11 Serial, you may sometimes find the word 'serial' in the results. This usually means your software download has a serial number.
What is a Keygen?
Keygen is short for Key Generator. It means a small program that can generate an activation code, serial number, license code or registration number for a piece of software. A keygen is made available by crack groups free to download. If you search a site for Twincat 2.11 Keygen, you may see the word 'keygen' in the results which usually means your download includes a keygen.
Popular Searches
Twincat 2.11 | Epica Live In Chile DVD Bootleg 2005 | Off Road Drive 3 Russ | Test Drive Unlimetetd | Lionel Traintown | Bluesoleil Bluetooth Driver Free Downloa | Producer Style Pack Escapes | Avs Corverted | Gta Librtycity | Eye Candy 6.1.1.1058 License Code | Warm Bodies 2013 BRRip Xvid AC3 Summer13gb | Motrola Phone Tools 4 | Dune 2000 Empror | Audion Labs Podcast Station V1.0.0.7 | Z44x Comvb Php Tutorial | Btls 032106 |
[ Home | Signup | Take A Tour | FAQ | Testimonials | Support | Terms & Conditions | Legal & Content Removal ]
Design and Layout © 2019 Zedload. All rights reserved.
Design and Layout © 2019 Zedload. All rights reserved.
Beckhoff TwinCAT Driver
© 2017 PTC Inc. All Rights Reserved.
Beckhoff TwinCAT Driver
2
Table of Contents Beckhoff TwinCAT Driver
1
Table of Contents
2
Beckhoff TwinCAT Driver
5
Overview
6
External Dependencies
7
Setup
8
Channel Properties - General
8
Channel Properties - Ethernet Communications
9
Channel Properties - Write Optimizations
10
Channel Properties - Advanced
11
Device Properties - General
11
Device Properties - Scan Mode
13
Device Properties - Timing
14
Device Properties - Auto-Demotion
15
Device Properties - Tag Generation
15
Device Properties - Communications Parameters
18
Device Properties - Options
18
Device Properties - Symbolic Settings
19
Device Properties - Redundancy
21
Automatic Tag Database Generation
22
Performance Optimization
24
Data Type Descriptions
25
Address Descriptions
26
Symbolic Tag Based Addressing
26
Tag Scope
26
Addressing Atomic Data Types
27
Ordering of TwinCAT Array Data
29
Error Descriptions
31
Error Codes
31
Address Validation
34
Address is out of range for the specified device or register.
34
Array size is out of range for address .
34
Data type is not valid for device address .
34
Device Address contains a syntax error.
34
Automatic Tag Database Generation Error Messages
www. ptc.com
35
Beckhoff TwinCAT Driver
3
Unable to generate a tag database for device . Reason: Beckhoff TwinCAT ADS DLL necessary for import is not loaded.
35
Unable to generate a tag database for device . Reason: Device is not responding. 35 Unable to generate a tag database for device . Reason: Device returned error code .
36
Unable to generate a tag database for device . Reason: Memory allocation error. 36
Driver Error Messages
36
Unable to import from Beckhoff TwinCAT ADS Communication driver.
36
Unable to load Beckhoff TwinCAT ADS Communication driver.
37
Unable to open a communication port on the ADS router.
37
Device Status Error Messages
37
Device is not responding.
38
Monitoring the global variable on device to update symbol information when a change is detected.
38
Unable to gather runtime information for device . Reason: .
38
Unable to perform Beckhoff compatibility on device due to memory allocation error.
39
Unable to synchronize with configuration file on device due to memory allocation error.
39
Unable to read tag on device . Requesting symbol information for each transaction.
39
Read Error Messages
40
Unable to read tag on device . Actual data type is not compatible with tag of type .
40
Unable to read tag on device . Address bounds exceeded.
40
Unable to read tag on device . Beckhoff TwinCAT ADS DLL necessary for runtime is not loaded.
41
Unable to read tag on device . Error Code .
41
Unable to read tag on device . Memory allocation error.
41
Unable to read tag on device . Runtime file is not valid.
42
Unable to read tag on device . Symbol not found in file.
42
Unable to read tag on device . Tag data size of bytes(s) exceeds actual data size of byte(s). 42 Unable to read tag on device . Tag does not meet filtering requirements.
Write Error Messages
43 43
Unable to write to tag on device . Actual data type is not compatible with tag of type .
43
Unable to write to tag on device . Address bounds exceeded.
44
Unable to write to tag on device . Beckhoff TwinCAT ADS DLL necessary for runtime is not loaded.
44
www. ptc.com
Beckhoff TwinCAT Driver
4
Unable to write to tag on device . Error Code .
44
Unable to write to tag on device . Memory allocation error.
45
Unable to write to tag on device . Runtime file is not valid.
45
Unable to write to tag on device . Symbol not found in file.
45
Unable to write to tag on device . Tag access is Read Only
46
Unable to write to tag on device . Tag data size of bytes(s) exceeds actual data size of byte(s).
46
Unable to write to tag on device . Tag does not meet filtering requirements.
46
Technical Notes
47
TwinCAT Memory Warning.
47
TwinCAT Time Slice Notes
47
Appendix: SYSTEMINFO Global Variables in a TwinCAT PLC Project
49
Appendix: Setting Up an AMS Remote Connection
50
Index
55
www. ptc.com
Beckhoff TwinCAT Driver
5
Beckhoff TwinCAT Driver Help version 1.068
CONTENTS Overview What is the Beckhoff TwinCAT Driver?
Device Setup How do I configure a device for use with this driver?
Automatic Tag Database Generation How can I easily configure tags for the Beckhoff TwinCAT Driver?
Optimizing Beckhoff TwinCAT Communications How do I get the best performance from this driver?
Data Types Description What data types does the Beckhoff TwinCAT Driver support?
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 this driver?
www. ptc.com
Beckhoff TwinCAT Driver
6
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: l
l
open, compatible PC hardware. embedded IEC 61131-3 software PLC, software NC and software CNC in Windows NT/XP/Vista, NT/ XP Embedded, and CE.
l
programming and Runtime systems together on one PC or separated.
l
connection to all common field buses.
l
support of PC interfaces.
l
data communication with user interfaces and other programs by means of open standards (such as OPC, OCX, DLL, and so forth).
World-wide Connection Through Message Routing TwinCAT PLC programs can run on PCs or on Beckhoff Bus Terminal Controllers. A message router manages and distributes all the messages, both in the system and via TCP/IP connections. PC systems can be connected with each other via TCP/IP; Bus Terminal Controllers are integrated via serial interfaces and field buses.
TwinCAT ADS (Automation Device Specification) The data link to TwinCAT servers occurs via the message router system, which enables Windows programs to both work with the local server and to exchange data with registered TwinCAT servers worldwide. The message router allows data exchange to remote servers on other PCs or field equipment. 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 networkcapable powerful communication with the Runtime system.
www. ptc.com
Beckhoff TwinCAT Driver
7
External Dependencies This driver has external dependencies. The Beckhoff TwinCAT ADS Communication Library is required on the same computer as the 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. ptc.com
Beckhoff TwinCAT Driver
8
Setup Communication Protocol ADS API
Supported Devices Beckhoff TwinCAT PLC BC9xxx Coupler Controller BX9xxx Coupler Controller
Maximum Channels and Devices The maximum number of channels supported by this driver is 100. The maximum number of devices per channel is 1024.
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.
AMS Remote Connections Management To communicate successfully with any remote TwinCAT runtime engine on a Beckhoff PLC (or an ADS library on any remote PC), the AMS Remote Connection Manager utility must be used to assign an AMS Net ID to the local station hosting the Beckhoff TwinCAT Driver. The AMS Net ID is also used to establish routes to remote AMS/ADS enabled devices. For more information, refer to Setting Up an AMS Remote Connection. 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). For more information about the AMS messaging protocol, consult Beckhoff's help documentation.
Tag Database Creation The Automatic OPC Tag Database Generation features of this driver have been designed to make setting up the OPC application less time consuming. This driver can be configured to automatically build a list of server tags within the server that correspond to device specific data. The automatically generated OPC tags can then be browsed from the OPC client.
Channel Properties - General This server supports the use of simultaneous multiple communications drivers. Each protocol or driver used in a server project is called a channel. A server project may consist of many channels with the same communications driver or with unique communications drivers. A channel acts as the basic building block of an OPC link. This group is used to specify general channel properties, such as the identification attributes and operating mode.
www. ptc.com
Beckhoff TwinCAT Driver
9
Identification Name: User-defined identity of this channel. In each server project, each channel name must be unique. Although names can be up to 256 characters, some client applications have a limited display window when browsing the OPC server's tag space. The channel name is part of the OPC browser information. For information on reserved characters, refer to 'How To... Properly Name a Channel, Device, Tag, and Tag Group' in the server help. Description: User-defined information about this channel. Many of these properties, including Description, have an associated system tag. Driver: Selected protocol / driver for this channel. This property specifies the device driver that was selected during channel creation. It is a disabled setting in the channel properties. Note: With the server's online full-time operation, these properties can be changed at any time. This includes changing the channel name to prevent clients from registering data with the server. If a client has already acquired an item from the server before the channel name is changed, the items are unaffected. If, after the channel name has been changed, the client application releases the item and attempts to reacquire using the old channel name, the item is not accepted. With this in mind, changes to the properties should not be made once a large client application has been developed. Utilize the User Manager to prevent operators from changing properties and restrict access rights to server features.
Diagnostics Diagnostics Capture: When enabled, this option makes the channel's diagnostic information available to OPC applications. Because the server's diagnostic features require a minimal amount of overhead processing, it is recommended that they be utilized when needed and disabled when not. The default is disabled. Note: This property is disabled if the driver does not support diagnostics. For more information, refer to 'Communication Diagnostics' in the server help.
Channel Properties - Ethernet Communications Ethernet Communication can be used to communicate with devices.
Ethernet Settings
www. ptc.com
Beckhoff TwinCAT Driver
10
Network Adapter: Specify the network adapter to bind. When Default is selected, the operating system selects the default adapter.
Channel Properties - Write Optimizations As with any OPC server, writing data to the device may be the application's most important aspect. The server intends to ensure that the data written from the client application gets to the device on time. Given this goal, the server provides optimization properties that can be used to meet specific needs or improve application responsiveness.
Write Optimizations Optimization Method: controls how write data is passed to the underlying communications driver. The options are: l
l
l
Write All Values for All Tags: This option forces the server to attempt to write every value to the controller. In this mode, the server continues to gather write requests and add them to the server's internal write queue. The server processes the write queue and attempts to empty it by writing data to the device as quickly as possible. This mode ensures that everything written from the client applications is sent to the target device. This mode should be selected if the write operation order or the write item's content must uniquely be seen at the target device. Write Only Latest Value for Non-Boolean Tags: Many consecutive writes to the same value can accumulate in the write queue due to the time required to actually send the data to the device. If the server updates a write value that has already been placed in the write queue, far fewer writes are needed to reach the same final output value. In this way, no extra writes accumulate in the server's queue. When the user stops moving the slide switch, the value in the device is at the correct value at virtually the same time. As the mode states, any value that is not a Boolean value is updated in the server's internal write queue and sent to the device at the next possible opportunity. This can greatly improve the application performance. Note: This option does not attempt to optimize writes to Boolean values. It allows users to optimize the operation of HMI data without causing problems with Boolean operations, such as a momentary push button. Write Only Latest Value for All Tags: This option takes the theory behind the second optimization mode and applies it to all tags. It is especially useful if the application only needs to send the latest value to the device. This mode optimizes all writes by updating the tags currently in the write queue before they are sent. This is the default mode.
Duty Cycle: is used to control the ratio of write to read operations. The ratio is always based on one read for every one to ten writes. The duty cycle is set to ten by default, meaning that ten writes occur for each read operation. Although the application is performing a large number of continuous writes, it must be ensured that read data is still given time to process. A setting of one results in one read operation for every write operation. If there are no write operations to perform, reads are processed continuously. This allows optimization for applications with continuous writes versus a more balanced back and forth data flow. Note: It is recommended that the application be characterized for compatibility with the write optimization enhancements before being used in a production environment.
www. ptc.com
Beckhoff TwinCAT Driver
11
Channel Properties - Advanced This group is used to specify advanced channel properties. Not all drivers support all properties; so the Advanced group does not appear for those devices.
Non-Normalized Float Handling: Non-normalized float handling allows users to specify how a driver handles non-normalized IEEE-754 floating point data. A non-normalized value is defined as Infinity, Not-aNumber (NaN), or as a Denormalized Number. The default is Replace with Zero. Drivers that have native float handling may default to Unmodified. Descriptions of the options are as follows: l
l
Replace with Zero: This option allows a driver to replace non-normalized IEEE-754 floating point values with zero before being transferred to clients. Unmodified: This option allows a driver to transfer IEEE-754 denormalized, normalized, nonnumber, and infinity values to clients without any conversion or changes.
Note: This property is disabled if the driver does not support floating point values or if it only supports the option that is displayed. According to the channel's float normalization setting, only real-time driver tags (such as values and arrays) are subject to float normalization. For example, EFM data is not affected by this setting. For more information on the floating point values, refer to 'How To ... Work with Non-Normalized Floating Point Values' in the server help. Inter-Device Delay: Specify the amount of time the communications channel waits to send new requests to the next device after data is received from the current device on the same channel. Zero (0) disables the delay. Note: This property is not available for all drivers, models, and dependent settings.
Device Properties - General A device represents a single target on a communications channel. If the driver supports multiple controllers, users must enter a device ID for each controller.
Identification
www. ptc.com
Beckhoff TwinCAT Driver
12
Name: This property specifies the name of the device. It is a logical user-defined name that can be up to 256 characters long, and may be used on multiple channels. Note: Although descriptive names are generally a good idea, some OPC client applications may have a limited display window when browsing the OPC server's tag space. The device name and channel name become part of the browse tree information as well. Within an OPC client, the combination of channel name and device name would appear as 'ChannelName.DeviceName'. For more information, refer to 'How To... Properly Name a Channel, Device, Tag, and Tag Group' in server help. Description: User-defined information about this device. Many of these properties, including Description, have an associated system tag. Channel Assignment: User-defined name of the channel to which this device currently belongs. Driver: Selected protocol driver for this device. This property specifies the driver selected during channel creation. It is disabled in the channel properties. Model: This property specifies the specific type of device that is associated with this ID. The contents of the drop-down menu depends on the type of communications driver being used. Models that are not supported by a driver are disabled. If the communications driver supports multiple device models, the model selection can only be changed when there are no client applications connected to the device. Note: If the communication driver supports multiple models, users should try to match the model selection to the physical device. If the device is not represented in the drop-down menu, select a model that conforms closest to the target device. Some drivers support a model selection called 'Open,' which allows users to communicate without knowing the specific details of the target device. For more information, refer to the driver help documentation. ID: This property specifies the device's driver-specific station or node. The type of ID entered depends on the communications driver being used. For many communication drivers, the ID is a numeric value. Drivers that support a Numeric ID provide users with the option to enter a numeric value whose format can be changed to suit the needs of the application or the characteristics of the selected communications driver. The ID format can be Decimal, Octal, and Hexadecimal. Note: If the driver is Ethernet-based or supports an unconventional station or node name, the device's TCP/IP address may be used as the device ID. TCP/IP addresses consist of four values that are separated by periods, with each value in the range of 0 to 255. Some device IDs are string based. There may be additional properties to configure within the ID field, depending on the driver. For more information, refer to the driver's help documentation.
Operating Mode Data Collection: This property controls the device's active state. Although device communications are enabled by default, this property can be used to disable a physical device. Communications are not attempted when a device is disabled. From a client standpoint, the data is marked as invalid and write operations are not accepted. This property can be changed at any time through this property or the device system tags. Simulated: This option places the device into Simulation Mode. In this mode, the driver does not attempt to communicate with the physical device, but the server continues to return valid OPC data. Simulated stops
www. ptc.com
Beckhoff TwinCAT Driver
13
physical communications with the device, but allows OPC data to be returned to the OPC client as valid data. While in Simulation Mode, the server treats all device data as reflective: whatever is written to the simulated device is read back and each OPC item is treated individually. The item's memory map is based on the group Update Rate. The data is not saved if the server removes the item (such as when the server is reinitialized). The default is No. Notes: 1. This System tag (_Simulated) is read only and cannot be written to for runtime protection. The System tag allows this property to be monitored from the client. 2. In Simulation mode, the item's memory map is based on client update rate(s) (Group Update Rate for OPC clients or Scan Rate for native and DDE interfaces). This means that two clients that reference the same item with different update rates return different data. Simulation Mode is for test and simulation purposes only. It should never be used in a production environment.
Device Properties - Scan Mode The Scan Mode specifies the subscribed-client requested scan rate for tags that require device communications. Synchronous and asynchronous device reads and writes are processed as soon as possible; unaffected by the Scan Mode properties.
Scan Mode: specifies how tags in the device are scanned for updates sent to subscribed clients. Descriptions of the options are: l l
l
l
l
Respect Client-Specified Scan Rate: This mode uses the scan rate requested by the client. Request Data No Faster than Scan Rate: This mode specifies the maximum scan rate to be used. The valid range is 10 to 99999990 milliseconds. The default is 1000 milliseconds. Note: When the server has an active client and items for the device and the scan rate value is increased, the changes take effect immediately. When the scan rate value is decreased, the changes do not take effect until all client applications have been disconnected. Request All Data at Scan Rate: This mode forces tags to be scanned at the specified rate for subscribed clients. The valid range is 10 to 99999990 milliseconds. The default is 1000 milliseconds. Do Not Scan, Demand Poll Only: This mode does not periodically poll tags that belong to the device nor perform a read to get an item's initial value once it becomes active. It is the client's responsibility to poll for updates, either by writing to the _DemandPoll tag or by issuing explicit device reads for individual items. For more information, refer to 'Device Demand Poll' in server help. Respect Tag-Specified Scan Rate: This mode forces static tags to be scanned at the rate specified in their static configuration tag properties. Dynamic tags are scanned at the client-specified scan rate.
Initial Updates from Cache: When enabled, this option allows the server to provide the first updates for newly activated tag references from stored (cached) data. Cache updates can only be provided when the new item reference shares the same address, scan rate, data type, client access, and scaling properties. A device read is used for the initial update for the first client reference only. The default is disabled; any time a client activates a tag reference the server attempts to read the initial value from the device.
www. ptc.com
Beckhoff TwinCAT Driver
14
Device Properties - Timing The device Timing properties allow the driver's response to error conditions to be tailored to fit the application's needs. In many cases, the environment requires changes to these properties for optimum performance. Factors such as electrically generated noise, modem delays, and poor physical connections can influence how many errors or timeouts a communications driver encounters. Timing properties are specific to each configured device.
Communications Timeouts Connect Timeout: This property (which is used primarily by Ethernet based drivers) controls the amount of time required to establish a socket connection to a remote device. The device's connection time often takes longer than normal communications requests to that same device. The valid range is 1 to 30 seconds. The default is typically 3 seconds, but can vary depending on the driver's specific nature. If this setting is not supported by the driver, it is disabled. Note: Due to the nature of UDP connections, the connection timeout setting is not applicable when communicating via UDP. Request Timeout: This property specifies an interval used by all drivers to determine how long the driver waits for a response from the target device to complete. The valid range is 50 to 9,999,999 milliseconds (167.6667 minutes). The default is usually 1000 milliseconds, but can vary depending on the driver. The default timeout for most serial drivers is based on a baud rate of 9600 baud or better. When using a driver at lower baud rates, increase the timeout to compensate for the increased time required to acquire data. Retry Attempts: This property specifies how many times the driver retries a communications request before considering the request to have failed and the device to be in error. The valid range is 1 to 10. The default is typically 3, but can vary depending on the driver's specific nature. The number of retries configured for an application depends largely on the communications environment.
Timing Inter-Request Delay: This property specifies how long the driver waits before sending the next request to the target device. It overrides the normal polling frequency of tags associated with the device, as well as one-time reads and writes. This delay can be useful when dealing with devices with slow turnaround times and in cases where network load is a concern. Configuring a delay for a device affects communications with all other devices on the channel. It is recommended that users separate any device that requires an interrequest delay to a separate channel if possible. Other communications properties (such as communication serialization) can extend this delay. The valid range is 0 to 300,000 milliseconds; however, some drivers may limit the maximum value due to a function of their particular design. The default is 0, which indicates no delay between requests with the target device. Note: Not all drivers support Inter-Request Delay. This setting does not appear if it is not available.
www. ptc.com
Beckhoff TwinCAT Driver
15
Device Properties - Auto-Demotion The Auto-Demotion properties can temporarily place a device off-scan in the event that a device is not responding. By placing a non-responsive device offline for a specific time period, the driver can continue to optimize its communications with other devices on the same channel. After the time period has been reached, the driver re-attempts to communicate with the non-responsive device. If the device is responsive, the device is placed on-scan; otherwise, it restarts its off-scan time period.
Demote on Failure: When enabled, the device is automatically taken off-scan until it is responding again. Tip: Determine when a device is off-scan by monitoring its demoted state using the _AutoDemoted system tag. Timeouts to Demote: Specify how many successive cycles of request timeouts and retries occur before the device is placed off-scan. The valid range is 1 to 30 successive failures. The default is 3. Demotion Period: Indicate how long the device should be placed off-scan when the timeouts value is reached. During this period, no read requests are sent to the device and all data associated with the read requests are set to bad quality. When this period expires, the driver places the device on-scan and allows for another attempt at communications. The valid range is 100 to 3600000 milliseconds. The default is 10000 milliseconds. Discard Requests when Demoted: Select whether or not write requests should be attempted during the off-scan period. Disable to always send write requests regardless of the demotion period. Enable to discard writes; the server automatically fails any write request received from a client and does not post a message to the Event Log.
Device Properties - Tag Generation The automatic tag database generation features make setting up an application a plug-and-play operation. Select communications drivers can be configured to automatically build a list of tags that correspond to device-specific data. These automatically generated tags (which depend on the nature of the supporting driver) can be browsed from the clients. If the target device supports its own local tag database, the driver reads the device's tag information and uses the data to generate tags within the server. If the device does not natively support named tags, the driver creates a list of tags based on driver-specific information. An example of these two conditions is as follows: 1. If a data acquisition system supports its own local tag database, the communications driver uses the tag names found in the device to build the server's tags. 2. If an Ethernet I/O system supports detection of its own available I/O module types, the communications driver automatically generates tags in the server that are based on the types of I/O modules plugged into the Ethernet I/O rack. Note: Automatic tag database generation's mode of operation is completely configurable. For more information, refer to the property descriptions below.
www. ptc.com
Beckhoff TwinCAT Driver
16
On Device Startup This property specifies when OPC tags are automatically generated. Descriptions of the options are as follows: l
l
l
Do Not Generate on Startup: This option prevents the driver from adding any OPC tags to the tag space of the server. This is the default setting. Always Generate on Startup: This option causes the driver to evaluate the device for tag information. It also adds tags to the tag space of the server every time the server is launched. Generate on First Startup: This option causes the driver to evaluate the target device for tag information the first time the project is run. It also adds any OPC tags to the server tag space as needed.
Note: When the option to automatically generate OPC tags is selected, any tags that are added to the server's tag space must be saved with the project. Users can configure the project to automatically save from the Tools | Options menu. On Duplicate Tag When automatic tag database generation is enabled, the server needs to know what to do with the tags that it may have previously added or with tags that have been added or modified after the communications driver since their original creation. This setting controls how the server handles OPC tags that were automatically generated and currently exist in the project. It also prevents automatically generated tags from accumulating in the server. For example, if a user changes the I/O modules in the rack with the server configured to Always Generate on Startup, new tags would be added to the server every time the communications driver detected a new I/O module. If the old tags were not removed, many unused tags could accumulate in the server's tag space. The options are: l
l
l
l
Delete on Create: This option deletes any tags that were previously added to the tag space before any new tags are added. This is the default setting. Overwrite as Necessary: This option instructs the server to only remove the tags that the communications driver is replacing with new tags. Any tags that are not being overwritten remain in the server's tag space. Do not Overwrite: This option prevents the server from removing any tags that were previously generated or already existed in the server. The communications driver can only add tags that are completely new. Do not Overwrite, Log Error: This option has the same effect as the prior option, and also posts an error message to the server's Event Log when a tag overwrite would have occurred.
Note: Removing OPC tags affects tags that have been automatically generated by the communications driver as well as any tags that have been added using names that match generated tags. Users should avoid adding tags to the server using names that may match tags that are automatically generated by the driver.
www. ptc.com
Beckhoff TwinCAT Driver
17
Parent Group: This property keeps automatically generated tags from mixing with tags that have been entered manually by specifying a group to be used for automatically generated tags. The name of the group can be up to 256 characters. This parent group provides a root branch to which all automatically generated tags are added. Allow Automatically Generated Subgroups: This property controls whether the server automatically creates subgroups for the automatically generated tags. This is the default setting. If disabled, the server generates the device's tags in a flat list without any grouping. In the server project, the resulting tags are named with the address value. For example, the tag names are not retained during the generation process. Note: If, as the server is generating tags, a tag is assigned the same name as an existing tag, the system automatically increments to the next highest number so that the tag name is not duplicated. For example, if the generation process creates a tag named 'AI22' that already exists, it creates the tag as 'AI23' instead. Create: Initiates the creation of automatically generated OPC tags. If the device's configuration has been modified, Create tags forces the driver to reevaluate the device for possible tag changes. Its ability to be accessed from the System tags allows a client application to initiate tag database creation. Note: Create tags is disabled if the Configuration edits a project offline.
www. ptc.com
Beckhoff TwinCAT Driver
18
Device Properties - Communications Parameters
Project Port Port Number The ADS devices in a TwinCAT message router are uniquely identified by a number referred to as the ADSPortNr. For more information, refer to table below.
System
Supported ADS-PortNr
Default Setting
TwinCAT 2 PLC Runtime Systems
801 811 821 831
801
TwinCAT 3 PLC Runtime Systems
851 852 853 854
851
BC9xxx/BX9xxx Series Controllers
800
800
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.
Device Properties - Options
Project Options Default Type: Specify the data type tol be assigned to a client/server tag when the default type is selected during tag addition, modification, and import. Client/server tags are assigned the default data type when any of the following conditions occur: 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.
www. ptc.com
Beckhoff TwinCAT Driver
19
Device Properties - 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
l
l
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. 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. Symbol File: This property 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. Auto-Synchronize File Changes: This feature updates the Runtime database automatically when the file has been modified. This option is only supported by BC/BX model devices. Caution: Enabling 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.
Import and Runtime Compatibility Additional OPC item information is located in the comment field after the PLC variable declaration in TwinCAT PLC Control. This optional functionality is used to minimize the OPC namespace of the server project. It also assigns the appropriate read/write item properties and OPC client access. Respect OPC Read/Write Item Properties When enabled, variables that include the string 'OPC_PROP[0005]: ' (defined within the variable comment field in the PLC project) will be assigned the appropriate Read/Write access. During import and Runtime, any tag(s) corresponding to a variable with the R/W access specified will carry the same Read/Write access rights. Whitespace is ignored.
www. ptc.com
Beckhoff TwinCAT Driver
20
Syntax: (*~(OPC_PROP[0005] : : )*)
l
1 = Read Only, 2 = Write Only, 3 = Read/Write. Optional and ignored. Read Only Example: dwTemperature:DWORD; (*~(OPC_PROP[0005]:1:Read Only)*)
l
Respect Tag Case on Import When disabled (default), imported tag and address strings are forced into upper case. When enabled, upper and lower case text is preserved when imported. Note: Respect Tag Case on Import behavior: 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.
Only Import Variables Marked for OPC When enabled, only tags with the keyword 'OPC:1' (defined within the variable comment field in the PLC project) will be imported and visible during Runtime. l
Syntax: (*~(OPC : 1 : )*) Optional and ignored.
l
Example: bMemFlag AT%MX0.0:BOOL; (*~(OPC:1:Visible to OPC Clients)*)
Only Import Variables Marked for OPC + Filter When Only Import Variables Marked for OPC is enabled with a Filter string, only tags in which the comment includes the string 'OPC:1' and 'OPC_Filter: ' will be imported into the project and visible during Runtime. Filter strings are arbitrary, user-defined strings used for another layer of filtering. If none are specified, this field will be ignored. Otherwise, the variable will only be imported if the filter string found in the comment section matches the filter set in Device Properties. Whitespace is treated literally. l
Syntax: (*~(OPC : 1 : )(OPC_Filter : : )*) Optional and ignored.
l
Example: bMemFlag AT%MX0.0:BOOL; (*~(OPC:1:Visible to OPC Clients)(OPC_Filter:Memory Access) *)
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. 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.
www. ptc.com
Beckhoff TwinCAT Driver
21
l
l
Syntax:(*~(OPC : 1 : )(OPC_PROP[0005] : : )*) Example: dwTemperature:DWORD; (*~(OPC:1:Visible to OPC Clients)(OPC_PROP[0005]:1:Read Only) *)
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. l
l
Syntax: (*~(OPC : 1 : )(OPC_Filter : : ) (OPC_PROP[0005] : : )*) Example: dwTemperature:DWORD; (*~(OPC:1:Visible to OPC Clients) (OPC_Filter:Memory Access) (OPC_PROP[0005]:1:Read Only)*)
OPC Item Description + Only Import Variables Marked for OPC Any characters placed before the tilde in the comment field are treated as a description and will be displayed in the server as an Item Description. l
Syntax:(*~(OPC : 1 : )*)
l
Example: (*This is my OPC Item Description~(OPC :1:Visible to OPC Clients)*)
Device Properties - Redundancy
Redundancy is available with the Media-Level Redundancy Plug-In. Consult the website, a sales representative, or the user manual for more information.
www. ptc.com
Beckhoff TwinCAT Driver
22
Automatic Tag Database Generation Controller-to-Server Name Conversions Leading underscores Leading underscores (_) in tag/program names will be replaced with U_. This is required since the server does not accept tag/group names beginning with an underscore.
Preparing for Automatic Tag Database Generation Upload Symbols from Device It is recommended that all communications to the Beckhoff TwinCAT of interest are halted during the database creation process.
In the server 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. 3. Next, select the desired Beckhoff Compatibility options. 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.
Upload Symbols from File The driver uses a file generated from Beckhoff TwinCAT PLC called an .tpy import/export file to generate the tag database. Note: All tags, including global and program, are imported and expanded according to their data type.
In Beckhoff TwinCAT PLC The .tpy file is automatically created the first time that a build is done on a clean project. 1. Open the TwinCAT PLC Control program. 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.
In the server 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.
www. ptc.com
Beckhoff TwinCAT Driver
23 3. Enter or browse for the location of the .tpy file that was previously created. 4. Next, select the desired Beckhoff Compatibility options. 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. ptc.com
Beckhoff TwinCAT Driver
24
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.
Optimizing the Application While the driver is fast, there are a couple of guidelines that can be used to control and optimize the application and gain maximum performance. The server refers to communications protocols like Beckhoff TwinCAT as a channel. Each channel defined in the application represents a separate path of execution in the server. Once a channel has been defined, a series of devices may then be defined under that channel. Each of these devices represents a single Beckhoff TwinCAT controller from which data will be collected. While this approach to defining the application will provide a high level of performance, it won't take full advantage of the driver or the network. An example of how the application may appear when configured using a single channel is shown below. In this example, each device appears under a single channel called Beckhoff_ TwinCAT. In this configuration, the driver must move from one device to the next as quickly as possible to gather information at an effective rate. As more devices are added or more information is requested from a single device, however, the overall update rate begins to suffer.
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. 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. ptc.com
Beckhoff TwinCAT Driver
25
Data Type Descriptions Data Type
Description
Boolean
Single bit
Byte
Unsigned 8-bit value
Char
Signed 8-bit value
Word
Unsigned 16-bit value
Short
Signed 16-bit value
DWord
Unsigned 32-bit value
Long
Signed 32-bit value
Float
32-bit IEEE Floating point
Double
64-bit IEEE Floating point
String
Null terminated character array
For a description of TwinCAT-platform specific data types, refer to TwinCAT Data Types.
Unsupported Data Types Unsupported data types include LBCD and BCD.
www. ptc.com
Beckhoff TwinCAT Driver
26
Address Descriptions The following table summarizes the valid addressing formats in the server.
Address
Notation
Example
Notes
Standard
tag_1
Tag cannot be an array
Array Element
[dim1, dim2, dim3]
tag_1 [2, 58, 547]
Dimension Range=1 to 3
Format
tag_1 [0,3]
Element Range=0 to 65535 Length Range=1 to 65535
/
String
tag_1/4
The number of characters to read/write equals the string length.
For information on how elements are referenced for 1, 2 and 3 dimensional arrays, refer to Ordering of Array Data. See Also Addressing Atomic Data Types
Symbolic Tag Based Addressing The Beckhoff TwinCAT Driver uses a tag or symbol-based addressing structure. These tags (which are commonly referred to as Native Tags) differ from conventional PLC data items in that the tag name itself is the address, not a physical or logical address.
Client/Server Tag Address Rules Beckhoff TwinCAT variable names correspond to Client/Server Tag addresses. Beckhoff TwinCAT variable names (entered via Beckhoff TwinCAT PLC) follow the IEC 61131-3 identifier rules. Client/Server Tag addresses follow these same rules and are listed below: l
Must begin with an alphabetic (A-Z, a-z) character or an underscore (_).
l
Can only contain alphanumeric characters and underscores.
l
First 32 characters are significant.
l
Cannot have consecutive underscores.
l
Are not case sensitive.
Client/Server Tag Name Rules The rules for tag name assignment in the server differs from address assignment because tag names cannot begin with an underscore.
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: .
Program Tags
www. ptc.com
Beckhoff TwinCAT Driver
27
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.
Structure Tag Addressing Beckhoff TwinCAT structure variables, global or program, contain one or more member variables. Member variables can be atomic or structured in nature.
Global tag example:
Program tag example:
..
..
This implies that a substructure would be addressed as:
Global Tag Example
Program tag example:
...
...
Arrays of structures would be addressed as:
Global Tag Example
Program tag example:
.[dim1, dim2, dim3].
.[dim1, dim2, dim3].
Again, this implies that an array of substructures would be addressed as:
Global Tag Example
Program tag example:
..[dim1, dim2, dim3].
..[dim1, dim2, dim3].
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.
Addressing Atomic Data Types The table below shows suggested usages and addressing possibilities for a TwinCAT Data Type given the address formats available.
Atomic Data Type BOOL
Client/Server Standard Data Type
Boolean
Array Element Boolean
www. ptc.com
String
Beckhoff TwinCAT Driver
Atomic Data Type
28
Client/Server Standard
Array Element
String
Tag Example
BOOLTAG
BOOLARR [0]
SINT/USINT
Data Type Tag Example
Byte, Char SINTTAG
String Byte, Char SINTARR[0]/4 SINTARR[0] String length cannot be longer than the array length minus the element position.
INT/UINT
Data Type Tag Example
Word, Short INTTAG
Word, Short INTARR[0]
Data Type Tag Example
DWord, Long DINTTAG
DWord, Long DINTARR [0]
Data Type
Float
Tag Example
REALTAG
Float REALARR
LREAL*
Data Type Tag Example
Double LREALTAG
Double LREALARR [0]
TIME
Data Type Tag Example
DWord, Long TIMETAG
DWord, Long TIMEARR [0]
STRING
Data Type Tag Example
String String STRINGARR STRINGTAG/80 [1]/80
DINT/UDINT
REAL
[0]
*This data type is not supported by the BC/BX Controller model.
Unsupported TwinCAT Data Types Unsupported data types include pointers, enumerations, TOD, and DT. See Also: Address Descriptions
www. ptc.com
Beckhoff TwinCAT Driver
29
Ordering of TwinCAT Array Data 1. Dimensional Arrays - array [dim1] 1 dimensional array data is passed to and from the controller in ascending order: for (dim1=0; dim1
© 2017 PTC Inc. All Rights Reserved.
Beckhoff TwinCAT Driver
2
Table of Contents Beckhoff TwinCAT Driver
1
Table of Contents
2
Beckhoff TwinCAT Driver
5
Overview
6
External Dependencies
7
Setup
8
Channel Properties - General
8
Channel Properties - Ethernet Communications
9
Channel Properties - Write Optimizations
10
Channel Properties - Advanced
11
Device Properties - General
11
Device Properties - Scan Mode
13
Device Properties - Timing
14
Device Properties - Auto-Demotion
15
Device Properties - Tag Generation
15
Device Properties - Communications Parameters
18
Device Properties - Options
18
Device Properties - Symbolic Settings
19
Device Properties - Redundancy
21
Automatic Tag Database Generation
22
Performance Optimization
24
Data Type Descriptions
25
Address Descriptions
26
Symbolic Tag Based Addressing
26
Tag Scope
26
Addressing Atomic Data Types
27
Ordering of TwinCAT Array Data
29
Error Descriptions
31
Error Codes
31
Address Validation
34
Address is out of range for the specified device or register.
34
Array size is out of range for address .
34
Data type is not valid for device address .
34
Device Address contains a syntax error.
34
Automatic Tag Database Generation Error Messages
www. ptc.com
35
Beckhoff TwinCAT Driver
3
Unable to generate a tag database for device . Reason: Beckhoff TwinCAT ADS DLL necessary for import is not loaded.
35
Unable to generate a tag database for device . Reason: Device is not responding. 35 Unable to generate a tag database for device . Reason: Device returned error code .
36
Unable to generate a tag database for device . Reason: Memory allocation error. 36
Driver Error Messages
36
Unable to import from Beckhoff TwinCAT ADS Communication driver.
36
Unable to load Beckhoff TwinCAT ADS Communication driver.
37
Unable to open a communication port on the ADS router.
37
Device Status Error Messages
37
Device is not responding.
38
Monitoring the global variable on device to update symbol information when a change is detected.
38
Unable to gather runtime information for device . Reason: .
38
Unable to perform Beckhoff compatibility on device due to memory allocation error.
39
Unable to synchronize with configuration file on device due to memory allocation error.
39
Unable to read tag on device . Requesting symbol information for each transaction.
39
Read Error Messages
40
Unable to read tag on device . Actual data type is not compatible with tag of type .
40
Unable to read tag on device . Address bounds exceeded.
40
Unable to read tag on device . Beckhoff TwinCAT ADS DLL necessary for runtime is not loaded.
41
Unable to read tag on device . Error Code .
41
Unable to read tag on device . Memory allocation error.
41
Unable to read tag on device . Runtime file is not valid.
42
Unable to read tag on device . Symbol not found in file.
42
Unable to read tag on device . Tag data size of bytes(s) exceeds actual data size of byte(s). 42 Unable to read tag on device . Tag does not meet filtering requirements.
Write Error Messages
43 43
Unable to write to tag on device . Actual data type is not compatible with tag of type .
43
Unable to write to tag on device . Address bounds exceeded.
44
Unable to write to tag on device . Beckhoff TwinCAT ADS DLL necessary for runtime is not loaded.
44
www. ptc.com
Beckhoff TwinCAT Driver
4
Unable to write to tag on device . Error Code .
44
Unable to write to tag on device . Memory allocation error.
45
Unable to write to tag on device . Runtime file is not valid.
45
Unable to write to tag on device . Symbol not found in file.
45
Unable to write to tag on device . Tag access is Read Only
46
Unable to write to tag on device . Tag data size of bytes(s) exceeds actual data size of byte(s).
46
Unable to write to tag on device . Tag does not meet filtering requirements.
46
Technical Notes
47
TwinCAT Memory Warning.
47
TwinCAT Time Slice Notes
47
Appendix: SYSTEMINFO Global Variables in a TwinCAT PLC Project
49
Appendix: Setting Up an AMS Remote Connection
50
Index
55
www. ptc.com
Beckhoff TwinCAT Driver
5
Beckhoff TwinCAT Driver Help version 1.068
CONTENTS Overview What is the Beckhoff TwinCAT Driver?
Device Setup How do I configure a device for use with this driver?
Automatic Tag Database Generation How can I easily configure tags for the Beckhoff TwinCAT Driver?
Optimizing Beckhoff TwinCAT Communications How do I get the best performance from this driver?
Data Types Description What data types does the Beckhoff TwinCAT Driver support?
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 this driver?
www. ptc.com
Beckhoff TwinCAT Driver
6
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: l
l
open, compatible PC hardware. embedded IEC 61131-3 software PLC, software NC and software CNC in Windows NT/XP/Vista, NT/ XP Embedded, and CE.
l
programming and Runtime systems together on one PC or separated.
l
connection to all common field buses.
l
support of PC interfaces.
l
data communication with user interfaces and other programs by means of open standards (such as OPC, OCX, DLL, and so forth).
World-wide Connection Through Message Routing TwinCAT PLC programs can run on PCs or on Beckhoff Bus Terminal Controllers. A message router manages and distributes all the messages, both in the system and via TCP/IP connections. PC systems can be connected with each other via TCP/IP; Bus Terminal Controllers are integrated via serial interfaces and field buses.
TwinCAT ADS (Automation Device Specification) The data link to TwinCAT servers occurs via the message router system, which enables Windows programs to both work with the local server and to exchange data with registered TwinCAT servers worldwide. The message router allows data exchange to remote servers on other PCs or field equipment. 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 networkcapable powerful communication with the Runtime system.
www. ptc.com
Beckhoff TwinCAT Driver
7
External Dependencies This driver has external dependencies. The Beckhoff TwinCAT ADS Communication Library is required on the same computer as the 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. ptc.com
Beckhoff TwinCAT Driver
8
Setup Communication Protocol ADS API
Supported Devices Beckhoff TwinCAT PLC BC9xxx Coupler Controller BX9xxx Coupler Controller
Maximum Channels and Devices The maximum number of channels supported by this driver is 100. The maximum number of devices per channel is 1024.
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.
AMS Remote Connections Management To communicate successfully with any remote TwinCAT runtime engine on a Beckhoff PLC (or an ADS library on any remote PC), the AMS Remote Connection Manager utility must be used to assign an AMS Net ID to the local station hosting the Beckhoff TwinCAT Driver. The AMS Net ID is also used to establish routes to remote AMS/ADS enabled devices. For more information, refer to Setting Up an AMS Remote Connection. 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). For more information about the AMS messaging protocol, consult Beckhoff's help documentation.
Tag Database Creation The Automatic OPC Tag Database Generation features of this driver have been designed to make setting up the OPC application less time consuming. This driver can be configured to automatically build a list of server tags within the server that correspond to device specific data. The automatically generated OPC tags can then be browsed from the OPC client.
Channel Properties - General This server supports the use of simultaneous multiple communications drivers. Each protocol or driver used in a server project is called a channel. A server project may consist of many channels with the same communications driver or with unique communications drivers. A channel acts as the basic building block of an OPC link. This group is used to specify general channel properties, such as the identification attributes and operating mode.
www. ptc.com
Beckhoff TwinCAT Driver
9
Identification Name: User-defined identity of this channel. In each server project, each channel name must be unique. Although names can be up to 256 characters, some client applications have a limited display window when browsing the OPC server's tag space. The channel name is part of the OPC browser information. For information on reserved characters, refer to 'How To... Properly Name a Channel, Device, Tag, and Tag Group' in the server help. Description: User-defined information about this channel. Many of these properties, including Description, have an associated system tag. Driver: Selected protocol / driver for this channel. This property specifies the device driver that was selected during channel creation. It is a disabled setting in the channel properties. Note: With the server's online full-time operation, these properties can be changed at any time. This includes changing the channel name to prevent clients from registering data with the server. If a client has already acquired an item from the server before the channel name is changed, the items are unaffected. If, after the channel name has been changed, the client application releases the item and attempts to reacquire using the old channel name, the item is not accepted. With this in mind, changes to the properties should not be made once a large client application has been developed. Utilize the User Manager to prevent operators from changing properties and restrict access rights to server features.
Diagnostics Diagnostics Capture: When enabled, this option makes the channel's diagnostic information available to OPC applications. Because the server's diagnostic features require a minimal amount of overhead processing, it is recommended that they be utilized when needed and disabled when not. The default is disabled. Note: This property is disabled if the driver does not support diagnostics. For more information, refer to 'Communication Diagnostics' in the server help.
Channel Properties - Ethernet Communications Ethernet Communication can be used to communicate with devices.
Ethernet Settings
www. ptc.com
Beckhoff TwinCAT Driver
10
Network Adapter: Specify the network adapter to bind. When Default is selected, the operating system selects the default adapter.
Channel Properties - Write Optimizations As with any OPC server, writing data to the device may be the application's most important aspect. The server intends to ensure that the data written from the client application gets to the device on time. Given this goal, the server provides optimization properties that can be used to meet specific needs or improve application responsiveness.
Write Optimizations Optimization Method: controls how write data is passed to the underlying communications driver. The options are: l
l
l
Write All Values for All Tags: This option forces the server to attempt to write every value to the controller. In this mode, the server continues to gather write requests and add them to the server's internal write queue. The server processes the write queue and attempts to empty it by writing data to the device as quickly as possible. This mode ensures that everything written from the client applications is sent to the target device. This mode should be selected if the write operation order or the write item's content must uniquely be seen at the target device. Write Only Latest Value for Non-Boolean Tags: Many consecutive writes to the same value can accumulate in the write queue due to the time required to actually send the data to the device. If the server updates a write value that has already been placed in the write queue, far fewer writes are needed to reach the same final output value. In this way, no extra writes accumulate in the server's queue. When the user stops moving the slide switch, the value in the device is at the correct value at virtually the same time. As the mode states, any value that is not a Boolean value is updated in the server's internal write queue and sent to the device at the next possible opportunity. This can greatly improve the application performance. Note: This option does not attempt to optimize writes to Boolean values. It allows users to optimize the operation of HMI data without causing problems with Boolean operations, such as a momentary push button. Write Only Latest Value for All Tags: This option takes the theory behind the second optimization mode and applies it to all tags. It is especially useful if the application only needs to send the latest value to the device. This mode optimizes all writes by updating the tags currently in the write queue before they are sent. This is the default mode.
Duty Cycle: is used to control the ratio of write to read operations. The ratio is always based on one read for every one to ten writes. The duty cycle is set to ten by default, meaning that ten writes occur for each read operation. Although the application is performing a large number of continuous writes, it must be ensured that read data is still given time to process. A setting of one results in one read operation for every write operation. If there are no write operations to perform, reads are processed continuously. This allows optimization for applications with continuous writes versus a more balanced back and forth data flow. Note: It is recommended that the application be characterized for compatibility with the write optimization enhancements before being used in a production environment.
www. ptc.com
Beckhoff TwinCAT Driver
11
Channel Properties - Advanced This group is used to specify advanced channel properties. Not all drivers support all properties; so the Advanced group does not appear for those devices.
Non-Normalized Float Handling: Non-normalized float handling allows users to specify how a driver handles non-normalized IEEE-754 floating point data. A non-normalized value is defined as Infinity, Not-aNumber (NaN), or as a Denormalized Number. The default is Replace with Zero. Drivers that have native float handling may default to Unmodified. Descriptions of the options are as follows: l
l
Replace with Zero: This option allows a driver to replace non-normalized IEEE-754 floating point values with zero before being transferred to clients. Unmodified: This option allows a driver to transfer IEEE-754 denormalized, normalized, nonnumber, and infinity values to clients without any conversion or changes.
Note: This property is disabled if the driver does not support floating point values or if it only supports the option that is displayed. According to the channel's float normalization setting, only real-time driver tags (such as values and arrays) are subject to float normalization. For example, EFM data is not affected by this setting. For more information on the floating point values, refer to 'How To ... Work with Non-Normalized Floating Point Values' in the server help. Inter-Device Delay: Specify the amount of time the communications channel waits to send new requests to the next device after data is received from the current device on the same channel. Zero (0) disables the delay. Note: This property is not available for all drivers, models, and dependent settings.
Device Properties - General A device represents a single target on a communications channel. If the driver supports multiple controllers, users must enter a device ID for each controller.
Identification
www. ptc.com
Beckhoff TwinCAT Driver
12
Name: This property specifies the name of the device. It is a logical user-defined name that can be up to 256 characters long, and may be used on multiple channels. Note: Although descriptive names are generally a good idea, some OPC client applications may have a limited display window when browsing the OPC server's tag space. The device name and channel name become part of the browse tree information as well. Within an OPC client, the combination of channel name and device name would appear as 'ChannelName.DeviceName'. For more information, refer to 'How To... Properly Name a Channel, Device, Tag, and Tag Group' in server help. Description: User-defined information about this device. Many of these properties, including Description, have an associated system tag. Channel Assignment: User-defined name of the channel to which this device currently belongs. Driver: Selected protocol driver for this device. This property specifies the driver selected during channel creation. It is disabled in the channel properties. Model: This property specifies the specific type of device that is associated with this ID. The contents of the drop-down menu depends on the type of communications driver being used. Models that are not supported by a driver are disabled. If the communications driver supports multiple device models, the model selection can only be changed when there are no client applications connected to the device. Note: If the communication driver supports multiple models, users should try to match the model selection to the physical device. If the device is not represented in the drop-down menu, select a model that conforms closest to the target device. Some drivers support a model selection called 'Open,' which allows users to communicate without knowing the specific details of the target device. For more information, refer to the driver help documentation. ID: This property specifies the device's driver-specific station or node. The type of ID entered depends on the communications driver being used. For many communication drivers, the ID is a numeric value. Drivers that support a Numeric ID provide users with the option to enter a numeric value whose format can be changed to suit the needs of the application or the characteristics of the selected communications driver. The ID format can be Decimal, Octal, and Hexadecimal. Note: If the driver is Ethernet-based or supports an unconventional station or node name, the device's TCP/IP address may be used as the device ID. TCP/IP addresses consist of four values that are separated by periods, with each value in the range of 0 to 255. Some device IDs are string based. There may be additional properties to configure within the ID field, depending on the driver. For more information, refer to the driver's help documentation.
Operating Mode Data Collection: This property controls the device's active state. Although device communications are enabled by default, this property can be used to disable a physical device. Communications are not attempted when a device is disabled. From a client standpoint, the data is marked as invalid and write operations are not accepted. This property can be changed at any time through this property or the device system tags. Simulated: This option places the device into Simulation Mode. In this mode, the driver does not attempt to communicate with the physical device, but the server continues to return valid OPC data. Simulated stops
www. ptc.com
Beckhoff TwinCAT Driver
13
physical communications with the device, but allows OPC data to be returned to the OPC client as valid data. While in Simulation Mode, the server treats all device data as reflective: whatever is written to the simulated device is read back and each OPC item is treated individually. The item's memory map is based on the group Update Rate. The data is not saved if the server removes the item (such as when the server is reinitialized). The default is No. Notes: 1. This System tag (_Simulated) is read only and cannot be written to for runtime protection. The System tag allows this property to be monitored from the client. 2. In Simulation mode, the item's memory map is based on client update rate(s) (Group Update Rate for OPC clients or Scan Rate for native and DDE interfaces). This means that two clients that reference the same item with different update rates return different data. Simulation Mode is for test and simulation purposes only. It should never be used in a production environment.
Device Properties - Scan Mode The Scan Mode specifies the subscribed-client requested scan rate for tags that require device communications. Synchronous and asynchronous device reads and writes are processed as soon as possible; unaffected by the Scan Mode properties.
Scan Mode: specifies how tags in the device are scanned for updates sent to subscribed clients. Descriptions of the options are: l l
l
l
l
Respect Client-Specified Scan Rate: This mode uses the scan rate requested by the client. Request Data No Faster than Scan Rate: This mode specifies the maximum scan rate to be used. The valid range is 10 to 99999990 milliseconds. The default is 1000 milliseconds. Note: When the server has an active client and items for the device and the scan rate value is increased, the changes take effect immediately. When the scan rate value is decreased, the changes do not take effect until all client applications have been disconnected. Request All Data at Scan Rate: This mode forces tags to be scanned at the specified rate for subscribed clients. The valid range is 10 to 99999990 milliseconds. The default is 1000 milliseconds. Do Not Scan, Demand Poll Only: This mode does not periodically poll tags that belong to the device nor perform a read to get an item's initial value once it becomes active. It is the client's responsibility to poll for updates, either by writing to the _DemandPoll tag or by issuing explicit device reads for individual items. For more information, refer to 'Device Demand Poll' in server help. Respect Tag-Specified Scan Rate: This mode forces static tags to be scanned at the rate specified in their static configuration tag properties. Dynamic tags are scanned at the client-specified scan rate.
Initial Updates from Cache: When enabled, this option allows the server to provide the first updates for newly activated tag references from stored (cached) data. Cache updates can only be provided when the new item reference shares the same address, scan rate, data type, client access, and scaling properties. A device read is used for the initial update for the first client reference only. The default is disabled; any time a client activates a tag reference the server attempts to read the initial value from the device.
www. ptc.com
Beckhoff TwinCAT Driver
14
Device Properties - Timing The device Timing properties allow the driver's response to error conditions to be tailored to fit the application's needs. In many cases, the environment requires changes to these properties for optimum performance. Factors such as electrically generated noise, modem delays, and poor physical connections can influence how many errors or timeouts a communications driver encounters. Timing properties are specific to each configured device.
Communications Timeouts Connect Timeout: This property (which is used primarily by Ethernet based drivers) controls the amount of time required to establish a socket connection to a remote device. The device's connection time often takes longer than normal communications requests to that same device. The valid range is 1 to 30 seconds. The default is typically 3 seconds, but can vary depending on the driver's specific nature. If this setting is not supported by the driver, it is disabled. Note: Due to the nature of UDP connections, the connection timeout setting is not applicable when communicating via UDP. Request Timeout: This property specifies an interval used by all drivers to determine how long the driver waits for a response from the target device to complete. The valid range is 50 to 9,999,999 milliseconds (167.6667 minutes). The default is usually 1000 milliseconds, but can vary depending on the driver. The default timeout for most serial drivers is based on a baud rate of 9600 baud or better. When using a driver at lower baud rates, increase the timeout to compensate for the increased time required to acquire data. Retry Attempts: This property specifies how many times the driver retries a communications request before considering the request to have failed and the device to be in error. The valid range is 1 to 10. The default is typically 3, but can vary depending on the driver's specific nature. The number of retries configured for an application depends largely on the communications environment.
Timing Inter-Request Delay: This property specifies how long the driver waits before sending the next request to the target device. It overrides the normal polling frequency of tags associated with the device, as well as one-time reads and writes. This delay can be useful when dealing with devices with slow turnaround times and in cases where network load is a concern. Configuring a delay for a device affects communications with all other devices on the channel. It is recommended that users separate any device that requires an interrequest delay to a separate channel if possible. Other communications properties (such as communication serialization) can extend this delay. The valid range is 0 to 300,000 milliseconds; however, some drivers may limit the maximum value due to a function of their particular design. The default is 0, which indicates no delay between requests with the target device. Note: Not all drivers support Inter-Request Delay. This setting does not appear if it is not available.
www. ptc.com
Beckhoff TwinCAT Driver
15
Device Properties - Auto-Demotion The Auto-Demotion properties can temporarily place a device off-scan in the event that a device is not responding. By placing a non-responsive device offline for a specific time period, the driver can continue to optimize its communications with other devices on the same channel. After the time period has been reached, the driver re-attempts to communicate with the non-responsive device. If the device is responsive, the device is placed on-scan; otherwise, it restarts its off-scan time period.
Demote on Failure: When enabled, the device is automatically taken off-scan until it is responding again. Tip: Determine when a device is off-scan by monitoring its demoted state using the _AutoDemoted system tag. Timeouts to Demote: Specify how many successive cycles of request timeouts and retries occur before the device is placed off-scan. The valid range is 1 to 30 successive failures. The default is 3. Demotion Period: Indicate how long the device should be placed off-scan when the timeouts value is reached. During this period, no read requests are sent to the device and all data associated with the read requests are set to bad quality. When this period expires, the driver places the device on-scan and allows for another attempt at communications. The valid range is 100 to 3600000 milliseconds. The default is 10000 milliseconds. Discard Requests when Demoted: Select whether or not write requests should be attempted during the off-scan period. Disable to always send write requests regardless of the demotion period. Enable to discard writes; the server automatically fails any write request received from a client and does not post a message to the Event Log.
Device Properties - Tag Generation The automatic tag database generation features make setting up an application a plug-and-play operation. Select communications drivers can be configured to automatically build a list of tags that correspond to device-specific data. These automatically generated tags (which depend on the nature of the supporting driver) can be browsed from the clients. If the target device supports its own local tag database, the driver reads the device's tag information and uses the data to generate tags within the server. If the device does not natively support named tags, the driver creates a list of tags based on driver-specific information. An example of these two conditions is as follows: 1. If a data acquisition system supports its own local tag database, the communications driver uses the tag names found in the device to build the server's tags. 2. If an Ethernet I/O system supports detection of its own available I/O module types, the communications driver automatically generates tags in the server that are based on the types of I/O modules plugged into the Ethernet I/O rack. Note: Automatic tag database generation's mode of operation is completely configurable. For more information, refer to the property descriptions below.
www. ptc.com
Beckhoff TwinCAT Driver
16
On Device Startup This property specifies when OPC tags are automatically generated. Descriptions of the options are as follows: l
l
l
Do Not Generate on Startup: This option prevents the driver from adding any OPC tags to the tag space of the server. This is the default setting. Always Generate on Startup: This option causes the driver to evaluate the device for tag information. It also adds tags to the tag space of the server every time the server is launched. Generate on First Startup: This option causes the driver to evaluate the target device for tag information the first time the project is run. It also adds any OPC tags to the server tag space as needed.
Note: When the option to automatically generate OPC tags is selected, any tags that are added to the server's tag space must be saved with the project. Users can configure the project to automatically save from the Tools | Options menu. On Duplicate Tag When automatic tag database generation is enabled, the server needs to know what to do with the tags that it may have previously added or with tags that have been added or modified after the communications driver since their original creation. This setting controls how the server handles OPC tags that were automatically generated and currently exist in the project. It also prevents automatically generated tags from accumulating in the server. For example, if a user changes the I/O modules in the rack with the server configured to Always Generate on Startup, new tags would be added to the server every time the communications driver detected a new I/O module. If the old tags were not removed, many unused tags could accumulate in the server's tag space. The options are: l
l
l
l
Delete on Create: This option deletes any tags that were previously added to the tag space before any new tags are added. This is the default setting. Overwrite as Necessary: This option instructs the server to only remove the tags that the communications driver is replacing with new tags. Any tags that are not being overwritten remain in the server's tag space. Do not Overwrite: This option prevents the server from removing any tags that were previously generated or already existed in the server. The communications driver can only add tags that are completely new. Do not Overwrite, Log Error: This option has the same effect as the prior option, and also posts an error message to the server's Event Log when a tag overwrite would have occurred.
Note: Removing OPC tags affects tags that have been automatically generated by the communications driver as well as any tags that have been added using names that match generated tags. Users should avoid adding tags to the server using names that may match tags that are automatically generated by the driver.
www. ptc.com
Beckhoff TwinCAT Driver
17
Parent Group: This property keeps automatically generated tags from mixing with tags that have been entered manually by specifying a group to be used for automatically generated tags. The name of the group can be up to 256 characters. This parent group provides a root branch to which all automatically generated tags are added. Allow Automatically Generated Subgroups: This property controls whether the server automatically creates subgroups for the automatically generated tags. This is the default setting. If disabled, the server generates the device's tags in a flat list without any grouping. In the server project, the resulting tags are named with the address value. For example, the tag names are not retained during the generation process. Note: If, as the server is generating tags, a tag is assigned the same name as an existing tag, the system automatically increments to the next highest number so that the tag name is not duplicated. For example, if the generation process creates a tag named 'AI22' that already exists, it creates the tag as 'AI23' instead. Create: Initiates the creation of automatically generated OPC tags. If the device's configuration has been modified, Create tags forces the driver to reevaluate the device for possible tag changes. Its ability to be accessed from the System tags allows a client application to initiate tag database creation. Note: Create tags is disabled if the Configuration edits a project offline.
www. ptc.com
Beckhoff TwinCAT Driver
18
Device Properties - Communications Parameters
Project Port Port Number The ADS devices in a TwinCAT message router are uniquely identified by a number referred to as the ADSPortNr. For more information, refer to table below.
System
Supported ADS-PortNr
Default Setting
TwinCAT 2 PLC Runtime Systems
801 811 821 831
801
TwinCAT 3 PLC Runtime Systems
851 852 853 854
851
BC9xxx/BX9xxx Series Controllers
800
800
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.
Device Properties - Options
Project Options Default Type: Specify the data type tol be assigned to a client/server tag when the default type is selected during tag addition, modification, and import. Client/server tags are assigned the default data type when any of the following conditions occur: 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.
www. ptc.com
Beckhoff TwinCAT Driver
19
Device Properties - 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
l
l
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. 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. Symbol File: This property 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. Auto-Synchronize File Changes: This feature updates the Runtime database automatically when the file has been modified. This option is only supported by BC/BX model devices. Caution: Enabling 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.
Import and Runtime Compatibility Additional OPC item information is located in the comment field after the PLC variable declaration in TwinCAT PLC Control. This optional functionality is used to minimize the OPC namespace of the server project. It also assigns the appropriate read/write item properties and OPC client access. Respect OPC Read/Write Item Properties When enabled, variables that include the string 'OPC_PROP[0005]: ' (defined within the variable comment field in the PLC project) will be assigned the appropriate Read/Write access. During import and Runtime, any tag(s) corresponding to a variable with the R/W access specified will carry the same Read/Write access rights. Whitespace is ignored.
www. ptc.com
Beckhoff TwinCAT Driver
20
Syntax: (*~(OPC_PROP[0005] : : )*)
l
1 = Read Only, 2 = Write Only, 3 = Read/Write. Optional and ignored. Read Only Example: dwTemperature:DWORD; (*~(OPC_PROP[0005]:1:Read Only)*)
l
Respect Tag Case on Import When disabled (default), imported tag and address strings are forced into upper case. When enabled, upper and lower case text is preserved when imported. Note: Respect Tag Case on Import behavior: 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.
Only Import Variables Marked for OPC When enabled, only tags with the keyword 'OPC:1' (defined within the variable comment field in the PLC project) will be imported and visible during Runtime. l
Syntax: (*~(OPC : 1 : )*) Optional and ignored.
l
Example: bMemFlag AT%MX0.0:BOOL; (*~(OPC:1:Visible to OPC Clients)*)
Only Import Variables Marked for OPC + Filter When Only Import Variables Marked for OPC is enabled with a Filter string, only tags in which the comment includes the string 'OPC:1' and 'OPC_Filter: ' will be imported into the project and visible during Runtime. Filter strings are arbitrary, user-defined strings used for another layer of filtering. If none are specified, this field will be ignored. Otherwise, the variable will only be imported if the filter string found in the comment section matches the filter set in Device Properties. Whitespace is treated literally. l
Syntax: (*~(OPC : 1 : )(OPC_Filter : : )*) Optional and ignored.
l
Example: bMemFlag AT%MX0.0:BOOL; (*~(OPC:1:Visible to OPC Clients)(OPC_Filter:Memory Access) *)
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. 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.
www. ptc.com
Beckhoff TwinCAT Driver
21
l
l
Syntax:(*~(OPC : 1 : )(OPC_PROP[0005] : : )*) Example: dwTemperature:DWORD; (*~(OPC:1:Visible to OPC Clients)(OPC_PROP[0005]:1:Read Only) *)
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. l
l
Syntax: (*~(OPC : 1 : )(OPC_Filter : : ) (OPC_PROP[0005] : : )*) Example: dwTemperature:DWORD; (*~(OPC:1:Visible to OPC Clients) (OPC_Filter:Memory Access) (OPC_PROP[0005]:1:Read Only)*)
OPC Item Description + Only Import Variables Marked for OPC Any characters placed before the tilde in the comment field are treated as a description and will be displayed in the server as an Item Description. l
Syntax:(*~(OPC : 1 : )*)
l
Example: (*This is my OPC Item Description~(OPC :1:Visible to OPC Clients)*)
Device Properties - Redundancy
Redundancy is available with the Media-Level Redundancy Plug-In. Consult the website, a sales representative, or the user manual for more information.
www. ptc.com
Beckhoff TwinCAT Driver
22
Automatic Tag Database Generation Controller-to-Server Name Conversions Leading underscores Leading underscores (_) in tag/program names will be replaced with U_. This is required since the server does not accept tag/group names beginning with an underscore.
Preparing for Automatic Tag Database Generation Upload Symbols from Device It is recommended that all communications to the Beckhoff TwinCAT of interest are halted during the database creation process.
In the server 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. 3. Next, select the desired Beckhoff Compatibility options. 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.
Upload Symbols from File The driver uses a file generated from Beckhoff TwinCAT PLC called an .tpy import/export file to generate the tag database. Note: All tags, including global and program, are imported and expanded according to their data type.
In Beckhoff TwinCAT PLC The .tpy file is automatically created the first time that a build is done on a clean project. 1. Open the TwinCAT PLC Control program. 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.
In the server 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.
www. ptc.com
Beckhoff TwinCAT Driver
23 3. Enter or browse for the location of the .tpy file that was previously created. 4. Next, select the desired Beckhoff Compatibility options. 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. ptc.com
Beckhoff TwinCAT Driver
24
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.
Optimizing the Application While the driver is fast, there are a couple of guidelines that can be used to control and optimize the application and gain maximum performance. The server refers to communications protocols like Beckhoff TwinCAT as a channel. Each channel defined in the application represents a separate path of execution in the server. Once a channel has been defined, a series of devices may then be defined under that channel. Each of these devices represents a single Beckhoff TwinCAT controller from which data will be collected. While this approach to defining the application will provide a high level of performance, it won't take full advantage of the driver or the network. An example of how the application may appear when configured using a single channel is shown below. In this example, each device appears under a single channel called Beckhoff_ TwinCAT. In this configuration, the driver must move from one device to the next as quickly as possible to gather information at an effective rate. As more devices are added or more information is requested from a single device, however, the overall update rate begins to suffer.
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. 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. ptc.com
Beckhoff TwinCAT Driver
25
Data Type Descriptions Data Type
Description
Boolean
Single bit
Byte
Unsigned 8-bit value
Char
Signed 8-bit value
Word
Unsigned 16-bit value
Short
Signed 16-bit value
DWord
Unsigned 32-bit value
Long
Signed 32-bit value
Float
32-bit IEEE Floating point
Double
64-bit IEEE Floating point
String
Null terminated character array
For a description of TwinCAT-platform specific data types, refer to TwinCAT Data Types.
Unsupported Data Types Unsupported data types include LBCD and BCD.
www. ptc.com
Beckhoff TwinCAT Driver
26
Address Descriptions The following table summarizes the valid addressing formats in the server.
Address
Notation
Example
Notes
Standard
tag_1
Tag cannot be an array
Array Element
[dim1, dim2, dim3]
tag_1 [2, 58, 547]
Dimension Range=1 to 3
Format
tag_1 [0,3]
Element Range=0 to 65535 Length Range=1 to 65535
/
String
tag_1/4
The number of characters to read/write equals the string length.
For information on how elements are referenced for 1, 2 and 3 dimensional arrays, refer to Ordering of Array Data. See Also Addressing Atomic Data Types
Symbolic Tag Based Addressing The Beckhoff TwinCAT Driver uses a tag or symbol-based addressing structure. These tags (which are commonly referred to as Native Tags) differ from conventional PLC data items in that the tag name itself is the address, not a physical or logical address.
Client/Server Tag Address Rules Beckhoff TwinCAT variable names correspond to Client/Server Tag addresses. Beckhoff TwinCAT variable names (entered via Beckhoff TwinCAT PLC) follow the IEC 61131-3 identifier rules. Client/Server Tag addresses follow these same rules and are listed below: l
Must begin with an alphabetic (A-Z, a-z) character or an underscore (_).
l
Can only contain alphanumeric characters and underscores.
l
First 32 characters are significant.
l
Cannot have consecutive underscores.
l
Are not case sensitive.
Client/Server Tag Name Rules The rules for tag name assignment in the server differs from address assignment because tag names cannot begin with an underscore.
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: .
Program Tags
www. ptc.com
Beckhoff TwinCAT Driver
27
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.
Structure Tag Addressing Beckhoff TwinCAT structure variables, global or program, contain one or more member variables. Member variables can be atomic or structured in nature.
Global tag example:
Program tag example:
..
..
This implies that a substructure would be addressed as:
Global Tag Example
Program tag example:
...
...
Arrays of structures would be addressed as:
Global Tag Example
Program tag example:
.[dim1, dim2, dim3].
.[dim1, dim2, dim3].
Again, this implies that an array of substructures would be addressed as:
Global Tag Example
Program tag example:
..[dim1, dim2, dim3].
..[dim1, dim2, dim3].
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.
Addressing Atomic Data Types The table below shows suggested usages and addressing possibilities for a TwinCAT Data Type given the address formats available.
Atomic Data Type BOOL
Client/Server Standard Data Type
Boolean
Array Element Boolean
www. ptc.com
String
Beckhoff TwinCAT Driver
Atomic Data Type
28
Client/Server Standard
Array Element
String
Tag Example
BOOLTAG
BOOLARR [0]
SINT/USINT
Data Type Tag Example
Byte, Char SINTTAG
String Byte, Char SINTARR[0]/4 SINTARR[0] String length cannot be longer than the array length minus the element position.
INT/UINT
Data Type Tag Example
Word, Short INTTAG
Word, Short INTARR[0]
Data Type Tag Example
DWord, Long DINTTAG
DWord, Long DINTARR [0]
Data Type
Float
Tag Example
REALTAG
Float REALARR
LREAL*
Data Type Tag Example
Double LREALTAG
Double LREALARR [0]
TIME
Data Type Tag Example
DWord, Long TIMETAG
DWord, Long TIMEARR [0]
STRING
Data Type Tag Example
String String STRINGARR STRINGTAG/80 [1]/80
DINT/UDINT
REAL
[0]
*This data type is not supported by the BC/BX Controller model.
Unsupported TwinCAT Data Types Unsupported data types include pointers, enumerations, TOD, and DT. See Also: Address Descriptions
www. ptc.com
Beckhoff TwinCAT Driver
29
Ordering of TwinCAT Array Data 1. Dimensional Arrays - array [dim1] 1 dimensional array data is passed to and from the controller in ascending order: for (dim1=0; dim1