I want to end automatically a PI Event Frame when the value of one of its attributes is equal to the current value of a PI Point.
How can I configure or develop it ?
Are you using Asset Based Analytics for this? If you are you could set the end condition in a similar manner:
'AttributeOfInterest' = 'SecondAttributeOfInterest'
If you really need to but highly discouraged you can reference the PI Point Directly
'AttributeOfInterest' = '\\servername\tagname'
You will also need to configure a StartTrigger.
Please provide more detail so we can share our thoughts.
thank your for replying.
Actually, it is a little more complicated.
On one of our production lines, I want to know when the coils go in and go out the furnace.
I've 2 PI points that represent a digital signal coming from the PLC, which are set to 1 when:
- a coil goes in the furnace
- a coil goes out the furnace
I've also a PI Point for the id of the coil that goes in the furnace.
When the first signal is set to 1, I want to start a new event frame.
When the second signal is set to 1, I want to end the previous event frame.
I attached a diagram which shows 5 examples.
I created a new analytics tag, called Coil.ID_out with the following syntax:
Prevval( ‘Coil.ID_in’, PrevEvent(‘FurnaceExitSignal’, ‘*’))
Initially, with the help of the tech support, I configured a PI Analysis with the following triggers:
StartTrigger: ‘FurnaceEntranceSignal’ = 1EndTrigger: ‘FurnaceExitSignal’ AND ‘Coil.ID_out’ = PrevVal(‘Coil.ID_in’,PrevEvent('Coil.ID_in', '*'))
Unfortunately, the EF are closed too early because the end trigger is always true.
So I would like :
- set the coil id in a PI-EF attribute when it starts,
- close the EF when the attribute is equal to the coil id at the exit of the furnace.
Thanks for your help,
Well, that's a nice one. The key issue (thanks for the diagram) is that two coils can be in the furnace at the same time. You cannot achieve that with a single Analysis as one EF analysis can only have one active EF at the same time.
I'd recommend to create some analysis attributes that write the ID of the first and second coil into two PI Points, using some logic to detect which ID to set or clear to zero. You can then drive the EF generation from those PI Points, using two analysis.
Quite busy, so no time to provide an example, but i hope this points you in a direction that will help you forward.
Please use the EFGen interface - with the Step behavior. In AF Analytics, you cannot use the same trigger condition to both start and end an event but EFGen with Step will work.
On second thoughts (after looking at the PNG), since you have 2 overlapping EFs, you need more logic and EFGen as is will not work. But if you have the following i.e.
Tag1 for Coil 1; Enter signal=1 and Exit signal=1 and Tag2 for Coil 2; Enter signal=1 and Exit signal=1
You can set up two EFGen instances - one EFGen looking at Tag1 and the second EFGen looking at Tag2; both with Step and it will work.
I agree with Roger here. The biggest issue here is that you have two coils in the furnace at the same time. AF Analytics and EFGen assume that they are only dealing with 1 "triggered EF" at a time (so I don't think EFGen will work without massaging the data first).
To build upon Roger's recommendation, I would get to the point of two trigger tags (1 = ON, 0 = OFF) that represent alternating coils in the furnace so that two coils in the data stream never overlap. So in your example, the triggers for A, C, and E are in one data stream while the triggers for B and D are in another data stream. If you get to this point, you should be able to configure two analytics that are triggering coil EFs on the same element with the correct start and end times.
For clarity, I should have said two trigger tags whose values in that tag are (1 = ON, 0 = OFF) ...
thank you very much for all your replies. I did what you suggested and it works very well.
So I created the analysis attribute 'Coil switch' whose value is calculated with the following expression:
if ('Enter signal'= 1) Then (If ('Coil switch'= 0) then 1 else 0) Else ('Coil switch')
Then, I created 2 PI EF Generation analysis. The first one has the following start and end triggers:
StartTrigger: TagVal('Enter signal','*') = 1 and TagVal('Coil switch','*') = 0
EndTrigger: TagVal('Exit signal','*') = 1 and TagVal('Coil switch','*') <> 0
The triggers of the second are:
TagVal('Enter signal','*') = 1 and TagVal('Coil switch','*') = 1
TagVal('Exit signal','*') = 1 and TagVal('Coil switch','*') <> 1
What do you think about these expressions ?
Now, I want to change the name of the generated Event Frames. I would like to set the coil id at the entry of the furnace.
I would like also to define the attributes of the EF.
How can I do it ?
I will also test the solution suggested by GoPal.
I have the exact same problem with a furnace that we are trying to create event frames for. I have read your solution and wonder what the status of your solution is? Can you send me screen shots of your solution? Do you have issues with the events getting confused if you have a wreck in the furnace? Any issues you have encountered and have a solution? I debated about doing this in ACE, but am trying very hard to use just the AF analytics. TIA. Charley
sorry I was not available.
The status of my problem is "resolved".
I created 2 PI EF Generation Analysis because there are 2 coils in the furnace during the transition between the next and current coils.
So the 2 PI EF Generation analysis generate alternately an Event Frame.
The analysis attribute "Coil Switch" allows to know which PI EF is enabled.
Don't hesitate if you have any other questions ?
Retrieving data ...