I will think loud on how I would solve the problem.
Six XBee sensors are all slave addresses are : S01 S02 .... S06
XBee coordinator is the master, so no address is needed
Slave S01 has data to send so, "S01" + Data will be Tx out
Immediatly after Tx action, Slave S01 go to RX loop count routine and here waits master ACK.
Code:
LoopCount:
Count=Count+1
if Count=XX then
Count=0
Time= Time +1
goto Tx again
endif
If Time=YY then error
SERIN2 RX\RTS, baud, 2500, LoopCount, [Wait("S01"), Data]
If Data=6 then main
goto LoopCount
This action will be repeated so many time as judged feasible using variable XX while variable YY will trigger an error in case of no response.
Master receive address + data then answer with received slave address + ACK
Slave Receive the proper address + ACK then delete data and return to main loop. (This will avoide to disturb the other slaves which will ignore the Tx)
Collisons are not avoided but ignored since Slaves will continue to Tx address + Data till it receives its address + ACK
The same will apply for all the other slaves.
Al.
Bookmarks