La séptima vida

...o el gato así lo espera/teme

Week 29 -- Rewrite of Device::Modbus

This week I have been working in the rewrite of Device::Modbus. This is what was accomplished:
  • Published an article detailing the reasons for re-writing Device::Modbus
  • The test suite is quite thorough. However, there are a couple of parts of the Client module that are hard to test and it still needs to be done. The Server module is not yet tested at the same level as the rest of the core distribution
  • To end the week, Sunday at 11:40pm the RTU client communicated to an industrial temperature controller!
  • I uploaded the core distribution to GitHub. I still need to prepare the RTU distro for uploading. It should be published this week.

I need to mock a client to exercise the parts of the Client module which read from the port. The Server module has not been fully tested either.

On the good side, this is the report from Devel::Cover:

----------------------------------- ------ ------ ------ ------ ------ ------
File                                  stmt   bran   cond    sub   time  total
----------------------------------- ------ ------ ------ ------ ------ ------
blib/lib/Device/Modbus.pm            100.0  100.0    n/a  100.0    6.7  100.0
blib/lib/Device/Modbus/ADU.pm        100.0  100.0  100.0  100.0   14.3  100.0
blib/lib/Device/Modbus/Client.pm      90.3  100.0  100.0   90.5   11.3   91.4
blib/lib/Device/Modbus/Exception.pm  100.0  100.0  100.0  100.0    7.3  100.0
blib/lib/Device/Modbus/Request.pm    100.0  100.0  100.0  100.0   15.2  100.0
blib/lib/Device/Modbus/Response.pm   100.0  100.0  100.0  100.0   14.9  100.0
blib/lib/Device/Modbus/Server.pm      61.6   33.3   60.0   80.8    6.9   58.0
blib/lib/Device/Modbus/Unit.pm       100.0  100.0  100.0  100.0    7.4  100.0
.../lib/Device/Modbus/Unit/Route.pm  100.0  100.0  100.0  100.0   16.1  100.0
Total                                 88.6   80.7   98.2   94.2  100.0   89.0
----------------------------------- ------ ------ ------ ------ ------ ------

So, this week I plan to:

  • Improve the testing of the core Client and Server modules
  • Prepare the RTU distribution for uploading to GitHub
  • Test the RTU server... I need to figure out how to do it. It is possible to do with a PLC or probably an Arduino sending pre-prepared requests.
  • Advance on the TCP set of modules
  • Test whatever is available in a Raspberry Pi

That's it for this week!