AGG Software Forums

Online Help Center => Data loggers and plug-ins => Topic started by: japras on January 09, 2019, 11:05:59 AM

Title: MODBUS RTU to My SQL
Post by: japras on January 09, 2019, 11:05:59 AM
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.
Title: Re: MODBUS RTU to My SQL
Post by: Arthur Grasin on January 09, 2019, 11:30:23 AM
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
Title: Re: MODBUS RTU to My SQL
Post by: japras on January 09, 2019, 03: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
Title: Re: MODBUS RTU to My SQL
Post by: japras on January 27, 2020, 10:37:39 AM
Hello Arthur, or other kind users,

i want to ask with this advanced serial data logger software:
- i have multiple machines that talk to a central modbus master, which is this advanced serial data logger
- right now if i have 2 devices for example with modbus ID 2 and modbus ID 3, i am able to get the data to parse just fine, using the same parsing variable name e.g. "ITEM1" but i am having issue with the ODBC module because it seems that i am unable to use the same "ITEM1"
- is it possible with the "modbusRTU" module, to set up multiple queries but then the data goes into the same variable name in the response items.

thank you .
Title: Re: MODBUS RTU to My SQL
Post by: Arthur Grasin on January 27, 2020, 11:11:13 AM
In your case, you should define separate request for each device and disable the "Export data for all requests at once" option.
Title: Re: MODBUS RTU to My SQL
Post by: japras on January 28, 2020, 11:37:16 AM
YOU ARE A GENIUS! THAT IMMEDIATELY MAKES IT WORK!
WOW YOU ARE TRULY LIFESAVER. I HAVE SPENT ALMOST 10 HOURS TRYING TO FIGURE THIS PROBLEM OUT. you solved it immediately. thank you very much, good sir!