xoLogger

<< Click to Display Table of Contents >>

 

xoLogger

This object holds all event notifications occurring on the other PlantModel Library objects, for recording purposes. This object must be unique and instantiated as "LogSvc" in a Data Folder called "Logger", that is, "Logger.LogSvc". The only property of this object is dicProps, a dictionary in which each element is an array with a variable number of elements, according to the type of object, as described next.

•For an xfCommandUnit-type object, this array must have 8 (eight) elements:

•Array(0): "xfCommandUnit"

•Array(1): Content of the PathName property

•Array(2): Returned value of the Application.E3GetActor method

•Array(3): Content of the LastCommandResult property

•Array(4): Name of the computer

•Array(5): Content of the WriteValue property

•Array(6): Content of the TimeStamp property

•Array(7): Content of the UserComment property

 

•For an xfDiscreteInfo-type object, this array must have 7 (seven) elements:

•Array(0): "xfDiscreteInfo"

•Array(1): Content of the PathName property

•Array(2): Content of the MultiState property

•Array(3): Content of the Value property

•Array(4): Content of the ValueCaption property

•Array(5): Content of the Caption property

•Array(6): Content of the TimeStamp property

 

•For an xfInterlockUnit-type object, this array must have 5 (five) elements:

•Array(0): "xfInterlockUnit"

•Array(1): Content of the PathName property

•Array(2): Content of the Value property

•Array(3): Content of the RTExpression property

•Array(4): Content of the Timestamp property

 

•For an xfParameter-type object, this array must have 8 (eight) elements:

•Array(0): "xfParameter"

•Array(1): Content of the PathName property

•Array(2): Returned value of the Application.E3GetActor method

•Array(3): Command result (0: OK, 1: Failure, 2: Command not authorized, or 3: Interlocked)

•Array(4): Name of the computer

•Array(5): Content of the TimeStamp property

•Array(6): Content of the Value property

•Array(7): Content of the NewValueRequest property

 

A timed script must be created, such as every 10 seconds, that removes the events added to the dicProps property, according to the next example.

Set dic = dicProps
For i = 1 to dic.Count
  Entry = dic.Item(i)
  strEvent = ""
  For j = 0 To UBound(Entry) - 1
    strEvent = strEvent & ";" & Entry(j)
  Next
  Call Application.TrackEvent("PlantModel:", strEvent)
Next
Call dic.RemoveAll()
dicProps = dic

 

In this example, the TrackEvent method of the Application object was used to remove the events, but users can also use the LogTrackingEvent method of the Alarm Server.

Was this page useful?