laitimes

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

author:A sprouted potato

In the Siemens PLC system, the correspondence between the data is a more important point, but also a point that is prone to errors, and it is explained in detail below.

Firstly, the correspondence and conversion relationship between bits, bytes, words, and double words are explained:

One byte = 8 bits;

Word = 2 bytes = 16 bits

doubleWord = 2 words (2Word) = 4 bytes (4bytes) = 32 bits (32 bits);

1. The correspondence between bits and bytes:

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

With the above figure, we can verify that MB100 is a byte corresponding to 8 bits of binary, and the lowest bit corresponds to M100.0

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

The highest bit corresponds to M100.7 in order, from right to left, M100.7-M100.0 corresponds to each binary bit of MB100. As shown in the figure below:

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

If it is applied to an example, the 8 colored lights can be lit sequentially, and one byte of data can be used for each binary bit, and the cyclic shift instruction can be used

2. The correspondence between words, bytes and bits:

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

The high 8 of MW100 corresponds to MB100, and the low 8 bits correspond to MB101.

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

The following diagram is shown below:

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

With the above chart display, it is not difficult to see that the correspondence is no longer in order, and the high and low levels have changed, which is also a point that is often prone to error. It needs to be paid attention to in the actual use process.

3. The correspondence between double words and words, bytes and bits:

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

As shown in the image, the double word contains two words that are not connected:

MD100对应MW100和MW102;

MW100 corresponds to MB100 and MB101;

MW102 corresponds to MB102 and MB103;

So MD100 does not correspond to MW100 and MW101, but MW100 and MW102. There is a diagram to verify that the correspondence between the two words and the word can be seen: the high and low positions are also MW100 in the high position, and MW102 in the low position.

The correspondence and conversion relationship between Siemens Botu bits, bytes, words, and double words

Data processing is an indispensable part of PLC applications, and the conversion between data is very important, and it is very important to understand and remember the correspondence.

The best way to practice the correspondence between the above data is to write a marquee program to deepen your memory.