Creating your first robot

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 DevTool'.

  2. Make sure the platform icon appeared on the tray. This means the 'electroNeek Agent' 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' function to set a certain value to a variable.

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

  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 workspace should look like on the picture below.

The workspace after adding the 'Assign value to variable' function

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' block 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 workspace should look like on the picture below.

Parameters of the 'Assign value to variable' function

Launching

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

The result will look like on the picture below.

The result of executing the robot

Result

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

  2. The variable created above appeared in the block with variables and its value.

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.

Using the 'Calculate a value' option to assign a value to a variable