This appendix describes the timestamp used by OPC.
For real-time data, the current time is used when the I/A data server reports the new value of a tag.
The Win32 function CoFileTimeNow is used to get the current time. This is the time format accepted by OPC. For historical data, the time value from the I/A server is converted to
FILETIME as is, regardless whether it is UTC or I/A time. The definition of CoFileTimeNow is as follows:
CoFileTimeNow
Returns the current time as a FILETIME structure.
HRESULT CoFileTimeNow(
FILETIME * lpFileTime //Pointer to return the structure );
Parameter LpFileTime
[out] Pointer to return the FILETIME structure.
Return Values S_OK
The FILETIME structure:
FILETIME
The FILETIME data structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601. It is the means by which Win32 determines the date and time. It is defined as follows:
typedef struct STRUCT tagFILETIME {
The low 32 bits of the Win32 date/time value.
dwHighDateTime
The upper 32 bits of the Win32 date/time value.
Appendix J. How to Configure Secured Read/Write Connections
This appendix describes the procedures to configure secured read/write connections.
The AIM*OPC Server has the ability to establish secured read/write connections to I/A Series Compound Block Parameters. It is recommended that secured connections be established if you plan to issue more than 2 writes per second total. Secured connections do not use the broadcast mechanism to issue the write command.
To create secured connections:
Create a secured points file in ASCII text format:
The file contains item_ids of those points to which the secured connections will be established.
Each item_id should be on a separate line in the file.
An example is shown below:
AW7001\MYCOMPOUND:CALC1.RI01
AW7001\MYCOMPOUND:CALC2.RI01
Only points to which the client writes values should be included in the file.
For example, if you have an advanced control application using OPC and intend to read 10 process values, calculate a setpoint and write the setpoint back to the I/A Series system. Only the C:B.P of the setpoint needs to be added into the secured writes file.
The name and location of the file are not important.
To configure the OPC server to use the secured writes file:
1. Open the AIM*OPC Server Configurator.
2. Select the Advanced tab. In the entry field AIM*secured writes point file, enter the full path name of the secured writes file.
Either manually type in the file name or use the browse button to locate the secured writes file.
3. To save the configuration to the hard drive, from the menu bar, select File >
SaveAs.
To configure the server to read the configuration file on start-up:
1. Select View > Options from the menu bar.
2. Under the General tab, check the Load configuration file on startup option.
3. Enter the configuration file name in the entry field.
The AIM*OPC server must be restarted in order for the changes to take effect.
By using the secured writes file, the OPC Server establishes secured connections for writes to those points listed in the file. The server still makes unsecured writes to points not contained in the secured writes file.
To disable writes to unsecured points,
Uncheck the Allow secured writes option in the Advanced tab of the configura-tor. This option disables writes to all points except those listed in the secured writes file.
NOTE
If this Allow secured writes option is changed, the configuration must be saved to a config file and then loaded at server startup (similar to the secured writes file option) in order for the changes to take effect.
Appendix K. OPC I/O Methods
This appendix describes the data I/O methods available from OPC servers.
NOTE
Please refer to the OPC DA 2.05a specification for further information.
Synchronous Versus Asynchronous I/O
All OPC compliant servers must provide two distinct methods for real-time data access. OPC clients can choose between synchronous and asynchronous I/O for their operations. All OPC servers must support both synchronous I/O and at least one form of asynchronous I/O, 2.05a or 1.0a. These terms only refer to communication between the client and the server, not between the server and its data source.
Synchronous operations are blocking calls made to an OPC server to either read or write a group of OPC items. When an OPC client makes a synchronous call, it passes control to the OPC server and does not continue processing until the call is complete. Synchronous operations are only used for testing, special operations (generally involving DEVICE reads), or in extremely simple OPC clients.
Asynchronous operations are non-blocking. OPC client applications establish call-back objects to which the OPC server can interface to deliver item updates. Once this call-back is established, the OPC server continually informs the client of changes in value to OPC items as they occur, being careful not to exceed the OPC group update rate and potentially overwhelm the client.
OPC clients may also create asynchronous transactions to perform non-passive operations. These transactions include reading from DEVICE, refreshing of all active items in an active group, and writing control values. Once the client creates a transaction, it can carry on processing until the OPC server informs it that the transaction is complete through the client’s call-back object. The server also returns an ID number when a transaction is created so that the client can try to cancel it if it is taking too long.
Asynchronous I/O is the normal preferred method for continuous real-time data access. However, synchronous I/O can be useful for scenarios involving infrequent or one-shot data access
operations.
Device Versus Cache Reads
When an OPC client creates a group and adds items to it, the OPC server attempts to retrieve val-ues for active items from its source of data. Internally, it maintains a data cache, which it attempts to update at least as fast as indicated by the update rate of the group. The server optimizes regular communication with its source of data for best performance while keeping the cache fresh.
If you need to retrieve real-time values directly from the data source (by-passing the regular opti-mization routines of the cache and the time delays they might impose), OPC provides the means to do this using device reads through either synchronous or asynchronous I/O.
Device reads may be performed at any time on specific items in a group. They ignore the update rate and active state of the group or items involved. Due to the fact that they by-pass normal optimization routines, however, device reads should be used sparingly as they can incur severe performance penalties in the server.
A scenario where a synchronous read from a device might be useful is in the case of a utility for altering a series of set points in the device. The client application might create an inactive group with the desired items and perform a device read. When the call completes, the item values are as current as possible. The utility can then display the values, allow the user to alter them, and syn-chronously write them out to the device. This can be followed by a second device read to ensure that the values were written.
Had a device read not been used, it could take some time before the server receives the first values for the group after it is activated. Additionally, there is no guarantee that the values would all arrive in the same update. A device read ensures that the values all arrive at the same time.
Technically, write operations are always device writes. However, there is no point in writing to the cache, so this terminology is redundant.
OPC DA 2.05a Versus 1.0a Asynchronous I/O
With the release of the OPC Data Access Version 2.05a Custom Interface Standard, the OPC Foundation included a new method for asynchronous I/O intended to replace the Version 1.0a standard. While some OPC servers may continue to support the old method of asynchronous I/O, they are under no obligation to do so. The new method is simpler, easier to implement, and avoids errors that occurred with slow client applications using the old method.
Older OPC clients that require 1.0a interfaces are not able to communicate properly with new OPC servers that support only the 2.05a interfaces. Similarly, newer OPC clients that require 2.05a interfaces are not able to communicate with old OPC servers that only support the 1.0a interfaces. Vendors of software that require or support 1.0a interfaces are encouraged to update to the 2.05a standard, which is intended to replace the 1.0a standard.
AIM*AT OPC Server software supports both DA 2.05a and 1.0a asynchronous I/O, and is thus able to communicate with OPC clients that depend on either method with an OPC server. OPC clients that support both methods generally attempt to use the 2.05a method first and then resort to 1.0a if that fails.
Appendix L. Alias Configuration
This appendix provides additional information about the configuration of aliases for OPC items in an AIM*AT OPC Server application.
Scaling Expressions
Table L-1 lists and describes the syntax for scaling expressions used in AIM*AT OPC Server aliases.
Table L-1. Alias Scaling Expressions
Expression Description Examples
‘text’ Text value (enclosed in
single quotation marks).
Not And Or Logical Not, Logical And,
Logical Or may also be used for binary math.
(7 3) And (1 <> 0)(12 And 5) = 4
TIME Current time as text. ‘The time is ’ + TIME
DATE Current date as text. ‘Today is ’ + DATE
INT(x) Returns the integer part
of x.
INT(3.14) = 3
FRAC(x) Returns the fractional part
of x.
FRAC(3.14) = 0.14
SQRT(x) Returns the square root
of x.
SQRT(16) = 4
DIV(x, y) Divides x by y. DIV(42, 7) = 6
IF(expression, x, y) Returns x if expression evaluates to TRUE, otherwise returns y
IF(6 12, ‘OK’, ‘Bad’) = ‘OK’
TRUE FALSE Constant Boolean true
and false
(5 > 6) = FALSE
Alias Configuration CSV File Format
AIM*AT OPC Server imports and exports alias configuration data in .CSV format files (see Table L-2).
Comma-delimited text files (CSV) contain records on each line. Commas separate the individual fields in a record. If the data within a field contains commas or spaces in itself, then the data is enclosed in double quotation marks (““). If the data contains a double quotation mark within itself, then two double quotation marks are used in place. Lines beginning with a hash mark (-) are ignored as comments.
Each record in an alias configuration CSV file has the following general format:
“Alias Group”, “Alias Name”, “Item Path”, <data type>, <read-only>,
<poll always>, <update rate>, <scaling> [, <scaling parameters>...]
For example:
“North.FIC101”,”CV”,”Com1.Plc1.4:0001F”,5,1,0,0,0
describes the syntax used in an alias configuration CSV file.
TYPEOF(x) Returns the data type of x
as a text description (‘STRING’, ‘INTEGER’,
‘FLOAT’, ‘BOOLEAN’,
‘ERROR’).
TYPEOF(‘hello’) = ‘STRING’
STR(x) Converts the numeric
value x to text.
STR(3.14) = ‘3.14’
UPPER(x)LOWER (x)PRETTY(x)
Converts the text value x to all uppercase or lowercase letters, or the first letter uppercase and the rest lowercase.
UPPER(‘hello’) = ‘HELLO’
LOWER(‘HI THERE’) =
‘hi there’ PRETTY(‘ALARM’) =
‘Alarm’
COPY(x, start, length) Returns a substring of the x, copying length charac-ters starting at start.
COPY(‘FIDDLE’, 2, 4) = ‘IDDL
FORMATNUMERIC(mask, x) Converts the numeric value x to text using the format mask.
FORMATNUMERIC('####.#', 123.4567) = ‘123.5’
INPUT The incoming value read
from OPC item.
INPUT * 3.1415
OUTPUT The outgoing value
written to OPC item.
OUTPUT / 3.1415
Table L-1. Alias Scaling Expressions (Continued)
Expression Description Examples
Table L-2. Alias Configuration CSV File Syntax
Field Description
“Alias Group” The name of the alias group folder to which the alias item is added. Periods in this name indicate subfolders below the root (that is, North.FIC101 = folder North under the root and subfolder “FIC101” under that).
“Alias Nam” The alias item name. To access a particular item from an OPC client, the full pathname is delimited with periods (that is, North.FIC101.CV).
“Item Path” The fully qualified item ID for the OPC item to which this alias refers.
<data type> A number indicating the data type to convert the value to before it is returned to the OPC client. This also appears as the canonical data type for the alias when browsing. Use as zero in this field for the default data type of the referenced OPC item.
<read-only> The number one in this field indicates that the alias cannot be written to. The number zero indicates that it can.
<poll always>,<update rate> These values are used in conjunction to ensure that an OPC item is always being scanned whether the client is presently using it or not. Set the “poll always” value to a one for the item to be scanned continuously, and spec-ify the update rate in milliseconds. Otherwise, set both values to zero.
<scaling> Indicates which type of scaling is applied to the alias item. The parameters that follow this value depend on the type used. Possible scaling types are; 0 (none), 1 (linear), 2 (square root), (gain/offset), and 4 (expression).
<high raw>,<low raw>,<high scaled>,
<low scaled>,<clamp>
Linear or square-root scaling parameters include the raw high and low values, scaled high and low values, and a clamping option. Possible clamp types are:
0 (none), 1 (clamp low value), 2 (clamp high value), and 3 (clamp both high and low values).
<gain>,<offset> Gain/offset scaling parameters include a scaling factor and an offset.
“Input Expression, Output Expression” Expression scaling parameters include input and out-put expressions. The inout-put expression is applied to the value from the OPC item when reading. The output expression is applied to values going to the OPC item when writing. These equations should be reciprocals of each other.
Index
Advanced OPC server options 54 OPC group update rate 54 time granularity 54
Advanced performance option settings 86 Advanced server configuration options 73 Advanced server parameter
AIM*AT server list 49 fast scan interval 49
max items per browse folder 49 max items per netAPI object 49 scan interval for string 49 slow scan interval 49
Aggregate Validity Threshold 47, 72 AIM*AT API Server Component configuring the AIM server 10 illustration of 2 AIM*AT Server List 49, 74 AIM*OPC Configurator 7, 19 AIM*OPC configurator
alias configuration page 33 starting 19
Alias
browsing for 35
creating new alias in OPC client 36 deleting 35
selecting 35
Alias configuration 129
Alias configuration CSV file format 130 Alias Configuration Page 33
Backup For Saved Configuration 50 Blue question mark 98
Browsing for tags 25
Browsing for Tags In Order To Assign Aliases 35 Browsing the Server Address Space 97
Buttons
alias configuration page 34 Delta configuration page 25 insert 34
Buttons, delete selected aliases 35 Buttons, edit selected alias 34 Buttons, insert new alias 34 C
Commit all log file writes 84 Configuration file
creating tags, updating tags, creating alias 23 defining OPC server parameters 22
defining settings 22
Configuration file, saving to 41
Configuration utility, main window 68 Configuration utility, server 67
Configurator OPC server 19
Control values, writing to OPC items 100 Create Items when they are browsed 47, 72
Creating A New Alias 36
set deltas of imported tags 25 set deltas of selected tags 25 Delta values
changing 29
Delta Values, changing 31 Device versus cache reads 127
Display time stamps using local time zone 105 Display value qualities as text 105
E
Edit Selected Alias 34 Editing A Selected Alias 38 Export Aliases 79
Expressions, scaling 129 F
Fast Scan Interval 49, 73 G
General logging settings 52, 83 General options 50
backup for saved configuration 50 load configuration on startup 51
restrict items to preconfigured aliases 51 General server parameters
aggregate validity threshold 47
create items when they are browsed 47 NetAPI Server Timeout 47
Server Connection Ping 47 server discovery ping 47
Global Customer Support Center xiv Green checkmark 98
H Insert New Alias 34, 76 Insert or Insert new alias 34 Installation
Launch configuration program on startup 82 Licensing
AIM*AT OPC Server 9 Linear scaling 77
Load Configuration On Startup 51 Load configuration on startup 82 M
Matrikon automation component 1 Matrikon configurator 8
Matrikon OPC Explorer
connecting to an OPC server 92 data display 99
setting options 102 signal generator 101 starting 87
viewing available OPC servers 91 Matrikon OPC explorer 1
Max Items per AIM*AT Object 49, 74 Max Items per Browse Folder 49, 74
Microsoft standard component category manager 114 N
NetAPI Server Timeout 47 O
OLE for Process Control (OPC) 2 OPC
DA 2
OPC DA 2.0 versus 1.0a asynchronous I/O 128 OPC Explorer, starting and using 87
OPC Group Update Rate 54 OPC groups, adding 93 OPC HDA 3
OPC items, adding 96
OPC items, validating added 98 OPC Server
shutdown 15, 17 startup 15 OPC server
configurator 19
OPC server control panel 16 OPC server parameters 45
Overwrite old log information 84 P Request time stamps with notification 103 Requested Data Type 98
Reset Statistics 80
Respect access rights when writing values 104 Restrict Items To Preconfigured Aliases Only 51 Restrict items to pre-configured aliases only 82
Revision information, document xiii S
Sanity check option 102
Save current configuration on shutdown 82 Saving the configuration file 41
Scaling expressions 129
Scaling formulas, applying to an alias 77 Scan Interval for String 49, 74
Selecting alias tags 35 Selecting tags 27
Server Connection Ping 47, 72 Server Discovery Ping 47, 72 Server object interfaces 107 Server parameters
general 46, 50
Set Deltas of Imported Tags 25 Set Deltas of Selected Tags 25 Shortcut menu, OPC server 67 Signal generator 101
Slow Scan Interval 49, 74 Software components 8
AIM OPC configurator 8 AIM*OPC Server 8
OPC automation components 8 standard OPC server browser 8 Standard quality flags 115
Statistics, viewing server 80
Synchronous versus asynchronous I/O 127 System requirements 5
T
Tag Studio main window 96 Tags
browsing for 25
changing delta values 29, 31 creating an alias 35
Telephone numbers for the Global Customer Support Center xiv Time bias setting 94
Time Granularity 54 Time granularity 86
U
Update rate, specifying 94 V
Validate Tags 98
Validating the OPC Items 98 VARIANT data types 117 W
Writing control values 100
Invensys Operations Management 5601 Granite Parkway Suite 1000 Plano, TX 75024
United States of America http://www.iom.invensys.com
Global Customer Support Inside U.S.: 1-866-746-6477
Outside U.S.: 1-508-549-2424 or contact your local Invensys representative.
Website: http://support.ips.invensys.com