comp.lang.ada
 help / color / mirror / Atom feed
From: "John" <jpwoodruff@irisinternet.net>
Subject: Re: Using Ada (or SPARK) in Ada-unaware environment
Date: 19 Jan 2006 16:50:49 -0800
Date: 2006-01-19T16:50:49-08:00	[thread overview]
Message-ID: <1137718249.572448.40990@g43g2000cwa.googlegroups.com> (raw)
In-Reply-To: <dqnkoj$pb4$1@sunnews.cern.ch>

I have a suggestion that might serve your control system that you
propose to implement in Ada.  The suggestion builds on your option #1
to import interfaces from C and to write device controls in Ada.

I have an experience that suggests you might divide that scheme into
two levels of abstraction.  Write "thin" bindings to the hardware
vendors' C libraries and capture these into a class of object whose
interface encapsulates the capabilities of the hardware.  Let me call
this class "controller".  For example, there might be a controller
that implements a particular brand of motor and lets its user move
clockwise or counterclockwise at some speed, for a specific number of
revolutions.

Write another layer of abstraction (in Ada) that presents an interface
to the control system.  Let me call this class "device".  An example
might be an actuator device that moves a cart to some position, or a
mirror to some angle.  The device's specification represents the needs
of the control system.

Implement the device's actions by invocations of the controller.

Consider the benefits of this scheme:
- Vendor's C library is completely encapsulated;
- A device can be "upgraded" by replacing the controller with a new
model, and the control system is unaffected;
- Data that characterize the hardware is separated from the data that
the control system presents to its user.
- Composite devices can be built.   For example two-axis motions built
of two separate controllers;

Here are a couple references to reports of a very large control system
that uses this strategy:

Fong et al., "Application Software Structures Enable NIF Operations,"
ICALEPCS 2001.
Lagin et al., "The Overview of the National Ignition Facility
Distributed Computer Control System", ICALEPCS 2001.
Both are at:
http://accelconf.web.cern.ch/accelconf/ica01/proceedings

Carey et al. "The National Ignition Facility: Early Operational
Experience
with a Large Ada Control System" in SigAda 2002.




      parent reply	other threads:[~2006-01-20  0:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-19  9:05 Using Ada (or SPARK) in Ada-unaware environment Maciej Sobczak
2006-01-19 10:16 ` Niklas Holsti
2006-01-19 10:21 ` Peter Amey
2006-01-19 20:05   ` Jeffrey R. Carter
2006-01-20  5:08   ` tmoran
2006-01-19 15:00 ` Steve
2006-01-19 15:45   ` Maciej Sobczak
2006-01-19 20:26     ` Simon Wright
2006-01-20  0:50 ` John [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox