Does OPC Publisher module dispose of creation and updating configuration tags file through IoT Hub ?

Galgani, Stefano 205 Reputation points
2023-07-03T15:06:47.1266667+00:00

Hi all,

I'm seeing a Azure IoT project with the use of OPC module 2.8 to acquire the signals from OPC server on IoT device nested hierarchy with 2 or 3 tiers.
The configuration tags file size that defines all signals is about 10 MB.

Is there a available way as the Module Twins for the custom modules, to create/update the opc publisher configuration tags file ?

Correct me if I wrong but I found at the followed link
https://github.com/Azure/Industrial-IoT/tree/main/docs/opc-publisher

section --> Programming against OPC Publisher using the OPC Publisher API.

Thanks

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
599 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,274 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 17,771 Reputation points Moderator
    2023-07-03T22:26:29.04+00:00

    Hi @Galgani, Stefano Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.

    I am checking to see if you got a chance to review the article Tutorial: Configure the OPC Publisher The article provides different options to configure the OPC publisher module. Let me know if that helps.

    If you want to update the configuration from external modules, you can alternatively leverage the option Configuration via Cloud-based, Companion REST Microservice

    You may refer the steps outline through the link Calling the Direct Methods API to get to know the steps involved in this approach. Please note that the Direct method approach has a pay load size limit of 256kb. If your payload size is greater that the allowed limit, you would want to take calling the API over HTTP approach. Kindly note that this feature is in preview and is not meant for production use.

    You can call the API over HTTP to update the module twin. You can send HTTP requests to the publisher module http server at https://localhost:8081. The unsecure endpoint is mounted at https://localhost:8080 for testing purposes. E.g. to get the swagger definition run:

    curl http://localhost:8080/swagger/v2/openapi.json
    
    

    To call the API you must authenticate to the built in HTTP server endpoint using an API Key. You can obtain the API key needed to authenticate from the publisher module twin. e.g., using the AZ CLI tool you can run

    az iot hub module-twin show -m publisher -n <hub name> -d <iotedgehubdev device name>
    
    
    

    If the OPC Publisher has successfully started then this will produce e.g., output as follows:

          ...
          "$version": 3,
          "__apikey__": "6dee3fd4-0bb2-4fb1-9736-99bb4435f020",
          "__type__": "OpcPublisher",
          "__version__": "2.9.0"
          ...
    

    You can now send HTTP requests to the publisher module http server at https://localhost:8081 with the Authorization header Bearer 6dee3fd4-0bb2-4fb1-9736-99bb4435f020. E.g., to call this API with the previously retrieved API Key run.

    curl -H "Authorization: Bearer 6dee3fd4-0bb2-4fb1-9736-99bb4435f020" https://localhost:8081/v2/configuration
    {"endpoints":[]}
    
    
    

    To update the configuration twin setting, you can use the command az iot hub module-twin update Please find more details about the command through the link az iot hub module-twin update

    Can this be achieved through OPC twin

    I believe OPC twin serves a different purpose than module twin. The OPC twin uses microservices and an Azure IoT Edge module to connect the cloud to a factory network. OPC Twin provides discovery, registration, and synchronous remote control of industrial devices through REST APIs. OPC Twin also supports the OPC HDA profile for historical data. These features are the same as the module twin capabilities which are designed to store module related information such as tags, desired properties, related properties and module identity properties.

    Hope this helps. Please let us know if you have any additional questions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.