LTEAFZE

Always taking state number 1 from digital set in PI ACE Calculation.

Discussion created by LTEAFZE on Sep 11, 2014

Hi Everyone,

 

I have created one digital set with state names : 0 - Inservice, 1 -  NotAvailable, 2-StandBy.

 

My PI ACE calculation is

 

Imports OSIsoft.PI.ACE

Public Class GTs_Inservice_StandBy_NA
    Inherits PIACENetClassModule
    Private L2_85MAK70EA101GXD01 As PIACEPoint
    Private L1_71HHA01CH001ZB02 As PIACEPoint
    Private L1_71CJP11EN372ZB01 As PIACEPoint
    Private L1_71CJP11EA225ZQ00 As PIACEPoint
    Private GTs_UnderMaint_M As PIACEPoint
    Private GTs_Digital_M As PIACEPoint
    '
    '      Tag Name/VB Variable Name Correspondence Table
    ' Tag Name                                VB Variable Name
    ' ------------------------------------------------------------

    ' GTs_Digital_M                           GTs_Digital_M
    ' GTs_UnderMaint_M                        GTs_UnderMaint_M
    ' L1-71CJP11EA225ZQ00                     L1_71CJP11EA225ZQ00
    ' L1-71CJP11EN372ZB01                     L1_71CJP11EN372ZB01
    ' L1-71HHA01CH001ZB02                     L1_71HHA01CH001ZB02
    ' L2-85MAK70EA101GXD01                    L2_85MAK70EA101GXD01
    '
    Public Overrides Sub ACECalculations()

        If (L1_71CJP11EN372ZB01.Value = "CLOSE" And L1_71HHA01CH001ZB02.Value = "ON") Then
            GTs_Digital_M.Value = "INSERVICE" '0
        ElseIf (L2_85MAK70EA101GXD01.Value = "NOT ON" And L1_71CJP11EA225ZQ00.Value < 10) Then
            GTs_Digital_M.Value = "NOTAVAILABLE" '1
        Else
            GTs_Digital_M.Value = "StandBy" '2
        End If
        'Or GTs_UnderMaint_M.Value <> " ") Then
        'If (L1_71CJP11EN372ZB01.Value = "OPEN" And L1_71HHA01CH001ZB02.Value = "ON" And L2_85MAK70EA101GXD01.Value = "ON" And L1_71CJP11EA225ZQ00.Value > 10) Then
        'If (L1_71CJP11EN372ZB01.Value = "OPEN" And L1_71HHA01CH001ZB02.Value = "OFF" And L2_85MAK70EA101GXD01.Value = "ON" And L1_71CJP11EA225ZQ00.Value > 10) Then
    End Sub

    Protected Overrides Sub InitializePIACEPoints()
        GTs_Digital_M = GetPIACEPoint("GTs_Digital_M")
        GTs_UnderMaint_M = GetPIACEPoint("GTs_UnderMaint_M")
        L1_71CJP11EA225ZQ00 = GetPIACEPoint("L1_71CJP11EA225ZQ00")
        L1_71CJP11EN372ZB01 = GetPIACEPoint("L1_71CJP11EN372ZB01")
        L1_71HHA01CH001ZB02 = GetPIACEPoint("L1_71HHA01CH001ZB02")
        L2_85MAK70EA101GXD01 = GetPIACEPoint("L2_85MAK70EA101GXD01")
    End Sub

    '
    ' User-written module dependent initialization code
    '
    Protected Overrides Sub ModuleDependentInitialization()
    End Sub

    '
    ' User-written module dependent termination code
    '
    Protected Overrides Sub ModuleDependentTermination()
    End Sub
End Class

 

In my calculation if condition 1 and 2 fails need to update 'StandBy' value for my digital tag. But always it is updating state number 1 value in the PI Database though 1 and 2 if condition fails.

 

        If (L1_71CJP11EN372ZB01.Value = "CLOSE" And L1_71HHA01CH001ZB02.Value = "ON") Then
            GTs_Digital_M.Value = "INSERVICE" '0
        ElseIf (L2_85MAK70EA101GXD01.Value = "NOT ON" And L1_71CJP11EA225ZQ00.Value < 10) Then
            GTs_Digital_M.Value = "NOTAVAILABLE" '1

 

       Else
            GTs_Digital_M.Value = "StandBy" '2
        End If

 

Please help me to resolve this issue.

Outcomes