Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > FPGAs/PLDs

Domain-specific languages for medical device design

Posted: 08 Apr 2014 ?? ?Print Version ?Bookmark and Share

Keywords:Domain-specific languages? Programmable Logic Controllers? PLCs? run-time system? general-purpose languages?

Domain-specific languages have become a common tool in the tool-box of software developers. There is a natural reason for this: they are more expressive and therefore tackle complexity better, making software development easier and more convenient. They can also raise the level of abstraction from raw implementation code to the actual problem domain. Designs and specifications expressed with the higher-level problem domain concepts make specifications easier to create, check and communicate with. Most importantly, together with domain-specific generators, they can automate the creation of production code.

When companies start using domain-specific languages, they often want to utilise existing languages and specifications along with related components and legacy code. Through a concrete example from a medical domain, we describe how existing languages for Programmable Logic Controllers (PLCs), like IEC 61131-3 structured text or function block diagrams, can be extended with domain-specific constructs.

We also demonstrate native code building for the run-time system (RTS), targeting both Intel and ARM processors, and managing HMI components for monitoring measurement and control processes. The high-level languages are not only used for design and code generation, but also when debugging and profiling, or even incremental specification and execution "on the fly". We conclude by describing our experiences of creating the domain-specific language and of using it in production.

Example domain: blood separation machines
PLCs are widely used in different industries and machines for automation. We focus here on a medical domain and describe how control logic for blood separation machines can be specified with models in domain-specific languages. These models are then used to generate the functional code C integrated with the libraries and target operating systems.

A blood separator is a medical device separating various kinds of fluids from blood. The main task of this device is to separate erythrocytes (RC), lymphocytes (BC) and plasma (PL) after centrifugation. In practice, the separation process is performed by mechanical presses and devices called "blood separation machines" operating with high speed and precision. Such a device is expected to:

???Prevent the mixing of fluids using a precise control logic with a prompt response;
???Enable measurements of fluid weight; and
???Recognise different blood variants and adapt the separation process to blood specifics.
In addition to these medical operations there are also technical and organisational requirements on machine operation, e.g. that a device can concurrently execute several processes of separation, make labels for marking bags, or update a database of blood types and blood supplies using a web service.

Traditionally applications for these devices are developed using general-purpose languages (GPL), such as C++, Java or IEC 61131, describing both the structure and logic of the application. Figure 1 shows an example of one of the languages: an IEC 61131 function block diagram. This language specifies the individual functions of the system, and their connections along with input and output variables. In our example, the model specifies the three variable links between functions for motor speed adjustment and a step motor. Other IEC languages then allow the specification of control and logic within the functions and the whole system.

Figure 1: Sample of IEC 61131 function block diagram: motor and adjustment functions.

1???2???3???4???5???6?Next Page?Last Page

Article Comments - Domain-specific languages for medica...
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top