DDHasTemplate()

Format

DDHasTemplate(Entity,Template[,Templates])

Returns

Returns a list of Boolean values (True or False) which indicate when a template (or list of templates) was assigned to an entity within the time range of the request.

This function is typically used to find out if an entity has a particular template (e.g. does Well2 have the Oil Producing Well template?). If more than one template name is supplied, False will only be returned if none of the templates are assigned.

It is possible to retrieve very large volumes of data through indiscriminate use of this function. Retrieving large amounts of Historian data across a slow network can affect system performance for all users of the system.

Inputs

Entity: Name of the entity whose template instances should be checked. 
Behaviour: Required
Dimensions: SingleValue
Valid data types: String

Template: The name of a template that is to be checked against the entity. 
Behaviour: Required
Dimensions: SingleValue
Valid data types: String

Templates: Comma-separated list of template names that are to be checked against the entity. 
Behaviour: Optional (0..n)
Dimensions: SingleValue
Valid data types: String

How to properly format data types

Examples

Expression: DDHasTemplate("myEntity", "myTemplate")
Result: Returns a collection of boolean values which indicate when "myTemplate" was or was not assigned to "myEntity" within the time range of the fetch request. The timestamp of each value indicates when a template instance started (in case of true value) or ended (in case of false value).

Tip: If you have access to the sample data, try running the following examples using the calculation tester.

Expression: DDHasTemplate("Archer","Oil Producing Well")
Result: True

Expression: DDHasTemplate("Archer","Area")
Result: False

Expression: DDHasTemplate("Archer","Oil Producing Well","Area")
Result: True 

 

Comments are closed