OPC-DA transport handler to access measurements using the OPC industry standard. The implementation is based on the Utgard library from the OpenSCADA project.
domain:
The domain namehost
:
The host nameusername
:
The username
password
:
The passwordpath:
Collection of path to different OPC items separated by ";"clsid:
The class identifierprogid:
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.
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=[ ['item1', 'OPCValue'], ['item2', 'OPCValue'] ] }) |
CREATE STREAM source (item1 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') |
To access the different parts of an OPC item the following functions exist:
Returns the value of the OPC item
Returns the quality of the OPC item
Returns the error code of the OPC item
Returns the timestamp of the OPC item
output = MAP({ expressions = [ ['quality(item)','quality'], ['error(item)','error'], ['value(item)','value'], ['timestamp(item)','timestampe'] ] }, input) |