AnsweredAssumed Answered

how to apply point type validation in ace?

Question asked by vdhar1992 on May 6, 2015
Latest reply on May 22, 2015 by aseck


I am trying to validate the point type for a tag say a digital tag. The condition verifies the point type of the tag and if it is digital then it will execute the calculation and otherwise log an error message. I am running the below code while debugging and testing it is working fine and writing "Calc Failed" in the output tag as expected. But when I am scheduling the calculation it is showing the calculated value. Ideally it should write "Calc Failed" in the output tag.

 

Here is the code snippet:

 

 

Try

     

PreviousDaysValues_1 = Input_Tag.Values("y", "t", 0)

TempVar = Input_Tag.PointType

 

 

 

 

If Not (TempVar = 101) Then

  

LogPIACEMessage(mlErrors, " datatype is not appropriate for the input tag of:" & Output_Tag.Tag, MyBase.Name)

Output_Tag.Value = "Calc Failed"

  

 

Else

  

 

'Checking for the No. Of Values in input tag for the previous day

  

 

If (PreviousDaysValues_1.Count = 0) Then

  

LogPIACEMessage(mlErrors, "No previous day values present in the tag:" & Input_Tag.Tag, MyBase.Name)

Output_Tag.Value = "No data"

  

 

Else

  

Output_Tag.Value = Input_Tag.TimeNE(Today.AddDays(-1), Today, "SYSOK")

 

End If

  

 

End If

     

 

Catch ex As Exception

LogPIACEMessage(mlErrors, " Calculation failed for the tag:" & Output_Tag.Tag, MyBase.Name)

 

End Try

Outcomes