LogObjectsBase (FB) ¶ FUNCTION_BLOCK ABSTRACT LogObjectsBase EXTENDS BACnet.BACnetServerPluginBase Base class for logging objects default implementions (Trend_Log, Trend_Log_Multiple, Event_Log). It tries to provide a feature complete implementation for logging objects with a reasonable simple implementation. Assumptions / provisions of LogObjectBase and derived: A.) All log data are stored in the file system, one file per object. If large data volumes should be used (Buffer_Size) a high performance file system is recommended. B.) no sophisticated Sequence / Total_Record_Count overflow handling needed - they simply overflow / wrap around If those assumptions / provisions are not valid for your use case, a more sophisticated implementation is needed, for example based on database, in-memory-database etc. BACstack log data are delivered as either IEC_BACNET_LOG_RECORD, IEC_BACNET_LOG_RECORD_MULTIPLE, or IEC_BACNET_EVENT_LOG_RECORD packed in a IEC_BACNET_PROPERTY_CONTENTS and are stored binary as is in one file per logging object. Such a log file contains: 1.) file header 2.) 0..numRecords-1 log records A log record in such a file consists of: 1.) log record header sequence : IEC_BACNET_UNSIGNED time stamp : IEC_BACNET_DATE_TIME 2.) log record data as C-structure 3.) actual number of records in file : IEC_BACNET_UNSIGNED Reasons to do so: - SysFile write operations in append mode doesnt allow writing at file pos <> end for some platforms - reading the last record should be efficient (rewind from file end), for example to get last sequence number If the number of records is supposed to be limited practically (Buffer_Size), then purge operations of the data files are needed (to get rid of old records). Those purge operations are done implicitely in the implementation. A purge operation basically copies the records - except the purged record(s) - to a temporary file, deletes the data file, copy/move the data file to the data file. For those purge operations it might be useful to choose a TempPath on a high speed file system (RAM file system). If TempPath <> PersistentPath the temporary file will be copied to the data file and deleted afterwards, otherwise the temporary file will be renamed to the data file. The purge operations involve a significant performance degradation. In general this should not be an issue, because BACnet logging objects are designed to inform a BACnet management device (OWS/AWS) about “log buffer mostly full” via Notification_Threshold and notifications. The BACnet management device should read and clear the log buffer to avoid “log buffer full” situations which will cause loss of logging data anyway. Properties: HardShutdown MaxDataSize ObjectType PersistentPath ServerDeviceId TempPath Methods: FreeReadRangeResult GetBufferSize GetRecordsByPosition GetRecordsBySequence GetRecordsByTime GetStopWhenFull Init PostStopBACnetStack ReadRangeResultSetInfo ScanObjectsAndSetCallbackAttachments SetCallbackAttachments SetReadCallbackAttachment SetWriteCallbackAttachment UpdateObjectPropertiesFromDataFile ComputeRecordSize CreateDataFiles DataFileName ListDataFiles LogDataFile LogFilePos LogFileSize LogFileSizeAndPos LogObjectAddrString LogObjectPropertyAddrString LogReadRangeResult LogRecord LogRecordContentInfo ObjectId PurgeDataFile ReadNumberOfRecordsAndLastSequenceFromDataFile ReadNumberOfRecordsFromDataFile ReadRangeErrorCompletion ReadRangeInfoToString RemoveDataFiles RemoveUnusedDataFiles ResetDataFile WriteRecordContentToDataFile Structure: BACnetEventCallback ReadRangeErrorCompletion (Method) Files DataFiles CreateDataFiles (Method) DataFileName (Method) ListDataFiles (Method) PurgeDataFile (Method) ReadNumberOfRecordsAndLastSequenceFromDataFile (Method) ReadNumberOfRecordsFromDataFile (Method) RemoveDataFiles (Method) RemoveUnusedDataFiles (Method) ResetDataFile (Method) WriteRecordContentToDataFile (Method) base ComputeRecordSize (Method) FreeReadRangeResult (Method) GetBufferSize (Method) GetRecordsByPosition (Method) GetRecordsBySequence (Method) GetRecordsByTime (Method) GetStopWhenFull (Method) HardShutdown (Property) Init (Method) Logging LogDataFile (Method) LogFilePos (Method) LogFileSize (Method) LogFileSizeAndPos (Method) LogObjectAddrString (Method) LogObjectPropertyAddrString (Method) LogReadRangeResult (Method) LogRecord (Method) LogRecordContentInfo (Method) MaxDataSize (Property) ObjectHandling ObjectId (Method) ObjectType (Property) PersistentPath (Property) PostStopBACnetStack (Method) ReadRangeResultSetInfo (Method) ScanObjectsAndSetCallbackAttachments (Method) ServerDeviceId (Property) SetCallbackAttachments (Method) SetReadCallbackAttachment (Method) SetWriteCallbackAttachment (Method) TempPath (Property) ToString ReadRangeInfoToString (Method) UpdateObjectPropertiesFromDataFile (Method)
BACnetEventCallback ¶ ReadRangeErrorCompletion (Method)
IBase.FB_Init (METH) ¶ METHOD FB_Init : BOOL InOut: Scope Name Type Return FB_Init BOOL Input bInitRetains BOOL bInCopyCode BOOL
IBase.FB_Reinit (METH) ¶ METHOD FB_Reinit : BOOL InOut: Scope Name Type Return FB_Reinit BOOL
IBase.QueryInterface (METH) ¶ METHOD QueryInterface : POINTER TO POINTER TO BYTE InOut: Scope Name Type Comment Return QueryInterface POINTER TO POINTER TO BYTE Input iid DWORD InterfaceID pResult POINTER TO UDINT
IBase.Release (METH) ¶ METHOD Release : DINT InOut: Scope Name Type Return Release DINT
InterfaceIds (GVL) ¶ InOut: Scope Name Type Initial Constant ITFID_IBase DWORD 16#0 ITFID_ICmpStartOEM DWORD 16#2000 ITFID_ICmpEndOEM DWORD 16#3FFF
TypeClass (ENUM) ¶ TYPE TypeClass : InOut: Name Initial Comment TYPE_BOOL 0 TYPE_BIT 1 TYPE_BYTE 2 TYPE_WORD 3 TYPE_DWORD 4 TYPE_LWORD 5 TYPE_SINT 6 TYPE_INT 7 TYPE_DINT 8 TYPE_LINT 9 TYPE_USINT 10 TYPE_UINT 11 TYPE_UDINT 12 TYPE_ULINT 13 TYPE_REAL 14 TYPE_LREAL 15 TYPE_STRING 16 TYPE_WSTRING 17 TYPE_TIME 18 TYPE_DATE 19 TYPE_DATEANDTIME 20 TYPE_TIMEOFDAY 21 TYPE_POINTER 22 TYPE_REFERENCE 23 TYPE_SUBRANGE 24 TYPE_ENUM 25 TYPE_ARRAY 26 TYPE_PARAMS 27 TYPE_USERDEF 28 TYPE_NONE 29 TYPE_ANY 30 TYPE_ANYBIT 31 TYPE_ANYDATE 32 TYPE_ANYINT 33 TYPE_ANYNUM 34 TYPE_ANYREAL 35 TYPE_LAZY 36 TYPE_LTIME 37 TYPE_BITCONST 38 TYPE_UXINT 39 TYPE_XWORD 40 TYPE_XINT 41 TYPE_XSRTING 42 TYPE_VARLENARRAY 43 TYPE_ANYSTRING 44 TYPE_VECTOR 45 TYPE_LDATE 46 TYPE_LDATEANDTIME 47 TYPE_LTIMEOFDAY 48 TYPE_INTERFACE 16#F000 Only for backward compatibility. Is not supported by CoDeSys. In version 3.1.1.1 there was this member so we include this value for compatibility. The integer-value is not correct! Must not be used
File and Project Information ¶ Scope Name Type Content FileHeader creationDateTime date 20.04.2021, 14:48:13 companyName string 3S-Smart Software Solutions GmbH libraryFile Base_Itfs.library primaryProject True productName CODESYS productProfile CODESYS V3.5 SP16 Patch 3 contentFile Base_Itfs.clean.json version version 2.0.0.0 ProjectInformation IsInterfaceLibrary bool True Released True LastModificationDateTime date 20.04.2021, 14:48:13 LibraryCategories library-category-list Intern|IoDriverBase Author string 3S - Smart Software Solutions GmbH Company System CompiledLibraryCompatibilityVersion CODESYS V3.5 SP16 DefaultNamespace IBaseLibrary Description See: Description Project Base_Itfs Title Base Interfaces Version version 3.5.17.0
Library Reference ¶ This is a dictionary of all referenced libraries and their name spaces.