Hi, I am trying to implement the Modbus RTUs slave functionality in an F28335. I am starting with implementing the first function of Modbus:
Code: 01
Description: Read coils
Here is an example for the function:
http://www.simplymodbus.ca/FC01.htm
The master sends a message which tells the slave which coils are to be read. My question is this:
In the example given in the posted link. coils #20 to #56 are to be read. What is the best way to implement these coils? Can I implement them as registers (each n byte register will have 8n coils) and then assign a coil number to each bit in those registers? Please advise.