Sign in to follow this  
Followers 0
JayA

Floating point format for modbus rtu

7 posts in this topic

I am researching the various methods that manufacturers other than Modicon such as flowmeters, valve controllers, dewpoint monitors deliver floating point values when requested either through Modbus command 03 or 04.  I need to write a universal serial driver for Omron CS1 PLC to accomplish the request of 32 bit floating point registers.  Floating point registers in these devices are usually two 16 bit registers long and are usually located in the 5000 or 7000 register range.  Does one request one floating point register at 5000 or 7000 and expect two regular 16 bit registers to be  returned?  Or do you have to request two registers to get two registers?  Is it defined or does each manufacturer do it differently?  What is the Enron Modbus specification? :-3

Share this post


Link to post
Share on other sites
The Modbus TCP specification is old and does not cover floating point numbers.  The Modbus/TCP specfication does.  I would follow the specification there. Modbus website

Share this post


Link to post
Share on other sites
I have aleady been through this exercise.  The Modbus/TCP specification is for implementing the original Modbus serial protocol on networks other than serial (ethernet, arcnet, etc.).  I am looking for examples of how manufacturers other than Modicon handle floating point registers in their products when implemented on serial devices.

Share this post


Link to post
Share on other sites
Jay I see from the post date that much sea have run in the ocean since you made the post, but I hope some comments still are appreciated.... I went through this subject over a year ago when I had to write a Modbus RTU driver to interface some valves. Regarding this spesific valve: - The valves supported only functions 01, 03, 15 and 16. - The holding registers contained both: integer (16 bit), float (IEEE) and hex... - They was numbered 40001- 400064 in the documentation, but the address in the telegram would be 0 - 63. - To read a float, 2 holding reg had to be read. Function 3. MSW of IEEE first. (lowest address). - A telegram example, read command, 14 holding reg, starting at address 0, station 1 : <1><3><0><0><0><14><196><14> < n > = decimal value n, not hex or ascii. Some quotes from a different modbus-driver I saw with float capabilities (Implemented in func. 3 and 16): "When 32 bits values are exchanged (integer or floating point) the position of the higher and the lower word in the telegrams must be checked and adjusted in the driver. Depending on the manufacturer, various terms are used to specify the word order in telegrams. - Modicon = LSW-MSW = Little Endian = Intel - IEEE = MSW-LSW = Big Endian = Motorola Modicon systems supports also the IEEE format. However, for the data transmission, the 16 lower bits are swaped with the 16 higher bits. The choice of the Modicon or the IEEE method must be selected. According to the Master possibilities, address offset of 5'000 or 60'000 can be used. Address range 5000-9095 or 60'000-64'095. The offset must be applied to the register address for using the 32 bits IEEE format. Maximum amount of values per request: Functions in Integer format: 127 Registers Functions in IEEE floating point: 63 Registers" regards kalle

Share this post


Link to post
Share on other sites
In six months of posting on multiple PLC forums this is the most intelligent answer that I have ever received on this particular subject.  Thanks so much. Kalle.  Please register on MR.PLC.com so that we may send you additional email. What brand or munufacturer's protocol did the quoted info originate?

Share this post


Link to post
Share on other sites
Hi Jay "this is the most intelligent answer that I have ever received on this particular subject." I'm not going to ask what the other answers was.... Regarding the spesific valve, I ended up reading/writing all relevant holding registers in a single telegram without making a Read_IEEE_function. The PLC code made all necessary float arrangement after reading / before writing. Link to the valve: http://www.lyng.com/motor/ Other systems supporting IEEE or Modicon floating point format: (quoted) - Visualisation system Staefa, with NIMOD interface - Honeywell TDC 3000 with APM-SI The quoted information was from a modbus driver for the plc brand SAIA PCD. (Swiss). Here is a driver list from the author: http://www.engiby.ch/drivers.htm He/they are productive..., but SAIA PCD is a PLC where it is easy to make drivers. Have done some myself. If you read the Modbus FAQ section, have in mind that a SAIA PCD register is 32 bit and the float format is a Motorola format, not IEEE. Regards Karl Egil

Share this post


Link to post
Share on other sites
Wow!  What a wealth of information!  It may take me a day or two to digest it. Thanks for the links. :-p

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0