ROBO Pro Coding (EN)

General use

General use

General use

ROBO Pro Coding is a development environment used to program the new TXT 4.0 Controller, and for programming fischertechnik models. ROBO Pro Coding is available for Windows, macOS, Linux, iOS, and Android, and can be obtained from these sources.

Google_Play_Badge_DE_230x67.png    App_Store_Badge_DE_230x67.png    Microsoft_Badge_De_230x67.png   Linux_Badge.png

 

Englisch-AllgemeineBenutzung-Bild1.PNG

 

image-1623839044249.22.21.png  

The code shown could be used for this model (left).The web interface of ROBO Pro Coding is structured as follows (the numbers refer to the areas designated in the image):

  1. This section shows what was programmed in blocks in Python
  2. This is the field to which the blocks are dragged to program them
  3. The program process is documented in the console 
    • Breakpoints are used to debug programs. They define certain points in the code at which the program is stopped. These are set using the Editor, and consist of the file name + line number.
    • You can view variable content under Expression.
    • The Callstack shows the nesting of calls. This is helpful in particular when using functions.
  4. This section includes all blocks for programming, sorted into the categories of actuatorssensors and processing
  5. This line is explained separately under header
  6. You can adjust the learning level to the user here. Depending on the level, for instance, only the most important blocks are displayed.

 

Header

image-1623793979375.19.18.png

The header contains (from left to right) the operating elements for starting the program, stopping the program, starting the debugger, accessing the interface test, uploading the current program, and connecting to the Controller.

Starting programs

To start your program from ROBO Pro Coding, click this symbol.

Stopping programs 

To stop your program before it ends independently, touch this symbol.

The debugger

The debugger is designed to make it easier to find errors in a program. You can use the menu at the top right corner to go through the code step by step, thereby simulating a program run. The program will nevertheless react to interactions with sensors, such as pushing a button. While running through the program, you can see which block you are in at the left side in the large field, as well as what point in the Python code you are at on the right side.

The interface test

When you click this symbol with the three sliders, this window will open:

Englisch-Allgemeine Benutzung Bild4.PNG

 

You can view all connected devices here. Under actuators, you can use the sliders to check whether they are working. The measured values are indicated for the sensors (there is a 1 by the button, for instance, because it is pressed). You can use the drop down menu (small triangle) to indicate what is connected.

Uploading programs

If you have written a program and want it to run autonomously on the Controller, you can load it to the Controller using this symbol. It will then appear as one of the files on the Controller. Touch the program name there to access the sub-folder for the program. There is a file here named “main.py.” Click this file, and the “Open” button at the bottom right should be illuminated green. If you press the “Open” button, another menu will open with four options:

  1. Load: Load the program, then you can start it from the home screen
  2. Auto load: The program will be re-loaded automatically the next time you start the Controller
  3. Auto start: The program will be re-loaded automatically the next time you start the Controller and started directly
  4. Delete project: The program will be deleted from the Controller
Connecting to the Controller 

This section explains how to connect to the Controller.

Controller configuration

To use components such as sensors and actuators in the program, you must connect them to the Controller, not only physically, but in the software as well. The Controller configuration is always opened automatically, and can be accessed at the top directly beside the main program.

Now, the Controller and all available components that can be connected to the Controller are displayed in the left area. Drag the Controller to the programming area. Then, you can connect the desired components to the Controller via drag and drop.

Screenshot Englisch-Allgemeine Benutzung Bild5.png

Saving programs

 If you would like to save a program, click the three lines at the top left of the ROBO Pro Coding website. Touch the “Export” option here. Now, you can select whether you would like to save your program locally on your device or on GitLab.

Local: After you have entered the name of the program, simply click “Export” and the program file will be on your device.

GitLab: After you have entered the name of your program and followed the steps indicated to enter your personal access token, simply click “Export” and the program file will be saved in your GitLab account.

 

 

Actuators

Actuators

Outputs

The Start each time block

The Start each time block offers the option of running a program when a condition is fulfilled. Therefore, it works similar to a case distinction, but runs not only one time, but rather every time the condition is fulfilled during the entire course of the program. The Start each time block:

