jason.maxwell

Add Existing Event Frame as Reference to another Event Frame

Discussion created by jason.maxwell on Aug 21, 2012
Latest reply on Dec 20, 2013 by seneschal

I have a scenario where I need to create an Event Frame (let's call it EF1) and I need to add a reference to an already existing Event Frame (let's call it EF0); this can be done in PI System Explorer by creating EF1, then right clicking it and choosing New > Add Event Frame Reference ...

 

How do I duplicate this behavior programatically?  I've tried:

 

 

 
ef1.EventFrames.Add(ef0);
eventFrame.CheckIn();

And:

 

 

 
AFReferenceType efRef = new AFReferenceType("efReference", "ef", "associatedEf");
efRef.Strength = AFReferenceStrength.Weak;
ef1.EventFrames.Add(ef0, efRef);

 

 

In both cases, the object in code appears to have the event frame added, but searching for and viewing the event frame in PI System Explorer doesn't show any child/referenced event frames.

 

 

 

 

Outcomes