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

Getting the time not working Options · View
mogwai
#1 Posted : Wednesday, January 25, 2012 1:52:26 PM
Rank: Member
Groups: Member

Joined: 4/8/2011
Posts: 16
Location: Denmark
Hi ALl

I want to know how long we are stopped.

I have an idear - but I am unsecure if this can be done.

I think it could be done with a PI expression:

- Tag 1 is showing 2000 when the stop start - after 10 min. it will show 0 (as it would show under production).
- Tag 2 shows 1 when the line is stoped. But also shows 1 under production.

I would like to make an expression there say if TAG 1 = 2000 then start timer. Furthermore take the time where Tag 2 shows 1 efter Tag 1 have showed 2000 and Tag 2 have not showed 0 yet.

Hope anyone can help.

Nis
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.
squatty
#2 Posted : Wednesday, January 25, 2012 2:23:17 PM
Rank: Advanced Member

Groups: Member

Joined: 4/7/2011
Posts: 137
Location: KZN, South Africa
You would need the following in order to do a Time Filter calculation using PI-Datalink

EXPRESSION,START TIME, END TIME

From what I can understand is that you are having difficulty writing the correct expression. Try the following as an expression

EXPRESSION#1
('TAG1')=2000
This expression will tell you how long this expression was true, depending on your selection it could be sec,min,hours or days.......

EXPRESSION#2
Part1
FindEq('TAG1','*-1s','*',2000)
This will give you the lastest timestamp when TAG1=2000

Part2
TimeEq('TAG2',FindEq('TAG1','*-1s','*',2000),'*',1)
This part will give you total seconds since Expression#2,Part1 enter a true state till the current time.

I hope this will put you on the right path, I don't expect it to solve your problem though, good luck and keep us posted.
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.