Flow computer Modbus protocol
Abstract:
ARM microcontroller based expansion module to be installed inside flow computer converting proprietary protocol RS-232 interface to two Modbus RS-485 interfaces. .NET app for reading and changing configuration.
Challenges:
- Design system for auto-generating code, UI and documentation for a given Modbus map. Working with 100+ registers and limited time, it wasn't an option to manually write documentation, code on both embedded and .NET side for communication and UI for visualization. Nor would it be very interesting to find all the typos and discrepancies causing bugs.
- Adapting my very simple RTOS (while loop calling tasks) to support task waiting for something for extended periods of time (seconds) without affecting other tasks and timing requirements.
Learnings:
- It is unlikely to get generic code right the first time. As project progressed and I reused the code for another project, I've got to refine the code. Spend less time first time around making the design and be prepared to come back and refactor as new use cases and requirements arise.
- Learned very basics of Latex. It is a good tool for automated generation of documentation.
- All the intricacies of implementing async/await statemachine.