Industrial-IoT
Industrial-IoT copied to clipboard
Is it possible to send messages from another module to OPC Twin?
Hi, I have several modules on our Edge devices (OPC Publisher, OPC Twin, ... and other custom modules).
The output of one of our modules, you have to write the value of the result in the OPC.
We think that the best option is to send a message to the OPC Twin through the edgeHub, but we did not find if this is possible.
Which is the best alternative to do this? Invoke an OPC Twin Direct Method?
Hi @felixmondelo, to send messages from one module to another, you could use routing in IoT Edge. This doc would be helpful: https://learn.microsoft.com/en-us/azure/iot-edge/module-composition?view=iotedge-1.4#declare-routes
For OPC Twin, this is not supported use case, since it is only supposed to communicate with cloud micro-services.
The description of the issue is in contrast with the title, that you would like to call a direct method in OPC Twin. Technically it is doable, however, it is not a supported use case. An alternative would be to integrate OPC client in your module and set the value directly in the OPC UA server.
Hope this helps.
Thank you @monikavar, I know that. My problem is if OPC Twin has any input to receive messages from other modules or not.
@felixmondelo no, it has no inputs to receive messages from other modules.
@monikavar then there isn't any way to communicate with OPC Twin from another module without going to the IoT Hub?
@felixmondelo OPC Twin has a direct method interface, but this is limited to the use case OPC Twin was built for (being used as the edge side component of the Inudstrial-IoT microservices).
@hansgschossmann the requirement is (all is in the Edge):
- I have the OPC Module getting signals from OPC
- The output of the OPC Module goes through a custom module that in some cases changes the value of a signal.
- That value changed has to be notified to OPC.
My idea was to use OPC Twin to notify OPC that change inside the Edge, but I suppose for your answer that this is not possible.
@felixmondelo thanks for explaining your scenario. Are you using only the IoT Edge modules or do you use the full Industrial IoT platform (with cloud microservices)?
Only the modules :-(
Yes, this is indeed not a supported scenario for OPC Twin. You might reach out to your MSFT contact to get an update on the Industrial product roadmap, there might be another solution better fitting your needs than the Industrial-IoT platform.
Closing for now. Please reactivate if you need further assistance.
This is now implemented in 2.9.0-preview2. The OPC Twin functionality has been exposed inside OPC Publisher and other modules can use the direct method API which is documented under /docs.