GetLatchVarColumnID (FUN) ¶ FUNCTION GetLatchVarColumnID : CAA.IDENT Calculates the column ID used to access a latch variable stored in the alarm storage. InOut: Scope Name Type Comment Return GetLatchVarColumnID CAA.IDENT The column ID Input usiWhichLatchVar USINT The 1-based index of the latch variable. xTypeColumn BOOL If TRUE : The column ID of the type column will be returned. If FALSE : The column ID of the value column will be returned.
AlarmStorageReader.prvReadLatchVarString2 (METH) ¶ METHOD prvReadLatchVarString2 : STO.ERROR This method reads for a string latch variable the stored variable value from the table TblLatchVarStrings. InOut: Scope Name Type Comment Return prvReadLatchVarString2 STO.ERROR A return value indicating, whether the processing was successful or not. Input liRowID LINT The row id used to read the string from the table TblLatchVarStrings. itfDatabaseAccess IDatabaseAccess The instance of IDatabaseAccess, that is used to access the database byLatchVarType BYTE The type of the latch variable pbVarValue POINTER TO BYTE Where to write value in case of STRING/WSTRING iSzVarValue INT
AlarmStorageReader.prvTblAlarmFindTimestamp (METH) ¶ METHOD prvTblAlarmFindTimestamp : STO.ERROR Searches a row in the table TbAlarm, that matches a given timestamp best. This method must not be called if the database table is empty. InOut: Scope Name Type Comment Return prvTblAlarmFindTimestamp STO.ERROR Input itfDatabaseAccess IDatabaseAccess The instance of IDatabaseAccess, that is used to access the database liTimstamp LINT The absolute timestamp to search for xUseNextRow BOOL This parameter indicates, which row has to be considered if the timestamp cannot be found exactly. Either the next row (TRUE) or the previous row (FALSE) Output idRowTimstamp CAA.IDENT Returns the row ID of the row corresponding to the given timestamp
AlarmStorageReaderGlobals (GVL) ¶ This GVL contains global configuration values of the alarm storage api. Attributes: qualified_only InOut: Name Type Initial Comment g_iMaxCountRowsToRead INT 1000 The maximum number of rows, that a single read request can read. The limit of 1000 records per single read call is good value, because normally not too many alarms are written to the storage resp. read from the alarm table. For slower hardware this value has to be decreased accordingly.
AlarmStorageRow (FB) ¶ FUNCTION_BLOCK AlarmStorageRow This function block contains the data, that will be written into the alarm storage. InOut: Scope Name Type Initial Comment Input udiAlarmID UDINT The internal IDs of the alarm, the alarm class and the alarm group udiAlarmClassID UDINT udiAlarmGroupID UDINT liTimestapLast TIMESTAMP The several timestamps of the alarm liTimestapActive TIMESTAMP liTimestapInactive TIMESTAMP liTimestapAcknowledge TIMESTAMP iOffsetLast INT -1 The several offsets of the alarm iOffsetActive INT -1 iOffsetInactive INT -1 iOffsetAcknowledge INT -1 usiPriority USINT The priority of the alarm class the alarm belongs to eState AlarmState The current state of the alarm ePrevState AlarmState The previous state of the alarm byTriggerValueType BYTE The several values attached to the alarm. For each value we store the type class value as BYTE and an 8 byte value representing the value. liTriggerValueVal LINT pLatchVariables POINTER TO ARRAY [0..10] OF LatchVariable Will be set by the code generation and contains the memory, where the latch variables can be stored (the size 0..10 is only for debug reasons) usiCountLatchVariables USINT itfAlarm IAlarm The IAlarm instance, where the data of this structure comes from idRow CAA.IDENT The row ID of the alarm in the alarm storage, or the original row id for remote alarm xIdRowValid BOOL xForceUpdate BOOL If the above row id is valid, used only in distributed alarm handling Indicating whether the row should only be updated sRemoteDeviceName STRING The name of the remote device in case of remote alarm cmtActive AlarmComment Alarm comments including user ids cmtActiveAck AlarmComment cmtWaitingConf AlarmComment cmtNormal AlarmComment Methods: GetLatchVarValue ResetAlarmComments SetLatchVarValue Structure: GetLatchVarValue (Method) ResetAlarmComments (Method) SetLatchVarValue (Method)
AlarmStorageReader.FB_Init (METH) ¶ METHOD FB_Init : BOOL FB_Init method used for initializing the semaphore to access the usage of THIS instance InOut: Scope Name Type Return FB_Init BOOL Input bInitRetains BOOL bInCopyCode BOOL
AlarmStorageReader.GetFirstLastRowID (METH) ¶ METHOD GetFirstLastRowID : EAlarmStorageReaderErrors This method determines first and last row IDs in the alarm storage. InOut: Scope Name Type Comment Return GetFirstLastRowID EAlarmStorageReaderErrors An EAlarmStorageReaderErrors indicating, whether the processing was successful or not Output diRowIDFirst DINT First row ID diRowIDLast DINT Last row ID
AlarmStorageReader.GetMinMaxTimestamps (METH) ¶ METHOD GetMinMaxTimestamps : EAlarmStorageReaderErrors This method determines minimum and maximum timestamp stored in the alarm storage. InOut: Scope Name Type Comment Return GetMinMaxTimestamps EAlarmStorageReaderErrors An EAlarmStorageReaderErrors indicating, whether the processing was successful or not Output liMinTimestamp LINT Returns minimum timestamp liMaxTimestamp LINT Returns maximum timestamp xTableIsEmpty BOOL Indicates, whether the database table is empty. The output parameter liMinTimestamp and and liMaxTimestamp contain valid values only if this output parameter is FALSE. udiCountAlarms UDINT The number of alarms, that are stored in the alarm storage for the given timestamp
AlarmStorageReader.Read (METH) ¶ METHOD Read : EAlarmStorageReaderErrors Reads data from the alarm storage. InOut: Scope Name Type Comment Return Read EAlarmStorageReaderErrors A EAlarmStorageReaderErrors value indicating, whether the processing has been completed successfully or not: EAlarmStorageReaderErrors.NoError: Completed successfully EAlarmStorageReaderErrors.WrongParameter: If the IAlarmStorageReaderConsumer instance is invalid EAlarmStorageReaderErrors.AdditionalReadCallRequired: Reading has been completed successfully, but there is additional call of method ContinueReading necessary to read the rest of the data Input liTimstampFrom LINT The timestamp (when the alarm became active) of the 1st alarm liTimstampTo LINT The timestamp of the last alarm xReadAscending BOOL If this parameter is TRUE, then the rows will be returned by “timestamp active” ascending, otherwise descending itfAlarmStorageReaderConsumer IAlarmStorageReaderConsumer An instance of IAlarmStorageReaderConsumer, to which the data read from the alarm storage will be passed.
AlarmStorageReader.RemoveAlarmStorageListener (METH) ¶ METHOD RemoveAlarmStorageListener : EAlarmStorageReaderErrors Removes an IAlarmStorageListener instance. InOut: Scope Name Type Comment Return RemoveAlarmStorageListener EAlarmStorageReaderErrors A EAlarmStorageReaderErrors value indicating, whether the processing has been completed successfully or not: EAlarmStorageReaderErrors.NoError: Completed successfully EAlarmStorageReaderErrors.WrongParameter: If the IAlarmStorageListener instance is invalid EAlarmStorageReaderErrors.NoObject: If the IAlarmStorageListener instance cannot be removed, because was not found, i.e. has not been added with method AddAlarmStorageListener EAlarmStorageReaderErrors.InvalidCall: If there is no alarm storage is available, where the IAlarmStorageListener instance can be unregistered Input itfAlarmStorageListener IAlarmStorageListener An instance of IAlarmStorageListener to unregister