How machin0r/cimsii-midas_ink_control works
Main Components
• User Application: At the top level, applications that import and use this library.
• Midas Object (Core API): This is the heart of the library (provided in midas_comms.py) which handles overall control and information.
• Serial Connection Module: The internal mechanism (via the “create_serial_connection” function) that establishes and maintains communication over an RS422 serial link. This module uses the pySerial dependency.
• Specialized Sub-Components (Sub-classes): The README documents that the Midas object has several sub-classes for different functions:
• Midas.Status() for alarms and status bits.
• Midas.Pressures() for infeed and meniscus parameters.
• Midas.Temperatures() for heater parameters.
• Midas.Pumps() for recirculation and meniscus pumps.
• Midas.Purge() for purge pressures and control.
• External Hardware (Ink System): Representing the actual Megnajet/Xaar CIMS II/HV/Midas ink system that communicates via RS422 signals.
Out Relationships and Interactions
• The User Application calls functions of the Midas object.
• Upon initialization and configuration, the Midas object calls create_serial_connection to instantiate an RS422-based connection (represented by an internal “Midas_Serial” object).
• After establishing the connection, various specialized sub-components (Status, Pressures, Temperatures, etc.) use this open channel to send and receive control commands.
• Data flow is bidirectional: commands (such as enable bits settings) travel from the user/application through the Midas object to the external hardware, and status/feedback is received back.
Important Architectural Patterns/Design Principles
• Modular Design: The entire system is broken into a main controller (Midas) and several auxiliary components (for status, pump control, etc.), each responsible for a particular aspect of the ink system’s operations.
• Abstraction over Hardware Communication: The implementation hides the complexities of RS422 serial communications behind a simple Python API.
• Encapsulation: The handling of the serial connection and the different control parameters are encapsulated within specific classes and methods, exposing a neat interface to client code.
Relevant Technologies
• Python as the programming language.
• pySerial library is used for handling RS422 communications.
• RS422 as the communication protocol used to talk to the ink system hardware.
• The layered abstraction from high-level API to low-level hardware communication.
• The precise roles of each sub-module within the Midas library.
• The specific technological stack (Python, pySerial, RS422) being used.