Programming for Bacnet and Modbus Subnet devices

Here is an example program showing how to read bacnet and modbus devices wired to the subnetworks of the T3 controller. The two subnets are set up on the RS485 bus connections of the T3 controller, one will have the modbus devices and the other will have the bacnet devices. Note that you cannot mix modbus and bacnet devices on the same subnetwork or you’ll have communications errors.

image

Click on the node at Tab1 and then on the gear icon at Tab2 to bring up the advanced setup screen for the T3 controller. The IP address is set as fixed with the last octet of the IP address used as the panel number at the two Tab3’s. These two items need to be the same in order for the network routing rules to work. We need to make this more intuitive and will work up something for the user interface soon.

Lower down are the protocol and baud rate settings for the two subnetworks. One of the subnets is referred to as ‘main’ and it is set to Bacnet MSTP protocol at Tab5. The other subnet is referred to as ‘sub’ and this is set to Modbus at Tab 4. There’s no difference between the main and the sub except the name, both networks support Modbus and Bacnet equally well.

It goes without saying that any devices connected to each of these networks must be set to the same protocol and baud rate or the communications will not work for one or possibly all devices on that subnet.

After T3000 builds the network connections you will see the devices in the tree at Tab 6.
[Update]: Now both bacnet and modbus devices will show up here, before it was only modbus but now device discovery for both protocols is fully supported.

Next we create some variables to hold the data from the network at Tab8, give them names and set the engineering units in the variables table. Notice at Tab9 that the values are zero becuase there is no program associated with these variables yet.

Next we create a short program to read and write some network points. Click on the programming icon at Tab 10 to bring up the list of programs running in this controller, each row represents one program. Click on the first row at Tab11 and hit the “Insert” key to bring up the program editor at Tab12.

Further down is a listing of the program. You can mix bacnet and modbus commands in the same program, the controller will take care of routing the traffic to the appropriate subnetwork.

Lines 40 and 50 are the bacnet commands which make use of the bacnet ‘AI’ keyword for analog input. The ‘28’ is the panel ID of the T3 controller itself followed by a ‘.’ to denote the subnetwork and then the address ID of the subnet device, ‘12’ in this case.
40 TEMP1 = 28.12.AI1
50 HUM1 = 28.12.AI2

Lines 90 and 100 are the modbus commands to read the corresponding data using modbus registers. The format is similar to the bacnet commands, using the ‘MAIN.SUBNET’ notation to refer to the T3 controller ID and the subnet node ID. Finally, note that modbus registers are integer values x 10 so we need to divide by 10 to get the actual value.
90 TEMP2 = 28.84.MB_REG101 / 10
100 HUM2 = 28.84.MB_REG304 / 10

*******Here is the whole program for reference **************
10 REM READ MSTP POINTS
20 REM — 28 → ADDRESS OF THE CONTROLLER, (LAST OCTET OF IP ADDRESS)
30 REM — 12 → SUBNET MSTP BACNET DEVICE ADDRESS
40 TEMP1 = 28.12.AI1
50 HUM1 = 28.12.AI2
60 REM READ MODBUS POINTS
70 REM — 28 → ADDRESS OF THE CONTROLLER, (LAST OCTET OF IP ADDRESS)
80 REM — 84 → SUBNET MODBUS DEVICE ADDRESS
90 TEMP2 = 28.84.MB_REG101 / 10
100 HUM2 = 28.84.MB_REG304 / 10

Here is a list of the network points activity generated by a typical control program, these network points are generated automatically and transparently for you any time you use an item which is not located on the local controller. In this example we see two modbus register reads to two separate thermostats using modbus register reads. You can see the devices are online and reporting some data under the value column.

TBD: Explain the “Time Remaining” column.

1 Like

Does this now work for BACnet?

Yes for sure, the T3 series and T3-nano all support both modbus and bacnet protocol on the two subnets.

1 Like

Yes, I updated the post up there to show that device discovery and management for both Bacnet and Modbus protocols are now supported. The only limitation now with Bacnet is we cant update the firmware of the bacnet devices over RS485. Ethernet devices like the T3-BB controller series are fine, you can update those in Bacnet mode over the Ethernet port but devices like the Tstat8 and humidity sensors, etc, you’ll have to switch everything to mdobus for the update and then back to Bacnet. That’s very cumbersome I admit and we’re working on a solution.

2 Likes

Hello,
what about 3rd party modbus units.
How can i read data from them?
I have a co sensor with modbus com.
br 9600, data bit 8, parity none, stop bit 1, the register is holding 0x0050.
The manufactur gave those remark for getting value from sensor:
1 open port
2. slave address select
3 function code 03 select
4. base address select.
5 register quantity select
modbus frame transfer to the sensor then get value from sensor.
How can i implement it on the T3 controller?

There are a few examples in the forum, please search for the keywords network programming. I can reply in more detail once i am back at my PC.

Maurice Duteau

The Bacnet MAC ID and the Modbus RTU Network ID share the same parameter, here it is in the T3000 user interface and its fairly clear there. I will ask the team to make sure this is also clear in the next release of the ISPTool.

image002.png

~WRD255.jpg

image001.jpg

This appears to still be a limitation. Is switching everything to Modbus still the only workaround?

My T3-TB does not allow me to set Bacnet protocol on both subnets - only one subnet can be Bacnet. Is this correct? This is the message given by the T3000 software (version Jan 6 2021 . 14)
image

For now the T3 controllers support one Bacnet MSTP subnet, not two.

Firmware updates work fine over Ethernet but we’re not quite there yet with updates over MSTP subnets. Should have it done after the local break, early Feb 2021.

1 Like

A question about the BACnet MSTP number, I see the default is 1 from a Niagara scan.

Is there a way to change this in the T3 Nano?

You can use the T3000 application, its in the advanced dialog, basic information tab. I guess we should add it as a Bacnet object so you can get at it directly from a generic Bacnet tool. Chelsea will do that in an upcoming release.

I can change the BACnet MSTP MAC address and Modbus ID. The setting that doesn’t seem to be able to be changed is the MSTP network number and the BIP Network number.

It shows 0 on the image posted and this is not editable in the tool.

Through a scan though the MSTP network number is set at 1.

This is a problem if multiple Nanos are installed for multiple MSTP networks as they will conflict.

image

the bacnet instance should cover you for that, no?

Maurice Duteau

You would need a unique MSTP network number for each MSTP bus.

Here is a case example where the MSTP bus number 1 and MSTP number 2 was used

1 Like

All right, I will get with the team to see what we can offer when we return from the local holiday on Feb20. Suffice to say, you can build up systems with hundreds of controllers with hundreds of subnets and the system knows how to route the packets to where they’re supposed to go, as long as the device has a unique bacnet instance number the details of the routing will be taken care of automatically.

We did the test today with a JACE (with the default BACnet IP Network number of 1) and it does cause an issue as the Nano with connected devices stays offline. As soon as we change the JACE network number to anything other than 1 then the Nano and the connected MS/TP devices come online. Great product but limited by the inability to set MS/TP network number. Looking forward to the fix update.

OK, we’re on it. Should have something to report in a day or two.

Any updates on implementing this feature?

The team is working on this, main issue being we need to be able to change bacnet instances over MSTP subnets. If there are other issues that we need to know about you can let me know.

Have the issues with bacnet devices not showing up in the system tree been resolved yet.
I read most of the posts and it seems to have been going on for years.