Loops and logic are implemented in the step configuration window. To start, right click on a step and select “Configure Step”
In this step configuration window, we can add different logic depending on if the step passes or fails. The simplest option for step logic is to simply halt on pass or fail:
This will halt the sequence on the applied step, and no other steps in the sequence will run. This is useful when a failure should stop the test - on an end-of-line test, simply stopping and rejecting a device if it fails any single test saves time. Other options might include halting on an acquisition step when a trigger isn’t met, since running analysis steps without a valid recording will just cause errors.
Steps passing or failing are dependent on the exact type of step. Different pass or fail logic can be used on:
- Limit Steps – If the limit passes, the step passes
- Display – Any results from limit steps displayed will affect the pass/fail status. If a single result displayed fails, the step will fail. This can be used for an overall pass/fail logic gate in the sequence
- Message Steps
- Ask the user a yes or no message. Yes will pass and no will fail
- External Hardware steps can read DIO ports and pass or fail dependent on the configuration
- Acquisition – Triggered record will fail if the triggered level is not met
- Custom LabVIEW or Python Steps – When writing a custom step, a step result can be programmed
- Post Processing – Some steps, such as frequency shift, will fail if the calculation fails
All other steps will pass by default.
Halting is useful, but it doesn’t give a lot of feedback to the operator. Another option is to jump to any other step in the sequence depending on pass or fail. When either of these options are enabled, the dropdown to the right shows all the other steps in the sequence.
With the same use case, instead of just halting on failure the step could instead be configured to jump to a message step that warns the operator that a device failed. The message step could even ask if they want to re-test.
Using logic to jump to an earlier step in the sequence is how loops are created.
This is widely used for directivity measurements. A loop is created which includes steps to move the turntable and make a measurement. Once a measurement has been made, it jumps back to the beginning and increments the angle by a set amount to make the next measurement. An example sequence is included with SoundCheck in "SoundCheck\Sequences\Loudspeakers\Polar Plot (MDT-4000 turntable - LAN).sqc"
In the sequence editor, the loop is represented by indentation. Using the plus button on the left hand side of the step exposes logic.
If you examine the configuration for step 17 - “Mes - Rotate Speaker”, it is set to jump on pass back up to Step 9 - “Pos - On-Axis Normalization”.
This repeats the section of the sequence. A loop needs a way to exit, otherwise it will run forever. This is implemented by enabling “After n repetitions” on the step configuration:
Here, the step jumps on pass or fail as defined above, but no matter what the pass or fail state after 18 repetitions it will instead jump to Step 18 - “ Mes - Home Prompt”. Enabling this checkbox activates the Loop Index.
Loop Index
Values in a loop can be automatically incremented using the Loop Index. Once the checkbox for “After n repetitions” is enabled, a value is added to SoundCheck’s Memory List called “Loop Index”. Every time this step runs and then jumps to an earlier step, the loop index increments. Since this value is stored in the memory list, it can be used in SoundCheck steps to change values per loop.
For example, a device might need to be tested at multiple different stimulus levels. Instead of writing a sequence or stimulus to test at each level, the loop index value can be used to insert the appropriate voltage.
Let’s say that the device needs to be tested from -20dBV to -10dBV in 2dB increments. A sequence can be written to test the device, and then a loop added at the end. The loop index value here can be named “Test Level”, the units set to dBV, and on each run it will increment by 2dB.
The stimulus step can then be set to use the “Test Level” value.
When the sequence first runs, it will playback a -20dBV signal. Each loop will increment by 2dB for 5 repetitions (for 6 total runs).
When data is repeated within a loop the current loop index value is prepended to the data name. All of the Fundamentals measured here are prepended by the loop index value showing the test level.
SoundCheck’s Loops & Logic simplify test sequences and provide powerful automation and additional flexibility. Contact the Listen support team if you have any questions about this valuable feature.
Comments