Creating your first workflow

Typical 'Hello, world!' application

Task description

Here we will create the first simplest robot which will save a value to a variable.

The purpose of this material is not to demonstrate all aspects of work in the platform, but to help a user understand the mechanics of developing first robots.

Solution

Run

  1. Run 'ElectroNeek Studio'.

  2. Make sure the platform icon appeared on the tray. This means the 'ElectroNeek Robot' program has also been launched.

  3. Make sure the license is active.

Adding the first block

We'll need to use the 'Assign value to variable' activity to set a certain value to a variable.

  1. Double-click (or drag and drop) the 'Assign value to variable' activity from the 'Basic' section which will add the block to the canvas.

  2. Make sure the block is connected with 'Start'. If not, do it manually (or right-click on the block and choose 'Start from here').

The canvas should look like on the picture below.

Setting parameters

We want to assign a value to a variable. Let the value be a string "Hello, world!".

  1. Activate the 'Assign value to variable' activity by clicking on it and make sure the parameters appeared on the right panel.

  2. Write hello_message in the 'Variable name' field.

  3. To input a text only, leave the 'Set a value' option selected.

  4. Write Hello, world! in the 'Calculate a value' field.

As a result, the canvas should look like on the picture below.

Launching

  1. Press the start button at the top of the 'Studio'.

The result will look like on the picture below.

Result

  1. The 'Task finished successfully' message appeared in the console.

  2. The variable value changed.

Possible task extension

This task can be modified in numerous ways. For example, the current date can be added to the "Hello, world!" with the use of the JavaScript language. Let's take a look at how we can achieve it.

  1. Repeat all the steps until the 3rd step of the 'Setting parameters' section.

  2. Now to enter a string combined with the date using JavaScript, we need to select the 'Calculate a value' option.

  3. Enter "Hello, world! " + new Date() to the corresponding field of the 'Variable value' parameter. The screenshot of the window is shown below.

  4. Run the algorithm. As a result, the text along with the current date will appear in the variables block.