fwPeriphAddressBACnet.ctl File Reference

Functions

void _fwPeriphAddressBACnet_set (string dpe, dyn_anytype addressConfig, dyn_string &exceptionInfo)
 Internal function to setup the SNMP addressing.
void _fwPeriphAddressBACnet_get (string dpe, dyn_anytype &addressConfig, bool &isActive, dyn_string &exceptionInfo)
 Retrieve configuration from _address config for BACnet.
 _fwPeriphAddressBACnet_delete (string dpe, dyn_string &exceptionInfo)
 Internal function to cleanup before deleting the BACnet _address and _distrib configs TODO: create function body.
void _fwPeriphAddressBACnet_check (dyn_anytype &addressConfig, dyn_string &exceptionInfo)
 Function to check and correct BACnet address configuration parameters before attempting to save them to the DP element.
bool _fwPeriphAddressBACnet_isDataTypeValid (string dataType)
bool _fwPeriphAddressBACnet_isReferenceValid (string reference)
dyn_string _fwPeriphAddressBACnet_explodeReference (string reference)
bool _fwPeriphAddressBACnet_isDeviceValid (string device)
bool _fwPeriphAddressBACnet_isObjecTypeValid (string objectType)
bool _fwPeriphAddressBACnet_isObjectIdValid (string objectId)
bool _fwPeriphAddressBACnet_isPropertyValid (string property)
bool _fwPeriphAddressBACnet_isIndexValid (string index)

Variables

const string fwPeriphAddress_TYPE_BACNET = "BACnet"
const string fwPeriphAddress_DRVID_BACNET = "BACNET"
const unsigned fwPeriphAddress_BACNET_POLL_GROUP = 12
const unsigned fwPeriphAddress_BACNET_OBJECT_SIZE = 12
const string fwPeriphAddress_BACNET_REF_SEPARATOR = "."
const int fwPeriphAddress_BACNET_REF_MIN_ELEM_NO = 4
 Separator used in reference _address field.
const int fwPeriphAddress_BACNET_REF_MAX_ELEM_NO = 5
 Minimum number of elements in reference _address field.
const int fwPeriphAddress_BACNET_REF_DEV_IDX = 1
 Maximum number of elements in reference _address field.
const int fwPeriphAddress_BACNET_REF_OBJ_TYPE_IDX = 2
 Index for device name in peripheral address.
const int fwPeriphAddress_BACNET_REF_OBJ_ID_IDX = 3
 Index for object type in peripheral address.
const int fwPeriphAddress_BACNET_REF_PROP_IDX = 4
 Index for object id in peripheral address.
const int fwPeriphAddress_BACNET_REF_IDX_IDX = 5
 Index for property in peripheral address.
const int fwPeriphAddress_BACNET_TYPE_DEFAULT = 800
 Index for property's index in peripheral address.
const int fwPeriphAddress_BACNET_TYPE_BOOL = 801
 Default.
const int fwPeriphAddress_BACNET_TYPE_UINT = 802
 Boolean.
const int fwPeriphAddress_BACNET_TYPE_INT = 803
 Unsigned Integer.
const int fwPeriphAddress_BACNET_TYPE_REAL = 804
 Signed Integer.
const int fwPeriphAddress_BACNET_TYPE_DOUBLE = 805
 Real.
const int fwPeriphAddress_BACNET_TYPE_ENUM = 809
 Double.
const dyn_int fwPeriphAddress_BACNET_TYPES
 Enumerated.

Detailed Description

Functions to set _address config for datapoint for BACnet driver.

Naming: when possible names used in WinCC OA help are used (e.g. "reference" is preferred over "address"). FW_PARAMETER_FIELD_AAABBB constants are used, not the fwPeriphAddress_AAABBB (who know which one is correct?). TODO: it would be better to switch to fwPeriphAddress_AAABBB as everybody else is using it.

Initial code was written based on WinCC OA help file on BACnet and _address config entry. Other things were taken from BACnet examples (BACnet_Samples.dpl in dplist directory of BACnet directory in WinCC OA installation, look for "PeriphAddrMain"). Also panels:

Table for _datatype. Help only defines 800, but these values were used in various places: 800 default 801 Boolean 802 UnsignedInteger 803 SignedInteger 804 Real 805 Double 809 Enumerated 806 skipped, see bacnetDrvPara.ctl, line 740 Valid IDs: 800-899.

Code based on other fwPeriphAddressAAABB.ctl files.

Note that setting _address is not enough to make it work appriopriate BACnet device datapoint has to exist (_BacnetDevice).

Changelog (put only important stuff here):


Function Documentation

void _fwPeriphAddressBACnet_set ( string  dpe,
dyn_anytype  addressConfig,
dyn_string &  exceptionInfo 
)

