First of all, I'm way out of my league here. I know that already.
I've been using the suggested modbus library (and I tried others too) but I cannot get it to work.
The example sketch is supposed to write HRs to the slave, but it doesn't do that. I've been monitoring it via a modbus slave tool. The Industruino is connected via the AB ports to a USB device which emulates another modbus device, in our case a slave, because the Industruino is destined to master over two other devices. I've been using the sketch from here: https://industruino.com/blog/our-news-1/post/modbus-rtu-master-and-slave-14 (solely the master sketch).
Provided is a screenshot of my settings as a listening device: Which shows up empty, always. No matter what settings I use. EDIT: Apparently I need more karma. Link here: https://pasteboard.co/JIxvGWJ.png
I've been reading something about a switch provided in the docs; I'm unable to find that one too on my board. This Ind/IO is about a year old by now.
We use Modbus all the time on the RS485 port, and it works great. Our basic library is SimpleModbusSlave, but we also tried SimpleMOdbusMaster too, and a master Industruino can supervise some slave Industruinos just fine.
Remember the Modbus buffer of the industruino is 64 bytes long (so 32 Modbus words). So do not ask an IndIO more than 32 words at a time (won't answer) and do not ask for more than 32 word at a time if you are the master (won't read the answer).
We came across some problems IndIO being a slave : since we updated our slave interfaces by blocks of 10 words, at a rate of one block / sec, some picky masters consider a too slow answer as a timeout error but on the whole, it works.
As a master, we also came across a number of problems related to the way Modbus is treated by the third-party slave : for instance, atlantic gas boilers cannot be asked more than one word every 5 seconds, or they either do not answer (if you ask more than one word at a time) or jam up their answers (if you ask faster than one word every 5 secs). ATV212 VSDs cannot be asked more than one word at a time, Saacke burners can answer to tables requests, but only on continuous tables, etc, etc, etc ...
What I recommend for tests is just an USB to RS485 interface, and a PC software simulator like ModbusSlave or ModbusPoll. This will help you diagnose what comes in or out of the RS485, and save you hours when confronted with a third-party hardware. You find them cheap anywhere.
Hope this helps,
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!