Crate brewdrivers

source ·
Expand description

A 3 tiered driver library for interacting with Modbus devices on a SCADA-like network.

This library is one of a set of repositories in the Brewery Control System project of the Navasota Brewing Company. It contains low level drivers for devices we use in the brewing process.

Layers

This crate operates on 3 layers:

  1. drivers – Low level abtractions of Modbus or other serial devices. These are very general and allow communication to nearly any device.
  2. controllers – Implementations of drivers for specific controllers. These are the controllers we use to control field devices in the brewery system.
  3. model – A conceptual model of an RTU, containing a list of devices. These devices are serializable and can be sent over the network. They contain connection details and state, so that they can use a controller to read or enact change in a field device. You can write a configuration file that models the RTU and its devices, then this crate can read the configuration file and update/enact the devices as necessary.

New controllers will be added as needed. See the examples/ directory to see how to use this library, and see the organization documentation for more information about the hardware and project as a whole.

Modules

  • A controller is a specific implementation of driver, made for one specific instrument. This module also includes pieces of data like state enums that are used by the controller and above layer but not the driver layer.
  • Default values for things
  • A driver is the lowest level. It is a generic implementation of Modbus or a serial instrument, or similar. Controllers are implementations of these drivers. If you’re looking to interact with a controller, look there.
  • Provides alternatives to the regular log::info, log::trace, etc. macros. These work the same way, but you can provide a Device as the first argument and it will print the id and state as a prefix.
  • Generalize states for controllers

Macros