2 Replies Latest reply on Aug 23, 2018 2:36 PM by NoéAlvarado

    Write Data from Datalink to PI Server - IMD Tags

    NoéAlvarado

      Hi to all

      I have a macro to write tags from Datalink to Excel. I am using a String Datatype to write some comments of the shift. The problem that I have is that I don´t know how to limit the period of time of comments.

      For example:

       

      TAG "String1" values:

      - 08:00 - 09:00     --> "The SAG Mill has been stopped".

      - 13:00 - 14:35     --> "Problem with the pump XX".

      When I write this values to the tag I write on the macro the first value. For example

           Write "The SAG Mill has been stopped" to 'String1' at 08:00.

      After that I write the next Value:

           Write "Problem with the pump XX" to 'String1' at 13:00.

       

      The macro is working, the problem that I have is how to finish the first value at 09:00 or 14:35. I tried to write 'String1' value at 09:00 to "NoOutput()" but doesn´t work, I want to have "No Data", because I didn´t have any event there, just like the "No Data" that I have when I created the tag. When I write "NoOutput()" this can give me problems with some calculations and also doesn´t look well on trends.

      Please can someone help me with this?

      Regards,

      Noé.

        • Re: Write Data from Datalink to PI Server - IMD Tags
          Lal_Babu_Shaik

          Hi Noe

           

          "No Data" is system digital state in PI. You can pass digital state code (248) as value to PI point and it will write "No Data" value.

           

          Thanks

          Lal

            • Re: Write Data from Datalink to PI Server - IMD Tags
              NoéAlvarado

              @Lal Babu Shaik

              Thanks for the reply. I know that "No Data" is a Digital State in PI. But I don´t know how to write that using VBA con Excel. Also I don´t know if that works on a IMD tag that collects String data.

              The code line that I am using to write is this one:

               

              "srv.PIPoints(Sheet5.Cells(IntFilaTA_1, IntColTA_1).Text).Data.UpdateValue DBLValorTA_1, DTFechaTA, dmReplaceDuplicates IntContadorTA_1 = IntContadorTA_1 + 1"

               

              Sheet5.Cells(IntFilaTA_1, IntColTA_1 --> Here is the tagname to write

              DBLValorTA_1 --> Here is the value to write to the tag.

              DTFechaTA --> The date to write the PI Point.

               

              Please,

              Can you help me with this.