Question

I didn't find any useful information about programming languages for real time systems. All I found was Real Time Systems and Programming Languages: Ada 95, Real-Time Java and Real-Time C/POSIX (some pdf here), which seems to talk about extensions of Java and C for real times systems (I don't have the book to read). Also, the book was published in 2001, and the information may be obsolete now.

So, I'm dubious whether these languages are used in real world applications, or if real time systems in the real world are made in other languages, like DSLs.

If the second option is true for you, what are the outstanding characteristics of the language you use?

Was it helpful?

Solution

The Real-Time Specification for Java now has several commercial-grade implementations:

These products span the continuum from compilation to native code (Aonix) to J2ME (aicas, apogee), to full J2SE (Sun, IBM). Most, if not all, have seen deployments in small numbers of safety- or mission-critical systems, but momentum is building. Examples include Eglin AFB's space surveillance radar modernization and the US Navy's use of RTSJ in the DDG-1000/Zumwalt destroyer. Sun also claims deployment in the financial transaction processing domain.

If you are interested in RTSJ, I suggest Peter Dibble's Real-Time Platform Programming, or Professor Wellings' Concurrent and Real-Time Programming in Java.

On a related note, there is also work underway to provide a Safety-Critical profile for the Java programming language, built as a subset of RTSJ. Also, an expert group has formed to explore a Distributed RTSJ DRTSJ, but the work is stalled.

OTHER TIPS

I am an avionics software engineer. I was able to participate in several development projects. The languages I used in those projects are: C, C++, and Real-time Java.

C is great. C++ is not so bad but C/C++ require strict coding standards for the safety considerations such as DO-178B.

I think Real-time Java is the way to go but I don't see many avionics applications, yet.

Korean jet trainer T-50 will have a mission computer running RT Java application serving HUD and MFD displays, and all of the mission critical functions.

The book covers use of Ada 95, the Java Real-Time System and realtime POSIX extensions (programmed in C). None of these is directly a domain specific language.

Ada 95 is a programming language commonly used in the late 90s and (AFAIK) still widely used for realtime programming in defence and aerospace industries. There is at least one DSL built on top of Ada - SparkAda - which is a system of annotations which describe system characteristics to a program verification tool.

This interview of April 6, 2006 indicates some of the classes and virtual machine changes which make up the Java Real-Time System. It doesn't mention any domain specific language extensions. I haven't come across use of Java in real-time systems, but I haven't been looking at the sorts of systems where I'd expect to find it (I work in aerospace simulation, where it's C++, Fortran and occasionally Ada for real-time in-the-loop systems).

Realtime POSIX is a set of extensions to the POSIX operating system facilities. As OS extensions, they don't require anything specific in the language. That said, I can think of one C based DSL for describing embedded systems - SystemC - but I've no idea if it's also used to generate the embedded systems.

Not mentioned in the book is Matlab, which in the last few years has gone from a simulation tool to a model driven development system for realtime systems. Matlab/Simulink is, in effect, a DSL for linear programming, state machines and algorithms. Matlab can generate C or HDL for realtime and embedded systems. It's very rare to see an avionics, EW or other defence industry real-time job advertised which doesn't require some Matlab experience. (I don't work for Matlab, but it's hard to over emphasis how ubiquitous it really is in the industry)

Real time applications can be made in almost any language. The environment (operating system, runtime and runtime libraries) must however be compliant to real time constraints. In most cases real-time means that there's always a deterministic time in which something happens. Deterministic time being ussually a very low time value in the microseconds/milliseconds range.

Real time systems depend solely on this criteria, as the specificiations usually say something like 'Every x (period of time) (do something | check something)'. Usually this happens if the system interfaces with external sensors and controls life-saving or life-threatening systems.

I was working on an in-car navigation and infotainment system developed mostly in C/C++ with an operating system configured specifically to meet the real-time constraints to provide real-time navigation and media playback.

But this is not all to real-time systems: Usually the selection of algorithms in the entire system is made to have deterministic runtimes according to the Big-O notation, mostly using linear or constant time. Everything else is considered non-deterministic and thus not useable for real-time systems.

All of the real-time systems I have worked with were predominantly written in C with some bits of assembler, or written mostly in assembler with little bits of C. (Depending on whether we're talking the 90s and beyond, or the 80s, respectively.) However, some of the real-time systems I've worked with have used -- not exactly DSLs -- special homegrown code generators.

Real-time oriented language?

What is real-time

First we have to define what real-time mean.

Of course depending on how your tool will work against the physical environment pure real-time couldn't be effectively done, mostly because there will be a lot of third party dependencies.

If you are building embed stuff by using microcontrollers like arduino, the language to use will be limited by the hardware, but with more complex stuff like Raspberry Pi, the language choice is very wide.

Granularity

This is depending on what you are measuring, if you're working with:

  • weather temperatures, one read each 10 minute could be enough
  • people height or weight, one or maybe four read by day
  • server status, between 1 second for fine debugging to approx 1 hour for quiet unimportant secondary server.
  • atomic collision count: something finer...

Event based reading

The right (better) way for collecting data is based on value change event... whenever the device do permit it.

Your tool have to not poll values from device, but the device have to send values to your tool, when they change.

This could be done by using an hardware interrupt trigger or by using port protocole like RS-232 staying listening on some serial port, for sample.

Monitoring environment

The last thing to be warned is how legitimate user will interact with.

If you're building embed standalone device, like robot, you may use graphic libraries to interact with touch screen.

If you're building web based monitor, you may have to keep in mind that the client could be an old 800x600 monochrome screen, using poor internet connection and small processor... But depending on final goal if you may interact with clients, you could ensure strong hardware and strong internet connections. Anyway you have to watch for connexion loosing and event for communication delay between server and client. There is mostly third party dependencies.

Which programming language?

From there, the language choice is wide and clearly depend on

  • your knowledge.
  • granularity requested (by using event-based too, of course)
  • the amount of time you have to build the tool (money;)
  • delay, co-workers...
  • kind of device
  • kind of monitoring
  • some other political reasons

You could build real-time monitoring engine by using and only, I've seen sophisticated engines that was built under only... I've personally built a web based, solar energy monitor by using , and .

I cannot believe no one has mentioned LabVIEW programming language which is widely used for Real-time safety-critical systems. It has extensive libraries and well-known design patterns for architecturing and implementing for RT systems.

Also National Instruments makes various hardware (cRIO, PXI and etc) which are designed for real-time applications.

We use LabVIEW for Fracking (Hydraulic Fracturing) which is used in safe-critical environments.

By the way, LabVIEW is also used for non-RT applications too.

PLCs run ladder and fbd code which is really a real-time dsl in the sense that your options are so limited that it is difficult to program in a way that would result in unpredictable runtime performance

A really purposeful application of the C language to real-time programming - and all related issues (such as parallel programming) - is offered by my Kickstarter http://www.kickstarter.com/projects/767046121/crawl-space-computing-with-connel It is called "Wide Programming" and I've been doing it most of my life. The rewards include a software library and a book - designed to be useful.

the company I've been working for since 2003 has been developing and deploying a Scada/Mes platform. Original implementation started in 1993, used Modula2 on OS/2. Later (1998) it was ported to Ada95 and Windows. Currently (2019) we use Ada compiler by AdaCore. Our system was ported and has been deployed to 32/64 Windows, HPUX, OpenVMS (and lately even to Raspberry). We have multiple installation in central Europe (gas industry, refineries, factories, power plants). We feel Ada's features give our system a high degree of reliability and prevents a lot of errors that would easily occour if we used languages like C. See also my blog https://www.ipesoft.com/en/blog/what-language-is-the-d2000-written

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top