fwPeriphAddressBACnet.ctl File Reference
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:
- panels/para/address_bacnet.pnl (used to set _address),
- panels/para/bacnet.pnl (to create/setup a device; might not be used here). Note: version WinCC OA 3.11 was used.
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):
- 2015-12-08: fixes (lgoralcz)
- 2015-11-30: initial creation (lgoralcz)
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
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.
Initial value:
Enumerated.