AnsweredAssumed Answered

Get previous value of TAG in PI ProcessBook

Question asked by matheusarruda on Aug 30, 2017
Latest reply on Aug 31, 2017 by gregor

Hello, how can I get the previous values from a TAG.

Example:

I have a TAG that counts from 1 to 10, at the moment this TAG is with the value of 8 and I want to get the previous value to 8 {In the case it would be 7}

Logic is the value of tag - 1.

I am trying to query with the code below.

 

Public Sub um_historico()

'Pego as um's anteriores ao processo

Dim srv As Server

Dim ptval As PIPoint

Dim vals As New PIValues, pival As PIValue

 

Set srv = Servers.DefaultServer

Set ptval = srv.PIPoints.Item("LTQ_SM_SSS_AGC_OPER_COIL_NUM")

Set pival = ptval.Data.ArcValue("", rtAtOrBefore)

txtHistorico1.Contents = pival.Clone

 

End Sub

Outcomes