BACnetDateTime (STRUCT) ¶ TYPE BACnetDateTime : STRUCT Helper Structure for CODESYS-typed date times to work with BACnet properties of BACnet standard type “BACnetDateTime” represented by CmpBACnet.IEC_BACNET_DATE_TIME. Please note: CmpBACnet.IEC_BACNET_DATE_TIME allows “unspecified” elements, but BACnetDateTime does not for historic reason. CmpBACnet.IEC_BACNET_DATE_TIME allows “unspecified” elements which are used for two different objectives. 1.) eventually “fully unspecified”: properties representing a time stamp or a time range start / end, for example BinaryInput.Change_Of_State_Time or TrendLog.Start_Time / .Stop_Time 2.) eventually “partially unspecified”: Schedule.Exception_Schedule The BACnet standard uses the terms “fully unspecified” or “fully specified”, but not the term “partially unspecified” (instead a bit more unspecific “unspecified”). “fully unspecified”: In most cases a time stamp indicates the time of a change of object state. Prior to first change of object state the time stamp is supposed to be “unspecified”. For an example see File.Modification_Date or PulseConverter.Update_Time Another use case of “fully unspecified” is a time range - see TrendLog.Start_Time and .Stop_Time or Schedule. “partially unspecified” is mainly used in Schedule.Exception_Schedule BACnetDateTime has been used in earlier versions of CODESYS BACnet as an API type instead of CmpBACnet.IEC_BACNET_DATE_TIME for convenience. So an interface breaking change would have been necessary to switch to CmpBACnet.IEC_BACNET_DATE_TIME to allow “unspecified” directly. We found this too hard of a measure, so we kept BACnetDateTime as an API type and added some assumptions and helper functions. Assumption: a BACnetDateTime dat = D#1970-1-1 AND tim = T#0S (begin of universe) or dat = D#2106-2-7 AND tim = T#23H59M59S999MS (end of universe) is assumed to be “fully unspecified”. Helper functions: IsBACnetBACnetDateTimeUnspecified to check if a BACnetDateTime is “fully unspecified”. IsBACnetDateTimeUnspecified to check if a CmpBACnet.IEC_BACNET_DATE_TIME is “fully unspecified”. InitializeBACnetDateTimeUnspecified to initialize a CmpBACnet.IEC_BACNET_DATE_TIME to “fully unspecified”. BACnetObjectBase.SetBACnetDateTimePropertyToUnspecified to initialize a property to “fully unspecified”. InOut: Name Type dat DATE tim TIME
BACnetDevObjPropReference (STRUCT) ¶ TYPE BACnetDevObjPropReference : STRUCT Helper Structure for CODESYS-Typed device object property references. InOut: Name Type objectID CmpBACnet.IEC_BACNET_OBJECT_ID propID CmpBACnet.IEC_BACNET_PROPERTY_ID index CmpBACnet.IEC_BACNET_SIGNED fDevicePresent BOOL deviceInstNumber CmpBACnet.IEC_BACNET_DWORD
BBMD_Info (STRUCT) ¶ TYPE BBMD_Info : STRUCT BBMD BDT entry InOut: Name Type Initial addr ARRAY [0..3] OF BYTE [0, 0, 0, 0] port WORD 47808
Utilities ¶ Utility functionalities for dealing with the BACnet object, their properties and some general issues like string conversion to different string representations. BACnetUtilities BACnetDateTimeCmp (Function) BACnetProperties GetBACnetDataTypeSize (Function) GetBACnetPropertyDataType (Function) InitializeEmptyPropertyInstance (Function) InitializePropertyInstance (Function) IsBACnetObjectAMEVCreatable (Function) IsBACnetPropertyAMEVASBWritable (Function) SetPropertyAgain (Function) FromBACnetContents GetBitStringFromContents (Function) GetBoolFromContents (Function) GetDateFromContents (Function) GetDateRangeFromContents (Function) GetDateTimeFromContents (Function) GetDevObjPropReferenceFromContents (Function) GetLrealFromContents (Function) GetObjectIDFromContents (Function) GetRealFromContents (Function) GetSetpointReferenceFromContents (Function) GetSignedFromContents (Function) GetTimeFromContents (Function) GetUnsignedFromContents (Function) GetWStringFromContents (Function) FromBACnetDataTypes FromBACnetBitString (Function) FromBACnetBoolean (Function) FromBACnetDate (Function) FromBACnetDateRange (Function) FromBACnetDateTime (Function) FromBACnetDevObjPropReference (Function) FromBACnetSetpointReference (Function) FromBACnetString (Function) FromBACnetTime (Function) FromBACnetTimeStamp (Function) IsBACnetBACnetDateTimeUnspecified (Function) IsBACnetDateTimeUnspecified (Function) InitializeBACnetDataTypes BitStrings BACnetBitStringGetBit (Function) BACnetBitStringSetBit (Function) InitializeBACnetBitString (Function) InitializeBACnetBoolean (Function) InitializeBACnetDate (Function) InitializeBACnetDateRange (Function) InitializeBACnetDateTime (Function) InitializeBACnetDateTimeUnspecified (Function) InitializeBACnetDevObjPropReference (Function) InitializeBACnetSetpointReference (Function) InitializeBACnetString (Function) InitializeBACnetTime (Function) InitializeBACnetTimeStamp (Function) IOUtilities Mem DeallocStackAllocatedContentBuffer (Function) FreeStackAllocatedMemory (Function) RegisterEventUtilities StringConversions BufferToString (Function) ISO88591 UTF8 ToString BACnetDateTimeToString (Function) EventIdToString (Function) IEC_BACNET_ERROR_TO_STRING (Function) MemoryToString (Function) PropertyAddrString (Function) PropertyAttributeExistenceString (Function) PropertyAttributePersistentString (Function) PropertyAttributeWritableString (Function) PropertyAttributesString (Function) PropertyIndexAddrString (Function)
BACnetUtilities ¶ Utilities for dealing with BACnet objects and their properties and BACnet data types. BACnetDateTimeCmp (Function) BACnetProperties GetBACnetDataTypeSize (Function) GetBACnetPropertyDataType (Function) InitializeEmptyPropertyInstance (Function) InitializePropertyInstance (Function) IsBACnetObjectAMEVCreatable (Function) IsBACnetPropertyAMEVASBWritable (Function) SetPropertyAgain (Function) FromBACnetContents GetBitStringFromContents (Function) GetBoolFromContents (Function) GetDateFromContents (Function) GetDateRangeFromContents (Function) GetDateTimeFromContents (Function) GetDevObjPropReferenceFromContents (Function) GetLrealFromContents (Function) GetObjectIDFromContents (Function) GetRealFromContents (Function) GetSetpointReferenceFromContents (Function) GetSignedFromContents (Function) GetTimeFromContents (Function) GetUnsignedFromContents (Function) GetWStringFromContents (Function) FromBACnetDataTypes FromBACnetBitString (Function) FromBACnetBoolean (Function) FromBACnetDate (Function) FromBACnetDateRange (Function) FromBACnetDateTime (Function) FromBACnetDevObjPropReference (Function) FromBACnetSetpointReference (Function) FromBACnetString (Function) FromBACnetTime (Function) FromBACnetTimeStamp (Function) IsBACnetBACnetDateTimeUnspecified (Function) IsBACnetDateTimeUnspecified (Function) InitializeBACnetDataTypes BitStrings BACnetBitStringGetBit (Function) BACnetBitStringSetBit (Function) InitializeBACnetBitString (Function) InitializeBACnetBoolean (Function) InitializeBACnetDate (Function) InitializeBACnetDateRange (Function) InitializeBACnetDateTime (Function) InitializeBACnetDateTimeUnspecified (Function) InitializeBACnetDevObjPropReference (Function) InitializeBACnetSetpointReference (Function) InitializeBACnetString (Function) InitializeBACnetTime (Function) InitializeBACnetTimeStamp (Function)
BACnetDateTimeCmp (FUN) ¶ FUNCTION BACnetDateTimeCmp : INT Compares two IEC_BACNET_DATE_TIME Return 0 -> dt1=dt2, -1 -> dt1<dt2, 1 -> dt1>dt2 InOut: Scope Name Type Return BACnetDateTimeCmp INT Inout dt1 CmpBACnet.IEC_BACNET_DATE_TIME dt2 CmpBACnet.IEC_BACNET_DATE_TIME
GetBACnetPropertyDataType (FUN) ¶ FUNCTION GetBACnetPropertyDataType : CmpBACnet.IEC_BACNET_DATA_TYPE Returns the BACnet-Data-Type for a specific BACnet-Object-Property. Note Data types may depend on the object type (i.e. the Present_Value of a Binary Value object is different to the Present_Value of a Analog Value object). InOut: Scope Name Type Comment Return GetBACnetPropertyDataType CmpBACnet.IEC_BACNET_DATA_TYPE Input objTyp CmpBACnet.IEC_BACNET_OBJECT_TYPE The object type having the desired property. propID CmpBACnet.IEC_BACNET_PROPERTY_ID The property ID of the property to determine its BACnet data type for.
InitializeEmptyPropertyInstance (FUN) ¶ FUNCTION InitializeEmptyPropertyInstance : BOOL Initializes a property (prop) with its (working) defaults (mostly empty) considering constant array sizes, lists and special property types. InOut: Scope Name Type Comment Return InitializeEmptyPropertyInstance BOOL Input objTyp CmpBACnet.IEC_BACNET_OBJECT_TYPE The object instance which has the desired property. accessID CmpBACnet.IEC_BACNET_ACCESS The access specifier used for initializing the property instance. propID CmpBACnet.IEC_BACNET_PROPERTY_ID The property ID of the property for which the instance data shall be initialized. Inout prop CmpBACnet.IEC_BACNET_PROPERTY_INSTANCE
InitializePropertyInstance (FUN) ¶ FUNCTION InitializePropertyInstance : BOOL Initializes a IEC_BACNET_PROPERTY_INSTANCE with the given parameters and data. InOut: Scope Name Type Comment Return InitializePropertyInstance BOOL Input ePropAccess CmpBACnet.IEC_BACNET_ACCESS The access specifier to use for initialization. ePropID CmpBACnet.IEC_BACNET_PROPERTY_ID The property ID to use for initialization. ePropDataType CmpBACnet.IEC_BACNET_DATA_TYPE The data type to use for initialization. uiNumOfElements UDINT The number of elements to use for initialization. uiDataSize UDINT The data size to use for initialization. pData POINTER TO BYTE The data to use for initialization. Inout propInst CmpBACnet.IEC_BACNET_PROPERTY_INSTANCE After a successfull call the initialized property instance data is written to thuis structure.
IsBACnetObjectAMEVCreatable (FUN) ¶ FUNCTION IsBACnetObjectAMEVCreatable : BOOL According to AMEV AS-B specifications return whether the given objer not. InOut: Scope Name Type Comment Return IsBACnetObjectAMEVCreatable BOOL Input objType CmpBACnet.IEC_BACNET_OBJECT_TYPE The object type to check for AMEV AS-B availability.