Modbus RTU RS485 - Receiving Issue
Posted: Tue Oct 30, 2018 8:02 pm
Hello, i hope you are all good!
I have to read a power meter (Voltage - Amperes - Watts etc.) using Modbus RTU.
In order to get some level of experience and understand things better, i first installed a modbus terminal software to observe the communication structure. I understand a few things and i was able aftes a few minutes to have a reply from the power meter with all the information that i want.
I then moved to flowcode, to write a simple program, to poll data from power meter since i knew the structure of the polling data.
I was a bit struggling to send the commands with the correct format because the power meter needs to receive hex values in the form :
0x01 + 0x04 + 0x00 + 0x00 + 0x00 + 0x08 + 0xF1 + 0xCC
I observed what was the form of the data, that the modbus terminal software was sending to power meter and that was of the form:
01 04 00 00 00 08 F1 CC
After a little search in the forum, i found how to send the hex value of 0x00 successfully.
Then i had a problem because of the 2 STOP Bits that the power meter protocol uses. To overcome this i used a small delay of 1ms after each command so it will be considered as 2 stop bits from power meter.
I finally managed to send the correct request data to power meter and it was sending a reply with all the data that i need.
My problem is how to read those data since the form of them is in hex and i have never done this again. I need to read the incoming data and show them on the LCD.
I have attached the flowcode 7 program that i used to poll data from power meter.
Could anyone give me a hand with this on please?
Thanks in advance
George
I have to read a power meter (Voltage - Amperes - Watts etc.) using Modbus RTU.
In order to get some level of experience and understand things better, i first installed a modbus terminal software to observe the communication structure. I understand a few things and i was able aftes a few minutes to have a reply from the power meter with all the information that i want.
I then moved to flowcode, to write a simple program, to poll data from power meter since i knew the structure of the polling data.
I was a bit struggling to send the commands with the correct format because the power meter needs to receive hex values in the form :
0x01 + 0x04 + 0x00 + 0x00 + 0x00 + 0x08 + 0xF1 + 0xCC
I observed what was the form of the data, that the modbus terminal software was sending to power meter and that was of the form:
01 04 00 00 00 08 F1 CC
After a little search in the forum, i found how to send the hex value of 0x00 successfully.
Then i had a problem because of the 2 STOP Bits that the power meter protocol uses. To overcome this i used a small delay of 1ms after each command so it will be considered as 2 stop bits from power meter.
I finally managed to send the correct request data to power meter and it was sending a reply with all the data that i need.
My problem is how to read those data since the form of them is in hex and i have never done this again. I need to read the incoming data and show them on the LCD.
I have attached the flowcode 7 program that i used to poll data from power meter.
Could anyone give me a hand with this on please?
Thanks in advance
George