Englisch-Ausgänge-Bild1.PNG

Is an abbreviation for the following construct:

Englisch-Ausgänge-Bild2.PNG

You can insert all conditions from this category into the Outputs category in the Start each time block.

Note: The program section in the Start each time block should be kept short, and should not contain any blocking calls or endless loops, so that this part of the program can be processed quickly.

LEDs

image-1623745844016.42.50.png

 

Set

You can use the set LED ... and set LED brightness ... blocks to switch the LEDs on and off, and to set their brightness to a certain value (from 0 to 512). 

Call

You can use the get LED brightness block to call up the brightness of an LED and process it as a value.

Query

You can use the blocks is LED ...  and is LED brightness ... to use the activity or the brightness of an LED as a condition. In the example, the brightness of the LED is set to 512 if it does not already have this brightness.

Englisch-Ausgänge-Bild4.PNG

 

 

Motors 

The symbol on the motor blocks represents all motors that are not encoder or servo motors.

Set

You can use the set motor speed to []... block to set the speed of a motor to a certain value (from 0 to 512). 

Call

You can use the get motor speed block to call up the speed of a motor and process it as a value.

Query

You can use the blocks if motor is running and if motor speed is ... to use the activity or speed of a motor as a condition.

Stop

You can use the block stop motor ... to stop a motor.

Compressor

image-1623746227574.40.52.png

 

Set

You can use the block set compressor [] to switch the compressor on or off. 

Query

You can use the block if compressor [] to use the activity of a compressor as a condition. 

Solenoid valve

image-1623746259058.41.19.png

Set

You can use the block set solenoid valve [] to switch the solenoid valve on or off. Here, “on” means that the valve is open, and “off” means that the valve is closed.

Query

You can use the block if solenoid valve [] to use the activity of a solenoid valve as a condition.

Actuators

Engine

The Start each time block

The Start each time block offers the option of running a program when a condition is fulfilled. Therefore, it works similar to a case distinction, but runs not only one time, but rather every time the condition is fulfilled during the entire course of the program. The Start each time block:

Bild1.PNG

Is an abbreviation for the following construct:

Bild2.PNG

You can insert all conditions from this category into the motor category in the Start each time block.

Note: The program section in the Start each time block should be kept short, and should not contain any blocking calls or endless loops, so that this part of the program can be processed quickly.

Engine 

The symbol on the motor blocks represents all motors that are not encoder or servo motors.

Set

You can use the set motor speed to []... block to set the speed of a motor to a certain value (from 0 to 512). You can use the drop down menu (small triangle) to select the direction of rotation.

Call

You can use the get motor speed block to call up the speed of a motor and process it as a value.

Query

You can use the blocks if motor is running and if motor speed is ... to use the activity or speed of a motor as a condition.

Stop

You can use the block stop motor [] to stop a motor. The stop motor [] block offers the option of stopping a motor directly, or allowing it to run to a stop. You can select the desired option using the drop down menu (small triangle):

Bild3.PNG                                                                              

 

Servo motor

image-1623746331741.42.25.png

Set

You can use the set position to... block to set the position of a servo motor to a certain value (from 0 to 512). 0 and 512 are the values for the maximum deflection to the left and right. At a value of 256, therefore, the servo motor will be in the center. 

Call

You can use the get position block to call up the position of a servo motor and process it as a value.

Encoder motor

image-1623746341213.40.14.png

The encoder motor has the same functions as a normal motor, but also offers the option of counting revolutions and controlling multiple motors synchronously. A rotation is divided into ~64 steps.

Set

You can use the block 

Bild6.PNG

to set the speed of a motor to a certain value (from 0-512). You can use the drop down menu (small triangle) to select the direction of rotation. In addition, you can enter the number of steps the motor should complete. In this example, the motor turns 100 steps, or one and one third turns. As you can see in the example, this block has a plus sign that can be used to control multiple motors synchronously. It is possible to synchronize motors to the master or to an extension, however comprehensive synchronization, for instance between motors of the master and an extension, is not possible.

