Reconnecting to Modbus
Dear all,
I'm running a project with an Industruino D21G using Modbus protocol. It's is a very simple sketch where I'm reading data from a PV Inverter. This inverter is on during the day, but when the night comes the inverter disconnect and switch off the data board. When the PV Inverter re connect as soon as the sun rise, I cannot read the Modbus register anymore, then I need to switch off and on the Industruino for reading again.
I assume that I have a problem with the timeout and\or the retry, but I don't know how to deal with it. Could anyone help to solve this problem: reconnect automatically the Modbus communications when the slave is available after a switch down.
Thanks in advance
Solved.
First, testing with packets[PACKET1].connection if conection is available. If not, after a certain time (when my inverter goes to OFF, it takes like 10-14 hours to go back to ON), reconnect by packets[PACKET1].connection = 1 (for each one of the packets used).
If Modbus is available again, packets[PACKET1].connection will be 1.
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 2/10/18, 10:01 AM |
Seen: 2255 times |
Last updated: 3/2/18, 3:54 PM |