When communicating in 485 network, sometimes the slave does not return data after the host asks
[Copy link]
The test environment is a 485 host responsible for sending instructions to 7 slaves in a continuous cycle. After the host sends the instruction and receives the correct reply from the slave, it sends the instruction to the next slave, and the cycle continues.
If the slave does not return data or the received data is abnormal, the host will wait for about 60 seconds before sending the next instruction. All data are observed through the serial port debugging assistant.
The 485 nodes use a soft wire similar to DuPont wire, and the length does not exceed 100cm.
The problem now is that when the host asks the slave, after a period of time, one of the slaves will not return data. This happens to every node.
Later, I cut off the power to one of the nodes (I cut off the power to it half-blindly, because when I checked the data, I always felt that this was caused by too frequent intervals between data transmission). In this way, the host would not send query commands to the slave for about 1 minute. Then I found that except for the slave that was powered off, the data of other slaves were returned normally.
Did I really guess it right? But I still don't know the truth. So please tell me the reason and solution of this situation I tested.
|