Page Contents

There are five places that you can provide a value for an externally defined variable:

  1. When using the run button
  2. In an execute step
  3. In a parent sequence’s header
  4. In a regimen header
  5. In an event

When providing the variable value in any of these places, you will be initially presented with the variable’s DEFAULT VALUE, which may serve as a shortcut when set to a frequently used value.

Run button

If you want to test run your sequence, you will need to provide a value for the variable to be used during the run. Simply click the RUN button and provide a variable value in the popup form. Then click RUN again and FarmBot will execute the sequence with the variable value provided. You can test run your sequence as many times as you want with the same or different variable values each time.

Execute step

If you add your sequence to another sequence using an EXECUTE command, then a variable form will be shown in the step.

Parent sequence header

If you add your sequence to another sequence using an EXECUTE command, you may select Variables - Add new to add a new variable that belongs to the parent sequence. You can then provide a value for that variable in the sequence header, and it will be passed into the subsequence(s). Notice that the value you choose will be displayed in each EXECUTE command that the value will be passed into.

Russian doll sequences

By setting the new variable in the parent sequence to Externally defined, you can create a set of “Russian doll” sequences that keep passing values from variable to variable further and further into their child sequences until ultimately, the value finds its way to a MOVE step.

Regimen header

If you add your sequence to a regimen, then a variable form will be shown in the regimen’s header. You can provide a value right there, or choose Externally defined, in which case you will need to provide a value in the event that runs the regimen (see below). Notice that the value you choose will be displayed in each regimen item that the value will be passed into.

Event

If you make an event for a sequence or a regimen with a variable set to Externally defined, then a variable form will appear in the add event panel.

What’s next?