Using the T3-BB controller to read & write to modbus tcp & BACnet/IP sensors

Can the T3-BB controller READ & WRITE modbus tcp & BACnet/IP sensors?
WITH EXAMPLE CONTROL BASIC PROGRAM

Sure, the T3 controllers can read & write Bacnet and Modbus sensors over Ethernet.
For modbus we have some special commands in our "Control Basic’ programming language:

01 (0x01) Read Coils > MB_COIL
02 (0x02) Read Discrete Inputs > MB_DISINPUT
03 (0x03) Read Holding Registers > MB_REG
04 (0x04) Read Input Registers > MB_INPUTREG
05 (0x05) Write Single Coil > MB_COIL
06 (0x06) Write Single Register > MB_REG

So suppose we have a Modbus device at IP address 192.168.0.100 and we want to read register #2 the program would look like this:

10 VAR1 = 100MBREG2

Where VAR1 is the variable on the local controller and 100 is the last IP octet of the Modbus IP device on your lan.

For Bacnet devices from other manufacturers just use the bacnet instance number and the Bacnet object you are interested in: AV, BV, AI, BI, AO, BO and so on. This works over both Ethernet/IP connections as well as RS485/MSTP connections.

10 VAR1 = 100AI2

And for the simplest method, for Bacnet devices from Temco Controls, use the native point name

10 VAR1 = 100IN2

Where 100 is the ‘Panel ID’ of the remote device and IN2 is the input point you are interested in, this could be IN, OUT, VAR, SCHED or any of the native point references. This is the preferred method when two Temco products are sharing network points because the point name will be replaced with the user text name once the program is sent and loaded back.

1 Like

Maurice this helps me and others to know how to read from modbus device.

I have other queries like:

1.How to read 32/64 bit register.

2.How to read bit mask register.

3.How to read real swapped register.

  1. How to read 32/64 bit register.
    For now we just support 16 bit registers.

2.How to read bit mask register.
The following are examples of reading a subnet device with Modbus ID=10 connected to a master controller on the Ethernet network with ‘Panel ID’ = 97
10 VAR10 = 97.10.MB_REG7
20 VAR9 = 97.10.MB_REG & 1
30 VAR9 = 97.10.MB_REG | 1
Use & (bitwise and) and | (bitwise or) to manage bit level read & write.

3.How to read real swapped register.
For now we only support 16bit low byte first.
For other structures you would have to manipulate the data in your program.

1 Like