Skip to main content

Block Stacking

Loading...

Up to this point, all blocks of every project were connected sequentially, like beads on a string. This means that an output of one block only connected to a single input of the next block. This doesn't have to be the case. It is possible to connect one block's output to several downstream blocks in a fashion called block stacking.

This project demonstrates how the stacking order of the blocks on the flowchart defines the order of execution. The rule is simple: Out of N stacked blocks, the topmost block executes first, and the lowest block executes last.

Two of the three stacked blocks in this application perform calculations, while the third one prints the result. If the stacking order is left unchanged, the result will be 30. Swap around the topmost and middle stacked blocks, and the result will be 20! Move the Debug Print block to a new position, and you will print the var_x value before all the calculations are performed!

This is the first project in the Tutorial where we use the On Boot event block. Use this block when you need to perform some actions right after the device (re)boots.