32 bit data types in modicon plcs

C

Thread Starter

Chris

I notice that register oder of 32-bit data type (DWord/Float) is not defined in modbus protocol. Does modicon modbus PLC support 32-bit data types? If yes, how does it arrange the register order? Does it save low word (bit 15-0) in first register or not? And what about other plcs?
 
B
So double word or float is not defined in Modbus Protocol. So what? Neither is the length of a string. When a host device, like an HMI, requests a Real (Floating Point) value, the driver software requests 2 consecutive reference addresses.

As to the "order" of the data. The format is "big-endian:.

Big-endian and little-endian are terms that describe the order in which a sequence of bytes are stored in computer memory. Big-endian is an order in which the "big end" (most significant value in the sequence) is stored first (at the lowest storage address). Little-endian is an order in which the "little end" (least significant value in the sequence) is stored first. For example, in a big-endian computer, the two bytes required for the hexadecimal number 4F52 would be stored as 4F52 in storage (if 4F is stored at storage address 1000, for example, 52 will be at address 1001). In a little-endian system, it would be stored as 524F (52 at address 1000, 4F at 1001).

IBM's 370 mainframes, most RISC-based computers, and Motorola microprocessors use the big-endian approach. TCP/IP also uses the big-endian approach (and thus big-endian is sometimes called network order). For people who use languages that read left-to-right, this seems like the natural way to think of a storing a string of characters or numbers - in the same order you expect to see it presented to you. Many of us would thus think of big-endian as storing something in forward fashion, just as we read.

On the other hand, Intel processors (CPUs) and DEC Alphas and at least some programs that run on them are little-endian. An argument for little-endian order is that as you increase a numeric value, you may need to add digits to the left (a higher non-exponential number has more digits). Thus, an addition of two numbers often requires moving all the digits of a big-endian ordered number in storage, moving everything to the right. In a number stored in little-endian fashion, the least significant bytes can stay where they are and new digits can be added to the right at a higher address. This means that some computer operations may be simpler and faster to perform.

Language compilers such as that of Java or FORTRAN have to know which way the object code they develop is going to be stored. Converters can be used to change one kind of endian to the other when necessary.

Note that within both big-endian and little-endian byte orders, the bits within each byte are big-endian. That is, there is no attempt to be big- or little-endian about the entire bit stream represented by a given number of stored bytes. For example, whether hexadecimal 4F is put in storage first or last with other bytes in a given storage address range, the bit order within the byte will be:

01001111

It is possible to be big-endian or little-endian about the bit order, but CPUs and programs are almost always designed for a big-endian bit order. In data transmission, however, it is possible to have either bit order.

The preceding definition is from searchNetworking.com, a TechTarget site for Networking professionals
 
Top