📜 ⬆️ ⬇️

How to develop an application for automation almost not knowing how to program. I'll have to learn IDE ...

Do you want to create your project in the "iron", which will turn the world upside down? Or automate the control of light in the hallway. At the same time you are not an expert in programming microcontrollers, but you figured out with arduino and how to blink its LEDs and only found out about field-effect transistors, triacs, 1-Wire. Now you want to manage all this economy and provide access via the Internet and store data in the cloud.



Or are you friends with a soldering iron, a PLC programming guru, snip a PDU in modbus. But a computer with Windows and SCADA is too expensive for a project or doesn’t suit for some reason ... And I want to run the program on a single-board computer Raspberry PI with access to its GPIO, I2C periphery.

Visual programming methods


Using ready-made components and libraries, you can develop a program using visual programming languages. Fortunately for programmers and unfortunately for users of all such systems, there comes a time when functionality is needed that is not supported out of the box. Programs do not generate other programs for our complex world better than programmers and we still have a job. We list how you can visually program typical tasks:
')
Flowcharts / Friendly Russian algorithmic language that provides visibility (DRAGON) / R-circuits, etc. What I remember very well about programming in school and the first courses of the institute are the flowcharts. Drawing flowcharts are suitable for students, so that, like with soldiers, all their free time is busy. Another application is learning to program paper on paper. Finally, someone works and draws such diagrams in order to pass the state project on ESPD / GOST. Sympathize with them!

CASE tools - hundreds of them for exorbitant money and often with dubious benefits. Especially many such systems are used by software and database architects.

The state diagram of UML from which with the help of code generation you can get a blank or a ready-made control program. This diagram is an example of automaton programming . And it is great for designing compilers, many electronic devices and any tasks and modules of systems in which there are entities with complex behavior.

Ladder language This language should be close to engineers and those who program PLCs. Elevator programming is one of the typical use cases.

The LabVIEW visual programming environment allows you to make quite complex systems visually and closely connected with the National Instruments hardware. I liked the example of how AndreyDmitriev in the comments on Habré implemented the task in the visual editor to compare the complexity with the Delphi solution and the LabVIEW review. Simulink for Matlab falls into the same category, as suggested in the comments.

Reactive blocks


In the same article about Reactive Blocks , a modified UML activity diagram is used, which is adapted to the project components and from which the code is generated. The developers have made a plugin for Eclipse with their model, schema analyzer and component events.

The project is available for free for open source projects, with a logical limitation. All building blocks you create in IDE will be available to everyone under an open source license.

Ideology Reactive Blocks


This is a visual design of the application from existing building blocks - the building block, which hide the complexity of interaction with hardware and cloud services.

Of course, it is better to write complex algorithms as java code, so the graphical diagram and the code are maintained in a synchronized state automatically. This is the eternal dream of component design, when components are written by programmers, and their users are experts in their field.

Just as you should not make from a diagram - a spaghetti diagram of hundreds or thousands of elements. In this case, you can draw a subdiagram in the form of exactly such a component-building block. In the case of open source solutions, you publish your block so that the community can also use it in their projects.

It is possible to automatically pack your application into a package (OSGI bundle) for the Eclipse Kura platform. Then it is possible to restart the application without restarting the container, a console is available for administration, as well as many services of this IoT platform and all the power of existing components and run it on the Raspberry PI or Beagleboard Black.

Install Reactive Blocks


There is an option to download the special assembly eclipse + Reactive Blocks immediately ready to launch from a page for Windows, Mac OS X or Linux. Another option is if you have Eclipse Neon (4.6) / Mars (4.5) / Luna (4.4) / Kepler (4.3) installed - you need to specify Update-Site and install the plugin.

In any case, for debian-based Linux builds, you need to install the libwebkitgtk-1.0 package before starting the development environment:

sudo apt install libwebkitgtk-1.0 

To use it in a ready-made JDK assembly, different from the default one available in the system, you need to add lines to the reactiveblocks.ini file:

 -vm PATH_TO_YOUR_JDK/bin/java 

Meet Reactive Blocks


To access the server component, I had to go through authorization and authentication using a Google account.

I wrote questions by mail and to the honor of their engineers and management, they gave me a one-on-one google hangout with a video conference, an IDE screencast and a simple example. Their lead developer turned out to be an aerospace engineer and loves aeromodelling in his spare time and designs autopilot .

It seemed to me a very interesting example of an alarm on a RaspberryPI using an accelerometer .



Having played with different examples, looking at the contents of the Building Blocks under the hood. It was especially interesting to find an OpenIMAJ library already familiar to me there.

Personally for myself, I did not find the advantages of Reactive Blocks compared to the development for Apache Camel with its rhiot components and visualization capabilities. About what I will post soon, and even a working example is ready! In the publication on Habré we Control the automatic machine on Groovy / Java. As a CNC machine in a home workshop, I didn’t turn into a cartoon of “two of a casket” I used Apache Camel to control the CNC machine .

Attempting to cross BeagleBoard Black GPIO with Reactive Blocks was unsuccessful.
Since the library for working with GPIO SilverThings / bulldog could not work in interrupt handling mode. You can of course poll the input port in a loop - but this is somehow not correct. Started bugreport # 96 for this library.

The built-in BeagleBoard Black RPU processor is suitable for real-time tasks where there is no place for java with its GC STW pauses.

For java programmers, in contrast to electronics engineers, there are thoughts on the practical use of Bitreactive IDE in complex projects and you need to understand:



findings


Instead of learning programming languages, you have to learn its schematic notation, components, and development tool. Does the programmer need this?

This solution is more suitable for engineers who are not experts in software who do not want to delve into the subtleties of java programming, but want to use all the power of existing components to communicate with the “cloud” IoT services, multimedia and work with java libraries wrapped in the building block.

Source: https://habr.com/ru/post/310784/


All Articles