Public Sub UpdateDeltaV()
Dim rtn As Integer
On Error GoTo ErrorHandler
'Send actual ingredient and amount to the DeltaV System
If gStep <> DRYADD_STEP Then
MsgBox "Wait for the step DRY_ADD"
Exit Sub
End If
If gActualIngredient <> "" Then
rtn = gOpcServer.SetItemValue("IngredientInfo",
gActualIngHandle, gActualIngredient)
Else
Exit Sub
End If
If gActualAmt <> 0 Then
rtn = gOpcServer.SetItemValue("IngredientInfo", gActualAmtHandle,
gActualAmt)
Else
Exit Sub
End If
'Set the Done flag to allow the SFC to continue
rtn = gOpcServer.SetItemValue("IngredientInfo", gDoneHandle, 1)
Exit Sub
ErrorHandler:
MsgBox "UpdateDeltaV: Error!" & vbCrLf _
& "Err.Number = " & Err.Number & vbCrLf _
& "Err.Description = " & Err.Description & vbCrLf _
& "Err.Source = " & Err.Source & vbCrLf
End Sub