BACNET

Concept Link IconSee also Concept Link IconExample

Communication control for the BACnet client driver.

WebVue support - Yes.

Mode Mnemonic Syntax
0 RESET_PRIORITY 1
1 RESET_ALL_PRIORITIES 2
2 TIME_SYNCHRONIZATION 3
3 START_NETWORK 4
4 STOP_NETWORK 4
5 START_DEVICE 5
6 STOP_DEVICE 5
7 WRITE_PRIORITY 6
8 RESTART_NETWORK 4
9 START_NOTIFICATION 7
10 STOP_NOTIFICATION 7
11 START_LOG 8
12 STOP_LOG 8
13 LOG_RETRIEVAL 9
14 BACKUP_DEVICE 5
15 RESTORE_DEVICE 5

You can specify the default value for writing and resetting the priority in a variable's Advanced properties: BACnet.Write priority.

Syntax 1

IntVal = BACNET(Mode, VariableName, Priority[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

VariableName

The name of a BACNET variable. Type STR.

Priority

The priority of the BACnet variable (between 1 and 16, or 0 to use the default Write priority). Type INTEGER.

ResultVar The name of a register variable to contain the result of the instruction. Optional. Type STR. .
Its values are:

0: Command in progress.
1: Command completed OK.

-2: The variable VariableName is not a BACnet variable or it is not mapped properly.

-4: The value of Priority is invalid.

-5: Command failed - Rejected by the device.

Execution

Mode

Mnemonic

Action

0

RESET_PRIORITY

Resets the value written at a particular priority level.

    Return:

0: Command sent.
-1: Unknown mode.

-7: Syntax error in parameter VariableName.

-8: A variable passed as parameter could not be found (VariableName or ResultVar) - See traces for more information.

-14: The value of Priority is out-of-range.

-15: Priority is missing.

-16: The variable VariableName is not a BACnet variable.

Syntax 2

IntVal = BACNET(Mode, VariableName[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

VariableName

The name of a BACnet variable. Type STR.

ResultVar The name of a register variable to contain the result of the instruction. Optional. Type STR.
Its values are:

0: Command in progress.
1: Command completed OK.

-2: The variable VariableName is not a BACnet variable or it is not mapped properly.

-5: Command failed - Rejected by the device.

Execution

Mode

Mnemonic

Action

1

RESET_ALL_PRIORITIES

Resets the priority values of a variable at all priority levels.

    Return:

0: Command sent.
-1: Unknown mode.

-7: Syntax error in parameter VariableName.

-8: A variable passed as parameter could not be found (VariableName or ResultVar) - See traces for more information.

-16: The variable VariableName is not a BACnet variable.

Syntax 3

IntVal = BACNET(Mode, NetworkName[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

NetworkName

The name of a BACnet network. Type STR.

ResultVar The name of a register variable to contain the result of the instruction. Optional. Type STR.
Its values are:

0: Command in progress.
1: Command completed OK.

-6: The network NetworkName could not be found.

Transition to 1 of the result variable confirms the sending of the time synchronization command. But because it is a BACnet service based on a broadcast, there is no guarantee that all BACnet devices on the network received and executed the command properly.

Execution

Mode

Mnemonic

Action

2

TIME_SYNCHRONIZATION

To synchronize the time for all devices on a network.

   

Return:

0: Command sent.
-1: Unknown mode.

-2: Syntax error in parameter NetworkName.

-3: The network NetworkName could not be found.

-8: The variable ResultVar could not be found.

Syntax 4

IntVal = BACNET(Mode, NetworkAlias[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

NetworkAlias

The name of a BACnet network. Type STR.

ResultVar The name of a register variable to contain the result of the instruction. Type STR (optional).
Its values are:

0: Command in progress.
1: Command completed OK.

-1: The network NetworkAlias could not be found.

In the case that the command fails (-2) you can check the BACnet status variables for more information.

Execution

Mode

Mnemonic

Action

3

START_NETWORK

Starts the network.

4 STOP_NETWORK Stops the network.
8 RESTART_NETWORK Restarts the network.
    Return:

0: Command sent.
-1: Unknown mode.

-2: Syntax error in parameter NetworkAlias.

-3: The network NetworkAlias could not be found.

-8: The variable ResultVar could not be found.

Syntax 5

IntVal = BACNET(Mode, NetworkAlias, DeviceAlias[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

NetworkAlias

The name of a BACnet network. Type STR.

DeviceAlias The name of a BACnet device. Type STR.
ResultVar The name of a register variable to contain the result of the instruction. Type STR (optional).
Its values are:

0: Command in progress.
1: Command completed OK.

-5: Command failed - Rejected by the device.

-7: The network NetworkAlias or the device DeviceAlias could not be found.

-9: Command aborted - A backup or restore is already in progress.

-10: Command failed - Device not connected.

In the case that the command fails (-2) you can check the BACnet status variables for more information.

Execution

Mode

Mnemonic

Action

5

START_DEVICE

Starts the device.

6 STOP_DEVICE Stops the device.
14 BACKUP_DEVICE Backup the device configuration.
15 RESTORE_DEVICE Restore the device configuration.
    Return:

0: Command sent.
-1: Unknown mode.

-2: Syntax error in parameter NetworkAlias or DeviceAlias.

-3: The network NetworkAlias or the device DeviceAlias could not be found.

-8: The variable ResultVar could not be found.

Syntax 6

IntVal = BACNET(Mode, VariableName, Value, Priority[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

VariableName

The name of a BACnet variable. Type STR.

Value The value to be written. Type - must be the same type as the variable that is to be written.

Priority

The priority of the BACnet variable (between 1 and 16, or 0 to use the default Write priority). Type INTEGER.

ResultVar The name of a register variable to contain the result of the instruction. Type STR (optional).
Its values are:

0: Command in progress.
1: Command completed OK.

-2: The variable VariableName is not a BACnet variable or it is not mapped properly.

-4: The value of Priority is invalid.

-5: Command failed - Rejected by the device.

Execution

Mode

Mnemonic

Action

7

WRITE_PRIORITY

Writes the variable with a particular priority.

   

Return:

0: Command sent.
-1: Unknown mode.

-7: Syntax error in parameter VariableName.

-8: A variable passed as parameter could not be found (VariableName or ResultVar) - See traces for more information.

-14: The value of Priority is out-of-range.

-15: Priority or Value is missing.

-16: The variable VariableName is not a BACnet variable.

Syntax 7

IntVal = BACNET(Mode, NetworkAlias, DeviceAlias, NotificationAlias[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

NetworkAlias

The name of a BACnet network. Type STR.

DeviceAlias The name of a BACnet device. Type STR.
NotificationAlias The name of a BACnet notification. Type STR.
ResultVar The name of a register variable to contain the result of the instruction. Type STR (optional).
Its values are:

0: Command in progress.
1: Command sent to the device.

-1: The notification class NotificationAlias could not be found.

-2: Command failed.

In the case that the command fails (-2) you can check the BACnet status variables for more information.

Execution

Mode

Mnemonic

Action

9 START_NOTIFICATION Start alarm notifications.
10 STOP_NOTIFICATION Stop alarm notifications.
    Return:

0: Command sent.
-1: Unknown mode.

-2: NetworkAlias is missing.

-3: DeviceAlias is missing.

-4: NotificationAlias is missing.

Syntax 8

IntVal = BACNET(Mode, NetworkAlias, DeviceAlias, LogAlias[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

NetworkAlias

The name of a BACnet network. Type STR.

DeviceAlias The name of a BACnet device. Type STR.
LogAlias The name of a BACnet log. Type STR.
ResultVar The name of a register variable to contain the result of the instruction. Type STR (optional).
Its values are:

0: Command in progress.
1: Command sent to the device.

-1: The log LogAlias could not be found.

-2: Command failed.

In the case that the command fails (-2) you can check the BACnet status variables for more information.

Execution

Mode

Mnemonic

Action

11 START_LOG Start log retrieval.
12 STOP_LOG Stop log retrieval.
    Return:

0: Command sent.
-1: Unknown mode.

-2: NetworkAlias is missing.

-3: DeviceAlias is missing.

-4: LogAlias is missing.

Syntax 9

IntVal = BACNET(Mode, NetworkAlias, DeviceAlias, LogAlias[, ResultVar]); or

IntVal = BACNET(Mode, NetworkAlias, DeviceAlias, LogAlias, Date, Count[, ResultVar]);

Return type: INTEGER.

Argument

Meaning

NetworkAlias

The name of a BACnet network. Type STR.

DeviceAlias The name of a BACnet device. Type STR.
LogAlias The name of a BACnet log. Type STR.
Date The reference timestamp for the first record to read, expressed as the number of milliseconds since 1980. See the instruction DateTimeValue. Type DOUBLE.
Count The number of records to read (between -10000 and +10000). Type INTEGER.
ResultVar The name of a register variable to contain the result of the instruction. Type STR. (Optional)
Its values are:

0: Command in progress.
1: Command completed OK.

-1: The network NetworkAlias, device DeviceAlias or log LogAlias could not be found.

-2: Command failed - Rejected by the device.

-5: Command aborted - A log retrieval is already in progress.

-6: Command failed - Device not connected.

In the case that the command fails (-2) you can check the BACnet status variables for more information.

Execution

Mode

Mnemonic

Action

13 LOG_RETRIEVAL Retrieve the log buffer using the supplied parameters. If the arguments Date and Count are set to 0, the buffer will be read in its entirety if the device supports it.
   

Return:

0: Command sent.

-1: Unknown mode.

-2: Syntax error in parameter NetworkAlias, DeviceAlias or LogAlias.

-3: The network NetworkAlias, device DeviceAlias or log LogAlias could not be found.

-5: Incorrect number of parameters.

-6: Syntax error in parameter Date or Count.

-7: Syntax error in parameter ResultVar.

-8: The variable ResultVar could not be found.

-14: Count is out-of-range.

Example

For an example, select the Example link above.