7/1/2025 5:33 PM | |
Joined: 12/18/2014 Last visit: 9/14/2025 Posts: 35960 Rating:
|
Hello Buttsy26, I don't understand why you open a new topic for the same problem as in this topic: modbus comms with Logo |
7/1/2025 5:47 PM | |
Joined: 9/27/2006 Last visit: 9/14/2025 Posts: 12408 Rating:
|
Hello Buttsy; When Siemens provides a Modbus driver it traies to adapt to the Modbus specifications (designed originally foir a Modicon PLC) on its own hardware. Modbus registers occupy 16 bits, and are used to transfer word-size information, basically integers in the range 0 to 65535 (unsigned values) or -32768 to 32767 (signed values) respectively. Since floating-point (REAL) numbers occupy 32 bits (and are formatted very strictly, according to IEEE 754), they occupy 2 seperate but contiguous registers in a Modbus transmission. If your Modbus mapping states that Volts starts at offset address 2, then you should read address 2 and 3, and in your Step 7 program you have to Move them both to a 32-but REAL register so it can be deciphered. as a floating point value. Unless your Modbus mapping give very different registers for Function 3 and Function 4 registers, very oftwen it does not matter which one you devide to work with, the important part is the offet you are selecting. Belopw is an example of IEEE 754 conversion, the folating point value you want to read is 240.0 Volts, in the last 2 lines you will find the binary and hexadecival 32-bit values that will be actually sent over your 2 Modbus registers. Hope this helps, Daniel Chartier Edit; I just read your exchanges wth ixo65, and found out that the Logo! was involved in your project. However, Logo! CPUs cannot handle floating point values internally. Look at this link to see about a possible alternative, or better yet, upgrade to a S7-1200 PLC: https://support.industry.siemens.com/cs/ca/en/view/109741041/89393485963 D.C. |
Last edited by: dchartier at: 07/01/2025 17:56:40 |
|
Follow us on