BACnet MS_TP Data Collection Guide

BACnet MS_TP Data Collection Guide


Protocol Overview

  • Protocol Description: BACnet MS/TP (Master-Slave/Token-Passing) is a physical layer and data link layer implementation of the BACnet protocol, designed for low-speed, low-cost application scenarios. It adopts a master-slave/token-passing mechanism and connects devices via an RS-485 serial bus to enable data communication and control between devices. It is commonly used for controllers, sensors, actuators and other devices in building automation.
  • Application Scenarios: This protocol is widely used in building automation systems such as HVAC (Heating, Ventilation, and Air Conditioning), access control, and lighting control, especially suitable for scenarios with long wiring distances, scattered nodes but low data rate requirements.
  • Edge2Cloud Factory Support: As a client, Edge2Cloud Factory supports connecting to and collecting device data on the serial bus through the BACnet MS/TP protocol, and supports automatic search and manual configuration of devices.

Prerequisites

Before starting the configuration, ensure the following preparations are completed:

  • Hardware Connection:a. Use an RS-485 serial cable to connect the designated serial port (e.g., COM2) of the Edge2Cloud Factory device to the target BACnet MS/TP bus.b. Ensure the bus wiring is correct (A/B lines) and the terminal resistor is configured properly (if needed).c. Connect the debugging computer to the Edge2Cloud Factory gateway for configuration.
  • Network Parameters:a. Not applicable. The MS/TP protocol uses serial ports instead of IP networks.b. Ensure the serial port parameters (baud rate, data bits, parity bits, stop bits) of the Edge2Cloud Factory are consistent with those of other devices on the bus.
  • Device Parameters:a. Prepare the Device ID (Device Instance Number) of the target BACnet device.b. Determine the Physical Address (MAC Address) of the target device on the bus (this address can be automatically discovered in some automatic search scenarios but is required for manual addition).c. Determine parameters such as Polling Cycle, Maximum Number of Information Frames, Maximum Number of Master Devices, etc.

Configuration Steps

Please follow the steps below to configure in the Web interface of Edge2Cloud Factory.

Add Device

Step 1: Open the Entry

Log in to the Edge2Cloud Factory management interface. Log in to the gateway management page -> [Data Collection] to enter the Edge2Cloud Factory configuration page.


Two methods are supported: Add Manually (Single Device) or Auto Search (Batch Devices).

Method 1: Manually Add a Single Device

Step 1: Add DeviceClick the "Create Device" button, fill in the device name (ensure uniqueness), and select the BACnet MS/TP protocol.

Step 2: Supplement InformationFill in the information on the current page, note do not click the [Auto Search] button, then save and submit after completion.Click the "Publish" button in the upper right corner of the page to make the configuration take effect.

Parameter Name Description Example
Name Device name, used to distinguish different devices. Packaging Workshop A - Packaging Machine 03
Protocol Select the communication protocol between the gateway and the device; "BACnet MS/TP" must be selected. BACnet MS/TP
Communication Method Select the local serial interface (e.g., COM2) used for device communication. This serial port must be connected to the target bus. COM2
Local Node Address The BACnet MAC address of the gateway itself on the MS/TP bus, ranging from 0 - 127, must be unique on the bus. 10
Maximum Number of Information Frames The maximum number of data packets the gateway can send when holding the token at one time, ranging from 1 - 255, default is 5. 5
Maximum Number of Master Devices Defines the upper limit of the token ring scale, must be ≥ the highest address of the actual master devices on the bus, ranging from 2 - 127, default is 10. 10
Device ID The BACnet device instance number of the device, an integer between 0 and 4194303. 12345
Polling Cycle The cycle time for device data collection, unit: seconds. 10
Description Descriptive information about the device to facilitate user identification of device functions. Packaging Workshop A - Packaging Machine 03 Device
Collection Timeout The timeout time for the device to respond after the gateway initiates a data collection request, unit: milliseconds. 1000
Enable Batch Collection Whether to enable the batch collection function; when enabled, variables with consecutive addresses are read in one collection request. Enabled
Maximum Batch Collection Count When batch collection is enabled, set the maximum number of data points collected in each batch. 64
Communication Interval Time The interval time between two communication requests, unit: milliseconds. 10
Serial Port Parameters (Display only) Shows the baud rate, data bits, parity bits, stop bits of the selected serial port, which should be consistent with other devices on the bus. 9600,8,N,1

Method 2: Automatically Search for Multiple Devices

Step 1: Add DeviceClick the "Create Device" button and directly select the BACnet MS/TP protocol.

Step 2: Auto SearchClick the "Auto Search" button to jump to the auto search device pop-up, supplement the information, and click [Search].

