BACnet Actions
Bacnet Write Object Property
You can utilize a bacnetWriteObjectProperty()
function to write to any writable property on a BACnet point, not just strictly for actions but modifying other properties. FIN can write to any property in an Object, we just need to know which property you want to write to.
For example, by default in FIN if you have the
bacnetWrite
tag asbacnetWrite:AV1
, what we do is send this on the wire. If they are unique and proprietary, then the below would help with this.
bacnetWriteObjectProperty
bacnetWriteObjectProperty(conn, obj, prop, value, priority: Number. <ctor>(16))
Write a BACnet property value
Parameters:
conn: the BACnet connection used to query the object properties
obj: either a BACnet point record or a point Ref, or a string formatted as
bacnetCur
, i.e.objectType:objectInstance
.prop: integer or string value representing the object property id
value: value to be written
priority: priority level, defaults to 16
Examples:
// Write the present value
bacnetWriteObjectProperty(@connRef, @pointRef, 85, 1.0) //in this case 85 is present value and 1.0 is the value
bacnetWriteObjectProperty(@connRef, "AV1", "present_value", 1.0, 16) //in this case 1.0 is the value and 16 is the priority array
bacnetWriteObjectProperty(@connRef, "2:1", 85, 1.0) //in this case "2:1" is AV1, look at the below functions on how we got this
//priority 16 is default so it can be omitted
Couple useful functions to find objects and properties below:
bacnetObjectTypeList()
- this returns all the object types. For above "2:1" example, if you run this func in folio, you'll see the ANALOG_VALUE shortName is AV and value is 2. The one is the point ID. Combine that would be AV1. (takes connector id)example:
bacnetObjectTypeList(@p:demo:r:2604f655-7cf3b976)
bacnetPropertyIdentifierList()
- this returns all the available properties (takes connector id)example:
bacnetPropertyIdentifierList(@p:demo:r:2604f655-7cf3b976)
In the Actions Example 1 below, you have a bacnetWriteObjectProperty()
being executed within the actions grid tag of a point where the first two parameters are using the point's own bacnetConnRef & bacnetWrite. See below for proper syntax.
$self->bacnetConnRef
= the point's own bacnetConnRef ID$self->bacnetWrite
= the point's own bacnetWrite tag value (aka the point ID i.e.. "AV1")$val
= the value the user will set once the "Set" action is selectedNote:Â Instead of hardcoding the bacnetConnRef & the bacnetWrite, you want it to be the values of whichever point you're commanding so that's where you utilizing the
$self->Â or $val
as you see above makes it dynamic.
Escaping $
If editing the actions directly via the Point Essentials view, then you want to make sure you escape the dollar sign $
character if not already escaped.
If using the Actions Category Permission tool, don't escape the $
because the tool already does that.
If you do escape it in the tool, it'll add additional backslashes and break the actions. You would then need to edit and re-save to fix them.
Actions Example 1
ver:"2.0"
expr,dis
"bacnetWriteObjectProperty($self->bacnetConnRef, $self->bacnetWrite, toStr(`present_value`), $val)", "Set"
Actions Example 2 - Numeric (string value for present value property)
ver:"3.0"
dis,expr,hvac_finCat
"Emergency Set","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, toStr(`present_value`), \$val, 1)",9
"Emergency Auto","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, toStr(`present_value`), null, 1)",9
"Manual Set","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, toStr(`present_value`), \$val, 8)",6
"Manual Auto","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, toStr(`present_value`), null, 8)",6
"Set Default","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, toStr(`present_value`), \$val, 16)",3
"Set Null","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, toStr(`present_value`), null, 16)",3
Actions Example 3 - Boolean (numerical value for present value property)
To execute a bacnetWriteObjectProperty
within the actions grid on points, make sure not to have quotations within quotations. If you need to use toStr()
instead like we did above IF using property name.
However, we recommend to use the numerical value of the property instead so that the actions appear where ever they may be called.
Writing to Relinquish Default property
The standard BACnet Relinquish Default property is 104. This property can be used to write to hardwired properties on proprietary devices like Johnson controllers. Some devices like Johnson can also utilize property 3113 that once it is written to is permanent (unlike an override).Â
You can use a command similar to the above to write to Relinquish Default, see below for exact actions grid used to resolve issue. Its recommended to use 104 since that is the standard property for Relinquish Default. It can be 3113 or the property name "Relinquish_Default". It is also recommended to use the numerical value of the property so that the actions will appear any where the action is available in the build, else if using the name, the actions won't appear in the HTML UI.
Actions - By 104
Actions - By Name
Writing to Cov Increment property
If the user wants to be able to modify the Cov_Increment
object property on a point, they can do so using the bacnetWriteObjectProperty()
func. Use case would be if a customer doesn't want to flood the network on every value change and only see change of value if it exceeds a certain threshold. That is where Cov_Increment
property comes into play. This is a property that needs to be configured on the device, not FIN. The device would also need to be able to support COV. However, below is example of how to modify and read this property from FIN in the event the user would want to modify.
Read Cov_Increment
property to see current configuration:
Go to folio and run query below with connector id and either point instance or point id.
bacnetReadObjectProperty(@conn_id, "point_instance", "Cov_Increment")
example 1:Â
bacnetReadObjectProperty(@236b97c6-88cdae62, "AV52", "Cov_Increment")
example 2:Â
bacnetReadObjectProperty(@236b97c6-88cdae62, @236b9811-6943ab2a, "Cov_Increment")
Write to Cov_Increment property:
Go to folio and run query below with connector id, either point instance or point id, and value for
Cov_Increment.
bacnetWriteObjectProperty(@conn_id, "point_instance", "Cov_Increment", 0.5)
example 1:Â
bacnetWriteObjectProperty(@236b97c6-88cdae62, "AV52", "Cov_Increment", 0.5)
example 2:Â
bacnetWriteObjectProperty(@236b97c6-88cdae62, @236b9811-6943ab2a, "Cov_Increment", 0.5)
To batch apply, the user can use a query below with their point tags of the points they want to modify:
readAll(point and temp and kind=="Number").toRecList().map (x=>Â bacnetWriteObjectProperty(x->bacnetConnRef,x->bacnetCur,"Cov_Increment", 1.1))Â
If this doesn't work consider the below:
This might require the previous subscription to expire
The setting is vendor-specific - so it might be that the setting has not persisted and might require a device reboot
This property is a configuration item that is taken care of when you setup the bacnet network usually and depending on the vendor can be something that FIN (or any other BACnet client) can effectively control
If you cannot change the property, meaning that your device does not support it, then that means the device will only work using the polling option