AGG Software Forums
March 26, 2019, 01:36:22 AM *
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]
  Print  
Author Topic: MODBUS RTU to My SQL  (Read 599 times)
japras
Newbie
*

Karma: +0/-0
Posts: 2


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

hello,

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:
#01#03#0C#42#9A#00#00#42#A0#00#00#42#A4#00#00#C7#2A
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 3 times.)

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

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

Karma: +0/-0
Posts: 762



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

Hello,

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".

Tutorial:
http://www.aggsoft.com/serial-data-logger/tutorials/modbus-polling-1.htm
Logged
japras
Newbie
*

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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines