AGG Software Forums
December 16, 2019, 02:32:27 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome on our forum!
   Home   Help Search Login Register  

Pages: [1]
Author Topic: MODBUS RTU to My SQL  (Read 1705 times)

Karma: +0/-0
Posts: 2

View Profile
« on: January 09, 2019, 02:05:59 PM »


i am new to this software. what i want to do is take data from my PLC using modbus RTU and to put it into SQL database.

I will highly appreciate if someone has managed to do this, to tell me how you managed to do it.

i am currently upto the stage where i have successfully managed to do a data query.
the response is as expected:
first part: 01 = slave ID
second part: 03 = function code
third part: 0C = number of registers to read
fourth part: 42 9A 00 00 = value of register that i want = 77 decimal
fifth part: 42 A0 00 00 = 80 decimal

Note: my data type is 32 bit single floating point, with big endian format

my question is, what is next for me to do?
- i tried to get these data to go into excel first but so far the data that is outputted to excel is gibberish
- I am guessing my issue is with the parsing stage? because i guess that is the part that converts the hex to a decimal number?

much appreciated.

* modbus.gif (161.23 KB, 1226x800 - viewed 2 times.)

* modbus2.gif (84.58 KB, 600x1080 - viewed 4 times.)

* modbus3.gif (64.9 KB, 660x558 - viewed 2 times.)

* modbus4.gif (184.59 KB, 1624x508 - viewed 5 times.)
Arthur Grasin
Tech. Support
Hero Member

Karma: +0/-0
Posts: 769

View Profile WWW
« Reply #1 on: January 09, 2019, 02:30:23 PM »


1. Address - it looks like offset. Please, try it.
2. Set Offset to -1. In this case, the program will calculate it automatically for sequential items.
3. Count - I think it should be "1".


Karma: +0/-0
Posts: 2

View Profile
« Reply #2 on: January 09, 2019, 06:17:04 PM »

Hi Arthur!

thanks very much. i finally found the solution and it was exactly as you said. i ended up trying all offsets between -1 and 8 and finally found out the correct address.

thank you very much sir! you are amazing
Pages: [1]
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines