Bacnet Func. Flashcards
bacnetLearn
bacnetLearn(conn, uri: null)
Returns a grid with the BACnet objects residing on the device the connector points to. The way this works is that a call with only the connector record will return a grid of folders for each object type that connector supports.
Example:
bacnetLearn(@some-bacnet-conn-ref)
The above will return a grid containing a dis
and learn
column, like:
dis,learn "ANALOG VALUE",`ANALOG_VALUE`
bacnetObjectTypeList
bacnetObjectTypeList()
List all standard BACnet object types
bacnetPing
bacnetPing(conn)
Asynchronously ping an bacnet connector Examples:
read(bacnetConn).bacnetPing bacnetPing(bacnetConnId)
Side effects:
- performs async network IO on background thread
- bacnetDevice: updated if ping successful
- bacnetVersion: updated if ping successful
bacnetProperyIdentifierList
bacnetPropertyIdentifierList()
List all standard properties that a BACnet object can support
bacnetReadHis
bacnetReadHis(conn, obj, range)
Read history log from a BACnet Trend Log object
Accepts as parameters:
- conn: the BACnet connection used to query the object properties
- obj: either a BACnet Trend Log point record or a point Ref, or a string formatted as
bacnetHis
, i.e.objectType:objectInstance
. SeebacnetHis
for more details - dateTimeRange: a date time range
Returns:
- A grid with ts, val columns
Examples:
bacnetReadObjectProperty(@connRef, @pointRef, now() -7day .. now()) bacnetReadObjectProperty(@connRef, "20:1", now() -7day .. now())
bacnetReadObject
bacnetReadObject(conn, obj)
Read all know properties for this BACnet object
Accepts as 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
. SeebacnetCur
for more details
Returns:
A grid with all known object properties.
bacnetReadObjectProperty
bacnetReadObjectProperty(conn, obj, prop, index: null)
Read a BACnet property from a BACnet object
Accepts as 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
. SeebacnetCur
for more details. You can pass a@connRef
also, this is short-hand for passing the conn device address. - prop: integer or string value representing the object property id
- index: the integer index of the property to read
Examples:
// Read present value bacnetReadObjectProperty(@connRef, @pointRef, 85) bacnetReadObjectProperty(@connRef, "AV1", "present\_value") bacnetReadObjectProperty(@connRef,"2:1", 85) // Read the 'object\_name' property on the device object that '@connRef' points to. bacnetReadObjectProperty(@connRef, @connRef, "object\_name") // Read the 'object\_list' size property on the device object that '@connRef' points to. bacnetReadObjectProperty(@connRef, @connRef, "object\_list", 0)
bacnetReadPropertyMultiple
bacnetReadPropertyMultiple(conn, objectPropDict)
Reads multiple object properties using the BACnet ReadPropertyMultiple service if the remote device supports it. Accepts as parameters:
- conn: the BACnet connection used to query the object properties
- objectPropDict: a Dict with BACnet object Ids as keys and Dict of BACnet object properties as values The dict format is: {objectId1:{prop_name1,prop_name2},objectId2:{prop_name1,prop_name2}}
Examples:
// Read present value and object name from 2 objects
bacnetReadPropertyMultiple(@connRef, {av1:{present\_value, object\_name}, av2:{present\_
bacnetScheduleEffectivePeriod
bacnetScheduleEffectivePeriod(conn, point)
Reads the effective period for a bacnet schedule point
Paramaters:
- conn: Ref to or a record with a bacnetConn tag
- point: Ref to or a point record that has a bacnetCur pointing to a bacnet schedule, or a string with a valid bancet schedule object address
Returns:
a grid with start and end dates Examples:
read(bacnetConn).bacnetScheduleEffectivePeriod(@pointRef) read(bacnetConn).bacnetScheduleEffectivePeriod("17:2")
bacnetScheduleRead
bacnetScheduleRead(conn, point)
Reads the weekly schedule from a bacnet schedule point
Paramaters:
- conn: Ref to or a record with a bacnetConn tag
- point: Ref to or a point record that has a bacnetCur pointing to a bacnet schedule, or a string with a valid bancet schedule object address
Returns:
a grid with entries for the week, the first day is Monday, each day has a midnight entry
Examples:
read(bacnetConn).bacnetScheduleRead(@pointRef) read(bacnetConn).bacnetScheduleRead("17:2")
bacnetScheduleWrite
bacnetScheduleWrite(conn, point, schedule, writeLevel: Number)Number.(8)
Writes a weekly schedule to a bacnet schedule point
Paramaters:
- conn: Ref to or a record with a bacnetConn tag
- point: Ref to or a point record that has a bacnetCur pointing to a bacnet schedule, or a string with a valid bancet schedule object address
- grid: A grid containing events as ts:val pair.
~~~
Each day needs to have a midnight entry with a null value. The grid values are always written Monday to Sunday, no matter the order they are in the grid.
~~~ - writeLevel: optional parameter specifying the bacnet priority level to write to, default is 8
Returns:
Grid with true for successful write, false otherwise
Examples:
read(bacnetConn).bacnetScheduleWrite(@pointRef,scheduleHis(@19e846bf-9baaa022,thisWeek() +1day , {timeline})) read(bacnetConn).bacnetScheduleRead("17:2",scheduleHis(@19e846bf-9baaa022,thisWeek() +1day
bacnetSyncCur
bacnetSyncCur(points)
Asynchronously synchronize current values for given list of proxy points. The point list may be any value supported by toRecList
. The points must have the following tags configured:
bacnetConnRef
bacnetCur
This call updates the following point tags:
-
curVal
: current value of the point -
curStatus
: status of the point (down/fault on failure) -
curErr
: error message on failure
bacnetSyncHis
bacnetSyncHis(proxies, range: null)
Import the lastest data from an BACnet Trend Log
object to the local history database. The proxies may be any value suppored by toRecList
.
Each proxy record must contain:
-
bacnetConnRef
: references the BACnet connector -
bacnetHis
: reference to theTrend Log
object -
his
: all the standard historized point tags
If the range is unspecified, then an attempt is made to synchronize any data after hisEnd
(last timestamp read).
Side effects:
- performs blocking network IO
- performs
bacnetPing
if first comms with bacnet conn - updates bacnetHis record with history data
- updates
hisStatus
tag transiently - updates
hisErr
tag transiently
bacnetWriteObjectProperty
bacnetWriteObjectProperty(conn, obj, prop, value, priority: Number)Number.(8)
Write a BACnet property value
Accepts as 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
. SeebacnetCur
for more details - prop: integer or string value representing the object property id
- value: value to be written
- priority: priority level, defaults to 8
Examples:
// Write the present value bacnetWriteObjectProperty(@connRef, @pointRef, 85, 1.0) bacnetWriteObjectProperty(@connRef, "AV1", "present\_value", 1.0, 16) bacnetWriteObjectProperty(@connRef,"2:1", 85, 1.0)