Learn about weak reference types
- Last UpdatedDec 17, 2024
- 1 minute read
- PI System
- PI Server 2018
- PI Server
Use a weak reference between two elements when you want to create a relationship between two elements but you do not want that relationship to control the lifetime of the child element. For example, you may want to organize your meters into groups, but if all strong references to the meter are removed, then you want it to automatically be removed from the grouping. In this case, you would use a weak reference between the group parent element and the child meter element.
Effect of a deleted strong element on an element with a weak reference type

Example
A child element with a weak reference is deleted as soon as no more strong references exist. You may find this useful if you want one view of your assets to be the primary view. For example, in the above illustration the primary view might be the Site ABC view and contain elements with strong parent-child reference types. Other views, such as Pumps, reference elements with a weak reference type. If the strong Pump01 element in the primary Site ABC view is deleted, the weak-referenced Pump01 element in the Pumps view is deleted automatically.