Skip to content

Write values to remote devices

pichler edited this page Jun 30, 2015 · 1 revision

If the present value property of an object should be written, this is done by using the object's priority array.

Priority array

The priority array is a read-only property that consists of commands that are categorized by priority levels of decreasing order. The priority is a number between 1 (highest priority) and 16 (lowest priority). The array may contain a value for each priority level or NULL. The present value of the commandable object follows from the highest non-NULL value in the array. If all array entries are NULL, the present value property is equal to the object property Relinquish_Default (so this value is something like priority level 17). The following example shows a priority array of a analog value object:

Priority level Value
1 NULL
2 10.0
3 NULL
4 NULL
5 NULL
6 15.0
7 NULL
8 NULL
9 NULL
10 NULL
11 NULL
12 NULL
13 20.0
14 NULL
15 NULL
16 NULL

The resulting present value of the priority array above is 10.0, because this is the non-NULL value with the highest priority level. Some prioriy levels have pre-defined applications defined in the BACnet standard. The following table shows these applications:

Priority level Application
1 Manual-Life Safety
2 Automatic-Life Safety
3 Available
4 Available
5 Critical Equipment Control
6 Minimum On/Off
7 Available
8 Manual Operator
9 Available
10 Available
11 Available
12 Available
13 Available
14 Available
15 Available
16 Available

When writing a value, the according priority level must be defined. More information related to the priority array can be found here. The object array can be read by sending a ReadPropertyRequest the the remote device:

ReadPropertyRequest request = new ReadPropertyRequest(objectIdentifier, PropertyIdentifier.priorityArray);

Writing a value

To write a value into the priority array (or the Relinquish_Default property), the bacnet4J library offers a WriteProperyRequest class. The following code snippet shows the signature of the class constructor:

WritePropertyRequest(ObjectIdentifier objectIdentifier, PropertyIdentifier propertyIdentifier,
            UnsignedInteger propertyArrayIndex, Encodable propertyValue, UnsignedInteger priority)

To write a value to the Relinquish_Default property, set the priority argument to null. To write a NULL-value into the priority array, pass a com.serotonin.bacnet4j.type.primitive.Null instance as property value. The follwoing example shows how to write 50.0 to the Relinquish_Default property of a certain object:

WritePropertyRequest request = new WritePropertyRequest(objectIdentifier, PropertyIdentifier.presentValue, null, new Real(50), null);
localDevice.send(remoteDevice, request);

Back to bacnet4J page