Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Builder (PI Server 2024 R2)

List of PI AF substitution parameters

  • Last UpdatedJun 04, 2025
  • 7 minute read

PI AF interprets numerous types of substitution parameters. The following tables are grouped by type:

Name substitution parameters

The following table lists the parameter names and substitutions.

Parameter name

Substitution

%@path%

The value of the object's attribute or attribute template, represented by the path.

%Analysis%

Name of analysis, if obtainable from the context.

%Attribute%

Name of the object's attribute or attribute template.

%|Attribute%

Name of the root attribute or attribute template that holds this data reference.

%..|Attribute%

Name of the parent attribute or attribute template that holds this data reference.

%Database%

Name of the PI AF database in which the attribute resides.

%Destination%

Name of the destination element for the transfer in which the attribute resides.

%Element%

Name of the element  in which the attribute resides.  For event frames, this refers to the name of the primary-referenced element.

%\Element%

Name of the root element in which the attribute resides.

%..\Element%

Name of the parent element of the element in which the attribute resides. To retrieve further ancestors, use the ..\ notation, such as %..\..\Element%.

%EventFrame%

Name of the event frame in which the attribute resides.

%\EventFrame%

Name of the root event frame in which the attribute resides.

%..\EventFrame%

Name of the parent event frame of the event frame in which the attribute resides. To retrieve further ancestors, use the ..\ notation, such as %..\..\EventFrame%.

%Model%

Name of the model, if obtainable from the context.

%Name:path%

Name of the object represented by the path to the object. If the path is not specified, null is returned since the name of the current object is being referenced.

%Server%

Name of the default Data Archive. It first resolves to the current PI AF database's default Data Archive if one is specified; otherwise, it resolves to the PI AF server's default Data Archive if one is specified. If one is not specified there, it resolves to the local default Data Archive.

Note: If the default Data Archive is not specified on the PI AF server or PI AF database, it can resolve to a different Data Archive for different client machines depending on their configuration.

%Source%

Name of the source element for the transfer in which the attribute resides.

%System%

Name of the PI AF server or collective where the attribute resides.

%Template%

Name of the template on which the element or event frame is based. For example, if you created element Valve101 from a template called Valve, then the substitute text would be Valve.

%\Template%

Name of the root template on which the element or event frame is based.

%..\Template%

Name of the parent template on which the element or event frame is based. To retrieve further ancestors, use the ..\ notation, such as %..\..\Template%.

%Transfer%

Name of the transfer in which the attribute resides.

Time substitution parameters

PI AF supports substitution parameters that specify a particular time and time zone, depending on the context. Optionally, you can augment these supported parameters by including a format string that specifies the format of the time string. See Format strings for time substitution parameters.

The following table lists the time substitution parameters that supports.

Parameter name

Substitution

%Duration%

Time span between the start time and end time, if it can be obtained from the time context. In open event frames, obtains the time span from start time to the current time. The time span uses a different format from other time substitution parameters.

  • You can use standard formats such as "c" (constant), "g" (general, short), or "G" (general, long), for example: %Duration:c%. For more information, see the MSDN article Standard TimeSpan Format Strings.

  • You can also use a custom time span format, as described in the MSDN article Custom TimeSpan Format Strings.

    Note that you need to define the symbols that separate days from hours, and so on with a string literal. For example, %Duration:d\.hh\:mm\:ss% defines a period (.) as the separator between days and hours, and a colon (:) as the separator between hours, minutes, and seconds.

%EndTime%

Local end time, if obtainable from the time context. For event frame-based objects that do not have an end time yet specified, the result is an empty string.

%StartTime%

Local start time, if obtainable from the time context.

%Time%

Local time, if obtainable from the time context.

%UtcEndTime%

Coordinated universal (UTC) end time, if it can be obtained from the time context. For event frame-based objects that do not have an end time yet specified, the result is an empty string.

%UtcStartTime%

Coordinated universal (UTC) start time, if it can be obtained from the time context.

%UtcTime%

Coordinated universal (UTC) time, if it can be obtained from the time context.

ID substitution parameters

The following table lists the ID substitution parameters that supports.

