aci.AddEventlogEntry

SUMMARY

Add an arbitrary entry to the ALPHA-VISION® event log

SYNTAX

aci.AddEventlogEntry((<object number>|<point id>), <entry>)

ARGUMENTS

object number (type:number)
The data object that is written as the key to the event log. May be zero if the entry does not refer to a data object.
point id (type:string)
The data object that is written as the key to the event log. May be zero if the entry does not refer to a data object.
entry (type:table)
The data to be written to the event log. Specified as a table with the following keys:
Key Type Default Description
Type number 100 An arbitrary number >=100 to identify the type of eventlog entry. Numbers <100 are used by the ALPHA-VISION®-system. May be used in figure condition tables to display a figure corresponding to your user defined eventlog entries.
NewValue number 0.0 The new value of the data object.
You may write any number to this field and display it in any form to the user in your eventlog figure.
OldValue number 0.0 The old value of the data object (before the event).
You may write any number to this field and display it in any form to the user in your eventlog figure.
NewLevel number (0-65535) 0 The new alarm level (combined with the unacknowledged flag) of the data object.
You may write any number to this field and display it in any form to the user in your eventlog figure.
NewState number (0-65535) 0 The new status of the data object.
You may write any number to this field and display it in any form to the user in your eventlog figure.
OldLevel number (0-65535) 0 The old alarm level (before the event) (combined with the unacknowledged flag) of the data object.
You may write any number to this field and display it in any form to the user in your eventlog figure.
OldState number (0-65535) 0 The old status of the data object (before the event).
You may write any number to this field and display it in any form to the user in your eventlog figure.
LT number current local time local time
TimeLevel number 0 Counts the changes to the system time. Currently not in use
UTC number current universal time universal time
TimeStamp number 0 Currently not in use
UserId number 0 The user that caused the event.
Print boolean false Determines whether this entry shall be printed
Note:
The keys have the same name as the corresponding columns in _EVENTLOG.DBF.

EXAMPLES

Write a new entry if the difference between the last and actual value of a data object is greater tha a predefined delta.

		act = aci.Obj_Value(objnum)
		if (math.abs(last - act) > delta) then
			local lvl = aci.Obj_QueryAttr(objnum, DOATTR.AlarmAct);
			local sts = aci.Obj_Sts(objnum);  		
			aci.AddEventlogEntry(objnum, {
				Type=101,
				OldState = sts,
				NewState = sts,
				OldLevel = lvl,
				NewLevel = lvl,
				OldValue = last,
				NewValue = act,
				}	)
			print("Added to event log: obj=", aci.Obj_QueryAttr(objnum, DOATTR.PointId), "old=", last, "new=", act)
			last = act
		end
		


Syntax Notation
[aaa]
aaa is optional (zero or one occurences)
(aaa|bbb)
aaa exclusive or bbb
(aaa)*
aaa may occur indefinitely often or may be omitted
(aaa)+
aaa may occur indefinitely often but at least once
(aaa)m..n
aaa may occur from m to n times