Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • domain: The domain name
  • host: The host name
  • username: The username
  • password: The passwordid: The program identifier
  • path: Collection of path to different OPC items separated by ";"
  • clsid: The class identifier
  • progid: The program identifier 
  • period: Period for synchronization

The OPC transport handler returns attribute values of type OPCValue. An OPCValue is a complex type that holds the quality, the error code, the timestamp, and the current value of an OPC item. To access the single values the functions value(OPCValue), quality(OPCValue), error(OPCValue), and timestamp(OPCValue) exist. When defining the schema, only the items defined in the path parameter are available in the order they are defined.

Example

PQL

Code Block
themeEclipse
titleOPC-DAClient Transport Handler
linenumberstrue
output = ACCESS({Source='source',
wrapper='GenericPush',
transport='OPC-DA',
protocol='None',
dataHandler='Tuple',
options=[
 ['host', 'example.com'],
 ['domain', 'Domain'],
 ['username', 'admin'],
 ['password', '12345'],
 ['progid', 'National Instrum.'],
 ['path','\\.\Some Item1;\\.\Some Item2']
],
schema=[
 ['value'item1', 'OPCValue'],
 ['item2', 'DoubleOPCValue']
]
})

CQL

Code Block
themeEclipse
languagesql
titleOPC-DAClient Transport Handler
linenumberstrue
CREATE STREAM source (value Doubleitem1 OPCValue, item2 OPCValue)
    WRAPPER 'GenericPush'
    PROTOCOL 'None'
    TRANSPORT 'OPC-DA'
    DATAHANDLER 'Tuple'
    OPTIONS ( 'host' 'example.com', 'domain' 'Domain', 'username' 'admin', 'password' '12345', 'progid' 'National Instrum.', 'path' '\\.\Some Item1;\\.\Some Item2')

 

Functions

To access the different parts of an OPC item the following functions exist:

value(OPCValue)

Returns the value of the OPC item

quality(OPCValue)

Returns the quality of the OPC item

error(OPCValue)

Returns the error code of the OPC item

timestamp(OPCValue)

Returns the timestamp of the OPC item

 

Code Block
languagepql
titleExample
linenumberstrue
output = MAP({
              expressions = [
                                ['quality(item)','quality'],
                                ['error(item)','error'],
                                ['value(item)','value'],
                                ['timestamp(item)','timestampe']
                            ]
             }, input)