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
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 SEQUENCE command, then a variable form will be shown in the step.
If you add your sequence to another sequence using an EXECUTE SEQUENCE command and choose
Location Variable - Add new, then a new variable will be created 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 SEQUENCE command that the value will be passed into.
Russian doll sequences
By setting the new variable in the parent sequence to
Defined externally, 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 TO 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
Defined externally, 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.
If you make an event for a sequence or a regimen with a variable set to
Defined externally, then a variable form will appear in the add event panel.