Step 3: Select DevicesYou can check multiple devices in the list and click "Next" to perform batch addition.

The default device name is the original device name found by the search. Note that device names in the system cannot be duplicated; if duplicated, you can click to modify them directly.

Parameter Name Description Example
Communication Method Select the local serial interface (e.g., COM2) used for device communication. This serial port must be connected to the target bus. COM2
Local Node Address The BACnet MAC address of the gateway itself on the MS/TP bus, ranging from 0 - 127, must be unique on the bus. 10
Maximum Number of Information Frames The maximum number of data packets the gateway can send when holding the token at one time, ranging from 1 - 255. 5
Maximum Number of Master Devices Defines the upper limit of the token ring scale, must be ≥ the highest address of the actual master devices on the bus, ranging from 2 - 127. 10

Step 4: Other ConfigurationsAfter supplementing and confirming the following information, click "Save" to complete the batch addition of devices, or click "Save and Configure Variables" to continue quick batch configuration of device variables.

Click the "Publish" button in the upper right corner of the page to make the configuration take effect.

Parameter Name Description Example
Polling Cycle The cycle time for device data collection, unit: seconds. 10
Collection Timeout The timeout time for the device to respond after the gateway initiates a data collection request, unit: milliseconds. 1000
Enable Batch Collection Whether to enable the batch collection function; when enabled, variables with consecutive addresses are read in one collection request. Enabled
Maximum Batch Collection Count When batch collection is enabled, set the maximum number of data points collected in each batch. 64
Communication Interval Time The interval time between two communication requests, unit: milliseconds. 10
Description Descriptive information about the device to facilitate user identification of device functions. Packaging Workshop A - Packaging Machine 03 Device

Step 5: Configure VariablesIf you clicked "Save and Configure Variables" in the previous step, you can quickly configure device variables in batches.

  • The left side is the search result area, and the right side is the batch addition area.
  • The top of the left side supports searching for object names/types and switching devices to search for corresponding variables.
  • Select multiple variables on the left, click the [Subscribe] or [Poll] button in the middle to add them to the right.
  • The default variable name is the object name; variable names within a single device in the system cannot be duplicated and cannot contain spaces, so the system will automatically remove spaces.
  • After clicking Save, you can view the successfully added devices and point table information.

Add Tag

Two methods: Add Manually (Single Tag) or Auto Search (Batch Tags).

Method 1: Manually Add a Single Variable

  1. Step 1: Add VariableClick the "Manual Addition" button, fill in the information, and save.

Parameter Name Description Example
Collection Mode Select the data collection mode, which can be "Polling" or "Subscription". Polling
Name The name of the variable to be collected, which will be used in the data reporting message and cannot be duplicated within the same device. Production Quantity
Variable Type Select the type of variable, usually "Device Variable" or "Virtual Variable". Device Variable
Object Type Select the type of the collected object according to the object classification of the BACnet protocol, such as Analog Input, Digital Input, etc. AI (Analog Input)
Instance Number Fill in the instance number of the object type, an integer between 0 and 4194303. 1
Data Type Defaulted by the system according to the object type; refer to the appendix table for mapping rules. float(float32)
Read/Write Permission Determined by the system according to the object type; refer to the appendix table for specifications. Users with read/write permission can select it by themselves, while those with read-only permission cannot modify it. Read Only
Unit The unit of the variable, such as unit, °C, KWh, etc. unit
Associated Group Select the data group to which the variable belongs. -
Description Fill in the descriptive information of the variable to help users understand the meaning of the variable. The number of products produced this time
Data Calculation Select the calculation method for the collected data, such as "None", "Offset Scaling", "Ratio Conversion", etc. None

Repeat this step to add all variables that need to be collected. After all variables are added/modified, click the "Publish" button in the upper right corner of the page to make the configuration take effect.

Method 2: Batch Auto Search and Add Variables

  1. Step 1: Auto SearchClick the "Auto Search" button, select the required variables, click [Subscribe] or [Poll] to select them to the right, and click [Save] to add them in batches.

After all variables are added/modified, click the "Publish" button in the upper right corner of the page to make the configuration take effect.

