cancel
Showing results for 
Search instead for 
Did you mean: 

Error handling from PCO Query

0 Kudos

Hi,

In my project I am integrating with a PLC through SAP PCO and OPC server.

I am currently testing error handling if something fails on any of the involved systems.

As a first test I stopped the agent instance that I use to read data from the PLC.

When I try to write through the agent instance with a PCO Quaery I get no errors.

The 'Success' attribute of the PCO Query is 1.

The 'LastErrorMessage' attribute is empty.

The only indication is the 'Output'which contains an error message.

<?xml version="1.0" encoding="UTF-8"?>

<Rowsets CachedTime="" DateCreated="2015-03-19T09:58:49" EndDate="2015-03-19T09:58:48" StartDate="2015-03-19T08:58:48" Version="14.0 SP5 Patch 12 (1-okt-2014)">

     <Messages>

          <Message>PoederMagazijn/ATS PLC/General/NewDataReady_InputTypeMessage: java.net.ConnectException: Connection refused: connect</Message>

     </Messages>

</Rowsets>

However, the same <Message> tags are used for success messages as well. So there is no clear way to identify an error.

Is there any other way I can be sure the PCO query was able to write and catch any errors?

FYI: we are using PCO 2.3 and MII 14.0

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

A small update. I tried again by upgrading the PCO version to 15.0 But still the same.

I did the following 2 test cases:

  1. Unplug the UTP cable to the PLC and write data via PCO query
  2. Disable the agent instance and write data via PCO query

In both cases the PCO Query returned the following output:

  • Success: 1
  • LastErrorMessage: <empty>

The only information that I get is in the results but it is not a good practice to interpret this because I don't know all the possible messages.

Result for Case 1:

<?xml version="1.0" encoding="UTF-8"?><Rowsets CachedTime="" DateCreated="2015-03-26T14:13:18" EndDate="2015-03-26T14:13:12" StartDate="2015-03-26T13:13:12" Version="14.0 SP5 Patch 12 (1-okt-2014)">

    <Messages>

        <Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/ProductDescription: Unspecified error</Message>

        <Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/ProductDescription: Operation failed</Message>

    </Messages>

</Rowsets>

Result for Case 2:

<?xml version="1.0" encoding="UTF-8"?><Rowsets CachedTime="" DateCreated="2015-03-26T12:11:37" EndDate="2015-03-26T12:11:35" StartDate="2015-03-26T11:11:35" Version="14.0 SP5 Patch 12 (1-okt-2014)">

    <Messages>

        <Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/OrderQuantityTarget: java.net.ConnectException: Connection refused: connect</Message>

        <Message>PoederMagazijn/ATS PLC/M1 Order Dispatch/OrderQuantityConfirmed: java.net.ConnectException: Connection refused: connect</Message>

    </Messages>

</Rowsets>

Please advice. I cannot provide any transaction integrity at this time. I would assume this to be one of the base principles of PCO.

Former Member
0 Kudos

Connection refuse error always comes when instances is stopped and also the PCo query throws error. Use catch block to capture the error. I hope this will help.