Skip to content

Subroutines

AutomationDirect edited this page Jan 10, 2020 · 4 revisions

Subroutines


Description

A subroutine is a list of commands to run in a sequence. Subroutines can be named and reused throughout a program to simplify a repeated task.


Usage

To create a subroutine, drag a 'Subroutine' block into the main canvas and connect the desired sequence of blocks under the 'commands' hook. To name a subroutine, click the text labeled 'Subroutine', then enter the desired name into the box. Wherever the subroutine needs to be executed, place a 'Subroutine Call' block:

The program will run the desired sequence of commands in place of this block.


Notes

  • Make sure the 'Subroutine Call' block has the same name as the subroutine being called.
  • Subroutines must have unique names. The block program will not 'verify' or 'upload' if there are any duplicate subroutine names.

Clone this wiki locally