OPC Gateway Configuration Guide
Home » OPC Gateway Configuration Guide
Printer Friendly Version

OPC Gateway Configuration Guide

The OPC Gateway (Protocol converter, Data Manager). Allows the transfer of data between any brand of OPC Servers or between our protocols. It function in a similarly manner to ladder logic, except that the Gateway is event driven and runs asynchronously. The source and trigger expression can be any arithmetic or logical expression with any number of variables.

Group Definition

    Items to be transferred are placed into groups. The update rate and dead band of each group controls the acquisition rate and percent dead band of all items in that group.

Group Name User supplied group name
Update Rate The acquisition rate of all items in this group in milliseconds.
Write Delay Put a delay between each write.
Dead Band Only items whose value are changed by greater than the specified dead band will be transferred. Applies only to items in which the raw low and high values are defined. See addtags for information on how to set the raw low and high values in IOServer. Each brand of OPC Server have its own method of setting the low and high values.
Active Set to 0 to stop this group.
Force Initial Update Set to true, for OPC Server that does not comply with the OPC Standard of sending the initial value.
Write on Good Quality Only Copy to destination only if the quality of source is good.
OPC 2 Force the use of OPC 2.0 even if the OPC 1.0 interface is published by the OPC Server.
Sync Read and Write Force the use of synchronous read and write. For use with OPC Servers that does not support async or exception reporting. Sync read and write will reduce performance.
Allow spaces in OPC Tag Tags must be bracketed by parenthesis when this option is enabled.
Copy timestamp to destination If enabled the value, quality and timestamp of the source is copied to the destination using IOPCAsyncIO3::WriteVQT instead of IOPCAsyncIO::Write
Reads Total number of reads
Writes Total number of writes
Items Number of items

Item Definition

    Each item defines source of the data and the destination of the data.

Source Expression When reading from IOServer the OPC Server Name may be omitted. The OPC Server name is anything before the '\' character. Any error detected is appended to this field. \App1\IOServer\Device1.40001 will access itemdID "Device1.40001" in the OPC Server "IOServer" on remote computer "App1"
Destination ItemID Write to Destination ItemID whenever the value at Source is changed. Any error detected is appended to this field.
Trigger Expression Copy Source to Destination only when the trigger is true or if the trigger is not specified.  Any error detected is appended to this field
Browse Browse OPC Servers items.

Item ID Current Item ID
Done Use this Item ID
Test Test if Item ID is valid
Cancel Don't use this item ID
Error Result of test
Available Item ID: Click on the text to first expand the tree
Active Set to 0 to stop this item.
Force Write Force write to destination even if the value of source or trigger is not changed.
Write Delay Delay the write by this number of milliseconds.
Write Data Type Convert data to this type before writing to the destination. If EMPTY is specified, then the data is converted to the destination data type.
Value The last value read.
Time Stamp The last time data was read. If the destination OPC Server supports IOPCAsyncIO3::WriteVQT, then the Time stamp information of the source is also copied. IOServer supports IOPCAsyncIO3::WriteVQT. If the source consist of more than one item, then the newest timestamp is used.
Quality The last quality of this item. If the destination is a DNP Slave, the .Online of that object will be set to 0/1 if the source quality is bad/good.
Reads Total number of reads
Writes Total number of writes

Source and Trigger Expression

The Trigger and source expression can be any combination of comparison, logical or arithmetic operation on OPC items from any OPC Server. ItemID must be space separated. Boolean are internally represented as a 16 bit integer with -1 for true and 0 for false.

Priority of operators (from the highest priority)

() Use to override priority
- not unary operator, negation and logical not
* / div mod multiply, divide, integer divide and modulus
- + plus and minus
<< >> left and right shift
< <= > >= comparison
= <> equality and non equality
bitand bitwise and
bitxor bitwise xor
bitor bitwise or
and logical and
or logical or

Functions supported:

abs, acos, asin, atan, ceil, cos, cosh, erf, erfc, exp, factorial, floor, gamma, j0, j1, log, log10, sin, sinh, sqrt, tan, tanh, y0, y1, 
atan2(y,x), jn(n,x), max(x,y), min(x,y), pow(x,y), yn(n,x), rand()

if(cond,x,y) return x if cond is true otherwise return y

quality(itemID) returns the quality of itemID.

Changed(itemID , percentDeadband, low, high) return 1 if itemID have exceeded the percentDeadband, otherwise it returns 0. If percentDeadband is 0, then the
timestamp of itemID must be within 3x the group update rate. If low is equal to high, then percentDeadband is the absolute deadband.

Scale(itemID , percentDeadband, rawLow, rawHigh, engLow, engHigh) scales itemID and clamp the value to [engLow, engHigh] within the percentDeadband.

LowPass(itemID , unitPerSecond) apply lowpass filtering. Reject values that changes faster than unitPerSecond

date(itemID, type) convert the timeID timestamp to VT_DATE format. Type 0 is convert to UTC time, otherwise convert to local time

time(itemID , type) return the time information from timeID timestamp.

type Time Information returned
0 Seconds since January 1, 1970
1 Year
2 Month: January is 1
3 Day of Week: Sunday is 0
4 Day: 1 to 31 
5 Hour: 0 to 23
6 Minute: 0 to 59
7 Second: 0 to 59
8 Millisecond: 0 to 999
9 Milliseconds since midnight

settime(value , type) set the system time

type Value
0 Seconds since January 1, 1970
1 Milliseconds since midnight

strcmp(str1, str2) return zero if strings are equal, -1 if str1 < str2 or 1 if str1 > str2. Comparison is case insensitive.

strftime(itemID , fmt) return a string formatted according to fmt using the strftime function with itemID timestamp.

strftimeUTC(seconds , fmt) return a string formatted according to fmt using the strftime function with integer seconds. Seconds is the number of seconds since January 1, 1970.

replace(string, pattern, replace) replace the first occurrence of pattern in string with replace. Use \t,\r or \n for the tab, carriage return or new line character. It uses pattern matching and replacement algorithms as documented in the user definable protocol.
e.g. replace(ioserver\modbus.40001[20],bstr , "(%u)-(%u)-(%u)", "$1") will return the string "2012" if the input string is "2012-12-1"
e.g. replace(ioserver\modbus.40001[20],bstr , "(%u)-(%u)-(%u)", "$3") will return the string "1" if the input string is "2012-12-1"

strAdd(string1, string2) return the concatenation of string1 and string2.

strFmt(fmt, n) return a string of real value n formatted according to fmt. Use formatting convention of printf. eg. stradd(strftime((DNPM.1.2.0.State),"%Y-%m-%dT%H:%M:%S."), strfmt("%03.0fZ",time((DNPM.1.2.0.State),8)))  to convert the timestamp to a string value.


Read Item History

The last 16 changes of the read items are displayed.

Time Time the read value was acquired.
Delta (ms) Time difference from previous read.
Read Value and itemID of read
Quality Quality of read value. 
Time Stamp Time stamp of read value. 
Write Value and status of write
Reserved Not used.
© Copyright IOServer Pty Ltd. All rights reserved.
E-mail:  Phone/Fax: +61 2 9805 0356 (Australia)

Last updated: 30 June 2016