4 Replies Latest reply on Mar 31, 2014 8:54 PM by mhamel

    Digital tags - Value & Status

    marco.zoccoli

      Hi all,

      I have a Digital tag, associate to a Digital status (ex. WHITEBLACK, where 1=WHITE and 2=BLACK). If I search this tag on "ArchiveValue" or "CurrentValue" or by "DataLink" I can read the value (WHITE or BLACK).

       

      I'm thinking to use 1 tag [AAAAAAA] no Digital, where i can put my logic (this tag can assume for example only  0&255), and 1 tag [DDDDDDD] digital, associate to the appropriate digital set, where i can see the value, with an exdesc like "IF AAAAAA=255 THAN 1 ELSE 2"

       

      Is possible to center this logic in only 1 tag? When I read the digital tag [DDDDDDD], can I choose to see WHITE/BLACK or the value of AAAAAAA (0/255)?

      Thanks and Regards,

      Marco

        • Re: Digital tags - Value & Status
          xwang

          Hi,

           

          It is not able to store 2 kinds of values in one PI point.  However, if you are using PI AF Server, this goal could be achieved.  You could create 2 attributes, the data reference of one attribute is "PI Point" and indicate it to your digital state point, the other is "formula".  You could use some formula function in PI AF Server to translate the "WHITE/BLACK" value into "0/255" value.

           

          Xi Wang

           

          vCampus team

            • Re: Digital tags - Value & Status

              Hello Marco,

               

              My understanding of your question is that you would like to evaluate another tag to 0 or 255 depending on your raw stored with a PI Point of type Digital with your custom Digital State set "WHITEBLACK" assigned. This can easily be done with PI Performance Equations. In my example the Digital tags name is "WhiteOrBlack". I suggest creating a PI Performance Equation tag with data type Int16 (or Int32). The question is what you would like to see is in case "WhiteOrBlack" receives a value/status that differs from "WHITE" and from "BLACK". With the following equation the calculated Performance Equation tag would assume no change:

               

               

               
              If DigText('WhiteOrBlack')="WHITE" Then 1 Else If DigText('WhiteOrBlack')="BLACK" Then 255 Else NoOutput()
              

              I would prefer the calculated tag reporting the same value as the raw data tag. This value will very likely be from the SYSTEM digital state set.

               

               

               
              If DigText('WhiteOrBlack')="WHITE" Then 1 Else If DigText('WhiteOrBlack')="BLACK" Then 255 Else 'WhiteOrBlack'
              

              Is that what you've been looking for?

                • Re: Digital tags - Value & Status
                  marco.zoccoli

                  Hi Gregor & Xi,

                   

                  When i read the result of this Performance Equation:

                   

                  If DigText('WhiteOrBlack')="WHITE" Then 1 Else If DigText('WhiteOrBlack')="BLACK" Then 255 Else NoOutput()

                   

                  I wouldchoose to display"1"(255) or "White"(black)

                   

                  (Xi, i don't want to store both information, just choose which read)

                   

                  Is it possible?

                   

                  Thanks for your help,

                   

                  Marco

                    • Re: Digital tags - Value & Status
                      mhamel

                      @Marco: This is not like unit of measure where you can decide to "show" the value with different unit of measure. The logic is static for a performance equation. Using PI AF attributes to display this information from different angles could solve your problem.

                       

                      I think that if you could describe what you are trying to achieve with this it would help.