4 Replies Latest reply on Jan 17, 2014 7:01 PM by pingram

    use UFL interface to store Point values to PI system

    omanlng

      I want to use UFL interface to store data from CSV file in PI system. some value coming for example as number and some time coming as <0.1 and <0.2.

       

      so I use the below configurations:

       

      --------------------------------------------------------------------------------------------

       

      PI Point configuration:

       

       

       

      - Point type: Float32 ( because we want trend the value)

       

      - Point source: SLIM

       

      - Location1: 1

       

      - Instrument tag: the same as what is coming in CSV file.

       

      ---------------------------------------------------------------------------------------------

       

      UFL interface configuration:

       

       

       

      [FIELD]

       

      - FIELD(1).NAME="Name1"

       

      - FIELD(1).TYPE="String"

       

      - FIELD(2).NAME="Timestamp"

       

      - FIELD(2).TYPE="DateTime"

       

      - FIELD(2).FORMAT="MM/dd/yyyy hh:mm"

       

      - FIELD(3).NAME="Name2"

       

      - FIELD(3).TYPE="String"

       

      - FIELD(4).NAME="Value"

       

      - FIELD(4).TYPE="String"

       

       

       

      [MSG]

       

      SG(1).NAME="MSG_1"

       

       

       

      [MSG_1]

       

      MSG_1.FILTER=C1=="*,*,*,*"

       

      Name1=["(*),*,*,*"]

       

      TimeStamp=["*,(*),*,*"]

       

      Name2=["*,*,(*),*"]

       

      Value=["*,*,*,(*)"]

       

       

       

      IF(Value == "<0.1") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-12, ) ENDIF

       

      IF(Value == "<0.2") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-13, ) ELSE StoreInPI(Name1&"."&Name2 , ,Timestamp,Value, , ) ENDIF

       

      --------------------------------------------------------------------------------------------

       

      when I run the interface, the error Cannot convert <0.01 from String to R8.

       

      hint: -12 and -13 should be reference to digital state value in system as for example <0.1 and <0.2 .

        • Re: use UFL interface to store Point values to PI system
          xwang

          Hi,

           

          This is a techsupport question.  My suggestion is that please go to techsupport to discuss on how to use UFL interface to achieve your goal.  OSIsoft vCampus is aimed to help customers to develop the special applications topped on PI system.

           

          However, for this issue, my idea is that your type of "value" is string in the UFL interface.  How come it could realise other condition, like "< 0.01", please?  You just give out 2 conditions, one is "<0.1", the other is "<0.2".  If there is some other value different with these 2, some other if ... else ... loops should be added.  My suggestion is why do not try to change the type of "value" to float32.  Then, you could use your current condition to convert the value, and store them into PI Server.

           

          Xi Wang

           

          vCampus team

            • Re: use UFL interface to store Point values to PI system
              omanlng

              Thank you Xi Wang

               

              i change the type of "Value" to float32, now the CSV file can be write the data to PI Points in PI system but the value showing  0 for PI point type Float 32 and Empty for PI point type String.

               

              Do you have any idea about the reason why write 0 as value?

               

              I check it in Log file and I fond

               

              "Write to PI (via SDK): test.F : time = 05-Jan-2014 21:01:00, value = , status = , flags = , annotation = ."

               

              what thats mean?

               

              best regards,

                • Re: use UFL interface to store Point values to PI system
                  xwang

                  Hi,

                   

                  I suggest please go to OSIsoft TechSupport team to get the detail information of PI UFL interface.  They are the expert to solve the PI products problem.  I guess "0" for float32 might have the same meaning with EMPTY for string.

                   

                  Xi Wang

                   

                  vCampus team

                    • Re: use UFL interface to store Point values to PI system
                      pingram

                      For anyone reading this forum, the resolution is the following. There were a bunch of IF statements:

                       

                       

                       

                       

                      IF(Value == "20/12/10") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-329, ) ENDIF

                       

                      IF(Value == ">28/23/19") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-330, ) ENDIF

                       

                      IF(Value == "22/15/12") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-331, ) ENDIF

                       

                      IF(Value == "22/18/14") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-332, ) ENDIF

                       

                      IF(Value == "21/15/12") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-333, ) ENDIF

                       

                      IF(Value == "21/12/09") then StoreInPI(,Name1&"."&Name2 ,Timestamp,0,-334, ) ELSE StoreInPI(Name1&"."&Name2 , ,Timestamp,Value, , ) ENDIF

                       

                       

                       

                      For all of the if statements, Mohammed is using the InstrumentTag to look up the tag. He just missed a comma, and it should instead read:

                       

                       

                       

                      ELSE StoreInPI( ,Name1&"."&Name2 ,Timestamp,Value, , )