OpcUAModule
The OPC Module is responsible for setting up and maintaining retrieval of OPC data, according to the tag configuration.
Modes
The OPC Module can be configured to run in 2 different modes:
- Microsoft OPC Publisher mode: Microsoft has provided a free off-the-shelf module that makes it possible to get data from OPC UA servers. In this mode, the Microsoft OPC Publisher handles the data collection. The data returned from the OPC Publisher does not have the correct format. Therefore the OPC UA Module is responsible for converting the data into measurements that can be processed by the ingestion functions, weather it is aggregated and uploaded to Cloud (cold path data) or streamed to a IoT Hub (hot path data). Since the OPC Publisher module from Microsoft only supports limited functionality, it does not provide write, browse-, snapshot-, validation- or historical backfill options. 
- Stand-alone OPC UA mode: Data collection is based on a OPC UA client reference implementation by OPC Foundation. When running in this mode, there are no dependencies to other modules. This mode also provides more functionality, compared to the OPC Publisher mode. The stand-alone mode currently only supports one OPC UA server. 
Environment Variables
When setting up the OPC UA Module, the follow environment variables are available:
LOCAL_STORAGE_CONNECTIONSTRING
Connection string for the blob local storage account (common for all modules)
FEATURE_OPC_PUBLISHER_ENABLED
Setting this value to "true" enables the OPC Publisher mode. Default is the Stand-alone OPC UA mode.
OPC_CONFIG_FILE_AND_PATH
Path to OPC Publisher configuration file. Required when using OPC Publisher mode. Default value is: /appdata/publishednodes.json
FEATURE_OPC_WRITE_ENABLED
Enables writing OPC tags back to the server. Requires Stand-alone mode.
FEATURE_OPC_BROWSE_ENABLED
Enables browsing the OPC UA namespace. Requires Stand-alone mode.
FEATURE_OPC_POLLBATCH_ENABLED
Enables the poll batch feature, that ensures that very slow changing tags are not subscribed, but instead polled. The reason for using this feature is to reduce the number of hot tag subscriptions, and spread the load on the OPC server over time. If data retrieval at exact time stamps is required, then this feature should not be used. However, if the data retrieval is allowed to be offset by a smaller amount of time, then this feature can allow for additional data collection stability. Requires Stand-alone mode.
OPC_POLLBATCH_READ_SIZE
If the poll batch feature is enabled, this parameter sets the amount of tags that are read concurrently from the OPC UA server. The smaller amount means more roundtrips to the server. However, the higher value also means more load on the server. Default value is 25. Requires Stand-alone mode and poll batch feature enabled.
FEATURE_OPC_CERT_AUTOACCEPT
Skip validation of the OPC UA server certificate. Requires Stand-alone mode.
APPCERT_COMMONNAME_OVERRIDE
Replaces common name (CN) in the application certificate. As a default the common name in the certificate takes value from the name of the opc server (as configured in the twin). If this value is set, it replaces the default common name.
Last updated
Was this helpful?