Note: Multiple synchronization calls in rapid sequence, such as could be caused by a loop (see example), can have a negative impact on synchronicity or prevent this entirely.

 

Stop

You can use the block stop motor ... to stop a motor. If you would like to stop multiple motors at the same time, you can add up to three additional motors by clicking the plus sign at the left of the block.

Bild7.PNG

Query

Block has reached position is used to utilize reaching the position as a condition. Position here means the end position of an encoder motor after completing the step size.

Actuators

Sound

The TXT 4.0 Controller: has a built-in speaker, and therefore offers the option of playing sounds.

The Start each time block

The Start each time block offers the option of running a program when a condition is fulfilled. Therefore, it works similar to a case distinction, but runs not only one time, but rather every time the condition is fulfilled during the entire course of the program. The Start each time block:

Englisch-Sound-Bild1.PNG

Is an abbreviation for the following construct:

Englisch-Sound-Bild2.PNG

You can insert all conditions from this category into the sound category in the Start each time block.

Note: The program section in the Start each time block should be kept short, and should not contain any blocking calls or endless loops, so that this part of the program can be processed quickly.

Play

Pre-installed audio files

You can use the following block to play one of 29 pre-installed sounds. You can select the desired audio using the drop down menu (small triangle). In addition, the sound can be played in a continuous loop. To do so, check the box beside the continuous loop symbol.

Englisch-Sound-Bild3.PNG

Own audio files

If you would like to play your own sound, you can use the block

Englisch-Sound-Bild4.PNG

To embed your own sound in the block, you must:

  1. be connected to the Controller
  2. enter the IP address of the Controller in the browser (you must select the IP that was used to connect to the Controller)
  3. enter USER: ft, PASSWORD: fischertechnik on the accessed page
  4. open the Sounds folder, and load the desired audio file to the Controller there using the plus sign (important note: the audio file must be available in wav format)
  5. enter “./filename.wav” in the ROBO Pro Coding block under path

Here as well, you have the option of playing the sound in a continuous loop.

Query

To query whether an audio file is played, use the play sound block. This can be used as a condition in the program.

Stop

To stop a sound, simply use the stop playing sound block in the program.

 

Actuators

Display

You can use the blocks in the Display category to design the screen of the TXT 4.0 Controller and make it easier to use. This requires two steps:

  1. Configure, which means
    • open a new file in the Display category using the Pages symbol with the plus sign at the top left
    • drag the desired items to the screened area (this represents the configurable part of the display)
    • adjust the specifications as needed. 
  2. Program, which means
    • program the interactions with the display in the main program using the blocks in the Display category.

Blocks

Event request

The event block [] opens the return value for an element. This block can only be used in the event programs. In these event programs, the block automatically relates to the event in whose program it is used. You can select the suitable type for the return value using the drop down menu (small triangle):

Bild1.PNG

 

Label field

You can use the label field element to place a text on the screen. The symbol in the display configurator is the label. Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

.

You can use the block set label field text ... to change the text shown in the course of the program.

Submissions

The inputs element allows users to enter text via the Controller. The associated symbol in the display configurator is the “T” character. Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

You can use the block set input field text ... to change the text shown in the course of the program.

Input program

The input program runs when an input is complete. It is written separately from the main program. Variables work globally across both programs. The input program runs in the block when input is complete. The event [] block is set to “text” in the input program. In this example, the variable name is set to the entered text; it is then used in the main program to output the entered text :

Bild2.PNG

Measurement instrument 

The measurement instrument function can display values (no values below 1). The associated symbol in the display configurator is the scale. Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

You can use the block set measurement instrument to value ... to set the measurement instrument to the entered value. This value should be within the pre-defined value range. If the value is outside of the value range, then one of the limits of the value range is shown depending on whether the value is too high or too low.

Status indicator

The status indicator displays the activity of something. Depending on the status, it will be illuminated (“active”) or not (“inactive”). The symbol in the display configurator is an illuminated diode. Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

Use the block set status indicator active [] to activate or deactivate the status indicator. You can choose whether the status indicator should be set to active or inactive using the drop down menu (small triangle).

Slider

