LimitDeviceObjectPropertyReferencesToCertainTypes (FB) ¶ FUNCTION_BLOCK LimitDeviceObjectPropertyReferencesToCertainTypes EXTENDS BACnet.BACnetServerPluginBase IMPLEMENTS BACnet.IBACnetEventConsumer Default implementation to limit properties of type CmpBACnet.IEC_BACNET_DATA_TYPE.DATA_TYPE_DEV_OBJ_PROP_REFERENCE to refer to properties of selected value types (BOOLEAN, UNSIGNED, SIGNED, REAL, ENUMERATED, BIT_STRING) only. This default implementation registers a write callback and rejects property write requests with inappropriate value types. BACnetServer.RWPropCBComplete needs to be 0 to ensure the write callback gets called prior modification (not after - RWPropCBComplete = 1). In case BACnetServer.RWPropCBComplete = 1 this default implementation rejects to register itself. LimitDeviceObjectPropertyReferencesToCertainTypes also checks client created objects for the same rules. This requires to be informed about client create object requests processed already, so LimitDeviceObjectPropertyReferencesToCertainTypes registers a (client) create object service application hook to watch client create object requests processed already from another BACnetServer-plugin (eventually). To ensure this technique can work you have to register LimitDeviceObjectPropertyReferencesToCertainTypes after the BACnetServer-plugin taking care for client create object requests (lets call it the “object producer” - see ClientCreatableObjects) and to ensure LimitDeviceObjectPropertyReferencesToCertainTypes.BACnetEventCallback gets called (see ClientCreatableObjects.BlockFurtherProcessing:=FALSE) because the the “object producer” doesn’t block processing further down the line (eventually setting it’s return value of BACnetEventCallback to TRUE). Actual limitation: works for Trend_Log object, not for Trend_Log_Multiple yet, because Trend_Log_Multiple.Log_DeviceObjectProperty is BACnetARRAY[N] of BACnetDeviceObjectPropertyReference. Properties: Name NumCallbacks NumHooks Methods: BACnetEventCallback GetCallback GetHook Init PostStartBACnetStack PreRegister Structure: BACnetEventCallback (Method) GetCallback (Method) GetHook (Method) Init (Method) Name (Property) NumCallbacks (Property) NumHooks (Property) PostStartBACnetStack (Method) PreRegister (Method)
LimitDeviceObjectPropertyReferencesToCertainTypes.BACnetEventCallback (METH) ¶ METHOD BACnetEventCallback : BOOL Callback callback for IEC_BACNET_CALLBACK_TYPE.BACNET_CALLBACK_WRITE InOut: Scope Name Type Comment Return BACnetEventCallback BOOL Input EventId DWORD If only one event is possibly called, the following Ids can be ignored. If there are more at least the EventId should be checked, to get the right type of pParameter. ID of the occured Event. Contains the class and the event (see CmpBACnet.EVENTIDS) usParamId WORD Id of the parameter structure (see pParameter and CmpBACnet.EVENTIDS) usVersion WORD Version of the parameter structure (see pParameter and CmpBACnet.EVENTIDS) pParameter POINTER TO BYTE Pointer to the event specific parameter, that is specified by Id (see CmpBACnet.EVENTIDS and CmpBACnet, i.e. EVT_BACNET_ACKALARM)
LimitDeviceObjectPropertyReferencesToCertainTypes.GetCallback (METH) ¶ METHOD GetCallback : BACnet.IBACnetServerPluginCallback InOut: Scope Name Type Return GetCallback BACnet.IBACnetServerPluginCallback Input index UINT
LimitDeviceObjectPropertyReferencesToCertainTypes.GetHook (METH) ¶ METHOD GetHook : BACnet.IBACnetServerPluginHook InOut: Scope Name Type Return GetHook BACnet.IBACnetServerPluginHook Input index UINT
LimitDeviceObjectPropertyReferencesToCertainTypes.Init (METH) ¶ METHOD Init
LimitDeviceObjectPropertyReferencesToCertainTypes.Name (PROP) ¶ PROPERTY Name : STRING
LimitDeviceObjectPropertyReferencesToCertainTypes.NumCallbacks (PROP) ¶ PROPERTY NumCallbacks : UINT
PropertyConfigurationMostlyAllWritable.GetPropertyAttributes (METH) ¶ METHOD GetPropertyAttributes : BOOL InOut: Scope Name Type Return GetPropertyAttributes BOOL Input objID CmpBACnet.IEC_BACNET_OBJECT_ID propID CmpBACnet.IEC_BACNET_PROPERTY_ID Output propAttr BACnet.BACnetPropertyAttributes
PropertyConfigurationMostlyAllWritable.Name (PROP) ¶ PROPERTY Name : STRING
ReinitDevice_SvcAppHook (FB) ¶ FUNCTION_BLOCK ReinitDevice_SvcAppHook EXTENDS BACnet.BACnetServerPluginBase IMPLEMENTS BACnet.IBACnetEventConsumer Default implementation for ReinitializeDevice service application hook This default implementation is supposed to be used as an example. If password check is passed it set DeviceObject.LastRestartReason and DeviceObject.TimeOfDeviceRestart. It doesnt stop/start the application nor the whole PLC, because this is not appropriate for all use cases. Properties: Name NumHooks Password TimeZone UpdateTimeZoneFromSystem Methods: BACnetEventCallback GetHook GetTimeZoneFromSystem Init Structure: BACnetEventCallback (Method) GetHook (Method) GetTimeZoneFromSystem (Method) Init (Method) Name (Property) NumHooks (Property) Password (Property) TimeZone (Property) UpdateTimeZoneFromSystem (Property)