What is Byte:Format MB:U8 and LB:U8 in modbus

flash053069

Member
Join Date
Oct 2014
Location
Harmony NC
Posts
32
I have a boiler I can write to registers to change set points in Celcius using Modbus. I am a beginner with this and do not understand the Byte:Format MB:U8 and LB:U8.
Does anyone know where I can find a table with this info. I don't know if its an Integer or REAL or what? I can write a 0 or 255 to this register value
Thanks in advance
 
Hello,

MODBUS holding/input registers use 2 bytes per register. Is the byte order MSB first or LSB first?

1 byte = 8 bits, 1 register is 2 bytes = 16 bits

Most Significant Byte or Least Significant Byte

For 1 register (2 bytes) you have two choices.

If 2 registers are used, to hold a floating point value, the byte count increases to 4, 2 bytes per register. Now the choice of byte order increases to 4.


Code:
Description                            Byte Order
Big Endian Format                      4,3,2,1
Big Endian w/ bytes swapped            3,4,1,2
Little Endian Format                   1,2,3,4
Little Endian w/ bytes swapped         2,1,4,3

The byte must be correct for proper communication of the value.

> MB:U8 and LB:U8

That indicates to me MSB first unsigned or LSB first unsigned. Unsigned meaning a byte value 0 - 255. Since it is only one byte the S was dropped.

So, the byte is placed in the first 8 bits of the 16 bit register or the second 8 bits of the 16 bit register. The value is not a float. It is an unsigned small integer.

One other thing, the bit order might be swapped. From the text you posted "MB:U8 and LB:U8" I am "guessing" it is the byte position in the register.

FYI, integer means different things in/on different computer languages/computers. If you do not know, check the documentation.
 
Last edited:

Similar Topics

Has anybody got a routine handy that will take an INT as input (1 - 21) and convert it to the Byte.Bit format that is needed to add to a basic...
Replies
14
Views
21,208
Our system utilises INPUT_BYTE to capture NMEA0183 ASCII stream which sends data to the NOM multiple times a second. The NOM module can either be...
Replies
0
Views
382
Hello everyone, friends. I need help with something. I want to read and change Bit and Byte numbers via HMI. I found a code snippet for this as...
Replies
18
Views
3,019
Hello everyone :) I just want to start with learning PLC programming, so I need advice. I have SIMATIC S7-1200, CPU with integrated memory...
Replies
5
Views
917
I have a C-More HMI that changes my PLC String from "Machine Status" to "aMhcni etStasu" . There is an option with other objects that have string...
Replies
15
Views
3,458
Back
Top Bottom