The slider indicates values based on its position. The user can change the position using the touch screen. The value can be accessed using the event [] block once the slider stops. The accessed value is a decimal number. If you want a whole number for the slider value, you must use the round block. The associated symbol for the slider is a line with a circle. Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

You can use the block set slider value ... to move the slider to another value. 

You can use set slider activated []  to change the activity using the drop down menu (small triangle).

Slider program

The slider program starts after the slider has been moved. It is written separately from the main program. Variables work globally across both programs. The slider program runs in the block on slider moved. The event [] block is set to “value” in the slider program. In this example, the speed of the motor is controlled using the slider. The value of the slider must be rounded, since the motor only accepts whole numbers for the speed:

Bild3.PNG

 

Button

The button is a labeled field that can be pressed. If you press the button, the button program will run once you release it again. The associated symbol for the button is the square labeled “OK.” Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

.

You can use block set button activated [] to change the activity using the drop down menu (small triangle).

Button program

The button program runs when the button is released. It is written separately from the main program. Variables work globally across both programs. The button program runs in the block on button clicked. The event [] block cannot be used in the button program, since the button has no return value. In this example, the LED is activated when the button is pressed.

Bild4.PNG

Switch

The switch can be in one of two positions, and is always in exactly one of these two positions. It returns true or false , depending on its position. The associated symbol for the switch is the oval with the dot. Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

The block

Bild5.PNG

takes over two functions. You can set the activity (select enabled in the drop down menu) or the status (select checked in the drop down menu) to either true or false 

Switch program

The switch program runs each time the switch is moved from one setting to another. It is written separately from the main program. Variables work globally across both programs. The switch program runs in the block on switch toggled. The event [] block is set to “checked” in the switch program, it returns the values true or false . This example program turns the LED on when the switch is toggled; otherwise, the LED is turned off:

Bild6.PNG

Checkbox

The checkbox can have one of two statuses, and is always in exactly one of these two statuses. It returns true or false , depending on the status. The symbol for the checkbox is the square with the check mark. Drag this symbol to the screened area to open a window at the right side. Here, you can use Inspector to define

.

The following block   takes over two functions. You can use the drop down menu (small triangle) to select which of these you will use. You can set the activity (select enabled in the drop down menu) or the status (select checked in the drop down menu) to either true or false .

Bild7.PNG

Checkbox program

The checkbox program runs each time the checkbox is pressed. It is written separately from the main program. Variables work across both programs. The checkbox program runs in the block on checkbox toggled. The event [] block is set to “checked” in the switch program, it returns the values true or false . This example program turns the LED on when the checkbox is checked; otherwise, the LED is turned off.

Bild8.PNG

Sensors

Sensors

Input

The Start each time block

The Start each time block offers the option of running a program when a condition is fulfilled. Therefore, it works similar to a case distinction, but runs not only one time, but rather every time the condition is fulfilled during the entire course of the program. The Start each time block:

Bild1.PNG

Is an abbreviation for the following construct:

Bild2.PNG

You can insert all conditions from this category into the inputs category in the Start each time block.

Note: The program section in the Start each time block should be kept short, and should not contain any blocking calls or endless loops, so that this part of the program can be processed quickly.

Button

image-1623679995498.03.59.png

The button is a digital sensor that differentiates “current flowing” from “no current flowing.” Whether current is flowing, therefore, depends both on the wiring and on whether the button is pushed. You can use the button in two ways:

image-1623592536466.48.54.png

As a “normally open contact”:
contacts 1 and 3 are connected.  

Button pressed: Current is flowing.                                                                                                             Button not pressed: No current is flowing

As a “normally closed contact”:

Contacts 1 and 2 are connected.         

Button pressed: No current is flowing.                                                                                                   Button not pressed: Current is flowing.                                                                                  

Call

You can use get mini button status to obtain more information on whether current is flowing through the button or not. If current is flowing, it will return 1, or 0 if no current is flowing. 

Query

To query whether the button is in a certain status, use the is button ... block. You can use the drop down menu (small triangle) to select which status to query. This block can be used as a condition.

Ultrasonic sensor