cancel
Showing results for 
Search instead for 
Did you mean: 

PCo: Call custom function in agent from MII

inesdahmann
Explorer
0 Kudos

Hi everybody,

I am trying to figure out how to call my own custom function in an PCo 2.2 agent (programmed via SDK) from MII 12.2. The function is defined in the TagQuery part of the agent class using the TagCall and TagCallParameter attribute, as described in this document: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10c5ed65-bcf9-2f10-a995-dce2cad64...

I assume calling the function from MII should work using a PCo Query, but I can't find out how to do this and there seems to be no documentation explaning which query mode to use (TagStore?) and which tags to write to PCo to trigger the function.

Any help would be greatly appreciated.

Best regards,

Ines Dahmann 

Accepted Solutions (1)

Accepted Solutions (1)

former_member196557
Active Contributor
0 Kudos

Hi Ines,

Currently, it is not possible to access PCo Agent Custom Functions from within MII TagQuery or PCoQuery objects. 

What are you trying to accomplish with the Custom Function? There may be another way to do this with MII/PCo.

Regards, Steve

inesdahmann
Explorer
0 Kudos

Hi Steve,

thanks for your answer!

The PCo agent receives data and forwards it to MII, where it is evaluated and processed. The custom function should implement logic to reset the agent communication in case a failure was detected by MII. We are trying to keep the application logic in MII separate from the communication in PCo, where our agent only forwards telegrams. That's why we need a way to tell the agent that the application has detected a fault and that the communication needs to be resetted.

My first thought was to use a tag query and implement some logic in the DoStore method, that when a query arrives from MII with this tag set to some value, I call my Reset function from there. But doing it using the custom function seemed like a more elegant way to do this 🙂

Best regards,

Ines 

former_member196557
Active Contributor
0 Kudos

Hi Ines,

I agree that your use of Custom Functions is the correct approach for the result you are trying to accomplish.  Using a special condition of a Tag/Value that can be detected in the DoStore method would be an alternative way of accomplishing this as well.

We are investigating the requirements to expose Custom Functions to MII PCoQuery and hope to have a solution for this at some point in the future.

Regards, Steve

Answers (0)