Bom dia,
estou com uma dificuldade onde algumas variáveis de alguns equipamentos não atualizam o valor em tempo de execução, e como possuo muitos equipamentos para não perder performance pensei em alterar o adviseType dentro da rotina, como no exemplo do código abaixo.
Case 30 ’ COMANDANDO E AGUARDANDO CONFIRMAÇÃO DE DESLIGAMENTO
fullTagCmd_stop = “Comunicacao.PLCABB.” & grp_stop & “.[.” & tagCmd_stop & “]”
fullTagSt_stop = “Comunicacao.PLCABB.” & grp_stop & “.[.” & tagSt_stop & “]”
'altera AdviseType
Application.GetObject(fullTagSt_stop).AdviseType = 0
Application.GetObject(fullTagCmd_stop).AdviseType = 0
IF timestamp_stop.Value = 0 THEN
mensagem_stop.Value = "Desligando " & equip_stop & "..."
Application.GetObject(fullTagCmd_stop).Value = False
timestamp_stop.Value = Timer
status_debug_stop.Value = True ' Reseta flag de debug
END IF
msg_debug_stop.Value = fullTagCmd_stop & " - " & Application.GetObject(fullTagCmd_stop).Value
msg_debug1_stop.Value = fullTagSt_stop & " - " & Application.GetObject(fullTagSt_stop).Value
IF Application.GetObject(fullTagSt_stop).Value = false THEN
timestamp_stop.Value = 0
Dim proximoPasso_stop
proximoPasso_stop = CInt(passoAtual_stop.Value) + 1
IF proximoPasso_stop >= rs.RecordCount THEN
diCase_stop.Value = 100
ELSE
passoAtual_stop.Value = proximoPasso_stop
diCase_stop.Value = 10
END IF
'altera AdviseType
Application.GetObject(fullTagSt_stop).AdviseType = 1
Application.GetObject(fullTagCmd_stop).AdviseType = 1
ELSE
IF (Timer - timestamp_stop.Value) >= tout_stop THEN
mensagem_stop.Value = "ERRO: Timeout ao desligar " & equip_stop
tagErro_stop.Value = True
diCase_stop.Value = 99
END IF
'altera AdviseType
Application.GetObject(fullTagSt_stop).AdviseType = 1
Application.GetObject(fullTagCmd_stop).AdviseType = 1
END IF
desta forma funcionaria?