![]() |
ALPHA-VISION® Functions: aci.AddEventlogEntry |
| 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. |
| boolean | false | Determines whether this entry shall be printed |
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