Projects » MyIO » Documentation » 2.0 Interface » 2.2 modbus Protocol

2.2 Myio modbus implimentation

Oringially I was going to use my own modbus-alike protocol, described here.  After a bit of flip-flopping I decided to stick with the full modbus protocol, as i can squash most of it into a small PIC device, and it keeps my options open for linking my work to other devices and software.

My implimentation of modbus will obviosuly be limited by the hardware I intend to use, but will still interact with standard modus software within those limitations.  The limitations are around the amount of RAM available in the smaller PIC's and that restricts the number of registers / coils / inputs I can emulate.  To some extent I'll get aound this by overlapping the mapping of the registers and coils in memory.

The PIC column represents where I'm at with the the I/O module, or RTU end, and PC is the C software running on the Linux PC. I'm using libmodbus for the low level driving on the PC, so the PC end really means I've tested the library call for that function.

Once I've finished things this will equate to the low level software features list, but in the mean time it's a check-list for me while I work on the code at each end.

The complete details of these commands can be found on the modbus website.

Function Code                           | PIC     | PC
0x01 - Read Coils | Done | Done
0x02 - Read Discrete Inputs | Done | Done
0x03 - Read Holding Registers | Done | Done
0x04 - Read Input Registers | Done | Done
0x05 - Write Single Coil | Done | Done
0x06 - Write Single Register | Done | Done
0x07 - Read Exception Status | Dunno | Dunno
0x08 - Diagnostics | Dunno | Dunno
0x0B - Get Comm event Counter | Done | TBA *
0x0C - Get Comm Event Log | Dunno | Dunno
0x0F - Write Multiple Coils | 50%** | Done
0x10 - Write Multiple Registers | TBA | TBA
0x11 - Report Slave ID | TBA | TBA
0x14 - Read File Record | No | No
0x15 - Write File Record | No | No
0x16 - Mask Write Register | No | No
0x17 - Read/Write Multiple Registers | No | No
0x18 - Read FIFO Queue | No | No
0x2B - Encapsulated Interface Transport | No | No
* - libmodbus does not support function 0x0B to test it.
** - Fudge version only supports even chunks of 8 bits. Needs finishing.

Key:

No - No Support, I'm not going to write this in at this stage.

TBA - I intend to support it, watch this space. :-).

Dunno - Not sure if I'll support it, see above.

Powered by Etomite CMS.