Skip to content

Overview

The SPT Framework is a collection of libraries that facilitates the creation of standardized machine code and can be reused on future projects due to its modularity and flexibility. The SPT libraries include the necessary objects to create a hierarchical structure to group the machine parts based on their interdependencies and then control those parts with a predefined state machine that can keep the parts synchronized or let them operate independently. The existing control code for external items can be encapsulated within standardized components that can then be utilized by the framework. This allows for rapid development of new machine code when a component such as an axis, cylinder, or database is deployed on future machines. Additionally, the integration of alarm handling enables the programmer to easily create and monitor conditions by separating these concerns from the control code. Because these alarms are created per component, they are portable and easily reused on future projects. These isolated code portions allow for easier development and troubleshooting.

The framework is designed to separate the ‘happy path’ control code from the error detection, the HMI interaction, and the recovery. This enables developers to focus on one subject at a time while lowering the concern for negatively impacting another section of code.

There are 2 main pieces of the SPT Framework: Components and Modules.

Components and Modules

Components

The components are used to control hardware such as an axis, a cylinder, or any other device connected to the I/O. They can also be the connection point to a database, implement a client/server communication architecture, or add functionality to other components. The purpose of a component is to encapsulate functionality within a standardized function block that can be used by the SPT Framework. Each component has a base set of features that the framework knows how to interact with, any additional functionality of the component can be handled by the code that implements the component. Components can work without the framework and therefore can be developed independently and tested outside of the framework.

Components are portable pieces of code that can have multiple instances within a project and also be reused on all projects. This reuse allows for component development time to be reduced each time it is implemented. When managed properly this also allows for future improvements to a component to be integrated into older instances.

A common implementation of a component is to encapsulate the functionality of a 3rd party device into a single component. Some hardware vendors will provide a library that can be used to communicate with their hardware. Creating a component from this library will allow development to happen in a single piece of code that can then be reused each time the hardware is reused. While this idea is not unique to the SPT Framework, the features of the framework encourage the use of good coding practices and provide a starting point for proper separation of concerns, along with integration to alarm monitoring and recovery, HMI communication, initialization, and cyclic updates.

Modules

The modules which follow a state machine and issue commands to components based on the current state and mode of the module. A module contains 0 or more components and possibly other modules. Each module is responsible for controlling its components while also monitoring each component for any alarms it may have. Modules represent a section of the physical or logical machine. Just like components they provide a standardized way to make the code more reusable, more importantly each module provides a separation of concerns by placing state specific code into individual methods. This allows for code that handles the resetting of errors to be isolated from the code for initializing or preparing for operation.

Each project will hold a single Machine Module that is at the top of the hierarchy and contains the Equipment Modules which represent the parts of the machine. This Machine Module (MM) will be responsible for controlling and monitoring each of the Equipment Modules (EMs). When the operator requests for the machine to change modes, it is the responsibility of the MM to command all EMs and wait for them to complete before continuing. The same is true with the state machine. When an operator starts and stops the machine, it is the MM that will command the EMs to change states in the appropriate order.