Industrial-IoT icon indicating copy to clipboard operation
Industrial-IoT copied to clipboard

Suggestion: Group Monitored Items in one structure in standalone publisher with possibility of trigger

Open martin-weber opened this issue 4 years ago • 0 comments

For our use cases we need a set of data points sampled and published in the same message. Additional, it would be great if all the nodes are publishing when a certain endpoint changes, for example a boolean switching from false to true.

Grouping

We would like to be able to group nodes in the publishednodes.json config file of the standalone publisher. The configuration could then look like the following with just a new section OpcNodeGroups:

[
    {
        "EndpointUrl": "opc.tcp://host.docker.internal:49322/",
        "UseSecurity": false,
        "OpcNodes": [
            {
                "Id": "ns=2;s=Machine1.Status",
                "OpcSamplingInterval": 1000,
                "OpcPublishingInterval": 5000,
                "DisplayName": "Machine1 Status"
            },
            {
                "Id": "ns=2;s=Machine1.Speed",
                "OpcSamplingInterval": 500,
                "OpcPublishingInterval": 2000,
                "DisplayName": "Machine1 Speed"
            }
        ],
        "OpcNodeGroups": [
            {
                "GroupId": "Machine1",
                "OpcSamplingInterval": 1000,
                "OpcPublishingInterval": 2000,
                "nodes": [
                    {
                        "Id": "ns=2;s=Machine1.Pressure",
                        "DisplayName": "Pressure"
                    },
                    {
                        "Id": "ns=2;s=Machine1.Temperature",
                        "DisplayName": "Temperature"
                    },
                    {
                        "Id": "ns=2;s=Machine1.TorqueA",
                        "DisplayName": "TorqueA"
                    },
                    {
                        "Id": "ns=2;s=Machine1.TorqueB",
                        "DisplayName": "TorqueB"
                    },
                    {
                        "Id": "ns=2;s=Machine1.OrderNumber",
                        "DisplayName": "OrderNumber"
                    },
                    {
                        "Id": "ns=2;s=Machine1.PartNumber",
                        "DisplayName": "PartNumber"
                    },
                    {
                        "Id": "ns=2;s=Machine1.PartFinished",
                        "DisplayName": "PartFinished"
                    }
                ]
            }
        ]
    }
]

The resulting message might then look like this the following sample. The messages asscociated the Group would then have a GroupId.

[
    {
        "NodeId": "nsu=MYServer;s=Machine1.Status",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "Machine1 Status",
        "Value": {
            "Value": 389,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "NodeId": "nsu=MYServer;s=Machine1.Speed",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "Machine1 Speed",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "GroupId": "Machine1",
        "NodeId": "nsu=MYServer;s=Machine1.Pressure",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "Pressure",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "GroupId": "Machine1",
        "NodeId": "nsu=MYServer;s=Machine1.Speed",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "Speed",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "GroupId": "Machine1",
        "NodeId": "nsu=MYServer;s=Machine1.TorqueA",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "TorqueA ",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "GroupId": "Machine1",
        "NodeId": "nsu=MYServer;s=Machine1.TorqueB",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "TorqueB",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "GroupId": "Machine1",
        "NodeId": "nsu=MYServer;s=Machine1.OrderNumber",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "OrderNumber",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "GroupId": "Machine1",
        "NodeId": "nsu=MYServer;s=Machine1.PartNumber",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "PartNumber",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    },
    {
        "GroupId": "Machine1",
        "NodeId": "nsu=MYServer;s=Machine1.PartFinished",
        "ApplicationUri": "urn:MYSERVER:UA%20Server",
        "DisplayName": "PartFinished",
        "Value": {
            "Value": -298,
            "SourceTimestamp": "2020-11-20T15:39:52.2521132Z"
        }
    }
]

Trigger for Group

It would be great if all the nodes are publishing when a certain endpoint changes, for example a boolean switching from false to true.

Therefore a Trigger in the OpcNodeGroup would be required, which defines the node for the trigger.

[
    {
        "EndpointUrl": "opc.tcp://host.docker.internal:49322/",
        "UseSecurity": false,
        "OpcNodes": [
            {
                "Id": "ns=2;s=Machine1.Status",
                "OpcSamplingInterval": 1000,
                "OpcPublishingInterval": 5000,
                "DisplayName": "Machine1 Status"
            },
            {
                "Id": "ns=2;s=Machine1.Speed",
                "OpcSamplingInterval": 500,
                "OpcPublishingInterval": 2000,
                "DisplayName": "Machine1 Speed"
            }
        ],
        "OpcNodeGroups": [
            {
                "GroupId": "Machine1",
                "OpcSamplingInterval": 1000,
                "OpcPublishingInterval": 2000,
                "Trigger": {
                    "Id": "ns=2;s=Machine1.PartFinished",
                    "Trigger": {
                        "Type": "Once",
                        "Value": true
                    }
                },
                "nodes": [
                    {
                        "Id": "ns=2;s=Machine1.Pressure",
                        "DisplayName": "Pressure"
                    },
                    {
                        "Id": "ns=2;s=Machine1.Temperature",
                        "DisplayName": "Temperature"
                    },
                    {
                        "Id": "ns=2;s=Machine1.TorqueA",
                        "DisplayName": "TorqueA"
                    },
                    {
                        "Id": "ns=2;s=Machine1.TorqueB",
                        "DisplayName": "TorqueB"
                    },
                    {
                        "Id": "ns=2;s=Machine1.OrderNumber",
                        "DisplayName": "OrderNumber"
                    },
                    {
                        "Id": "ns=2;s=Machine1.PartNumber",
                        "DisplayName": "PartNumber"
                    },
                    {
                        "Id": "ns=2;s=Machine1.PartFinished",
                        "DisplayName": "PartFinished"
                    }
                ]
            }
        ]
    }
]

This is just a proposal /feature request. I'm glad to see other options and possibilities. Thanks, Martin

martin-weber avatar Nov 30 '20 10:11 martin-weber