4 Replies Latest reply on Apr 15, 2019 9:03 AM by AFlor

    Help with UFL ini (PI Connector for UFL)

    AFlor

      Hi all,

       

      I have a problem with mi INI file in UFL connector. The problem is that i am not able to store values with the timestamp specified in data file.

      Datafile is like this:

      +-------------------------------------------------------------------------------
      | Measurements received at :  9-APR-2019 16:19:07.28
      +-------------------------------------------------------------------------------
      | Global MEAsurements.
      | R4-Furnace Pressure                        P.HOR | Pa       =    12.58984   
      | R4-Fuel-oil Temperature                          | °C       =   0.0000000E+00
      | R4-Calorific Value of Fuel-oil                   | kcal/l   =   0.0000000E+00
      +-------------------------------------------------------------------------------
      | Recuperator MEAsurements.
      | R4-Inlet Air Temperature                         | °C       =   0.0000000E+00
      +-------------------------------------------------------------------------------
      | Zone  1 - RECUPERATION, TOP.
      | R4-TC#1 Temperature                        TC.21 | °C       =    82.5625   
      | R4-TC#2 Temperature                        TC.22 | °C       =    76.1875   
      | R4-Oxygen Content                           O2.1 | %        =   0.0000000E+00
      +-------------------------------------------------------------------------------
      | Zone  2 - RECUPERATION, BOTTOM.
      | R4-TC#1 Temperature                        TC.28 | °C       =    678.4375   
      | R4-TC#2 Temperature                        TC.27 | °C       =    673.0625   
      +-------------------------------------------------------------------------------
      

       

      My INI file is this one:

      'Declare fields, with name and data type
      [FIELD]
      FIELD(1).Name="Timest"
      FIELD(1).Type="DateTime"
      FIELD(1).Format= "d-MMM-yyyy hh:mm:ss","JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC"
      FIELD(2).Name = "Value"
      FIELD(2).Type = "Number"
      FIELD(3).Name = "TagName"
      FIELD(3).Type = "String"
      
      
      'Define name for message
      [MSG]
      MSG(1).Name = "Timestamp"
      MSG(2).Name = "Data"
      
      'Define filters
      [Timestamp]
      Timestamp.Filter = C1 == " | Measurements received*"
      Timest=C1(":")-(".") 'timestamp starts at column 30
      [Data]
      Data.Filter = C2=="|*" AND C53=="|*"
      Value = C65-C80 'value field starts at column 65
      TagName = C2("|")-("|") 'tag name starts at column 4
      TagName = REPLACE(TagName," ","")
      Tagname = "PLANT_" & TagName
      
      'StoreinPI data with timestamp
      StoreInPI(TagName, ,Timest, Value)
      

       

      All values retrieved are timestamped with processing time of the datafile, instead of Timest field.

       

      Any idea of what is wrong or how can i retrieve correct timestamp?

       

      Another minor problem is that REPLACE function is not doing anything and tags are named like this one:

      "R4-Furnace Pressure                        P.HOR "

       

      Thanks in advance.

        • Re: Help with UFL ini (PI Connector for UFL)
          cramsey

          Your code works for me.

           

          Put a print statement in your INI logic after you make the assignment to see the timestamp it is extracting:

           

          Timest=C1(":")-(".") 'timestamp starts at column 30

          print("timest=")

          print(Timest)

            • Re: Help with UFL ini (PI Connector for UFL)
              AFlor

              Hi Clint,

               

              Thanks for your answer.

               

              I did it yesterday to see if timestamp was correctly extracted, but nothing is published on Logs Information pane. I do not know the reason.

              So I created a second configuration with another INI file just to archive the value of Timest on a tag so see if it was correct or not.

              'Declare fields, with name and data type

              [FIELD]

              FIELD(1).Name="Timest"

              FIELD(1).Type="DateTime"

              FIELD(1).Format= "d-MMM-yyyy hh:mm:ss","JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC"

               

              'Define name for message

              [MSG]

              MSG(1).Name = "Timestamp"

               

              [Timestamp]

              Timestamp.Filter = C1 == " | Measurements received*"

              Timest=C1(":")-(".") 'timestamp starts at column 30

              Print(ToString(Timest))

              Print("Timestamp is: " & ToString(Timest))

               

              StoreInPI("TEST_TIMESTAMP_UFL", ,Timest, Timest)

               

              The strange thing, is that timestamp seems to be correct, but it is not applied as timestamp for the value.

            • Re: Help with UFL ini (PI Connector for UFL)
              cramsey

              As far as the printing not showing up...

               

              When adding data sources to the PI connector and you modify the Config file to point to an INI file, the INI file settings are copied into the connector repository. If you modify the INI file, you must read the file into the connector repository for the changes to take effect. Follow the steps in this topic to ensure that changes to the INI file are read by the connector.

               

              Procedure

              1. Open the INI file in a text editor.

              2. Apply your changes and save the file.

              3. Click either the Change or Delete button in the Data Source configuration page.

              4. Navigate to the appropriate directory and select the .INI file.

              5. Click Save at the bottom of the configuration page.

              If no syntax problems were encountered, the .INI will be accepted. If problems are

              encountered, an error message is displayed with the line number of the error. In that case,

              edit the INI file again to correct the problem and repeat the previous steps.

               

               

              Let me do some more poking around for the root issue.