Versions Compared

Key

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

The BACNET object corresponds to the BacNet system object.

The BACNET object generates sends events listed presented in the table below. Procedures start are started when the corresponding event occurs. The format of the event procedure for the BacNet object:

Code Block
OnEvent("BACNET","_id_","_событие_")

BACNET object events description:

 

EventDescription
EventEvent description
ERRORError message received
EVENT_OCCURES
Message acknowledgment

Message confirmation

WRITE_OCCURES

Recording confirmation
WRITE_RESULTRecording result

 Operator format for describing actions with the BacNet object :

Code Block
DoReact("BACNET","_id_","_команда_" [,"_параметры_"]);

The list List of commands and parameters for the BACNET object is presented in the table.:

Command
description
ParametersParameters description

WRITE

send a value to the BACnet device

bacnet_application_tag<>

Data type. Possible values:

NULL = 0
BOOLEAN = 1
UNSIGNED INT = 2
SIGNED INT = 3
REAL = 4
DOUBLE = 5
OCTET STRING = 6
CHARACTER STRING = 7
BIT STRING = 8

bacnet_value<>

Parameter value

bacnet_objtype<>

Object type:

ANALOG INPUT = 0
ANALOG OUTPUT = 1
ANALOG VALUE = 2
BINARY INPUT = 3
BINARY OUTPUT = 4
BINARY VALUE = 5

bacnet_instance<>

BACnet unique global device identifier

bacnet_property_id<>

Property
id
ID

bacnet_device_id<>

BACnet device
identifier
ID in the system
EVENT –
EVENTsend a message to the BACnet device

event_type<>

Event type

from_state<>

Change state from

to_state<>

Change state to

message_text<>

Event text

 Examples. The code is given in JScript, see Programming Guide (JScript)

Writing to an object using a script.

Code Block
var msg = CreateMsg();

//bacnet_application_tag
var BACNET_APPLICATION_TAG_NULL = 0;
var BACNET_APPLICATION_TAG_BOOLEAN = 1;
var BACNET_APPLICATION_TAG_UNSIGNED_INT = 2;
var BACNET_APPLICATION_TAG_SIGNED_INT = 3;
var BACNET_APPLICATION_TAG_REAL = 4;
var BACNET_APPLICATION_TAG_DOUBLE = 5;
var BACNET_APPLICATION_TAG_OCTET_STRING = 6;
var BACNET_APPLICATION_TAG_CHARACTER_STRING = 7;
var BACNET_APPLICATION_TAG_BIT_STRING = 8;

//bacnet_objtype
var OBJECT_ANALOG_INPUT = 0;
var OBJECT_ANALOG_OUTPUT = 1;
var OBJECT_ANALOG_VALUE = 2;
var OBJECT_BINARY_INPUT = 3;
var OBJECT_BINARY_OUTPUT = 4;
var OBJECT_BINARY_VALUE = 5;

//bacnet_property_id
var PROP_PRESENT_VALUE = 85;

msg.StringToMsg("BACNETINT|1|WRITE");
msg.SetParam("bacnet_application_tag", BACNET_APPLICATION_TAG_UNSIGNED_INT);
msg.SetParam("bacnet_value",30);

msg.SetParam("bacnet_objtype",OBJECT_ANALOG_VALUE);
msg.SetParam("bacnet_instance",0);

msg.SetParam("bacnet_property_id",PROP_PRESENT_VALUE);
msg.SetParam("bacnet_device_id",12345);

DoReact(msg);

In case of successful script execution, an event will appear in the Debug window

...

Code Block
DebugLogString("Script2");
var msg = CreateMsg();


msg.StringToMsg("BACNETINT|1|EVENT");

msg.SetParam("event_type", "0");
msg.SetParam("from_state", "1");
msg.SetParam("to_state", "0");

msg.SetParam("message_text", "test_text1!");

DoReact(msg);

If the module receives an event, the following event will be displayed in the Debug window:

...