I'm building a single master multiple slave RS485 network for remote sensors on test equipment. I have the hardware built and working, and I can do a Serial.print on the master and have the slaves display the values received on their attached OLED screens. The goal is for the master to cycle through the slave addresses one by one and request data, then wait for the slave to respond (or timeout and register as a fail on the master's GUI).
The issue I have is that to work out if a packet is intended for a slave device I have to parse the entire packet, wait for start and end packets, and check the address. This means every device has to capture and check every packet on the network for its own address byte. If I compare on the fly I can exit the serial loop as soon as I know which device the packet is intended for, but the next received packet will just re-open the serial loop part way through transmission.
Other than disabling the RS485 transceiver between packets, is there an elegant way to solve this issue without massive overheads?
My hardware uses Arduino Nanos (master is currently an Uno but will be a piece of National Instruments hardware) and MAX13487 transceivers.