Menu Tools --> References
Function LeValor(NomeDoTag As String) As String
Dim tag As PIPoint
Dim srv As Server
'Dim Valor As PIValues
Dim Valor As Variant
Dim timestamp As Variant
Set srv = Servers("TADCIPI01")
Set tag = srv.PIPoints(NomeDoTag)
Valor = tag.Data.Snapshot.Value
'Set Valor = Tag.Data.Snapshot.Value
If Valor <> "Bad" Then
LeDado = Valor
Else
LeDado = "-1"
End If
End Function
Dim tag As PIPoint
Dim srv As Server
'Dim Valor As PIValues
Dim Valor As Variant
Dim timestamp As Variant
Set srv = Servers("TADCIPI01")
Set tag = srv.PIPoints(NomeDoTag)
Valor = tag.Data.Snapshot.Value
'Set Valor = Tag.Data.Snapshot.Value
If Valor <> "Bad" Then
LeDado = Valor
Else
LeDado = "-1"
End If
End Function
Nenhum comentário:
Postar um comentário