1 Then
apiControllerTag.Value = rndkey
apiDateAndTimeIntegerTag.Value = Round(DateAndTimeIntegerTag.Value / 10)
errorTag.Value = "update"
timeTag.Value = "????"
End If
serverNode = myGroup.Item("batch_server").Value
'MsgBox serverNode
r.Node = serverNode
End Sub
Private Sub FactoryTalkAlarmandEventBanner1_EventClick(ByVal Item As FTAlarmEventSummary.IEventItem)
End Sub
Private Sub NumericInput1_Change()
On Error GoTo errh1
If NumericInput1.Value Mod 5 = 0 Then
If Not initialised Then
initialised = True
Exit Sub
End If
If apiControllerTag.Value <> rndkey Then
If DateAndTimeIntegerTag.Value - apiDateAndTimeIntegerTag.Value > 20 Then
apiControllerTag.Value = rndkey
apiDateAndTimeIntegerTag.Value = DateAndTimeIntegerTag.Value
End If
Exit Sub
End If
If Not started Then
Start
Exit Sub
End If
On Error GoTo errh
update
errorTag.Value = ""
End If
Exit Sub
errh:
errorTag.Value = err.Description
errh1:
End Sub
Private Sub update()
clearUpdated
Dim s As String
s = r.GetItem("TIME")
timeTag.Value = s
Dim values As UnitValues
Dim u As Variant
For Each u In units
s = r.GetItem(u.id & "BatchId")
u.values.batch = s
Next u
update1
setTags
End Sub
Private Sub update1()
Dim unitProcedure As String
Dim unitProcedureId As String
Dim batch As String
s = r.GetItem("BatchList")
Dim batches() As String
batches = Split(s, vbCrLf)
Dim uu As Unit
For x = LBound(batches) To UBound(batches) - 1
Dim c As String
Set values = New UnitValues
values.recipe = Split(batches(x), vbTab)(1)
values.recipeDescription = Split(batches(x), vbTab)(2)
values.createId = Split(batches(x), vbTab)(8)
s = r.GetItem(Split(batches(x), vbTab)(8) & "BatchStepDataList2")
Dim batchSteps() As String
batchSteps = Split(s, vbCrLf)
For xx = LBound(batchSteps) To UBound(batchSteps) - 1
Dim SS() As String
SS = Split(batchSteps(xx), vbTab)
If SS(2) = "1" Then
values.procedureId = SS(0)
values.procedure = SS(1)
End If
If SS(2) = "2" Then
values.unitProcedureId = SS(0)
values.unitProcedure = SS(1)
End If
If SS(2) = "3" Then
If Trim(SS(6)) <> "" Then
Set uu = getUnit(SS(8))
If Not uu Is Nothing Then
uu.values.recipe = values.recipe
If values.unitProcedureId <> "" Then
uu.values.operation = SS(1)
End If
uu.values.operationId = SS(0)
uu.values.procedure = values.procedure
uu.values.procedureId = values.procedureId
uu.values.unitProcedureId = values.unitProcedureId
If values.procedureId <> "" Then
uu.values.unitProcedure = values.unitProcedure
End If
uu.values.state = SS(6)
uu.values.failure = Trim(SS(14))
values.unitProcedure = ""
values.unitProcedureId = ""
'Exit Sub
End If
End If
End If
If SS(2) = "4" Then
If LCase(SS(1)) Like "ep_*" Then
If SS(6) = "RUNNING" Then
uu.values.eps = uu.values.eps + 1
End If
End If
End If
Next xx
Next x
End Sub
]]>