cancel
Showing results for 
Search instead for 
Did you mean: 

PCo Open query on PI tags gives error

Former Member
0 Kudos

I have recently migrated our PI systems to Windows 2012 server and upgraded to PI 2012. As a consequence I have installed SAP Plant Connectivity v2.3 and am running an agent between MII v12.1 and PI 2012. I am seeing an error whenever I try and retrieve the list of tags for a tag query (e.g every time I open up the Tag Query Details screen on MII workbench, when it will immediately run an open query to retrieve the first 250 tags). The list of tags is eventually retrieved after about 2 minutes.

I have SAP Plant Connectivity v2.1 still installed on another server and before I switched to v2.3 I had configured v2.1 to run an agent between MII and the new PI system through this 3rd server. When I use this I see the same error but it does not result in a delay of 2 minutes so the issue has not been noticed when running previously (I have only ever had one agent or the other running - not both at the same time). The PCo v2.3 is installed on the new PI server. I attach some screen shots showing the error. Has anyone come across this before or knows what the problem is?

The config of the data server on MII is exactly the same except for the IP address. The config of Plant Connectivity is the same except for an additional setting on the new version (e.g Multithreading option - I have set to the default of 6) and selection of MII pre 12.2 (I am running v12.1)

Accepted Solutions (1)

Accepted Solutions (1)

former_member196557
Active Contributor
0 Kudos

Hi Richard,

Which version of the PI SDK is installed on the PI Server where PCo is installed? The PI SDK is a required component of the PCo OSISoft PI Source Agent.

Please set the Logging level of the PCo Agent Instance to Verbose and then re-execute the MII TagQuery by opening the TagQuery Details page. PCo will log the incoming query from MII so that we can see what is being sent from MII, and log the details of the responses from PI.

Regards, Steve

Former Member
0 Kudos

Hi Steve

Many thanks for your reply. I am using PI SDK 2012. I have set the logging level on PCo to Verbose and I attach a dump of the relevenat output lines below. I notice that in the instances where a specific tag is queried then there is no problem e.g -

e.g |Information|AgentBase|Tag Query:  pragma UseLegacy;RETRIEVE FIRST "CMB_Formpress_Production_Run_Time_Shift_PF"

it only errors when doing an "open" query against all the tags using the following:

|Error|AgentBase|Error executing Directives of Tag Query:  pragma UseLegacy;LIST Groups RECURSIVELY WHERE RowCount=250;|"ParserException: Parse Error occured in directive

|Information|AgentBase|Tag Query:  pragma UseLegacy;LIST Groups RECURSIVELY WHERE RowCount=250;|

I can't find any control over the above - MII always triggers this query when I open a PI tag query and click on the Tag Query Details section. I spoke to a PI consultant and he does not recognize the error as a PI or SDK specific problem but he pointed me to another article regarding PCo:

http://help.sap.com/saphelp_mii122sp01/helpdata/en/4a/a98326ff1537b1e10000000a421138/content.htm

in which it mentions - "On the Hierarchy tab, you can select tags for which you want to execute the query. If groups are supported by the selected PCo agent, the system displays the groups and tags in the tree view". The error message from PCo seems to be saying that Groups are not supported but I don't know where I have any control over this. I could not see anything obvious in the config of the agent on PCo.

Rgds

Richard.

former_member196557
Active Contributor
0 Kudos

Hi Richard,

The error you are getting when opening the Tag Details Query template is because the PI server does not have Groups, and the LIST GROUPS directive is not valid in PCo for a PI Source.  This query is executed from the TagQuery template object in MII, which uses the older LISA protocol to communcate with PCo (and the obsolete UDS before that).  MII Versions 12.2 and later have a new PCoQuery tempate which, among other things, does not execute the LIST GROUPS directive when the Tag brower window in the Query template is opened.  The error per se does not cause any issues with subsequent tag queries from MII to PI.

In the PCo log you should see a LIST TAGS RECURSIVELY WHERE ROWCOUNT = XXX; message from MII, followed by a response when PCo returns the results to MII.  Do you see any additional messages that occur between the request and the response that would indicate why the query is taking 2 minutes to execute?

Also, what is the exact version of PCo 2.3 that you are using?  What are the settings for the PI source Agent?

Regards, Steve

Former Member
0 Kudos

Hi Steve

Thanks again for the info. I have looked at the log entries and I do see the LIST TAGS RECURSIVELY WHERE ROWCOUNT=250 message immediately after the LIST GROUPS directive (at 09:06:01 AM this morning).

1/7/2014|9:06:01
  AM|990|.|30|4164|PI_PCo_Wrexham|Information|AgentBase|Tag Query:  pragma UseLegacy;LIST Tags RECURSIVELY
  WHERE RowCount=250;|""
1/7/2014|9:06:01
  AM|990|.|30|4164|PI_PCo_Wrexham|Information|AgentBase|Query:  <pco:tag
  xmlns:pco="uri:sap-pco-request"><![CDATA[pragma
  UseLegacy;LIST Tags RECURSIVELY WHERE RowCount=250;]]></pco:tag>|""
1/7/2014|9:06:01
  AM|927|.|24|4164|PI_PCo_Wrexham|Information|PCoQueryRequestHandler|Query
  Processing Time: 15.6013 milliseconds|""
1/7/2014|9:06:01
  AM|927|.|24|4164|PI_PCo_Wrexham|Information|AgentBase|Tag Query:  pragma UseLegacy;LIST Groups RECURSIVELY
  WHERE RowCount=250;|""
1/7/2014|9:06:01
  AM|927|.|24|4164|PI_PCo_Wrexham|Error|AgentBase|Error executing Directives of
  Tag Query:  pragma UseLegacy;LIST
  Groups RECURSIVELY WHERE RowCount=250;|"ParserException: Parse Error
  occured in directive number 1

I looked for a return message (I assume these are the ones which show the number of milliseconds) and I found the one for the same thread (30) as the LIST TAGS message at 09:07:45, showing 103401.2101 ms.

1/7/2014|9:07:45
  AM|390|.|30|4164|PI_PCo_Wrexham|Information|PCoQueryRequestHandler|Query
  Processing Time: 103401.2101 milliseconds|""

There are hundreds of information and warning messages between these but none for the same thread and all for specific tag queries running from live applications. Unfortunately I can't find a way to attach the file for you to see the detail.

However, I did some further testing, going back to my 2.1 version, and although this shows the same type of log messages, it does not have the same delay (takes 3 seconds to return the tags). So, I have now removed v2.3 from my live PI server and installed v2.1. This now returns the tags in 3 seconds and does not seem to have had any other adverse effect. I don't have version 2.2 so I cannot test with that but I am now inclined to leave v2.1 in place. I did some timings on my other 3 PCo instances and 2 of them returned the tags in about 25 seconds and the other returned it in 1.5 minutes. The users on those instances are not doing direct tag retrieval queries so have not seen any problem so far. The one which has been giving me problems is where the users are changing selecting their own tags through an MII Chart, using the "Settings/Query Properties/Select Tags" option. This does the same thing as the MII Workbench when opening a tag query and select tag query details.

I have not extracted the Verbose messages in my latest testing but I will try and generate a Verbose log for both v2.1 and 2.3 to try and get a comparison.

The explicit version I am having problems with is 2.300.1406.1651

former_member196557
Active Contributor
0 Kudos

Hi Richard,

Please download and install the latest Service Pack and Patch for PCo 2.3 in Service Marketplace, from Support Portal->Software Downloads->Support Packages and Patches->A - Z Index->P->SAP Plant Connectivity->SAP Plant Connectivity->Win32->PCo23SP03P_7-10012010.exe. Lets first see if this newer SP addresses any of your issues.

Regards, Steve

Former Member
0 Kudos

Hi Steve

I will request this from the Basis team and I will confirm once I have received it, installed it and tested it (will probably take a few days).

Thanks & regards

Richard.

Former Member
0 Kudos

Hi Steve

I have installed PCo23SP03P_7-10012010.exe and it took even longer to retrieve the tags so I have reverted back to v2.1 and I will stay with that for now. Many thanks for all your help.

Rgds

Richard.

former_member196557
Active Contributor
0 Kudos


Hi Richard,

I would recommend that you log a ticket on this issue and if possible post the VERBOSE logs from both the PCo 2.1 and PCo 2.3 instances.  I am unable to duplicate this issue, but our internal PI Server is not PI 2012.

Regards, Steve

Former Member
0 Kudos

Is there any documentation around the commands that the TagFixedQuery will accept?

I did find this:

https://www.google.ch/patents/US8176074

That would be great.

Answers (1)

Answers (1)

former_member191528
Participant
0 Kudos

Hi Richard !!

We are facing the same issue. Has there been any update on it ? Were you able to fix it ?

Thanks,

Kiran

Former Member
0 Kudos

Hi Kiran

Sorry - I don't have any update. I managed to work around it by going back to PCo 2.1. Not sure what additional functionality has been added in the later 2 versions but 2.1 is not causing me any problems currently.

Rgds

Richard.

former_member191528
Participant
0 Kudos

Thanks Richard !! I appreciate your response.