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

PI Connector for UFL

Learn about data storage in PI Points, AF elements and Event Frames

Learn about data storage in PI Points, AF elements and Event Frames

  • Last UpdatedJan 28, 2025
  • 4 minute read

StoreEvent or StoreInPI

To send data to PI points, use the StoreEvent() or StoreInPI() function.

  • Time stamp

  • Value

  • Status

  • Questionable flag

The syntax for this action is as follows:

StoreInPI( Tag, ElementAttribute, TimeStamp, Value[, Status, Questionable] )

StoreEvent( Tag, ElementAttribute, TimeStamp, Value[, Status, Questionable] )

Parameters:

Parameter

Description

Data Type

Tag

(Required)

Specifies the target PI point.

String

Element attribute

(Optional)

Attribute name (data reference to PI Point) of the corresponding AF element. If you omit this parameter, the point cannot be referenced through an AF element.

String

TimeStamp

(Optional)

Time stamp to be recorded with the value. Must be a valid DateTime value. If you omit this parameter, the current system time is recorded.

DateTime

Value

(Required)

The value to be recorded in the target PI point.

String Int32 Number DateTime

Status

(Optional)

PI point status specified as a whole number corresponding to an entry in the PI System digital set.

Int32 or Number

Questionable

(Optional)

0 for valid values, non-zero if there is an issue with the quality of the value being sent.

Int32 or Number

Return value

Void

StoreEvents

This action sends the following data to the specified PI points

  • Time stamp(s)

  • Values

  • Statuses

  • Questionable flags

The syntax for this action is as follows:

StoreEvents( TagNames, ElementAttributes, TimeStamp(s), Values[, Statuses, Questionables] )

Parameters:

Parameter

Description

Data Type

TagNames

(Required)

Specifies the target PI points.

Collection of String

Element attributes

(Optional)

Attribute names (data references to PI Point) of the corresponding AF element. If you omit this parameter, the points cannot be referenced through an AF element.

Collection of String

TimeStamp(s)

(Optional)

Time stamp (one for all tags) or a collection of time stamps (per tag) to be recorded with the values. If you omit this parameter, the current system time is recorded.

DateTime or Collection of DateTime

Values

(Required)

The values to be recorded in the target PI points.

Collection of

  • String

  • Number

  • Int32

  • DateTime

Statuses

(Optional)

PI point statuses specified as the collection of numbers corresponding to an entry in the PI System digital set. Omit this parameter or set to 0 for valid values.

Collection of Int32 or Number

Questionable flags

(Optional)

PI point questionable flags specified as the collection of numbers. Omit this parameter for values without flags.

Collection of Int32 or Number

Return value

Void

StoreElement

The StoreElement() function creates or updates a PI AF element using the following parameters:

  • Full path to a PI AF element (backslash delimited string)

  • Template name

  • Dynamic attributes (Tag names)

  • Static attributes

Using the StoreElement() function, you can create AF elements with a specified set of dynamic and/or static attributes. Any subsequent call to this function with the same Path-name and the same set of dynamic and static parameters (that is - the same set of attributes keeping the same values) will not be propagated to the PI Asset server; however, any change to the number of parameters in collections or their types will result in the element template update

The syntax for this action is as follows:

StoreElement( Path, Template[, DynAttributes, StatAttributes] )

The square brackets indicate that those parameters are optional and can be omitted.

Parameters:

Parameter

Description

Data Type

Full path to AF element

(Required)

Back slash delimited path to an AF element. For instance: Gateway\Device\Dataset

String

AF template name

(Required)

Template name in AF for the aforementioned element. REM: The connector will always create a template for a new element and will name it according to this parameter.

String

Dynamic attributes

(Optional)

Collection of tag names (AF dynamic data references) for the aforementioned element.

Collection

Static attributes

(Optional)

Collection of static attributes.

Collection

Return value

Void

Note: Once the AF element gets created, it is always accompanied by a template that is named according to the AF template name parameter in StoreElement(). Please make sure that neither the AF template name nor the data types of the template attributes are changed after the AF element creation.

StoreEventFrame

The StoreEventFrame() function creates an Event Frame using the following parameters:

  • Event frame name

  • Template name

  • Start time

  • End time or Time out

  • Referenced AF element

  • Dynamic attributes (Tag names)

  • Static attributes

Using this function, you can create an event frame and, optionally, reference an AF element, which has been created by the connector. Other two optional parameters are collections of dynamic and static parameters to the event frame.

Note: Since connector version 1.1, the event frame name will not be suffixed with current time; as well as calls to StoreEventFrame() with the same name and start time will update an existing event frame.

StoreEventFrame( Name, Template, StartTime, EndTime[, RefElementPath, DynAttributes, StatAttributes] )

Parameters:

Parameter

Description

Data Type

Event frame name

(Required)

Event frame name

String

AF template name

(Required)

Template name in AF for the aforementioned event frame. REM: The connector will always create a template for a new event frame and will name it according to this parameter.

String

Start time

(Required)

Event frame start time.

DateTime

End time

(Optional)

Event frame end time.

The end time can be omitted when it is not known at start time; in such a case, the event frame will be opened and any valid end time used in subsequent calls to this event frame name will close it.

Alternatively, this parameter accepts Time data type. If this was the case, the event frame will automatically close after the timeout expired.

DateTime or Time

Full path to referenced AF element

(Optional)

Full path to the referenced element.

String

Dynamic attributes

(Optional)

Collection of dynamic attributes.

Collection

Static attributes

(Optional)

Collection of static attributes.

Collection

Return value

Void

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