The DrvADS driver is used to communicate via ADS with PLCs from Beckhoff.
Information:
For more information about the ADS protocol and products from Beckhoff visit http://www.beckhoff.se/ DrvADS uses libraries from Beckhoff for communication via ADS.
Information:
This document is used in conjunction with Chapter "Communication" of the Web Port Manual.
NOTE!
If you are using an older Beckhoff TwinCAT 2 system, you need to use DrvTwinCAT2.
This driver is included with DrvADS.
If the TwinCAT2 IO-device is missing, please reinstall Web Port and select the driver during the installation setup.
NOTE!
If you intend to use the Webservice on the ADS driver, you must use DrvTwinCAT2 instead.
Webservice functionality is only supported when communicating through the TwinCAT 2 driver.
To use DrvADS, an IO device is first created which is then used to communicate with the connected device. Tags are then used to define which addresses to read and write (see "Tags"). The driver does not have its own settings, these are set uniquely for each IO device that is created.
Installation
The installation of DrvADS is done by selecting DrvADS (Beckhoff) when installing the Web Port. See "Installation" for more information on the installation process.
NOTE!
DrvADS also requires that an ADS router is installed. This is installed automatically with TwinCAT. It is sufficient to install TwinCAT CP or Twincat Runtime. If TwinCAT CP is not installed and you create an IO device with this driver, a chain is started outside the Web Port control that looks for TwinCAT dll files, and when they are not found, they will generate an error that causes the Web Port to shut down.
IO Device
To use DrvADS, an DrvADS type IO is first created. For more information, (see "Create IO-device" in the manual).
In addition to general settings, there are the following settings for an IO device of the DrvADS type:
| Setting: | Description |
| AmsNetID | The ID the PLC has in the ADS router configuration |
| AmsPort | The communication port used |
| Timeout | Timeout for communication in milliseconds |
| Auto-tag | Activates the function where Web Port automatically generates tags based on the comment in the PLC program. For more information see "Auto-tag" |
| Disable tag on fail | If checked, tags are disable in case of consecutive reading errors to reduce the risk of consequential problems. Disabled tags are reactivated after 60 minutes and a new read attempt is performed |
| Use symbol address | Indicates whether symbol address or register should be used for addressing |
| Connect via ADS or web services | Web Port supports both the ADS protocol and Web Services. (Web Services need to be enabled in Twincat) |
| Web Service Address | Example of address http://<ip address or name of PC device>/tcadswebservice/tcadswebservice.dll |
| Web Service read interval | Questions about web services are grouped. Here is how often to read |
| Web Service max queue | Specifies how many tags to retrieve in the same query |
Information
In order for the Web Port to be able to communicate via ADS, the PLC must be configured in the ADS router. It is important that an x indicates that a connection has been made to the PLC. For more information, see the TwinCAT manual.
The ADS Router can also be configured via the TwinCAT System Properties and the ADS Router tab. If the configuration is done here, the corresponding settings in the PLC are also required.
Tags
To read and write addresses from a Beckhoff PLC, tags must be created and linked to its IO device. For more information on how to create tag lists and tags, see "Tags" in the Web Port manual.
TIP!
Create a tag list for each IO device. This is to get a good structure and easily find tags in the lists.
NOTE!
If Auto-tag is used, a tag list with the same name as the IO device is automatically created.
Tags associated with a DrvADS IO device may have the following data types:
| Data type in TwinCAT | Data type in Web Port |
| BOOL | DIGITAL |
| BYTE | UINT |
| SINT | UINT |
| WORD | UINT |
| DWORD | ULONG |
| INT | INT |
| UINT | UINT |
| LINT | INT64 |
| ULINT | UINT64 |
| DINT | LONG |
| UDINT | ULONG |
| REAL | REAL |
| STRING | STRING |
| TIME | TIME |
| TOD (TIME_OF_DAY) | TIME |
| DATE | DATE |
| DT (DATE AND TIME) | DATE |
Information:
The address field indicates the symbol name to be read / written. A symbol name is a reference to the memory address in the PLC where a variable is stored.
If a variable is in a function block, the symbol name will be:
| functionblockname.variable name | Note the delimiter "." |
If a variable is in a global variable list, the symbol name will be:
| .variablename | Note "." before the variable name |
If Use Symbol Address is unchecked, addresses are entered in the following format: groupindex:offset
For more information on addressing, see Beckhoff's manual regarding "" Index-Group / Offset "Specification of the PLC services"
Web Port also supports reading arrays using square brackets, for example with address MAIN.ARRAY_OF_INT[1]
TIP!
To invert a tag or make a comparison, the address can be terminated with a Boolean expression. The data type remains the same but the value of the tag becomes 1 or 0 depending on whether the expression is met or not.
Example:
| symbolname=0 | Returns 1 when the variable = 0. |
For more information, see "Tag naming convention" in the manual.
NOTE!
If the PLC program changes, the IO device may need to be reset in Web Port. To do this, open the settings box for the IO device where the RESET button is located. The reason for this is that the connection between symbol names and memory addresses may have changed during the software update. Resetting the IO device in Web Port clears the lookup list Web Port uses to speed up communication.
Auto-tag
When Auto-tag is selected on the IO device, a tag list is automatically created in Web Port where tags imported from the PLC are stored. This list can not be changed from the Web Port but is affected by the variables defined in the PLC. The variables are filtered based on their comments and then imported into the tag list in Web Port.
Information:
To update a tag list created via Auto-tag go to SYSTEM SETTINGS / TAGS and then click on the tag list. In the dialog that opens, select Reload to import tags from the PLC.
The comment is structured according to the following structure:
1. The comment begins with a standard variable description, for example Flowtemperature.
2. Then follows ~wp: which tells the Web Port that this variable should be imported.
Unless otherwise specified, Web Port creates a tag where the symbol name of the variable is converted to tag name by converting it to uppercase and substituting . with _
The data type is set according to the list of data types above.
As a comment, everything is taken before ~wp:
3. To further control how the Web Port generates tags, all parameters (columns) described in chapter "Trend settings" of the manual can be used. These are specified on the form [parameter] value. One or more parameters can be set one after the other.
Example:
The example below creates a tag that, regardless of symbol name, gets the tag name VS01_GT11_PV. The description on the tag is set to FlowTemperature, the number of decimals is set to 1 and the unit to ° C.
FlowTemperature~wp:[name]VS01_GT11_PV[unit]°C[format]0.0
Import filter
Another possibility to import tags to Web Port is using the filter import file DrvADSImportFilter.csv. This is included in the installation of DrvADS and is located under the data directory for WebPort / assets / import / DrvADS /.
The file has the following columns:
| Column: | Description: |
| startwidth | Filters symbol names that begin with this expression |
| contains | Filters symbol names that contain this expression |
| endswith | Filters symbol names ending in this expression |
| find | Searches for this expression in the symbol name and replaces it |
| replace | Replaces the match from find with this value |
| rawmin | Possible scaling value (rawmin) for tag |
| rawmax | Possible scaling value (rawmax) for tag |
| engmin | Possible scaling value or limit (engmin) for tag |
| engmax | Possible scaling value or limit (engmax) for tag |
| unit | Unit for the tag |
| format | Possible formatting for the tag |
| description | Description of the tag |
| alarmoption | Any alarm settings for the tag |
| trendoption | Any trend settings for the tag |
Information:
DrvADSImportFIlter.csv contains a number of lines to show how it can be used. To be useful, however, it should be expanded and adapted to the library and designation standard used in programming the PLC.
To perform an import go to System Settings / Tags and open the tag list where the tags are to be imported. Click the Import Tags tool button. In the dialog that opens, select the IO device from which the tags are to be imported, and enter the Prefix that the tags are to receive in the Web Port. Click the Import button in the dialog box to start the import. If Update Existing is selected, Web Port will update existing tags that are affected by the import. If Cancel with matching filter is selected, Web Port will cancel the import of a certain line in the import filter. If it is not selected, it will continue, and can then create several tags in the Web Port from the same tag in DUC if it gets several matches. When the import has been completed, an information box will appear stating how many tags have been imported.
NOTE!
Import skips tags already in Web Port. This also applies if the tags are in other tag lists, as Web Port checks the tag name generated during import.
Manual Tag Import
With Manual Tag Import, it is possible to import tags from an IO device into a tag list in Web Port that can be edited and managed directly from Web Port.
Unlike Auto-tag, the imported tags are stored in a manually created tag list, which means that the content can later be modified, adjusted, or deleted within Web Port.
Before performing a manual import, make sure that Auto-tag is not selected on the IO device.
How to perform a Manual Tag Import
-
Create a new tag list in Web Port.
-
Open the tag list and select Import tags.
-
In the import dialog that opens, choose the IO device from which the tags are to be imported.
-
Continue as described in the Import tags section
Import Type and Settings for ADS
For ADS devices, the import dialog contains a dropdown called Import type, which defines how the import is performed. The available options are:
-
Filter import
Uses the import filter file (DrvADSImportFilter.csv) as described in the previous section.
This option allows tags to be filtered, renamed, and configured based on the definitions in the CSV file. -
Use Auto Tag Feature
Select this option when performing a Manual Tag Import.
When Use Auto Tag Feature is selected, choose the desired Import behavior:
-
Add new tags
Imports and adds new tags from the device.
Existing tags in the tag list are not removed or replaced.
Updated tags will not be affected. -
Add/Delete tags
Imports and adds new tags from the device and removes any tags in the Web Port tag list that are no longer present in the device. Updated tags will normally not be affected.
Info
To update existing tags in the tag list, select Update existing in combination with your chosen Import behavior.
This will perform the import as defined by the Import behavior (adding new tags and/or removing missing tags) and update any existing tags that have changed on the IO device.
The remaining configuration options are available when Filter import is selected.