The DrvCTAPI driver is used to connect the Web Port to Citect via CTAPI. The driver provides the ability to read and write tags in Citect, as well as retrieve alarms and trends. It is also possible to link Citect projects to Web Port to automatically import tag lists from Citect to Web Port.
Information:
This document is used in conjunction with Chapter "IO-devices" of the Web Port manual.
CTAPI is the interface Citect provides to give 3rd party systems access to data.
Installation
The installation of DrvCTAPI is done by selecting DrvCTAPI when installing the Web Port. See "Installation" for more information on the installation process.
Preparations in Citect
In order to use DrvCTAPI, certain settings must first be made in Citect. Below is a list of preparations.
- Set Remote=1 under the [CTAPI] category in Citect.ini
- Create a user that can be used when connecting via CTAPI
- Create a Device in Citect to write alarm events to file (System/Device)
- Set your alarm device as Log Device on the alarm categories to be written to file.
Information:
The following settings are necessary for the alarm device to be connected to the Web Port.
Other settings can be selected at your discretion.
Format: {DATE,10}|{TIME,8}|{TAG,80}|{LOGSTATE,16}
Type: ASCII_DEV
No. Files
1
Tip!
If multiple devices are used in Citect to write alarms to file, a group must be created. Then the group is used as Log Device for the alarm categories to be written to file.
Web Port driver settings
In Web Port, the Driver must be connected to Citect. This is done by navigating to SYSTEM SETTINGS/COMMUNICATION/DRIVERS. Then click DrvCTAPI in the list.
The following settings can be specified:
| Setting: | Description: |
| Server address | A valid computer name or IP address of the server where Citect is running |
| Username | Username used to connect to CTAPI |
| Password | Password used to connect to CTAPI |
| Master DBF | Path to master.dbf (NOTE! use UNC path if Citect is not running on the same computer as Web Port) |
| Handle alarms | Specifies whether Web Port should handle alarms (active by default) |
| Handle alarm history | Specifies whether alarm history should be retrieved from Citect (active by default) |
| Handle trend | Specifies whether Web Port should handle trend (inactive by default) |
| Handle trend history | Specifies whether trend history should be retrieved from Citect (active by default) |
| Alarm import file | Path to the alarm file created during Citect preparation |
| Alarm init fype |
Type 1 uses ctFindFirst(hCtAPI, "Alarm",.. Type 2 uses ctFindFirst(hCtAPI, "CTAPIAlarm(.. |
Tip!
If Web Port and Citect are running on different machines and the project paths in master.dbf do not use UNC, the path to master.dbf can be supplemented with search and replace expressions.
This then causes the project paths in master.dbf to be converted from local path to UNC.
The search and replace expression is specified together with the path to master.dbf according to the following format:
{path master.dbf}|{search-string}|{replace-string}
- {path master.dbf} is replaced with the current path where master.dbf can be reached.
- {search-string} is replaced with e.g. C:\citect\
- {replace-string} is replaced with e.g. \\citect\
IO-Devices
To communicate with Citect, an IO device of type DrvCTAPI must be created. For more information see chapter "IO-devices" of the manual.
In addition to general settings (see "general settings" in IO-devices), the following settings are available for an IO device of type DrvCTAPI:
| Setting: | Description: |
| Project | Specified to link a Citect project to the IO and thus enable tag import |
| Auto import | Autogenerate tag lists associated with the project specified under Project. These tag lists will not be editable in Web Port. It is also possible to import tag lists manually into a tag list, which allows you to influence the tags in the Web Port |
| Extended alarm merging | Do an extended check of alarm tags in Citect. If no individual tag is associated with the alarm tag, one will be created in the Web Port |
| Tag life span | Specifies how long a tag subscription is active for a read |
| Refresh rate | Specifies how often a tag is updated when a subscription is active |
| Trend Display Mode | Specifies how the trend data is displayed when retrieved from Citect. See the Citect manual for TRNQUERY and Display Mode for more information |
| Trend Data Mode | Specifies whether time stamps on trend history should be exact or interpolated |
| Alarm comment field | Specifies the database field to be used for commenting on alarm tags |
Tags
In order to read and write Citect tags via an IO device, tags must be created and associated with it. For more information on how to create tag lists and tags, see chapter "Tags" of the manual.
Tip!
Create a tag list for each IO device. This is to get a good structure and to easily find tags in the lists.
NOTE! Does not apply if autotagging is selected, as a tag list is then created automatically.
Tags associated with an IO device of type DrvCTAPI have the same data types as in Citect.
Information:
The address field specifies the tag name used in Citect.