BACnet driver settings

BACnet (Building Automation Control Network) is a communication protocol designed for use in building automation. Mervis IDE supports for selected platforms both BACnet server and BACnet client. The BACnet driver acts as a BACnet client - it allows reading and writing of data on a server, which may be a 3rd party device, such as an air handling unit, security system, etc. To integrate data from Mervis RT into a supervisory system (SCADA) use BACnet server please. The BACnet client is used for integration of third-party systems on automation level - “into a PLC”.

BACnet is supported on the following platforms:
mark220
mark320
markMX
IMIO105
IMIO110
ICIO205
mark125
Windows RT
wall - all types

Other platforms do not support BACnet client nor BACnet server.

The BACnet standard describes several communication media, such as UDP/IP, Ethernet, RS485 (MS/TP), LON, etc. Mervis uses UDP/IP over Ethernet as a transport protocol. (Do not confuse with BACnet over Ethernet, which uses MAC addresses of network cards rather than IP addresses for addressing.) The RS485 interface can not be used now, to talk with BACnet MS/TP devices please use a BACnet router from any available manufacturer.

BACnet object and property types, and their mapping on Mervis variables

The driver is designed so as to allow free assignment of a selected object type, instance, and property to a Mervis IDE variable. Any type and property can be selected, including vendor-specific objects and properties, as it is possible to enter also a user specific property as a number. Please keep in mind the data types of the assigned objects so that the Mervis IDE variable type fits the BACnet object property type. There is usually no problem with standard objects, such as Analog Input, Multistate Value etc., because the required property is mostly the Present Value (85). If another property has to be used, please check its data type in the BACnet standard, and select the corresponding value type and array index, which specifies the part of data to be mapped.

More complex objects can not be mapped onto Mervis variables easily, such as the BACnet Schedule object to a Mervis Time Scheduler. This integration is even not part of the integration concept: editable objects, like weekly schedulers, should be integrated directly into HMI, such as into a SCADA program. 

First, define and set up the communication channel. Use BACnet protocol, and UDP as link protocol.



Insert a Device into the channel. The Device is a container for datapoints..



Device properties
Name- device name for easier orientation in the project, will be part of the Autogen variable name
Enable- Device must be enabled to True to work properly. If False, the device is blocked, and is not taken into account at compilation.
Device Extension - not used in this version
Note - freely definable text note

UDP Parameters
Device IP Address - address of BACnet server, the 3rd party device.
Device Port - UDP port number of the BACnet server. Standard value is 47808. Check with the BACnet server manufacturer if in doubt.
Local Port - UDP port number for outgoing datagrams. Normally shall be kept at 0 (automatic assignment from the range of “free ports” 49152-65535 according to IANA), however, some servers may require the client to use the standard BACnet port number 47808 for outgoing datagrams too. Check with the BACnet server manufacturer if in doubt. In this parameter, the outgoing port number can be set manually.
Note - freely definable text note

BACnet Device Parameters
Device object instance - each BACnet server has an instance of the Device object as a mandatory feature. The Device object contains general information about the device (manufacturer name, firmware version, description, name, communication parameters - segmentation, max. packet length), and list of all other objects which the device contains. The Device object instance number is usually 1.
Network Address Type - prepared for extension of communication fetures. Select Nonefor BACnet/UDP.
Note - freely definable text note

BACnet - parameters for None
According to the network address type, other parameters may be required. There are no parameters necessary for None.

Prototype Definition
This section is to be completed if the generic device shall be saved as a library device, or Prototype. The parameters help to sort, filter, and organize devices in the library. 
Device Version ID - alphanumeric identification of version in case the manufacturer releases more versions of the device
Lock for Link Protocol - set to False.
Manufacturer ID - name of device manufacturer, usually abbreviated. Used for easy identification of prototype in the library.
Model ID - prototype name, typically device name as defined by the manufacturer
Prototype Version - version of Mervis library device. Versions may vary e.g. by the set of communicated variables. The version number has to be enterd as vX_Y, e.g. “v1_0”.
Status- Development, Test, Release, Obsolete, Broken, Unsupported. The status can be set according to the development stage of the prototype. This parameter may influence visibility of the prototype in the library. 
Development- the prototype is being worked on
Test - definition ready, must be tested on real device
Release - tested, ready for deployment at site
Obsolete- there is another, more recent version of prototype, whih shall be used rather than this one
Broken- split-off version from the main branch, not maintained anymore
Unsupported- do not deploy, this device is in the library from historical reasons or for compatibility with old projects.

