From: Zbynek Zahradnik
Sent: Saturday, March 24, 2012 9:28 AM
To: P.
Subject: RE: CS713A - Best way of confirming that data has been received - resultArray.exception ?
P.,
Yes, what you intend to do is the right way. Whether the fact that there is no exception actually indicates that the value has made it to the PLC partially depends on the implementation of the specific OPC Server, but for “normal” servers (as I expect the SimaticNET server is), this is indeed how they behave.
Best regards,
Zbynek Zahradnik, OPC Labs
From: P.
Sent: Saturday, March 24, 2012 9:13 AM
To: Zbynek Zahradnik
Subject: CS713A - Best way of confirming that data has been received - resultArray.exception ?
Zbynek
I am using the following code to send several items to a Siemens PLC. I would like to know the best way of confirming that the data had been received - If I were to check the resultArray[].exception property for every item at the end of this code is it a robust way of confirming that each item of data has been sent and received by the PLC?
OperationResult[] resultArray = opcDAClient.WriteMultipleItemValues
(new[]
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.lineSpeed", lineSpeed),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.blankSize", blankSize),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.coilWidth", coilWidth),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.palletSize", palletSize),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.layersToProduceFull", layersToProduceFull),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.coilPitch", coilPitch),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.blankPattern", blankPattern),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.layersToProducePart", layersToProducePart),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.totalLayersToProduce", totalLayersToProduce),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.fullPalletsReqd", fullPalletsReqd),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.coilGauge", coilGauge),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.totalBlanksToProduce", totalBlanksToProduce),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.blanksToPunch", blanksToPunch),
new DAItemValueArguments("", "OPC.SimaticNET.1", "SIMATIC 300 Station.CPU 317-2 PNDP(1).BCS TO PLC.toolPitch", toolPitch)
);
Regards
P.