Using Loops in the Sequence Wizard
Using Loops in the Sequence Wizard
You can view a video of this tutorial also.
There are three different kinds of loops in the Sequence Wizard. The purpose of a loop step is to re-run a single step, or re-run multiple steps until the loop criterion is met.
File names are handled automatically by the loop steps, as described in Names of Data Files.
Loops are also valuable when Using Variables .
Loop (Cycle)
The Loop (Cycle) step allows you to re-run a single step, or multiple steps for a user-specified number of cycles. This step can contain any number of other steps, including other loops. To properly use a Loop (Cycle) step,
- First select a Loop (Cycle) step from the Available Steps under Sequencer Utilities, and add it to the User-defined Sequence.
- Then add any steps you wish to loop as children of the Loop (Cycle) step.
You can do this in two different ways:
- You can select the Loop (Cycle) step in the User-defined Sequence, and then add the children from the Available Steps,
- Or you can add all of the steps and then order your sequence afterwards.
Either way, you end up with the same result.
A simple example of how to use a loop is shown in the following sequence:
In this sequence there are three steps listed as children of the Loop (Cycle) step. These child steps (Polarization Resistance, Potentiostatic EIS, and Delay) run within the loop. By double-clicking the Loop (Cycle) step you can edit the number of cycles the loop will run. The parameter dialog box for the Loop (Time) step is pictured below:
The default Loop Count is 1. You can change this and then click the OK button to save your change.
When the sequence pictured above is run, it first performs a Polarization Resistance measurement, followed by a Potentiostatic EIS scan. Then the sequence pauses for the user-specified time in the Delay step. Then the sequence repeats again, until it has performed all three sub-steps for the number of cycles specified by the Loop Count parameter.
Loop (Time)
The Loop (Time) step is similar to the Loop (Cycle) step except it allows you to re-run a single step, or multiple steps, for a user-specified amount of time. The parameter dialog box for the Loop Time step is:
The default Loop Time is 30 minutes. You can change the Loop Time and Time Units and then click the OK button to save your changes. The child experiments run until the time has expired. Note that ALL child experiments are completed, for the timing is only checked at the beginning of a loop, not in the middle of the loop. So if the time has not yet expired, another complete loop runs.
Loop (Variable)
The Loop (Variable) step allows you to loop child steps until a variable meets a certain criterion. Before you use this loop, please read Using Variables. A simple example of using this Loop step is:
Let’s say we are connected to a battery. In the sequence pictured above , we are going to Loop until VLAST has exceeded some value. Inside the loop we perform an EIS scan followed by a galvanostatic charging step. The parameter dialog box for the Loop (Variable) step is:
This dialog box lets you select a variable by name. After you select a variable, different Operators become available. These Operators are conditional operators. They are:
< less than Loop finishes when the variable is less than the value entered. <= less than or equal to Loop finishes when the variable is less than or equal to the value entered. > greater than Loop finishes when the variable is greater than the value entered. >= greater than or equal to Loop finishes when the variable is greater than or equal to the value entered. = equal to Loop finishes when the variable is equal to the value entered. Normally test only against an integer. != not equal Loop finishes when the variable is not equal to the value entered. Normally test only against an integer.
The Value is the value against which the variable is compared. It needs to be an appropriate numeric type for the selected variable. For example, an integer cannot be compared to a real number, but rather must be compared to an integer. Pictured below are the entries used for the above example:
This loop can also be combined with user-defined variables, which are described in Using Variables.
After all these fields are defined and you click the OK button, that step in the Sequence shows the Variable Name, Operator, and Value.
Comments are closed.