AnsweredAssumed Answered

PI ACE Programs Check for AF Connection

Question asked by vsinyuk on Mar 4, 2016
Latest reply on Mar 4, 2016 by bshang

 

Hello,

When writing PI ACE programs, is there a way to check for an AF connection after a certain period of time to make there is still a connection and to reconnect if there is no connection? Here is an   example when it initially connects to the AF Server and database. Any suggestions would be super helpful. Thank you!

 

Overrides Sub ModuleDependentInitialization()

 

' this is the configuration module


Dim myModule As PISDK.PIModule

 

Try


' Connecting to the PI System


Dim ppAFServer As PISDK.PIProperty

 

"AFServer")

 

New OSIsoft.AF.PISystems().Item(ppAFServer.Value)

 

' Connecting to the AF database        


Dim ppAFDatabase As PISDK.PIProperty

 

"AFDatabase")

 

' Starting from the root element        


"GasMeasurement\" + myModule.Name

 

' Get other important PI Module Properties


"NonFlowingRunTempDeviationTolerance").Value

 

"FlowingRunTempDeviationTolerance").Value

 

"RunFlowDeviationTolerance").Value

 

"FlowingRunPressureDeviationTolerance").Value

 

"NonFlowingRunPressureDeviationTolerance").Value

 

Catch ex As Exception

 

"ACECalc MeasurementHealth.ModuleDependentInitialization(): " & ex.ToString(), MyBase.Name)

 

End Try


End Sub

 

Outcomes