Internal function to setup the SNMP addressing.

Constraints
Should only be called from fwPeriphAddress_set
Parameters:
dpe Datapoint element to act on
addressConfig Address object is passed here:

exceptionInfo Details of any errors are returned here
void _fwPeriphAddressBACnet_get ( string  dpe,
dyn_anytype &  addressConfig,
bool &  isActive,
dyn_string &  exceptionInfo 
)

Retrieve configuration from _address config for BACnet.

Constraints
Should only be called from fwPeriphAddress_get
Parameters:
dpe Datapoint element to read from
addressConfig Address object is returned here (configParameters).
See also:
_fwPeriphAddressBACnet_set()
Parameters:
isActive TRUE if address config is active, else FALSE
exceptionInfo Details of any errors are returned here
_fwPeriphAddressBACnet_delete ( string  dpe,
dyn_string &  exceptionInfo 
)

Internal function to cleanup before deleting the BACnet _address and _distrib configs TODO: create function body.

Constraints
Should only be called from fwPeriphAddress_delete
Parameters:
dpe Datapoint element to read from
exceptionInfo Details of any errors are returned here
void _fwPeriphAddressBACnet_check ( dyn_anytype &  addressConfig,
dyn_string &  exceptionInfo 
)

Function to check and correct BACnet address configuration parameters before attempting to save them to the DP element.

Note: in other cases this function is public (no "_" prefix), but there's no reason why to make it private.

Parameters:
addressConfig The address configuration object is passed here. In some cases, an amended (fixed) version may be returned here
exceptionInfo Details of errors in the address configuration are returned here
bool _fwPeriphAddressBACnet_isDataTypeValid ( string  dataType  ) 

Validate datatype.

Parameters:
dataType (string) IN datatype (as string), ex. "800".
Returns:
value of type 'bool' true if datatype is acceptable, false if not
bool _fwPeriphAddressBACnet_isReferenceValid ( string  reference  ) 

Validate BACnet address reference.

Example reference: "Device_6789.AnalogInput.1.Min_Pres_Value" or: "Device_6789.BinaryValue.3.Reliability.2". Note: last element is optional.

<Device>.<Object_Type>.<Object_Id>.<Property>.<Index /optional/>

Parameters:
reference (string) IN BACnet address reference
Returns:
value of type 'bool' true if address is valid, false otherwise
dyn_string _fwPeriphAddressBACnet_explodeReference ( string  reference  ) 

Explodes string representing BACnet reference. *

Parameters:
reference (string) IN BACnet reference string, ex.
Returns:
value of type 'dyn_string' List of elements (ex. BACnet device, object id, etc.) or empty list if string was invalid
bool _fwPeriphAddressBACnet_isDeviceValid ( string  device  ) 

Check if a given BACnet device exists in the configuration.

This function simply check if a datapoint of a given name and type "_BacnetDevice" exists.

TODO: stub, returns always true

Parameters:
device (string) IN BACnet device name
Returns:
value of type 'bool' True if device exits, false if BACnet device doesn't exist
bool _fwPeriphAddressBACnet_isObjecTypeValid ( string  objectType  ) 
bool _fwPeriphAddressBACnet_isObjectIdValid ( string  objectId  ) 

Check if BACnet object ID is valid for _reference element.

Note, this does not check if an object id really exists in the device, only if it is correct, i.e. a number.

Parameters:
objectId (string) IN BACnet object id
Returns:
value of type 'bool' true if valid BACnet object id, false if not valid
bool _fwPeriphAddressBACnet_isPropertyValid ( string  property  ) 

Check if BACnet object's property is valid for _reference element.

Parameters:
property (string) IN BACnet object's property
Returns:
value of type 'bool' true if property is valid, false otherwise
bool _fwPeriphAddressBACnet_isIndexValid ( string  index  ) 

Check if given BACnet object's property index is valid.

Parameters:
index (string) IN object's property index
Returns:
value of type 'bool' true if BACnet object's property index is valid, false otherwise

Variable Documentation

const string fwPeriphAddress_TYPE_BACNET = "BACnet"
const string fwPeriphAddress_DRVID_BACNET = "BACNET"
const unsigned fwPeriphAddress_BACNET_POLL_GROUP = 12

Separator used in reference _address field.

Minimum number of elements in reference _address field.

Maximum number of elements in reference _address field.

Index for device name in peripheral address.

Index for object type in peripheral address.

Index for object id in peripheral address.

Index for property in peripheral address.

Index for property's index in peripheral address.

Default.

Boolean.

Unsigned Integer.

Signed Integer.

Real.

Double.


Generated on 10 Dec 2015 for fwConfigs by  doxygen 1.6.1