Externally Defined Variables
There are five places that you can provide a value for an externally defined variable:
- When using the run button
- In an execute step
- In a parent sequence’s header
- In a regimen header
- 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.
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 thebutton and provide a variable value in the popup form. Then click 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.
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.
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). All regimen items will show the variables and the values that will be used when the sequence is run (either the explicitly set values in the regimen, or the variable’s default values).
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.
Once the event has been scheduled, all event instances will show the variables and the values that will be used when the event runs (either the explicitly set values in the event or the variable’s default values).