YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

PE Tag Being Executed Twice Options · View
sw
#1 Posted : Tuesday, May 31, 2011 6:50:56 AM
Rank: Newbie
Groups: Member

Joined: 5/31/2011
Posts: 1
Location: Malaysia
Smile Hi Guys...

Another newby in Osisoft PI System here, I have some questions on PE tag.

I have a PE tag ('PE_Tag') with 'Event-Based scheduling'.
It will be trigged whenever tag ('Trigger_Tag') is triggered.
'Trigger_Tag' is a digital tag which has the CLOSE/OPEN value

The equation of the PE tag is :

IF TagVal('Trigger_Tag') = "CLOSE" THEN IF TagVal('Trigger_Tag') = PrevVal('Trigger_Tag') THEN TagVal('PE_Tag', '*') ELSE TagVal('PE_Tag', '*') + 1 ELSE TagVal('PE_Tag', '*')

I have 2 problems:

1. I noticed that whenever there is an event for 'Trigger_Tag', the 'PE_Tag' will be executed twice. The timestamp of each execution of the 'PE_Tag' is 1 second difference.
Do you guys know what this happen?

2. My 'Trigger_Tag' was set to have max time for exception test = 60 minutes, and max time for compression test = 60 minutes.
I notice that whenever my value pass the exception test, the latest value of the tag in PI SMT > Archive Editor will be updated, and the PE tag is being executed.
When the value pass compression test, there will be one new value being archived for the tag, and the PE tag is being executed again.

Thus my PE tag is calculated wrongly.

Is there any way that i can change my equation in order for me to get the correct calculation?

Thank you.

Sw
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
milesUK
#2 Posted : Wednesday, June 01, 2011 8:44:21 AM
Rank: Advanced Member
Groups: Member

Joined: 5/28/2009
Posts: 75
Location: Cheshire, UK
Hi SW and welcome.

From my VBA experience this construct requires a couple of "END IF" statements (if PI uses them!) otherwise the two ELSE parts may execute always:

IF TagVal('Trigger_Tag') = "CLOSE" THEN
IF TagVal('Trigger_Tag') = PrevVal('Trigger_Tag') THEN
TagVal('PE_Tag', '*')
ELSE
TagVal('PE_Tag', '*') + 1
END IF
ELSE
TagVal('PE_Tag', '*')
END IF

Or perhaps some additional parentheses:

IF TagVal('Trigger_Tag') = "CLOSE" THEN
( IF TagVal('Trigger_Tag') = PrevVal('Trigger_Tag') THEN
TagVal('PE_Tag', '*')
ELSE
TagVal('PE_Tag', '*') + 1 )
ELSE
TagVal('PE_Tag', '*')

I'm clutching at straws here as I have not used similar IF..THEN..ELSE in PI PE's and could not find them after a quick scan of the Help pages.

Re point 2. Your If..THEN abov will update 'PE_Tag' for every event in 'Trigger_Tag' including same-state. I.e. CLOSE followed by CLOSE 60 minutes later!

Hope some of that helps.
MilesUK
ProcessBook v3.0.15.3
Ahmad
#3 Posted : Wednesday, June 08, 2011 9:43:00 PM
Rank: Newbie
Groups: Member

Joined: 6/8/2011
Posts: 1
Location: California
I would start with a simpler conditional structure to narrow down the problem more easily (like a simple value assignment as opposed to your if-then structure). You may be able to get rid of the double-value on your PE by turning the compression on for your PE tag. If you have more questions you may want to contact OSIsoft Tech Support at techsupport@osisoft.com for a closer look.
Landry
#4 Posted : Thursday, June 09, 2011 1:37:13 AM
Rank: Newbie
Groups: Member

Joined: 6/9/2011
Posts: 1
Location: San Leandro
Nesting if-then-else statements is a feature of PE Tags. It looks like you need to add parentheses, as milesUK suggested, to fix the problem. Also, you will need to be careful to initialize the PE Tag to zero since you reference its current value on the first execution of the calculation.

If this does not fix the problem, please email OSIsoft Tech Support at techsupport@osisoft.com to further troubleshoot the issue.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.