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

PI Interface for Universal File and Stream Loading UFL

Learn about principles of operation for the PI UFL interface

Learn about principles of operation for the PI UFL interface

  • Last UpdatedFeb 05, 2025
  • 2 minute read

The PI UFL interface is started using a Windows batch (.bat) file that invokes the executable with a set of parameters, including the full path to the .ini file, where the per data-source related parameters and the parsing logic are defined. When started, the interface performs the following steps:

  1. Validates the startup parameters.

  2. Checks the syntax of the expressions in the .ini file. If errors are detected, it logs the errors and exits.

  3. Compiles the configuration .ini file.

  4. If a point source or tag mask is specified, loads the corresponding PI points.

During the main processing loop, the interface:

  1. Checks for new data.

  2. If new data is available, reads it, and for each line (message), checks whether the message satisfies any of the filters in the .ini file.

  3. If a message passes the filters, determines its message type. Messages that are not caught by a filter are not processed.

  4. Breaks the message into its component fields, performs any required calculations and transformations, then writes the resulting data to Data Archive.

    The interface processes one data line at a time. Lines of text are referred to as messages, and you can use text-matching expressions to specify how a message is broken into its component fields. If multiple matches to a pattern are found in one line, only the first match is taken. To demonstrate the principles, the following report file, created by a manufacturing process, is composed of two heading lines followed by lines containing the data:

    Message type examples

    HEADING 1: Pressure Report
    HEADING 2: Unit AB12 02-Dec-2016

    Date: 01-Dec-2016 12:00:00 Value: 341 Tag: Pressure
    Date: 01-Dec-2016 01:00:00 Value: 339 Tag: Pressure
    Date: 01-Dec-2016 02:00:00 Value: 344 Tag: Pressure

    The interface recognizes two message types:

    • The first message type as illustrated by lines one and two in the example above contains no relevant information and can be ignored.

    • The second message type, illustrated by the final three lines in the example above, consists of data which the interface should forward to PI.

    To process the input through the .ini file, you need to:

    • Declare the message types, name them and specify their filters.

    • Declare fields (variables), give them a name and (data) type.

    • Specify one or more statements that extract and assign parts of the message to fields.

    • Specify one or more action statements which forward the extracted info to PI.

    The above steps are expressed in the language of the .ini file as follows:

    Message types, filters and field extraction

    The following provides a PRINCIPLE-SHOWING example without the PlugIn sections. You must declare fields with a name and data type.

    [FIELD]
    FIELD(1).Name = "Timestamp"
    FIELD(1).Type = "DateTime"
    FIELD(2).Name = "Value"
    FIELD(2).Type = "Number"
    FIELD(3).Name = "Tagname"
    FIELD(3).Type = "String"

    Declare the message types, and name them.

    [MSG]
    MSG(1).name = "MsgType1"
    MSG(2).name = "MsgType2"

    Specify filters for the individual message types.

    [MsgType1]
    MsgType1.Filter = C1=="HEADING *"

    Do nothing.

    [MsgType2]
    MsgType2.Filter = C1=="Date:*"

    The following are examples of field extractions using the fixed position markers Cn and wildcard extraction syntax ["(*)"].

    Timestamp = C7-C26
    Value = ["*Value: (*) *"]
    Tagname = ["*Tag: (*)"]

    Forward the fields to PI Data Archive using the StoreInPi function.

    StoreInPi(Tagname,,Timestamp,Value,,)

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