Device info
Optional data.
Manufacturer- Full name of device manufacturer
Model - Device name as specified by manufacturer
Version - Device version as specified by manufacturer
Category path - Text to specify path in the tree for device selection in the library, e.g. “IRC\Heating”. The levels are separated by “\”.

The next step is adding the communication group. A Group contains one or more I/O data points.

Right click into the working area of the Device and select Add Group.



Group Properties
Name- freely definable group name
DataPoint.SortOrder - leave as is
Read/Write Interval - how often will the data be read or written. Leave 0 ms for continuous update.
Is Custom Box- leave as is
Group Type - select if the Group will contain variables for reading from a BACnet server, or for writing to a BACnet server.
Note - freely definable text note

BACnet group parameters
Group Action - leave as is
Write Only On Change - set to Trueat WriteOnly groups
Note - freely definable text note

In the Group, individual data points can be inserted with entered parameters for BACnet communication. All data points which are in a Group are communicated in one BACnet request, which may make the communication more efficient. However, if the group is too large, the maximum datagram length (APDU) accepted by the other party may be exceeded. It is recommended not to put more than about 20 datapoints into a group.

Right click the working area of the Device and select Add Data point. Then enter the data point properties.



Data Point Properties
Name - if not defined otherwise below, this name is used as part of the global variable name for automatic generation of variables (Autogen).
DataPoint.SortOrder - leave as is
Group- select the group the datapoint shall be in
Is Custom Box - taken from the Group properties automatically
Read / Write Interval - taken from the Group properties automatically
Group Type - for information, taken from the Group properties automatically
Comm. Value Mapped Type - usually BuiltIn, only if the variable is Binary Input/Output/Value, then Bit
ST Type - usually REAL for analog values, some of integer types (INT…) for multistate variables
Transform - usually Identity; BACnet do not need any scaling, linearisation, etc.
Note - freely definable text note

Autogen
Enable SWAutogen - True, if a corresponding global variable for use in FUPLA or ST programs shall be generated automatically
Target Project (SWAutogen) - select the project to generate the global variable in
Generated Variable (SW Autogen) - for information, name of the automatically generated variable
Generated variable name (SW Autogen)- if the variable name shall be different from the data point name, enter the variable name here. Normally, it is left blank. 
Retain (SW Autogen) - if True, the variable value is stored in NVRAM or Flash. Normally, it is False.

BACnet data point parameters
These parameters shall be provided by the BACnet server (3rd party device) manufacturer. They are available as a table or EDE file. The BACnet objects and their properties also can be read out from the BACnet server online, using a BACnet browser (e.g. Yabe).
Object Type - BACnet Object Type; select either from predefined standard types, or select Specific and in the next item, Specific Object Type,enter its number. This is used for the object types which are defined by manufacturers, and are not part of the BACnet standard. 
Object Instance - BACnet Object Instance, or object number within a particular BACnet Device.
Property ID - A BACnet object must have more BACnet Properties, which can be mapped onto Mervis variables. Standard properties have defined numbers - Property IDs, however, manufactures are allowed to define specific properties with Property ID 512 and higher. We usually need the property No. 85, Present Value. If another property than Present Value shall be mapped,select Custom and enter the property ID in the next parameter.
Custom Property ID - enter only if another property than Present Value shall be mapped.
Priority - writing into BACnet objects is done with certain priority, and can only be executed if the object to write to has currently set the same or lower (i.e. with higher priority number) priority. (There are 16 priorities, the highest being 1 = Manual Life Safety.) It is recommended to let the default priority as Not Specified and if writing is not successfull, contact the BACnet server manufacturer. Incorrect usage of priorities may disturb the intended BACnet server functionality.
Value Type - Data type of the read or written value in BACnet (BACnet Application Datatype). It should fit with the ST type entered above. According to BACnet standard, for binary types (bool), the types Enumerated (the most typical), BoolApl or BoolCtx may be used; test online or contact the BACnet server manufacturer if in doubt. .
Array Index - normally not used, with value of -1.
Note - freely definable text note

Then compile the project, and use the generated variables in FUPLA or ST programs as any other global variables.