Parameter name

Substitution

%AnalysisId%

ID of the analysis with which the attribute is associated.

%AttributeId%

ID of the attribute that holds this data reference.

%|AttributeId%

ID of the root attribute or root attribute template in which the attribute resides.

%..|AttributeId%

ID of the parent attribute or parent attribute template in which the attribute resides. Further ancestors can be retrieved by using the ..| notation, such as %..|..|AttributeId%.

%DatabaseId%

ID of the database in which the attribute resides.

%ElementId%

ID of the element in which the attribute resides. For event frames, this refers to the ID of the primary referenced element.

%\ElementId%

ID of the root element in which the attribute resides. For event frames, this refers to the ID of the primary referenced element of the root event frame in which the attribute resides.

%..\ElementId%

ID of the parent element in which the attribute resides. For event frames, this refers to the ID of the primary referenced element of the parent event frame in which the attribute resides. Further ancestors can be retrieved by using the ..\ notation, such as %..\..\ElementId%.

%EventFrameId%

ID of the event frame in which the attribute resides.

%\EventFrameId%

ID of the root event frame in which the attribute resides.

%..\EventFrameId%

ID of the parent event frame in which the attribute resides. Further ancestors can be retrieved by using the ..\ notation, such as %..\..\EventFrameId%.

%Id:path%

ID of the object represented by the path to the object. If the path is not specified, the ID of the current object is used. .

%ModelId%

ID of the model in which the attribute resides.

%SystemId%

ID of the PI AF server in which the attribute resides.

%TransferId%

ID of the transfer in which the attribute resides.

Description substitution parameters

The following table lists the description substitution parameters that supports.

Parameter name

Substitution

%Description:path%

Description of the attribute represented by the path to the attribute. If the path is not specified, the description of the current attribute is used.

%|Description%

Description of the root attribute or root attribute template in which the attribute resides.

%..|Description%

Description of the parent attribute or parent attribute template in which the attribute resides. Further ancestors can be retrieved by using the ..| notation, such as %..|..|Description%.

%ElementDescription%

Description of the element in which the attribute resides. For event frames, this refers to the description of the primary referenced element of the event frame in which the attribute resides.

%\ElementDescription%

Description of the root element where the attribute resides. For event frames, this refers to the description of the primary referenced element of the root event frame in which the attribute resides.

%..\ElementDescription%

Description of the parent element in which the attribute resides. For event frames, this refers to the description of the primary referenced element of the parent event frame in which the attribute resides. Further ancestors can be retrieved by using the ..\ notation, such as %..\..\ElementDescription%.

%EventFrameDescription%

Description of the event frame in which the attribute resides.

%\EventFrameDescription%

Description of the root event frame in which the attribute resides.

%..\EventFrameDescription%

Description of the parent event frame in which the attribute resides. Further ancestors can be retrieved by using the ..\ notation, such as %..\..\EventFrameDescription%.

Path substitution parameters

Path substitutions cannot generally be used to create references to other attributes, because they contain backslash characters. The Path substitution parameters are most useful with String Builder data references when you construct paths for output into strings. The path that is produced does not include the PI AF server or database.

The following table lists the path substitution parameters that supports.

Parameter name

Substitution

%ElementPath%

Path of the base element, the element of an attribute, or the primary referenced element of an event frame.

%..\ElementPath%

Path of the parent element in which the attribute resides. For event frames, this refers to the path of the primary referenced element of the parent event frame in which the attribute resides. Further ancestors can be retrieved by using the ..\ notation, such as %..\..\ElementPath%.

%EventFramePath%

Path of the event frame, or the element of an attribute of an event frame.

%..\EventFramePath%

Path of the parent event frame in which the attribute resides. Further ancestors can be retrieved by using the ..\ notation, such as %..\..\EventFramePath%.

Environment variable parameter

The following table lists the environment variable parameter that supports.

Parameter name

Substitution

%Environment Variable%

Value of the matching system-environment variable. For example, %COMPUTERNAME% is replaced with the name of the computer on which the data reference is executing.

In This Topic
TitleResults for “How to create a CRG?”Also Available in