BACnetServer (FB)¶
FUNCTION_BLOCK PUBLIC FINAL BACnetServer IMPLEMENTS IBACnetServerInternal, CmpEventMgr.ICmpEventCallback, IBACnetEventConsumer
FB representing the BACnet-Server, which is the core of any BACnet-Application. Each BACnet-Server gets assigned one BACnet-Device-Object, which is initialized together with the BACnet-Server (properties of the BACnet-Device-Object are part of the BACnet-Server-CODESYS-Device as parameters). All BACnet-Object (BACnet-Object-CODESYS-Devices) added as childs of a BACnet-Server are consequently under the corresponding BACnet-Device-Object. This BACnet-Server-FB is responsible for starting the BACnet-Server on the CODESYSControl-Component side (using CmpBACnet.BACnetServerInit), which eventually makes all BACnet-Objects under this BACnet-Server visible in the BACnet network. There are two options for starting/stopping the BACnetServer which could be configured. The first option “AutoStart=TRUE” starts the BACnetServer when the application owning the BACnetServer-FB is loaded. The second option “AutoStart=FALSE” allows programmatic start/stop of the BACnetServer, using BACnetServer.StartBACnetStack() / StopBACnetStack(). This option should be used, if object initialization data needs to be computed (not configured in the device tree), to ensure the BACnetServer is started with consistent object definitions. Apart from this the BACnet-Server-FB gives the functionality to register FBs implementing IBACnetEventConsumer for Hooks and Callbacks. Moreover some additional functionalities for specific services are provided.
To get an idea how to use most important BACnet server features and services please refer to several examples provided with(in) the CODESYS BACnet package.
BACnet_example.project - the basics including - server side / client side read / write property - notifications - calendar/scheduler - commandable objects (priority array) - client subscribe COV - client create / delete object - client UTC time sync
BACnet_DeviceDiscovery.project - how to do device discovery
BACnet_LoggingServer.project - how to use BACnetDefaultImpl to make Trend log work on your PLC BACnet_LimitBACnetDeviceObjectPropertyReference.project - how to ensure implementation limitations of BACnetDefaultImpl.TrendLog
BACnet_PersistentServer.project - how to use BACnetDefaultImpl to make BACnet objects and object properties persistent on your PLC
BACnet_Routing.project - how to use multiple BACnet “data links” for BACnet routing
BACnet_Routing.project - how to use multiple BACnet “data links” for BACnet routing
BACnet_BBMD_example.project - how to use multiple CODESYS BACnet devices in a network setup involving BBMD
- InOut:
Scope
Name
Type
Initial
Comment
Output
ConfCOVNotificationStatus
CmpBACnet.IEC_BACNET_STATUS
CmpBACnet.IEC_BACNET_STATUS.BACNET_STATUS_NOT_INITIALIZED
Status-Variable holding the call’s status after a call of ConfCOVNotification.
Properties:
Methods:
Structure:
- DemoMode (Property)
- DeviceAddressBindings
- DeviceId (Property)
- DeviceObject (Property)
- GenerateBACstackConfig (Method)
- GetDatalink (Method)
- HideToOutside (Property)
- HooksCallbacks
- LocalProcessID (Property)
- NumDatalinks (Property)
- Objects
- Persistence
- Plugins
- PropertyAttributes
- PropertyConfiguration
- Running (Property)
- Services
- SrvrInit
- StartBACnetStack (Method)
- StopBACnetStack (Method)
- StringType (Property)
- SupportUnsolicitedCOV (Property)