User Documentation
27|33
© All rights with Robert Bosch GmbH, also for the case of protected rights applications
EN_User_documentation_Instructions_for_controlling_the_Logamatic_5000_controller_series_via_Modbus_TCP_I
P_20210203.docx | 10.02.2021
Bit Number
Bit
7
Bit
6
Bit
5
Bit
4
Bit
3
Bit
2
Bit
1
Bit
0
Valence
128
64
32
16
8
4
2
1
Bit to be set
X
Calculated integer or bit pattern:
𝐼𝑛𝑡𝑒𝑔𝑒𝑟 = 𝑉𝑎𝑙𝑒𝑛𝑐𝑒 𝐵𝑖𝑡
2
= 4
𝐵𝑖𝑡 𝑃𝑎𝑡𝑡𝑒𝑟𝑛 = 0000000000000100
𝑏
If, on the other hand, you would like to set several bits (e.g. temperature-controlled
[Bit2], priority [Bit1] and guide tank [Bit0]), the table and corresponding calculation
would look like this:
Bit Number
Bit
7
Bit
6
Bit
5
Bit
4
Bit
3
Bit
2
Bit
1
Bit
0
Valence
128
64
32
16
8
4
2
1
Bit to be set
X
X
X
Calculated Integer or Bit Pattern:
𝐼𝑛𝑡𝑒𝑔𝑒𝑟 = 𝑉𝑎𝑙𝑒𝑛𝑐𝑒 𝐵𝑖𝑡
2
+ 𝑉𝑎𝑙𝑒𝑛𝑐𝑒 𝐵𝑖𝑡
1
+ 𝑉𝑎𝑙𝑒𝑛𝑐𝑒 𝐵𝑖𝑡
0
= 4 + 2 + 1 = 7
𝐵𝑖𝑡 𝑃𝑎𝑡𝑡𝑒𝑟𝑛 = 0000000000000111
𝑏
6.2
Reading single bits from Modbus registers
If you want to read individual bits from a Modbus register, e.g. to read out the cur-
rent errors on the safety chain, proceed as follows:
First, read out the register contents as an integer. The read integer must then be
transferred to a bit pattern. To transfer the integer to a bit pattern, please proceed as
follows:
Now divide the read integer by the valence, starting with the highest bit (division with
remainder). If the quotient is equal to zero, you can divide the integer with the signifi-
cance of the next smaller bit. As soon as the quotient is not equal to zero, the cur-
rent bit is set and you can use the remainder of the divisi-on as a dividend for the
calculation with the significance of the next smaller bit. You apply this scheme until
you have divided the integer or the remainder by all bits. The result is the corre-
sponding bit pattern.
For this you can use the following formula (division with remainder):
𝐵𝑖𝑡
𝑁𝑢𝑚𝑏𝑒𝑟𝑋
=
𝐼𝑛𝑡𝑒𝑔𝑒𝑟 𝑜𝑟 𝑅𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟
𝑉𝑎𝑙𝑒𝑛𝑐𝑒 𝐵𝑖𝑡
𝑁𝑢𝑚𝑏𝑒𝑟𝑋