Skip to content
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

Message mode PubSub with Json message encoding has value in Binary encoding for complex (multilevel structure) data type #2090

Closed
nelsonmorais opened this issue Oct 19, 2023 · 10 comments · Fixed by OPCFoundation/UA-.NETStandard#2349 or #2094
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nelsonmorais
Copy link

nelsonmorais commented Oct 19, 2023

Describe the bug
We have OPC Publisher v2.9.2 running with the following command line parameters --strict --mm=PubSub --me=Json.

We're subscribing to an (internally developed) OPC-UA Server on a node that is a Variable with a DataType of a custom Structure which is made of multiple levels (custom Structure that has fields that are also a custom Structure), and where one of the fields on the inner and deepest level Structures is an optional Field.

Bug: We're publishing the messages to an Azure IoT Hub and observed that the serialization of the Node of this multilevel Structure DataType is not serialized as Json, instead the value is showing the Binary encoding. Other custom Structures with a single level (so none of the Structure Fields point to another custom Structure) are serialized properly.

Here's a sample of the serialization observed on the IoT Hub (see the value of ns=1;s=PostBondingInspection that shows the Binary encoding instead of Json, like the other custom Structures on the same message payload:

{
  "body": {
    "MessageId": "6178ab9f-7b4c-436f-8027-7de6d87b79f1",
    "MessageType": "ua-data",
    "PublisherId": "xxx_module_msft-opc-publisher",
    "DataSetWriterGroup": "EVO3",
    "Messages": [
      {
        "MetaDataVersion": {
          "MajorVersion": 1222365154,
          "MinorVersion": 2465399015
        },
        "MessageType": "ua-deltaframe",
        "DataSetWriterName": "DSW_EVO3",
        "Payload": {
          "ns=1;s=PostBondingInspection": {
            "Value": "YMBavekB2gEGAAAAMTEyMjU2AiQAAAAwODI0MTEyMi0wMTdiLWI0NzMtMDMxNi1jYmEwOTlkM2IwZWUAAAAAAAAAAAAAAAABAAAACQAAAFBEQV9CQVNFRAEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAEZDXzIwMjNfMDlfMDVfMDAxNAEAAAD6////AAAAAAYAAAAAAAAAAQAAAAAAAAAMAAAAWUdBR19QQkktcGJpBwAAAFVOS05PV04GAAAAKm51bGwqBgAAACpudWxsKgYAAAAqbnVsbCoGAAAAKm51bGwqBgAAACpudWxsKgYAAAAqbnVsbCpjAAAACgAAAF9MT1RfTk9ORV8AAAAAAAAAAAEAAADKembt6uEZwGrPzXBdFNw/fWr87QZ0G0AGAAAAKm51bGwq",
            "SourceTimestamp": "2023-07-09T05:10:33.5197086Z"
          },
          "ns=1;s=TransportUnitEnd": {
            "Value": {
              "Clock": "2023-10-18T17:37:21.15Z",
              "UserName": "112256",
              "TransportUnitEndSystemId": 1,
              "TuEndId": "*null*",
              "LotId": "_LOT_NONE_"
            },
            "SourceTimestamp": "2023-07-09T05:10:33.5277084Z"
          },
          "ns=1;s=DieHasBeenPicked": {
            "Value": {
              "Clock": "2023-10-18T17:37:01.26Z",
              "UserName": "112256",
              "DiePickMid": "*null*",
              "PickupVacuum": -1,
              "ComponentId": "27241122-017b-b4d6-0316-ef2e483eccd5",
              "EjectorLifetimeCounter": -1
            },
            "SourceTimestamp": "2023-07-09T05:10:33.5277084Z"
          },
          "ns=1;s=TransportUnitStart": {
            "Value": {
              "Clock": "2023-10-18T17:37:23.47Z",
              "UserName": "112256",
              "TransportUnitStartSystemId": 2,
              "TuStartId": "*null*",
              "LotId": "_LOT_NONE_"
            },
            "SourceTimestamp": "2023-07-09T05:10:33.5277084Z"
          },
          "ns=1;s=ProcessStateMachineChangedState": {
            "Value": {
              "Clock": "2023-10-18T17:37:25.25Z",
              "UserName": "112256",
              "ProcessState": 7
            },
            "SourceTimestamp": "2023-07-09T05:10:33.5277084Z"
          }
        }
      }
    ]
  },
  "enqueuedTime": "Wed Oct 18 2023 16:37:40 GMT+0200 (Central European Summer Time)",
  "properties": {
    "$$MessageSchema": "application/x-network-message-json-v1"
  },
  "systemProperties": {
    "iothub-connection-device-id": "XYZ",
    "iothub-connection-module-id": "msft-opc-publisher",
    "iothub-connection-auth-method": "{\"scope\":\"module\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
    "iothub-connection-auth-generation-id": "638332222702179027",
    "iothub-enqueuedtime": 1697639860001,
    "iothub-message-source": "Telemetry",
    "x-opt-sequence-number": 5388332,
    "x-opt-offset": "5755283072872",
    "x-opt-enqueued-time": 1697639860157
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Start the OPC Publisher with the command line settings --strict --mm=PubSub --me=Json.
  2. Have an OPC-UA Server that exposes a Variable Node that has a DataType of a multilevel Structure as indicated above. Note that in our case the multilevel Structure also has an optional Field on the inner and deepest level Structures, we don't know if this is the reason for the observed faulty behavior.
  3. Ensure that the OPC Publisher is subscribing to the Node indicated on Step 2.
  4. Publish the messages to an IoT Hub.
  5. Observe that the message contains the value of the multilevel Structure Node serialized in Binary instead of Json.

Expected behavior
We expect the custom multilevel Structure to be serialized properly in Json and not in the Binary form.

Screenshots
Here are some screen shots of the Information Model built with the Siemens SiOME Tool as well as the UaExpert while the OPC-UA Server is running.

Object with the exposed Variables (highlighted the Variable where we see the faulty serialization, all the others work as expected):
image

Some of the inner custom DataTypes (Structures in bold) where the Structure optional Field is defined (DataTypes defined under Types>DataTypes>BaseDataType>Structure>CartesianCoordinates):
image

See below the screenshots of another inner Structure (PbiBondType) as well as the root DataType Structure (PostBondingInspectionType) that the Variable PostBondingInspection shown on the server Objects (EVOMachine.EventsCollection) points to . See the DataTypes of the fields that point to the other Structures to create the multilevel Structure. See also the Target Node Id name (ns=1;s=PostBondingInspection.Binary) of the Forward ReferenceType HasEncoding with a Target Default Binary (the same naming convention was applied to all the other Structures defined on the Information Model):
image

In UaExpert, here's the expansion of the DataTypeDefinition of the PostBondingInspectionType on the multiple screenshots below (note that the DefaultEncondingId.Identifier maps to the Forward ReferenceType Identifier indicated above, maybe this is relevant for your analysis):
image
image
image
image
image

See also the screenshots for the inner Structures:

  • PbiBondType
    image

  • 2DCartesianCoordinatesDouble (note that the Theta Field is optional)
    image

  • 2DCartesianCoordinatesInt32 (note that the Theta Field is optional)
    image

  • 3DCartesianCoordinatesInt32 (note that the Theta Field is optional)
    image
    image

Here's the Object with the Variable and a sample value:

  • Object / Variable
    image

  • Value
    image
    image

The OPC-UA Server was developed in house using the Traeger SDK, here's an excerpt of the data types definition:

  • PbiBondType
    [OpcDataType(id: "PbiBondType", namespaceUri: "http://XXX.com/UA/YYY/EVO")]
    [OpcDataTypeEncoding(id: "PbiBondType.Binary", namespaceUri: "http://XXX.com/UA/YYY/EVO", Type = OpcEncodingType.Binary)]
    public class PbiBond
    {
        public PbiBond()
        {
            this.Pos = new ThreeDCartesianCoordinatesInt32();
        }
        public string PosName { get; set; }
        public ThreeDCartesianCoordinatesInt32 Pos { get; set; }
    }
  • 2DCartesianCoordinatesDouble (note that the Theta Field is optional)
    [OpcDataType(id: "2DCartesianCoordinatesDouble", namespaceUri: "http://XXX.com/UA/YYY/EVO")]
    [OpcDataTypeEncoding(id: "2DCartesianCoordinatesDouble.Binary", namespaceUri: "http://XXX.com/UA/YYY/EVO", Type = OpcEncodingType.Binary)]
    [OpcDataTypeEncodingMask(OpcEncodingMaskKind.Auto)]
    public class TwoDCartesianCoordinatesDouble
    {
        public double X { get; set; }
        public double Y { get; set; }
        public double? Theta { get; set; }
    }
  • 2DCartesianCoordinatesInt32 (note that the Theta Field is optional)
    [OpcDataType(id: "2DCartesianCoordinatesInt32", namespaceUri: "http://XXX.com/UA/YYY/EVO")]
    [OpcDataTypeEncoding(id: "2DCartesianCoordinatesInt32.Binary", namespaceUri: "http://XXX.com/UA/YYY/EVO", Type = OpcEncodingType.Binary)]
    [OpcDataTypeEncodingMask(OpcEncodingMaskKind.Auto)]
    public class TwoDCartesianCoordinatesInt32
    {
        public int X { get; set; }
        public int Y { get; set; }
        public int? Theta { get; set; }
    }
  • 3DCartesianCoordinatesInt32 (note that the Theta Field is optional)
    [OpcDataType(id: "3DCartesianCoordinatesInt32", namespaceUri: "http://XXX.com/UA/YYY/EVO")]
    [OpcDataTypeEncoding(id: "3DCartesianCoordinatesInt32.Binary", namespaceUri: "http://XXX.com/UA/YYY/EVO", Type = OpcEncodingType.Binary)]
    [OpcDataTypeEncodingMask(OpcEncodingMaskKind.Auto)]
    public class ThreeDCartesianCoordinatesInt32
    {
        public int X { get; set; }
        public int Y { get; set; }
        public int Z { get; set; }
        public int? Theta { get; set; }
    }
  • PbiPostBondingInspection
    [OpcDataType(id: "PostBondingInspectionType", namespaceUri: "http://XXX.com/UA/YYY/EVO")]
    [OpcDataTypeEncoding(id: "PostBondingInspectionType.Binary", namespaceUri: "http://XXX.com/UA/YYY/EVO", Type = OpcEncodingType.Binary)]
    public class PostBondingInspection
    {
        public PostBondingInspection()
        {
            this.DiePlace = new TwoDCartesianCoordinatesInt32();
            this.PbiBond = new PbiBond();
            this.PbiOffset = new TwoDCartesianCoordinatesInt32();
            this.DiePlaceSub = new TwoDCartesianCoordinatesInt32();
            this.PbiOffsetDouble = new TwoDCartesianCoordinatesDouble();
        }
        public DateTime Clock { get; set; }
        public string UserName { get; set; }
        public byte DiePickSystemId { get; set; }
        public string TransportUnitIdentifiedId { get; set; }
        public TwoDCartesianCoordinatesInt32 DiePlace { get; set; }
        public int StatusPbi { get; set; }
        public PbiBond PbiBond { get; set; }
        public string PbiSubstrateId { get; set; }
        public TwoDCartesianCoordinatesInt32 PbiOffset { get; set; }
        public TwoDCartesianCoordinatesInt32 DiePlaceSub { get; set; }
        public string PbiDataset { get; set; }
        public string PbiType { get; set; }
        public string HostData1 { get; set; }
        public string HostData2 { get; set; }
        public string HostData3 { get; set; }
        public string HostData4 { get; set; }
        public string HostData5 { get; set; }
        public string PackageId { get; set; }
        public int PbiQuality { get; set; }
        public string LotId { get; set; }
        public double PbiArea { get; set; }
        public TwoDCartesianCoordinatesDouble PbiOffsetDouble { get; set; }
        public string PbiStepLayoutSpecifier { get; set; }
    }

[UPDATE TO ADD THE PUBLISHED METADATA]
And here is the metadata message published by the OPC Publisher, which contains useful information for the bug analysis, because:

  • The custom Structures 2DCartesianCoordinatesDouble, 2DCartesianCoordinatesInt32, 3DCartesianCoordinatesInt32 DataTypes are not present on the StructureDataTypes.
  • The fields of the custom Structures that point to our custom Structures 2DCartesianCoordinatesDouble, 2DCartesianCoordinatesInt32, 3DCartesianCoordinatesInt32 incorrectly point to Id=18809 which is the parent node (Types>DataTypes>BaseDataType>Structure>CartesianCoordinates) of where our custom Structures 2DCartesianCoordinatesDouble, 2DCartesianCoordinatesInt32, 3DCartesianCoordinatesInt32 are defined.
  • The PbiBondType also doesn't appear on the StructureDataTypes, but it's correctly referenced on the PostBondingInspectionType field.
{
  "body": {
    "MessageId": "beb90cb4-2a03-4850-88a2-b17365236f49",
    "MessageType": "ua-metadata",
    "PublisherId": "xxx_module_msft-opc-publisher",
    "DataSetWriterId": 3,
    "DataSetWriterGroup": "EVO3",
    "MetaData": {
      "Namespaces": [
        "http://opcfoundation.org/UA/",
        "http://XXX.com/UA/YYY/EVO",
        "http://opcfoundation.org/UA/Diagnostics"
      ],
      "StructureDataTypes": [
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "ComponentCarrierChangedType",
            "Namespace": 1
          },
          "Name": {
            "Name": "ComponentCarrierChangedType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "ComponentCarrierChangedType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "Name",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "Id",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "SystemId",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "LoadCarrierSlotPos",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "WaferCassetteId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "DieHasBeenPickedType",
            "Namespace": 1
          },
          "Name": {
            "Name": "DieHasBeenPickedType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "DieHasBeenPickedType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "DiePickMid",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PickupVacuum",
                "DataType": {
                  "Id": 6
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "ComponentId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "EjectorLifetimeCounter",
                "DataType": {
                  "Id": 6
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "EpoxyMeasurementDataType",
            "Namespace": 1
          },
          "Name": {
            "Name": "EpoxyMeasurementDataType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "EpoxyMeasurementDataType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "SystemId",
                "DataType": {
                  "Id": 5
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "MiliGramm",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "EpoxyServiceLifeSettingsType",
            "Namespace": 1
          },
          "Name": {
            "Name": "EpoxyServiceLifeSettingsType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "EpoxyServiceLifeSettingsType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "Id",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "SystemId",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "Name",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "Type",
                "DataType": {
                  "Id": 2
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "MessageDisplayedType",
            "Namespace": 1
          },
          "Name": {
            "Name": "MessageDisplayedType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "MessageDisplayedType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "SystemId",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "MessageId",
                "DataType": {
                  "Id": 7
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "ShortText",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "LongText",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "PostBondingInspectionType",
            "Namespace": 1
          },
          "Name": {
            "Name": "PostBondingInspectionType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "PostBondingInspectionType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "DiePickSystemId",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "TransportUnitIdentifiedId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "DiePlace",
                "DataType": {
                  "Id": 18809
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "StatusPbi",
                "DataType": {
                  "Id": 6
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiBond",
                "DataType": {
                  "IdType": 1,
                  "Id": "PbiBondType",
                  "Namespace": 1
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiSubstrateId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiOffset",
                "DataType": {
                  "Id": 18809
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "DiePlaceSub",
                "DataType": {
                  "Id": 18809
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiDataset",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiType",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "HostData1",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "HostData2",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "HostData3",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "HostData4",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "HostData5",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PackageId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiQuality",
                "DataType": {
                  "Id": 6
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "LotId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiArea",
                "DataType": {
                  "Id": 11
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiOffsetDouble",
                "DataType": {
                  "Id": 18809
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "PbiStepLayoutSpecifier",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "ProcessStateMachineChangedStateType",
            "Namespace": 1
          },
          "Name": {
            "Name": "ProcessStateMachineChangedStateType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "ProcessStateMachineChangedStateType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "ProcessState",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "ProductionContinueType",
            "Namespace": 1
          },
          "Name": {
            "Name": "ProductionContinueType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "ProductionContinueType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "ProductionEndType",
            "Namespace": 1
          },
          "Name": {
            "Name": "ProductionEndType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "ProductionEndType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "ProductionStartType",
            "Namespace": 1
          },
          "Name": {
            "Name": "ProductionStartType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "ProductionStartType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "ProductName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "SubstrateIdentifiedType",
            "Namespace": 1
          },
          "Name": {
            "Name": "SubstrateIdentifiedType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "SubstrateIdentifiedType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "SubstrateIdentifiedId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "SubstrateIdentifiedSystemId",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "TransportUnitEndType",
            "Namespace": 1
          },
          "Name": {
            "Name": "TransportUnitEndType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "TransportUnitEndType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "TransportUnitEndSystemId",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "TuEndId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "LotId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        },
        {
          "DataTypeId": {
            "IdType": 1,
            "Id": "TransportUnitStartType",
            "Namespace": 1
          },
          "Name": {
            "Name": "TransportUnitStartType",
            "Index": 1
          },
          "StructureDefinition": {
            "DefaultEncodingId": {
              "IdType": 1,
              "Id": "TransportUnitStartType.Binary",
              "Namespace": 1
            },
            "BaseDataType": {
              "Id": 22
            },
            "StructureType": "Structure_0",
            "Fields": [
              {
                "Name": "Clock",
                "DataType": {
                  "Id": 13
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "UserName",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "TransportUnitStartSystemId",
                "DataType": {
                  "Id": 3
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "TuStartId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              },
              {
                "Name": "LotId",
                "DataType": {
                  "Id": 12
                },
                "ValueRank": -1,
                "ArrayDimensions": [],
                "MaxStringLength": 0,
                "IsOptional": false
              }
            ]
          }
        }
      ],
      "EnumDataTypes": [],
      "SimpleDataTypes": [],
      "Fields": [
        {
          "Name": "ns=1;s=ProductionEnd",
          "Description": "ProductionEnd",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "ProductionEndType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "ab4e0d79-0e30-477d-94f6-0d1bfef17a9c",
          "Properties": []
        },
        {
          "Name": "ns=1;s=SubstrateIdentified",
          "Description": "SubstrateIdentified",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "SubstrateIdentifiedType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "abaa9316-da89-4cd1-b163-346da56be32c",
          "Properties": []
        },
        {
          "Name": "ns=1;s=ProcessStateMachineChangedState",
          "Description": "ProcessStateMachineChangedState",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "ProcessStateMachineChangedStateType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "7751cabc-bec0-42f2-bf7c-414d584dd0a4",
          "Properties": []
        },
        {
          "Name": "ns=1;s=EpoxyMeasurementData",
          "Description": "EpoxyMeasurementData",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "EpoxyMeasurementDataType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "8cb5a288-398c-4355-b435-c0cc8ba5cdd3",
          "Properties": []
        },
        {
          "Name": "ns=1;s=EpoxyServiceLifeSettings",
          "Description": "EpoxyServiceLifeSettings",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "EpoxyServiceLifeSettingsType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "bb1d1c91-3760-4b89-822e-dc98d38b8ef6",
          "Properties": []
        },
        {
          "Name": "ns=1;s=ComponentCarrierChanged",
          "Description": "ComponentCarrierChanged",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "ComponentCarrierChangedType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "4d5c3ae3-9154-4135-a3bf-496290fa2461",
          "Properties": []
        },
        {
          "Name": "ns=1;s=TransportUnitEnd",
          "Description": "TransportUnitEnd",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "TransportUnitEndType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "c7ecc78b-b11b-4bdd-860d-b7d7bd05151d",
          "Properties": []
        },
        {
          "Name": "ns=1;s=PostBondingInspection",
          "Description": "PostBondingInspection",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "PostBondingInspectionType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "0483ffb2-2ca4-4683-9310-c28ea292ac96",
          "Properties": []
        },
        {
          "Name": "ns=1;s=DieHasBeenPicked",
          "Description": "DieHasBeenPicked",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "DieHasBeenPickedType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "bd6846c8-cf55-48ad-a040-5975f1e3916f",
          "Properties": []
        },
        {
          "Name": "ns=1;s=ProductionStart",
          "Description": "ProductionStart",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "ProductionStartType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "58ab4022-4ddd-4e9d-8114-bde5e18d7414",
          "Properties": []
        },
        {
          "Name": "ns=1;s=MessageDisplayed",
          "Description": "MessageDisplayed",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "MessageDisplayedType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "301ce8ca-dace-4833-b3e0-8cdf395886a6",
          "Properties": []
        },
        {
          "Name": "ns=1;s=TransportUnitStart",
          "Description": "TransportUnitStart",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "TransportUnitStartType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "7154ba34-6d70-4bfb-8962-f0d0122db8a3",
          "Properties": []
        },
        {
          "Name": "ns=1;s=ProductionContinue",
          "Description": "ProductionContinue",
          "FieldFlags": 0,
          "BuiltInType": 22,
          "DataType": {
            "IdType": 1,
            "Id": "ProductionContinueType",
            "Namespace": 1
          },
          "ValueRank": -1,
          "ArrayDimensions": [],
          "MaxStringLength": 0,
          "DataSetFieldId": "a222108b-9d18-48f4-9a5d-ca8e0eaee0cc",
          "Properties": []
        }
      ],
      "ConfigurationVersion": {
        "MajorVersion": 1222365154,
        "MinorVersion": 2465399015
      }
    },
    "DataSetWriterName": "DSW_EVO3"
  },
  "enqueuedTime": "Wed Oct 18 2023 16:06:40 GMT+0200 (Central European Summer Time)",
  "properties": {
    "$$MessageSchema": "application/x-network-message-json-v1"
  },
  "systemProperties": {
    "iothub-connection-device-id": "XYZ",
    "iothub-connection-module-id": "msft-opc-publisher",
    "iothub-connection-auth-method": "{\"scope\":\"module\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
    "iothub-connection-auth-generation-id": "638332222702179027",
    "iothub-enqueuedtime": 1697638000806,
    "iothub-message-source": "Telemetry",
    "x-opt-sequence-number": 5388259,
    "x-opt-offset": "5755282905776",
    "x-opt-enqueued-time": 1697638000884
  }
}

Desktop (please complete the following information):

  • OS: Ubuntu 18.04.6 LTS (Bionic Beaver)
  • OPC Publisher Version: 2.9.2.

Additional context
The problem seems to be similar to the one reported here: #1334 that was closed without conclusion.
@koepalex, @mregen we can provide the information model file (*.Nodeset2.xml) on a direct message if needed.

@nelsonmorais
Copy link
Author

Updated the original description to include the OPC Publisher metadata message as it looks like it might contain relevant information for the bug analysis.

@marcschier marcschier self-assigned this Oct 19, 2023
@marcschier marcschier added the bug Something isn't working label Oct 19, 2023
@marcschier marcschier added this to the 2.9.3 milestone Oct 19, 2023
@nelsonmorais
Copy link
Author

Hi @marcschier I've seen that you've labeled this issue to be addressed on v2.9.3, is there an ETA that you can share?
Thanks!

@marcschier
Copy link
Collaborator

Hi @marcschier I've seen that you've labeled this issue to be addressed on v2.9.3, is there an ETA that you can share? Thanks!

Goal is to release 2.9.3 end of November, but since this bug must be addressed in the OPC UA stack dependency, we might need to push this out to 2.9.4 if we do not have an updated nuget before end of November.

@nelsonmorais
Copy link
Author

@marcschier Thanks for the update!

Given that this issue might take some time to be fixed and this is blocking us to get access to an important set of data form one of our machines that we've just connected and for which we were not expecting this issue, is there any workaround that you could share that would allow us to solve the problem in the meantime, so that we can get access to the data?

If not, any "push" to have this issue addressed sooner would be greatly appreciated 😄

From our end, and if possible, we could even consider to temporarily do and use a private build from the source on this repository once the fix is available from your end and a final release (v2.9.3, v2.9.4) is not published yet.

@marcschier
Copy link
Collaborator

marcschier commented Oct 21, 2023

Once the fix is checked into the OPC-F repo, I will build a preview image that is using the preview nuget of the stack. using this preview build you could help us confirm that the issue is really addressed.

@mregen
Copy link
Contributor

mregen commented Oct 26, 2023

Hi @nelsonmorais, I think the issue is fixed in the stack PR because there are types derived from the CartesianCoordinates abstract type used for some structure members, which is the same issue. But to be sure it needs additional verification.

@nelsonmorais
Copy link
Author

@mregen Thanks for the update!
Let me know when and where can I get access to a preview build of the OPC Publisher that I can try to let you know if the problem is resolved at our end.

@marcschier marcschier reopened this Oct 27, 2023
@marcschier
Copy link
Collaborator

Reopening to track the integration of the preview stack nuget.

@marcschier marcschier reopened this Oct 28, 2023
marcschier added a commit that referenced this issue Nov 13, 2023
Fixes for 

* #2090 
* #2091 (Updated documentation)
* #2096 
* #2097 
* #2098 
* #2100
@marcschier
Copy link
Collaborator

A latest build is available at mcr.microsoft.com/iotedge/opc-publisher:2.9.3-preview2. Closing, please re-open if issues persist.

@nelsonmorais
Copy link
Author

Thanks @marcschier!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment