许泽博Zblog 我的人生旅程记录

VB脚本-自用

 Dim iNum

    iNum =Mid(Item.Parent.Parent.CaptionText,2,1)

    If iNum = "0" Or iNum = "2" Or iNum = "4" Or iNum = "5" Or iNum = "6" Or iNum = "7" Then 

   Dim  value 

   Dim sPrgName  

   sPrgName = Mid(Item.Parent.Parent.CaptionText,2,4)

   value = CheckLineState(sPrgName)  

   If Not value Then Exit Sub  

End If    

    WritePrgOperiteRecord Item.ObjectName,128,0  

============================================================================

Function CheckLineState(sEntityName) 

Dim sPrgLineC

Dim sPrgLineCA

Dim sUserGroup

sUserGroup = HMIRuntime.Tags("@NOTP::$WorkPost").Read 

     If sUserGroup="管理员"  Then

      CheckLineState =True 

       Exit Function 

     End If

sPrgLineC = HMIRuntime.Tags("@NOTP::L" & sEntityName & ".TankCauTime").Read 

     sPrgLineCA = HMIRuntime.Tags("@NOTP::L" & sEntityName & ".TankCATime").Read

     If sPrgLineC <= 0 Or sPrgLineCA <= 0 Then

       CheckLineState = False

       MsgBox "清洗时间超时",,"提示"

     Else

       CheckLineState =True

     End If

    

End Function 


2025年10月29日 | 发布:许泽博 | 分类:自控 | 评论:0

发表留言: