--- title: "B&R OPC UA example" slug: "br-opc-ua-example" tags: ["Data collection", "Data Collection Module", "Collector", "JSON config", "OPC UA", "B&R"] updated: 2021-10-07T06:55:06Z published: 2021-10-07T06:55:06Z canonical: "kb.secomea.com/br-opc-ua-example" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.secomea.com/llms.txt > Use this file to discover all available pages before exploring further. # B&R OPC UA example The purpose of this article is to show some DCM config file examples for OPC UA with a B&R (BR-automation) PLC Please pay attention to the specific format of the NodeIDString value: "NodeIdString" : "::AsGlobalPV:gState.Main", #### Full DCM config collecting from B&R OPC UA PLC and delivering to Secomea DCC ```json { "ConfigName" : "BR_OPCUA_2_DCC", "ConfigDescription" : "Example configuration B&R OPCUA PLC to DCC", "CheckpointInterval" : 600, "WaitForNTP" : false, "Collectors" : [ { "CollectorName": "OpcUaMap", "CollectorDescription": "Setup using B&R CPU with OPC-UA Server", "Protocol": "OPC-UA/TCP", "CollectorIPAddr" : "10.0.0.50", "CollectorPortno": 4840, "ConnectRetryMin": 2, "ConnectRetryMax": 240, "OPCUAAccess": { "OPCUASecurityPolicy": "none", "OPCUAUserTokenType": "anonynmous", "OPCUATimeStampPolicy": "dcm" }, "SamplePoints": [ { "SampleName" : "MachineMainState", "SampleDescription" : "All time number of units palletized", "SamplesSaved" : 10, "SampleDataType" : "byte", "OPCUAObject" : { "NodeIdNameSpaceIndex" : 6, "NodeIdType" : "string", "NodeIdString" : "::AsGlobalPV:gState.Main", "OPCUASampleInterval" : 15 } }, { "SampleName" : "UnitTripLife", "SampleDescription" : "All time number of units palletized", "SamplesSaved" : 10, "SampleDataType" : "uint32", "OPCUAObject" : { "NodeIdNameSpaceIndex" : 6, "NodeIdType" : "string", "NodeIdString" : "::AsGlobalPV:pStatistics.unit_trip_life", "OPCUASampleInterval" : 60 } } ] } ], "DataServers" : [ { "ConnectRetryMax": 60, "ConnectRetryMin": 2, "DatasrvName": "DCC", "DatasrvProtocol": "SCI/SPD", "IOPin": true, "SCISPDParams": { "DevCertName": "DCC Certificate", "DevPkeyName": "DCC Private Key", "PushInterval": 1, "RootCAName": "DCC CA Certificate", "SCIServerAddr": "dcm-dcc.secomea.com", "SPDPort": 443, "Security": "TLS1.2" } } ] } ``` #### And the B&R OPC UA collector on its own ```json { "CollectorName": "OpcUaMap", "CollectorDescription": "Setup using B&R CPU with OPC-UA Server", "Protocol": "OPC-UA/TCP", "CollectorIPAddr" : "10.0.0.50", "CollectorPortno": 4840, "ConnectRetryMin": 2, "ConnectRetryMax": 240, "OPCUAAccess": { "OPCUASecurityPolicy": "none", "OPCUAUserTokenType": "anonynmous", "OPCUATimeStampPolicy": "dcm" }, "SamplePoints": [ { "SampleName" : "MachineMainState", "SampleDescription" : "Machine Main Status", "SamplesSaved" : 5, "SampleDataType" : "byte", "OPCUAObject" : { "NodeIdNameSpaceIndex" : 6, "NodeIdType" : "string", "NodeIdString" : "::AsGlobalPV:gState.Main", "OPCUASampleInterval" : 15 } }, { "SampleName" : "UnitTripLife", "SampleDescription" : "All time number of units palletized", "SamplesSaved" : 10, "SampleDataType" : "uint32", "OPCUAObject" : { "NodeIdNameSpaceIndex" : 6, "NodeIdType" : "string", "NodeIdString" : "::AsGlobalPV:pStatistics.unit_trip_life", "OPCUASampleInterval" : 60 } } ] } ``` #### And example with 22 sample points incl. aggregations ```json { "ConfigName": "DefaultConfig", "ConfigDescription": "Default Configuration", "CheckpointInterval": 60, "WaitForNTP": false, "Collectors": [ { "CollectorName": "OpcUaMap", "CollectorDescription": "Setup using B&R CPU with OPC-UA Server", "Protocol": "OPC-UA/TCP", "CollectorIPAddr": "10.0.0.50", "CollectorPortno": 4840, "ConnectRetryMin": 2, "ConnectRetryMax": 240, "OPCUAAccess": { "OPCUASecurityPolicy": "none", "OPCUAUserTokenType": "anonynmous", "OPCUATimeStampPolicy": "dcm" }, "SamplePoints": [ { "SampleName": "MachineMainState", "SampleDescription": "Machine Main Status", "SamplesSaved": 10, "SampleDataType": "byte", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:gState.Main", "OPCUASampleInterval": 15 } }, { "SampleName": "UnitTripLife", "SampleDescription": "All time number of units palletized", "SamplesSaved": 10, "SampleDataType": "uint32", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pStatistics.unit_trip_life", "OPCUASampleInterval": 60 } }, { "SampleName": "TotalPowerConsumption", "SampleDescription": "Total power consumption of all drives", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:gMappView.powerStatistics.powerConsumption.kwh", "OPCUASampleInterval": 3600 } }, { "SampleName": "MachineTempOutside", "SampleDescription": "temperature outside cabinet", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::PT100:PT100.flag.temp_Outside", "OPCUASampleInterval": 3600 } }, { "SampleName": "MachineTempInside", "SampleDescription": "temperature inside cabinet", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::PT100:PT100.flag.temp_Inside", "OPCUASampleInterval": 3600 } }, { "SampleName": "OverallServiceWarning", "SampleDescription": "Flag if one or more machineparts have reached its service point", "SamplesSaved": 10, "SampleDataType": "bool", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:gHMI_MACHINE.Oper_Info.HMI.Overall_warningHide", "OPCUASampleInterval": 3600 } }, { "SampleName": "OverallMachineWarning", "SampleDescription": "Flag if the machine has a warning", "SamplesSaved": 10, "SampleDataType": "bool", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:gWarn.Status", "OPCUASampleInterval": 300 } }, { "SampleName": "PalletMagasineWarning", "SampleDescription": "Flag if the palletmagasine is not in run", "SamplesSaved": 10, "SampleDataType": "bool", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::PMS:PMS.Flag.WarnPalletMag", "OPCUASampleInterval": 300 } }, { "SampleName": "OverallMachineAlarm", "SampleDescription": "Flag if the machine has a Alarm", "SamplesSaved": 10, "SampleDataType": "bool", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:gAlarm.Status", "OPCUASampleInterval": 300 } }, { "SampleName": "BUB1", "SampleDescription": "Buffer Conveyor ", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[152].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "DRB_V1", "SampleDescription": "Turning conveyor", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[154].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "SIS3", "SampleDescription": "Counter pusher", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[160].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "FPL", "SampleDescription": "Foil dispenser", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[180].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "BUB3", "SampleDescription": "Buffer Conveyor ", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[182].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "BUB4", "SampleDescription": "Buffer Conveyor ", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[184].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "PLB_ELV", "SampleDescription": "Elevator", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[203].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "TRS_B", "SampleDescription": "Travers PM800", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[204].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "PAR_R", "SampleDescription": "Parallel conveyor", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[205].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "DRH_S_V2", "SampleDescription": "Turning head", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[206].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "STS_R", "SampleDescription": "Travers PM 2000", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[210].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "SKB_O_V3", "SampleDescription": "Press conveyor", "SamplesSaved": 10, "SampleDataType": "float", "OPCUAObject": { "NodeIdNameSpaceIndex": 6, "NodeIdType": "string", "NodeIdString": "::AsGlobalPV:pMachineStat[215].Data[0].Distance.Overall.Total", "OPCUASampleInterval": 3600 } }, { "SampleName": "MachineMainState2SecInterval", "SampleDescription": "When MachineMainState value = 2, sample OverallMachineAlarm", "SamplesSaved": 0, "SampleDataType": "uint32", "Aggregation": { "Function": "eventcompute", "Expression": "MachineMainState,2,==", "Values": [ "OverallMachineWarning", "PalletMagasineWarning", "OverallMachineAlarm" ], "TriggerSample": "MachineMainState", "TriggerNewInterval": 8 } } ] } ], "DataServers": [ { "ConnectRetryMax": 10, "ConnectRetryMin": 2, "DatasrvName": "DCC", "DatasrvProtocol": "SCI/SPD", "IOPin": true, "SCISPDParams": { "DevCertName": "DCC Certificate", "DevPkeyName": "DCC Private Key", "PushInterval": 1, "RootCAName": "DCC CA Certificate", "SCIServerAddr": "dcm-dcc.secomea.com", "SPDPort": 443, "Security": "TLS1.2" } } ] } ```