Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

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 Stack 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 Stack if you have the bacnetWrite tag as bacnetWrite: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:

Code Block
// 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(@24105f7e-6d8d076c)
  • bacnetPropertyIdentifierList() - this returns all the available properties (takes connector id)
    • example: bacnetPropertyIdentifierList(@24105f7e-6d8d076c)


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.

  1. $self->bacnetConnRef = the point's own bacnetConnRef ID
  2. $self->bacnetWrite = the point's own bacnetWrite tag value (aka the point ID i.e.. "AV1")
  3. $val = the value the user will set once the "Set" action is selected
    Note: 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.


Code Block
titleActions Example 1
ver:"2.0"
expr,dis
"bacnetWriteObjectProperty($self->bacnetConnRef, $self->bacnetWrite, \"present_value\", $val)", "Set"


Code Block
titleActions Example 2
ver:"2.0"
dis,expr,hvac_finCat
"Emergency Active","pointEmergencyOverride(\$self, true)",9
"Emergency Inactive","pointEmergencyOverride(\$self, false)",9
"Emergency Auto","pointEmergencyAuto(\$self)",9
"Manual On","pointOverride(\$self, true, \$duration)",6
"Manual Off","pointOverride(\$self, false, \$duration)",6
"Manual Auto","pointAuto(\$self)",6
"Set Default","pointSetDef(\$self, \$val)",3
"Set Bacnet level 1 ON","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, \"present_value\",1,1)",9
"Set Bacnet level 1 OFF","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, \"present_value\",0,1)",9
"Set Bacnet level 1 Null","bacnetWriteObjectProperty((\$self)->bacnetConnRef, (\$self)->bacnetWrite, \"present_value\",null,1)",9

To execute a bacnetWriteObjectProperty within the actions grid on points, you have to escape the quotation characters within the string value so that's why you see "\" marks on the Relinquish Default quotes 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.


...