Introduction This document describes the Output Channel Cache Library. The library is dened and implemented in outputChannelCache.h and outputChannelCache.cpp respectively. The pri- mary documentation for this library is its corresponding Doxygen-generated HTML output. The Doxygen documentation should be consulted for a detailed description of the library's API. The document you are reading now is supplemental, and is intended to provide deeper background for the library's purpose and implementation. In cases where the Doxygen doc- umentation disagrees with this document, the Doxygen documentation should be considered correct. The output channel cache library was written as a support library for the system's control server1. It serves as an intermediate layer between the control server application and the hardware outputs the control server manipulates. The control server uses an internal state machine based on our State Machine Library2. One feature of that library is the option to allow a user to manually force jumps from any state in the state machine to any other state in the state machine. However, doing so in real-world applications often requires special planning. In the case of the control server's state machine, the ability to arbitrarily jump into any state means that each state must be able to fully congure the system's hardware control outputs as appropriate for that state. States cannot rely on earlier states to have already done this, because there is no guarantee that earlier states in the normal transition chain have actually been visited. But the system has many dozens of hardware control outputs (valve controls, heater setpoints, gas ow rate setpoints, etc.). Fully specifying the state of every control output in the entry function of every state machine state would be both cumbersome and error-prone. It is these issues the output channel cache library was designed to address. The library uses a conguration le to store the names of every hardware output channel it is allowed to manipulate, along with default values for those channels. The purpose for maintaining default values is this: when writing the entry function for a given state machine state, the author need only specify the output state of those hardware channels that will di*er from their default values. Typically this is a very small subset of the total number of outputs. All other output channels will automatically be set to their default values. This feature enormously simplies the task of the state machine author. The library also maintains an internal cache, which stores the current state of each output. When the control code requests that an output channel be congured to a certain value, that value is rst compared with the value in the cache. If they match (meaning the channel is already congured to that value), then no client request is sent to the server that main- tains that output. This can signicantly reduce the amount of client/server message tra*c between the application using the output channel cache library and the servers the library communicates with. 1See design document DES-0015, The Control Server for details on the control server application. 2See design document DES-0014, The State Machine Library for a better understanding of features and limitations of the state machine used by the control server.
Revised: September 30, 2014 |
Published: June 1, 2011