Select Page

Model-driven development of sensor interfaces

Tool support through SensIDL

Authors: Dr. Christoph Rathfelder and Nathalie Hipp, Hahn-Schickard, Emre Taspolatoglu and Jörg Henß, FZI Research Center for Information Technology

Contribution – Embedded Software Engineering Congress 2016

SensIDL (https://www.sensidl.de) is an open-source tool for the simplified implementation of communication interfaces for intelligent and resource-constrained sensor systems, which can be considered a central component of the "Internet of Things." SensIDL (Sensor Interface Definition Language) supports sensor developers with a dedicated interface description language and associated editors, enabling the efficient definition and documentation of sensor interfaces. Based on this description, code generators automatically create the necessary code on both the sensor and receiver sides. This semantically enriched API allows for the instantiation and subsequent transmission of data. This reduces the workload for developers and increases the efficiency and quality of development and implementation.

Integrating intelligent sensor systems into IT landscapes and the Internet of Things (IoT), as well as communicating with mobile devices, always presents developers with a complex and error-prone challenge. There is a lack of both uniform standards and efficient development tools that support and relieve developers during programming. Due to the highly heterogeneous mix of sensor systems in terms of their computing power, communication interfaces, processor architectures, operating systems, and programming languages, a wide variety of communication technologies and interfaces have emerged in the field of embedded systems. Because of the lack of a uniform standard and supporting development tools, developers are often forced to implement communication manually as individual solutions.

Application scenario

Several processing steps are necessary for seamless communication between sensor information from the sensor system and a mobile device. The SensIDL tool is designed to support both sensor developers and developers of receiving systems in recurring tasks by automatically generating the necessary implementation code (see Fig. 1)., PDF).

The sensor developer is supported by the developed SensIDL language and its associated editors in clearly describing the sensor data and interfaces at a content/semantic level. The necessary interface implementation can then be automatically generated from this description by the tool.

The software developer for the receiving IT system receives a formal and unambiguous interface definition from the description created by the sensor developer. The necessary code on the receiver side can also be automatically generated using SensIDL. This significantly simplifies the implementation of sensor data access and thus the integration process.

Model-driven approach

The model-driven software development approach, as used in SensIDL, combines the two technical concepts of domain-specific languages (DSLs) and code generation via model transformations. Domain-specific languages offer a formal framework for describing the structures, dependencies, behavioral models, or requirements of software applications within defined domain boundaries. This limits their applicability compared to general-purpose programming languages like Java or C. In contrast, DSLs allow developers to focus on the essential aspects of modeling. For this reason, DSLs are often used when complexity needs to be reduced or encapsulated, or when technology and implementation details need to be hidden. DSLs always have an underlying formal model. This is referred to as a meta-model or abstract syntax because it defines the structure and organization of information.

Code generators and transformation mechanisms are the central element for the practical implementation of model-driven software development. They automatically generate new elements, such as source code, from the model created using DSL. This addition of code generators leads to a significant increase in development and implementation efficiency.

The SensIDL tool

Following a model-driven approach, SensIDL uses its own description language with special elements for describing sensor interfaces. This results in an efficient implementation of the communication interfaces of smart sensors, independent of the chosen communication technology.

Fig. 1 (see PDFFigure 1 illustrates the structure of the SensIDL tool. The SensIDL description language and the SensIDL editor allow users to easily and intuitively define the interfaces and data offered by smart sensors. The SensIDL grammar acts as the link between the editor and the underlying meta-model. Based on the SensIDL meta-model and the user-generated description, various code generators can be executed. These code generators can produce both the necessary implementation code for different programming languages and the associated documentation. This ensures, among other things, that the documentation always corresponds to the implementation.

The SensIDL plug-in

The SensIDL tool is based on the Eclipse platform and can therefore be installed as an Eclipse plug-in and in embedded development environments built upon it, such as CodeComposer. It can then be used for programming in C, C++, and Java without having to switch development environments. Various technologies of the Eclipse platform are used. The Eclipse Modeling Framework (EMF) and the Xtext project are used to define the SensIDL language and the editors. The code and documentation generators are based on the Xtend generator infrastructure.

As in any programming language, some keywords are defined in the SensIDL language (example in Fig. 2, see...). PDF), which help the developer to create the sensor description. First, a sensor interface defines which represents the sensor interface. Within these interfaces, the so-called... sensorData several dataSets, which reflect the individual sensor information. Each sensor piece of information can be composed of various variables, each of which can be assigned a name, a data type, a physical unit, and/or a scope or value. The SensIDL editor supports the user with syntax highlighting and autocomplete, ensuring that developers can write definitions quickly and efficiently in the SensIDL language. Based on this description, the various generators can then be launched via the context menu. Currently, generators are available for the programming languages C, C++, C#, Java, and JScript, as well as a generator for creating interface documentation.

Application example

Fig. 2 (see PDF) shows a screenshot of the SensIDL editor to illustrate the description using a current measurement sensor as an example. eMeter to demonstrate. The eMeter It provides sensor information on both the current on the individual conductors and the transmitted energy. dataSet Conductor Several further possibilities of SensIDL are shown. In the declaration of the dataSets The possibility of so-called inheritance is demonstrated. The key word here is... uses The possibility of defining identical parts in the sensor information only once. Additionally, it becomes clear that variables can also be directly assigned a value, as in... recordType. With the variable powerFactor It is demonstrated that linear mapping is also possible with SensIDL, meaning that a byte is transmitted, but the possible value range of 0 to 255 is then mapped to the value range 0 to 1. Options such as setting an offset or applying scaling are also implemented. Furthermore, method declarations with appropriate visibility can be defined, allowing only the get or set method to be created for specific variables.

outlook

The SensIDL project is in the final phase of its initial funding and will subsequently be further developed as a community-driven open-source project. In addition to its application in internal development projects, cross-project collaboration with the Eclipse Vorto (https://eclipse.org/vorto) is the goal, focusing on the description of devices for the "Internet of Things" and the generation of integration code in middleware systems. A model transformation from the Vorto project to SensIDL is intended to seamlessly connect the integration layer (Vorto generators) with the sensor implementation (SensIDL generators). Additional interface connections, such as OPC UA, are also planned.

Download the article as a PDF


Modeling – MicroConsult Training & Coaching

Do you want to bring yourself up to date with the latest technology?

Then find out more here MircoConsult offers training courses/seminars/workshops and individual coaching on the topic of modeling/embedded and real-time software development.

Training & coaching on the other topics in our portfolio can be found here. here.


Modeling – Expertise

Valuable expertise in modeling/embedded and real-time software development is available. here Available for you to download free of charge.

To the specialist information

You can find expertise on other topics in our portfolio here. here.

MicroConsult Newsletter

With the MicroConsult newsletter, you'll stay on the pulse of the embedded world. Look forward to proven practical knowledge, real professional tips, and current events – directly from our experts for your project success.

Subscribe now!

Published by

weissblau media

weissblau media