Verification & Troubleshooting

  • Devices cannot be found or connected successfully:
    • Check whether the Edge2Cloud Factory and the target device are correctly connected to the same RS-485 bus, and whether the A/B lines are reversed.
    • Check whether the serial port parameters (baud rate, data bits, parity bits, stop bits) are consistent with all devices on the bus.
    • Check whether the "Local Node Address" conflicts with the addresses of other devices on the bus.
    • Check whether the "Maximum Number of Master Devices" is set correctly (should be greater than or equal to the highest address of the master devices on the bus).
    • Confirm whether the terminal resistor configuration on the bus is correct (usually at both ends of the bus).
  • Data collection fails or communication is unstable:
    • Verify whether the configuration of the device's Device ID, Object Type, and Instance Number is correct.
    • Check whether parameters such as "Polling Cycle", "Collection Timeout", and "Communication Interval Time" are set reasonably (whether they are too short leading to untimely device responses).
    • Check whether the bus load is too heavy; try adjusting the "Maximum Number of Information Frames".
    • Check whether there is interference in the line; ensure the RS-485 line is far away from high-voltage lines.
  • Question: Where to view relevant logs when an exception occurs?
    • Debug Logs:

    • System Logs:  

Appendix

Protocol Data Type Corresponding Description

When configuring variables in Edge2Cloud Factory, the data type correspondence is as follows:

Object Type C Language Type Data Type Read/Write Permission Value Description
Analog Input (AI) Float Float (float32) Read Only Single-precision floating-point number
Analog Output (AO) Float Float (float32) Read/Write Single-precision floating-point number
Analog Value (AV) Float Float (float32) Read/Write Single-precision floating-point number
Binary Input (BI) Bool Boolean (boolean) Read Only 0 or 1, indicating ON/OFF status (INACTIVE/ACTIVE)
Binary Output (BO) Bool Boolean (boolean) Read/Write 0 or 1, indicating ON/OFF status (INACTIVE/ACTIVE)
Binary Value (BV) Bool Boolean (boolean) Read/Write 0 or 1, indicating ON/OFF status (INACTIVE/ACTIVE)
Multi-state Input (MSI)
uint32_t
Integer (uint32) Read Only Unsigned integer, representing different values of multi-state status
Multi-state Output (MSO)
uint32_t
Integer (uint32) Read/Write Unsigned integer, representing different values of multi-state status
Multi-state Value (MSV)
uint32_t
Integer (uint32) Read/Write Unsigned integer, representing different values of multi-state status

Detailed Explanation of MS/TP Key Parameters

Parameter Name Meaning and Function Configuration Suggestions and Explanations
Local Node Address The physical address (MAC address) of the gateway itself on the MS/TP bus. Used to identify and address the gateway device at the underlying hardware level. Range: 0 - 127. Rule: Must ensure that this address does not conflict with the MAC addresses of all other MS/TP devices on the bus.
Maximum Number of Master Devices Defines the upper limit of the MS/TP token ring scale. It sets a rule for the bus protocol: the expected number of devices that may become master devices (i.e., devices that need to participate in token passing). The token will circulate among addresses from 0 to (Max Master). Must be ≥ the highest MAC address of all actual master devices on the bus. Example: If the master device with the highest address on the bus is 31, this parameter should be set to at least 31. If uncertain, it can be set to the maximum value of 127.
Maximum Number of Information Frames Limits the "speaking time" of a device while holding the token. Specifies the maximum number of data packets a device can send once it obtains the token, after which it must pass the token to the next device. Function: Prevents a single device from occupying the bus for a long time, ensuring the fairness and real-time performance of bus communication. Suggestion: The default value is usually 5 or 8. For gateways that need to collect a large amount of data, it can be appropriately increased (e.g., 16), but not too large to avoid affecting bus real-time performance.


Revision History


Version Date Author Changes
1.0 2026-02-06 WX Initial document creation.
    • Related Articles

    • BACnet IP Data Collection Guide

      1. Protocol Overview Protocol Description: BACnet IP is a communication protocol for building automation and control networks, based on IP networks for data communication and control. It enables interoperability between building devices, supporting ...
    • OPC UA Data Collection Guide

      1. Protocol Overview Protocol Description: Modbus TCP is a common industrial automation protocol based on TCP/IP network transmission. Application Scenarios: This protocol is widely used for data acquisition and control of devices such as PLCs, ...
    • Modbus TCP Data Collection Guide

      1. Protocol Overview Protocol Description: Modbus TCP is a common industrial automation protocol based on TCP/IP network transmission. Application Scenarios: This protocol is widely used for data acquisition and control of devices such as PLCs, ...
    • Siemens S7 Data Collection Guide

      1. Protocol Overview Protocol Description: The S7 protocol is a proprietary communication protocol developed by Siemens for its S7 series PLCs. It is primarily used for data communication between STEP 7 programming software and S7 PLCs, as well as ...
    • Omron CipNet Data Collection Guide

      1. Protocol Overview Protocol Description: CipNet is the term used by Omron for its EtherNet/IP network solution. EtherNet/IP is a widely adopted industrial Ethernet communication protocol that encapsulates the Common Industrial Protocol (CIP) within ...