ControlPoint Core Development Tools: "sFoundation™"
An automated machine's application software can be divided into two sections: the core and the infrastructure. The core software is the interesting, proprietary code that is unique to the machine and forms much of the basis for the its competitive advantage. The infrastructure is the foundation for the core software. It is the code that is more or less similar from machine to machine; the code that deals with mundane issues such as machine initialization, error handling, thread handling, interrupt handling, and diagnostics. While the quality of the core section will make or break the success of the machine, the infrastructure can only break the machine. Well implemented, the infrastructure will go unnoticed; poorly implemented, it will destroy an otherwise excellent machine design. The recognition of this important fact led to the development of the ControlPoint sFoundation.
The term "sFoundation" stands for software foundation. The idea behind the sFoundation is to not only provide a rich toolset with which to create the core application—and the sFoundation function library is indeed rich with over four hundred functions—but to make it easy to build a well-designed, functional and reliable software foundation. The sFoundation makes it easy to handle a number of infrastructure tasks:
Error Handling
A centralized error handling system generates an automatic call to a user-defined function upon any error condition. The error code structure returns information valuable for debugging and user prompts.
A "command gate" automatically operates to prevent the flood of errors that are often collateral to the initial error. This allows easier error recovery.
A "trace dump" can be automatically recorded to disk upon an error condition. This shows the exact, time-stamped commands sent to, and returned from, the ControlPoint system leading up to the error. This data provides a wealth of debugging information.
Thread Handling
Multi-threading offers a number of important benefits for the typical automated machine (such as increased responsiveness, improved determinism of response, and better processor utilization, among others), but it has a bad reputation with many engineers for exponentially increasing the complexity of the application software. In fact, the parallel-execution nature of multi-threading applications is more complex, and there are a number of pitfalls one can fall prey to if not careful.
ControlPoint can be used in either single-threaded or multi-threaded designs, but it has been systematically designed to take advantage of multi-threading and to eliminate many of the difficulties associated with multi-threaded programming. For this reason, the vast majority of ControlPoint programmers design all but the most simple machines with a multi-threaded architecture.
Event Handling
The ControlPoint system is inherently an event-driven system. The need for "spin loops", or constant polling, with their associated CPU burden, has been practically eliminated. Nodes can simply be set up to generate attention requests (i.e., interrupts) on a wide variety of user-defined events or conditions. So rather than constantly polling to check the status of the system, the software can just be set up to request notification for when various events occur.
For example, programmers can generate attention requests with user-definable logic equations that use motion-related events and I/O, such as: "generate an attention request if a motion axis is within "B" counts before the end of a move AND it hasn't seen a proximity sensor OR the motor drive has shut down." This provides fast response to complex conditions with minimal host overhead.
The software can also easily be configured to subscribe to parameter change events. This means that any time a parameter is changed by any thread or function, all "subscribers" will be automatically updated. This can be used, for example, to update a user-interface without having to explicitly make a call to do so each time a parameter is changed. This is an easy and reliable way to keep the user-interface synchronized to the current state of the machine.
Machine Initialization
Self-addressing of all nodes eliminates the need to set physical addressing and reduces mistakes.
Automatic diagnostics ensures system integrity.
Power-up node state is user definable.
A system inventory function returns a list of all nodes on the network to prevent configuration errors. Configuration management is also enhanced by the availability of node-specific data such as node type, firmware revision and checksum, hardware revision, serial number, and installed options.
Diagnostics
Although the ControlPoint system is extremely robust (individually optically isolated nodes, with redundant power, and fault tolerance to intermittent wiring problems), if problems do occur, ControlPoint provides abundant diagnostic information. For example, ControlPoint can often pinpoint the location of a wiring fault, even if it is intermittent.
Network integrity is constantly monitored by each node so the user can get notice of impending failure to allow for preventative maintenance.
Autonomous user-defined data polling
Programmers can define a set of data to be automatically collected and cached without host intervention. This allows supervisory and user-interface data to be automatically collected and refreshed without host overhead.
Data caching
The ControlPoint driver caches time-invariant data so that system performance is easily optimized.
Direct bit access
Most bit registers allow for direct access of individual bits so that there is minimal need for tedious (and error-prone) "bit twiddling" (e.g., shifting, masking, etc.).
RISC-like instruction set
The ControlPoint core instruction set is impressively compact. It has been designed to allow for relatively easy porting from other machine control systems without loss of functionality.
Integrated power distribution and machine saftey
The sFoundation integrates with its ControlPoint electrical counterpart, the eFoundation. The eFoundation is a patented control component that cost-effectively eliminates most of the design tasks associated with power distribution, power control, and safety interlock control. The software development time typically spent on these tasks is considerable, yet this software confers little, if any, competitive advantage. Worse yet, this software is risky because the functions it controls are governed by national and international standards; lack of compliance with the standards often results in last-minute delays and reengineering. The eFoundation, combined with its sFoundation software interface, saves designers from this low-value-added effort and risk.
One integrated driver and common API
By utilizing time-tested, de facto standards for all external interfaces, yet tying them altogether with a common Application Programming Interface (API), ControlPoint's unique design gives machine designers more component choices and interoperability with third-party hardware (motors, drives, sensors, actuators, etc.) than any other solution. Simultaneously, it avoids the well-documented problems inherent in design- by-committee "standards." One integrated driver and API greatly reduces the machine software complexity and eliminates the incompatibility problems that arise in trying to get multiple software drivers to co-exist reliably.