cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PCo trigger on tag

inesdahmann
Explorer
0 Kudos

Hello Experts,

I have a problem with SAP PCO and I can't figure out what I am doing wrong. It would be great if someone here could help me with this problem 🙂

The setup is as follows:

* A PLC with 5 values I am interested in, with one value "STATUS" indicating that the other four have been updated. Every time this is the case, the value of STATUS changes.

* OPC Server (running on the same server as pco) serving these values

* SAP PCo with OPC Source system and MII destination that writes these values to a database. Agent instance is configured with trigger "Always" and expression "STATUS".

* We currently are on Manufacturing Suite 15, but problem existed already on PCo 2.3/MII14.0

So far, so good. The expected result is that  I am getting new rows in the database table, with each row having a different value for STATUS, since that is my trigger and a row is only written, if STATUS has changed.

However, the actual result is, that I am getting two rows with the same STATUS and inconsistencies on the other values because they have not yet been fully updated (see attached picture).

It seems to me, that the trigger mechanism is not working correctly or that I have not configured properly. I had a look at this thread https://scn.sap.com/thread/3280319 but it sounds like my approach is correct (trigger on one subscription item and put trigger plus all others in a notification. Why is it not working as expected?

Thanks in advance for your comments and expertise 🙂

Regards,

Ines

Accepted Solutions (1)

Accepted Solutions (1)

former_member196557
Active Contributor
0 Kudos

Hi Ines,

The 'Always' trigger mode does not evaluate the Trigger Expression. With the Always trigger, when ANY of the subscribed tags changes value. those tags and values are sent to the destination.

Use a 'While True' trigger and express the trigger so that it generates a trigger event based on the new value:

if the STATUS tag is always going to be >0, use 'STATUS' >0

if the STATUS tag can have 0 as a valid trigger, then use ('STATUS' .0) || ('STATUS'==0)

When the trigger fires, the most current value of the tags defined in the Output of the notification will all be sent to the destination.

The difference between the On xxx and While xxx triggers are that an On xxx trigger is an edge trigger, the trigger expression must be evaluated as the complement of the trigger before it will be evalulated again ( True->trigger, False->no trigger, True->trigger).  A While xxxx trigger fires every time the expression value matches the While state (true for While True, false for While False)

Please refer to the Application Help at help.sap.com/pco, in the Notification ->Notification: Trigger Tab for more details.

Regards, Steve

inesdahmann
Explorer
0 Kudos

Hi Steve,

thanks for your reply! The PCo UI is a bit misleading there. It would be better to disable the input field for the expression on the choice of "Always" in the dropdown, if this is not a valid input...

I tried your suggestion with trigger WhileTrue, but since 'STATUS' is a string variable, I set the trigger expression to 'STATUS' != "0". This seems to work!

Answers (0)