-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subscribing to complex datatypes #1334
Comments
@Mkasakka which version of OPC Publisher are you using? Do you use it standalone (which I expect) or as part of Industrial IoT Platform? Please try to use |
Hi, yes you are correct I am using the Publisher in standalone mode. The current version is 2.7 and the output in the initial post is now with the message mode "PubSub". |
I've tested the OPC Publisher in standalone version 2.8.0 with the complexe data type of iot-edge-opc-plc (with --ctb) and the complexe data type is working: {
"MessageId": "379",
"MessageType": "ua-data",
"PublisherId": "opc.tcp://localhost:50000_39d40f4aae5f07696bc0737f6ba45a4d4bd63d79",
"DataSetWriterGroup": "opc.tcp://localhost:50000_39d40f4aae5f07696bc0737f6ba45a4d4bd63d79",
"Messages": [
{
"DataSetWriterId": "opc.tcp://localhost:50000_ad96df769e92a48dd17e03373f81ee07296dbfc4",
"MetaDataVersion": {
"MajorVersion": 1,
"MinorVersion": 0
},
"Payload": {
"http://microsoft.com/Opc/OpcPlc/Boiler#i=15013": {
"Value": {
"Temperature": {
"Top": 3360,
"Bottom": 3365
},
"Pressure": 103365,
"HeaterState": "On_1"
},
"SourceTimestamp": "2021-08-25T09:14:05.416079Z"
}
}
}
]
} So it could be that the OPC UA stack (complexe data type) can't decode your custom type. Would it be possible that you provide an public available endpoint of the OPC UA server, that we can connect and check the data type definitions? |
@mregen is this information sufficient or do we require something else? |
Hi @Mkasakka, what you get in the Body of the JSON message is the binary encoding of the structure. Find the DataType in Types/DataTypes/Structure, e.g. like here: then if possible, expand all fields of the DataTypeDefinition: and copy the content. Then we can try to repro the case here and see why we cannot decode it. |
Hi @Mkasakka , based on the screenshot I cannot root cause the issue. By any chance, could you provide the Nodeset2 or other model files? Is this a custom model or companion spec? |
Sure anything you need! As I understand it is a custom model, can you elaborate on what file you need? |
Hi @Mkasakka , there might be files with extension *.nodeset2.xml in your plc project. Some are used for companion specs and are included by others, very likely there are some files which describe e.g. |
Hi, sorry to say this but I do not find any files with that suffix. Could it have something to do with the fact that I am using the Opc ua server from Beckhoff? |
Hi @Mkasakka the *.nodeset2.xml file does describe the OPC UA namespace of the server. I am not familiar with the Beckhoff modeling tool. Can you check with the Beckhoff documentation (or the people who have configured the OPC UA servers address space) what would be the equivilant to the nodeset2.xml file? |
Close stale issue |
Currently, the OPC publisher IoT edge module is a great tool for simple data like a sensor value here and there. But if you try to subscribe to a complex data type such as a custom struct, the messages coming from the module are a mixture of json and uadb (or plain uadb depending on the cmd-line arguments). An example of such a message, containing two nodes, one bool, and one custom struct:
I am using version 2.7 in a standalone configuration. And the cmdl arguments go as follows:
Is there a way to decode the body of the second node in the cloud or in another iot edge module?
If not, could this be a feature? I'm thinking something on the lines of adding the reading of the DatatypeDictionary from the server at startup, which would bring the information of the DataTypes to the Publisher, and then while configuring the nodes the developer could set the type of the node in the pn.json file.
To reproduce the example message above:
Hope this is the right way to ask/suggest this kind of thing.
Br,
Markus
The text was updated successfully, but these errors were encountered: