on 06-15-2016 12:41 PM
Dear community,
i'm using PCo 15.1 to send Notifications to a DB or send sensor data to MII.
Right now, the trigger is always on, what generates a lot of data. Is it possible to write a trigger expression to send a notification every minute?
It is just a test scenario, where i would like to send a room temperature every minute, since i don't need it every second...
Tag comes from OPC Server.
Thanks and best regards
Stefan
Hi, In the trigger type select condition as onTrue
and try to compare seconds in the expression
ex: if second is 00 then only raise the notification. This happens once in every minute so i think your requirement gets full filled.
Pls refer to the functions of expression editor here.
Functions in the Expression Editor - SAP Plant Connectivity - SAP Library
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The PCo Notification trigger does not evaluate functions for the expression logic., only tag values that can be modified by the expressions. For example, this trigger expression does not cause a WhileTrue trigger to fire: second(datenow)%5==0 when the function returns a value of 5, 10, 15, etc.
If the PLC or OPC Server exposes a seconds tag (i.e., for Kepware it is _System.Time_Second) then subscribe to that tag and then use the MOD operator in PCo to fire a WhileTrue trigger every x seconds like this: (Time_Seconds%5)==0 will evaluate to True every 5 seconds.
An alternate method of doing this is to create an additional OPC Agent with an update rate identical to the sample rate that you want to use, and then choose an Always trigger. However, this will NOT trigger a notification unless at least one of the subscribed tags changes value between the update rate interval.
Regards, Steve
Hi Steve,
thanks for describing the two methods to send notifications based on a given time.
In my case, i could only find the current time, provided by the server. Is it also possible to create an expression for that?
The tag "current time" has the value 2016-06-17T10:16:05:564Z
In my opinion, it has to be possible to create an expression where only the "05" is the relevant part of the value to trigger a notification. Could you provide such an expression?
For the second method: Were can i alter the general OPC Agent Update rate?
Thank you
Best regards
Stefan
Hi Stefan,
You can use this expression in a WhileTrue trigger: second('tagname') where tagname is the tag name that you defined in the Subscription list. Use the Expression Editor to select the second(date) function and replace date with a selected subscription item. So to do a 5 second interval for the trigger, the expression would be:
second('CurrentTime')%5==0
Where CurrrentTime is the name of the Subscription item for your current time value.
Regards, Steve
Hi Steve,
sry for the delay..
I just compared PCo with other OPC Clients, which give the oppertunity to see live changes and alter the update rate every single tag with one click. If I use the trigger expression that you suggested, PCo sends the value in the database (roomtemperature every 5 minutes to name one example).
best regards
Stefan
Hi Stefan,
PCo Management Console was not designed or intended to be used as a general OPC Client. Since most OPC Servers already offer a client as part of the software, this was not seen as a requirement.
You can only change the Agent Update rate when the associated Agent Instances are not running. Do you have a requirement to be able to change Update rate while the associated Agent Instances are Running?
Not sure about what you asking here: 'If I use the trigger expression that you suggested, PCo sends the value in the database (roomtemperature every 5 minutes to name one example).'
Regards, Steve
Hello,
I want to store the metadata about the tags.
Example, when I subscribe the new tag, i want to store the information about the tag such as name, source, data type in HANA.
How can it be possible using PCo?
Best Regards,
Megha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Megha,
Tag Metadata is only maintained in PCo. In PCo 15.1, If you set up an ODBC Destination (to write data to HANA tables) you can access the PCo metadata and write it with the tag data as part of the record.
Can you provide more detail about what you are trying to accomplish?
Regards, Steve
Hi Steve,
Thanks for your reply.
My objective to use PCo is to get data from OPC serverand using PCo store it in HANA DB.
I created restful destination and i am able to store the data.
But my requirement is to collect the metadata of all tags from different machine in a separate table in HANA. Suppose if someone is adding new machine then i want to store the tags information in a table in HANA.
If I use the ODBC connection, It will give data in narrow format, can we changed it to wide format?
Regards,
Megha
Hi Steve,
I am able to simulate the data in HANA successfully.
Can I send data for multiple tables.
Suppose If i am selecting different tables which has same column name ex: TAB1 [COL1, COL2, COL3], TAB2[COL1,COL2,COL3]
I want to send data in first table from different machine or tags and in second table from different.
What I see in destination tab, only unique column names gets populated.
Is there any way that we can achieve the above scenario.
Regards,
Megha
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.