Coder Social home page Coder Social logo

wagomodbusnet's People

Watchers

 avatar  avatar  avatar

wagomodbusnet's Issues

IDisposable

The Microsoft provided libraries for opening connections: Socket and SerialPort both implement IDisposable. However, the ModbusMaster$ that use them do not implement that interface nor a finalizer. This causes the problem when a ModbusMaster reference is set to null: the connection is not released.

Throw Exceptions instead of using Error Codes

Remove all error/return codes and replace them with exceptions. By the end, wmnRet and wmnErrorOffset will be removed.

Return codes clutter the caller. It is better to throw an exception when you encounter an error. (Martin, R. C. (2009). Clean Code: a handbook of agile software craftsmanship. p 104)

Bug: ModbusRtu Query() not working

This is because the method is looking for a TimeoutException in the WagoModbusNet namespace. This new exception should be removed. Also, the logic should be moved out of the finally block top the catch block. Not operating on an expected Exception is the ultimate goal.

Unit Tests

Found several errors in the first update. Unit Tests should be created to avoid these. Currently, the various ModbusMasters cannot have unit tests for their modbus operations, save connection failure. The data manipulation methods should be turned protected/internal, so that unit tests can be run on them.

ModbusMaster Interface

IModbusMaster may seem pedantic to have as an interface given the ModbusMaster abstract class, however under my understanding, this can make using Dependency Injection containers a bit more straightforward. Need to research this more.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.