Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is there any specific language which is designed for mechatronics programming? I know about LabView, which is a data flow language, but not sure about its main platform.

Could you recommend to me, some languages apart from c/c++? Any language which is used in the topic of mechatronics( robotics, sensor programming, etc ).

share|improve this question
somewhat related: stackoverflow.com/questions/5616237/… –  amphibient Nov 27 '12 at 21:42
add comment

4 Answers

up vote 3 down vote accepted

Before "mechatronics" was called that, in the industry they just called it "automation". The field is dominated in North America initially by Ladder logic, which everyone on this website (except me) would absolutely hate if they saw it. It has its purposes however.

In the last 10 years you see a lot more standardization of automation languages, specifically the IEC-61131-3 standard, which includes the following languages:

  • LD (Ladder Diagram) - a.k.a. ladder logic
  • FBD (Fundion Block Diagram) - similar to your labview
  • SFC (Sequential Function Chart) - a fancy state machine or state diagram
  • ST (Structured Text) - a "normal" computer language with a syntax similar to BASIC/Pascal
  • IL (Instruction List) - kind of like assembly, but not really

In real life (I do this for a living) I see a lot of LD, and then secondarily a bunch of FBD and ST. I myself have used SFC in several projects over the last 5 years, and I like some of its features, but it has some problems (notably gentle recovery from faults is usually harder in SFC than in LD).

Note that IEC-61131-3 is only a standard that nails down the data types and the features of the languages, but the syntax of each language typically differs greatly from vendor to vendor. You can't just export code from one vendor's IDE and import it into another. They're not compatible.

There was one other proprietary automation language I used, called Steeplechase. It's a flowchart based language, similar to SFC, but simpler. I believe it was purchased by Entivity, which was then purchased by Phoenix Contact, so I think they still sell it. I remember it also had a ladder logic engine as well.


For an example of ladder logic (and a bit of SFC), here's an introductory tutorial I wrote on how to get going with Rockwell Software's RSLogix 5000 ladder logic programming software for Allen-Bradley's popular line of ControlLogix PLC's: RSLogix 5000 Tutorial. It'll give you a good idea of how it works, even though the example is a bit contrived.

share|improve this answer
The main benefit of ladder logic is that it emulates mechanical relays, and is a lot easier for people like electricians (with no programming experience and plenty of electrical knowledge) to use. –  Brendan Nov 28 '12 at 8:33
@Brendan - that, plus the fact that with most PLCs you can view the logic in "online" mode and watch the current state of the logic in real time. That makes troubleshooting easier. It's like looking at a circuit diagram where the wires a color-coded depending on if they're "on" or "off". –  Scott Whitlock Nov 28 '12 at 12:11
Thank you. With the Erlang( @mattnz mentioned it ) and what you have wrote, I think it will be a good start for my dissertion. :) –  Fred Nov 29 '12 at 11:42
add comment

I am using the Wikipedia definition of mechatronics, which would encompass things as common as a Dishwashers, ABS brakes in cars etc.

@Scott gives a very good answer for products focused on field programmable and bespoke systems. Another class of products - specific products developed with production runs of 1000's or millions of units in mind (Toys/cameras, automotive systems such as ABS, remote door opening etc.....), Software in these automation systems are indistinguishable from traditional embedded systems, using identical software tools and development practices. Most of these are programmed in general purpose languages focused on reliability, efficiency and ability to run on resource constrained systems (obviously tradeoffs have to be made). These include as C/C++ (most common so must be mentioned despite the question) Modulo2, Ada, D. More recently Erlang was designed with principles more aligned to mechatronics than most general purpose languages.

share|improve this answer
+1 - I had always assumed it was C, but Erlang doesn't surprise me. –  Scott Whitlock Nov 27 '12 at 22:01
For my reassurance, would you mean that C/C++ is still prominent in the industry of embedded automation e.g. appliances, automotive, handhold electronics...? I used to work in a company producing firmware and software for handhold devices and they also use C/C++ –  Son Le Nov 16 '13 at 4:41
add comment

As an addition to Scotts answer, there is also another strong force in the field of industrial automation: Siemens. Their PLC, the S7, is very common and comes with some - non-IEC-compatible - languages:

  • graph (like SFC)
  • kop
  • fup
  • scl (like ST): a little bit comparable to an programming language like C. It's actually readable
  • awl (like IL): Assembler-like programming.

Which language you like is totally based on your own decision. For easy I/O Mapping and simple decision-making i would stick with il/awl, if i have to programm complexer things, i rather stick with st/scl.

share|improve this answer
Thank you. These languages are needed for my dissertation. Learning them will comes later on. :) –  Fred Nov 29 '12 at 9:02
We might go a little bit off-topic - but what is the title of your dissertation? I'm kinda curious now. –  mri Nov 29 '12 at 12:53
"Main programming languages and their descriptions" It's a mechatronics subject at the university, and the prof. said i should involve languages developed directly in the field of mechatronics. –  Fred Nov 30 '12 at 7:46
add comment

First of all I think actually all programming languages ​​which allows you to write Hardware related. e.g. C/C++, Assembler. In my opinion for hardware-oriented programming, you do not manage it without C/C++. It's the best and safest choice. But you can try it with python! There existing many hardware-oriented libs for Pyro, myro. I search for this, here is my result:

google python, sensor, robotic

python hardware programming

share|improve this answer
Yeah, I found pyro and myro, but they are only python extensions. I looked for languages which was specifically designed for mechatronics/automation/robotics. –  Fred Nov 27 '12 at 13:16
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.