6 Replies Latest reply on Aug 31, 2018 11:59 AM by TDvorak

    Getting Integer Values for Digital State Pi Tags

    TDvorak

      Question: My goal is to get the integer value of a Digital State tag.  An example of the digital states for data a 'PhaseID' Pi point tag is shown below.  Using the Analysis option in Pi System Explorer, is there a Cast type or similar function where I can get the actual state number (int16('PhaseID')?) value of the digitalstate?

       

      Example Pi Tag Name = 'PhaseID'

       

      Example of Digital states for 'PhaseID' tag are summarized below:

      State Number     State Name

      0                          "Phase1"

      1                          "Phase2"

      2                          "Phase 3"

      ...                           ...

       

      Alternatively, I can create another Pi point and Boolean logic using PEs to create integers for the different phases; however, the PE results are (non-integer) interpolated values and are not equivalent to the digital State - state number.  Does anyone have a suggestion on how to best resolve this issue?

       

      Thanks in advance!