Example code for reading values

Hi All,

Just trying out T10 stat reading values from AQ-N via modbus. Can someone tell me what the keywords are for all the different types of modbus registers?
I don’t want to do this via bacnet as yet, would like to stick with modbus.
As far as I know the temperature value etc, are not readable with keyword MB_REG as I get no value from that.
Or am i missing something.
So I have a T10 which I am talking to via MODBUS because that is usable in T3000 to program etc, and MODBUS to AQ-N stat. I have them both visible in T3000 and I can see the values, but program wise, how do I read/write to the AQ-N?
I can see the register list in view registers, and can see all the values there, but something either wrong with my syntax for MB_REG or there is another keyword to get at the 30000 registers.

T10: address 100
AQ-N address 101

Jim

To integrate by modbus:
Check out the T3000 → tools → register viewer, there you can see all the registers, data structure, descriptions and current value.

I’ll suggest that you could set the protocol to Bacnet, that way you dont have to deal with a big modbus register list and converting the various modbus data structures.

Set the device to bacnet first, then the master controller (Tstat10 I assume) to bacnet afterwards. Once a subnet device is set to bacnet it will start sending out a lot of traffic and if there are any other modbus devices on that subnet they will be blocked.

Ya I can use bacnet but that stinks to make programming changes. Unless I am wrong you can’t edit programs while in bacnet mstp mode.
I can see the register list, what I am looking for is what are the keywords?
Mb_reg…
What others?

You can refer to the following Demo to see how to use each keyword.thank you

10 REM THE FOLLOWING ARE EXAMPLES OF READING A SUBNET DEVICE MODBUS ID=1
20 REM WHICH CONNECTED TO A MASTER CONTROLLER ON THE ETHERNET NETWORK WITH ‘PANEL ID?
30 REM READ THE REGISTER UNDER MODBUS RS485 IN MODBUS FLOATING POINT MODE AND SAVE IT
40 VAR100 = 1.2.MB_REG_FLOAT_ABCD33
50 VAR101 = 1.2.MB_REG_FLOAT_CDAB44
60 VAR102 = 1.2.MB_REG_FLOAT_BADC55
70 VAR103 = 1.2.MB_REG_FLOAT_DCBA66
80 REM HOW TO READ BIT MASK REGISTER.
90 VAR104 = 1.2.MB_REG7
100 VAR105 = 1.2.MB_REG7 & 1
110 VAR106 = 1.2.MB_REG7 | 1
120 VAR107 = 1.2.MB_COIL7
130 VAR108 = 1.2.MB_DISINPUT7
140 VAR109 = 1.2.MB_INPUTREG7
149 REM READ OTHER DEVICE USE BACNET PROTOCAL 123456 IS THE DEVICE ID (INSTANCE NUMBER)
150 VAR110 = 123456AI2048
160 VAR111 = 123456AV3
170 VAR112 = 123456AO4
180 VAR110 = 123456BO5
190 VAR110 = 123456BI6
200 VAR110 = 123456BV7
210 VAR1 = MB_BLOCKWRITE ( 1 , 2 , 3 , 111 , 5 , 6 )
220 VAR10 = MB_BLOCKREAD ( 1 , 2 , 3 , 2 , VAR1 , VAR2 )

Can we do concatenation for reading data e.g. I want to read data using mod-bus TCP and I want to use ip as a variable like → “201.1.MB_DISINPUT21”
Instaed of “201” I want to use variable for it like “IP.1.MB_DISINPUT21”

The first digit represents the panel ID. You can set the panel ID to be exactly the same as the last digit of the IP address

Thanks Fance, but this will not work for me, I have 4 3rd party devices and I want to read data from them over tcp. I just want to make their IPs change able.

For network modbus/TCP point, format is xx.yy.MB_REGzz.
XX → the last byte of ip address. for example, 192.168.0.100. xx is 100.
YY → RTU/RS485 subnet modbus id of device.
ZZ → Register you want to read or write.