clear
Clear a received Script trigger. The clear instruction is commonly used immediately before a wait or repeat until instruction to ensure that any Script triggers received before the wait or repeat until instructions are ignored.
Usage:
- clear scripttrigger0
Examples:
- Generate myWfmA, clear any Script triggers, wait for receipt of a Script trigger, then generate myWfmB:
generate myWfmA
clear scripttrigger0
wait until scripttrigger0
generate myWfmB
Without the clear instruction, any Script triggers received during generation of myWfmA would cause myWfmB to be generated after the smallest possible delay. - Continuously step between three waveforms, waiting for a Script trigger between each:
repeat forever
clear scripttrigger0
wait until scripttrigger0
generate myWfmA
clear scripttrigger0
wait until scripttrigger0
generate myWfmB
clear scripttrigger0
wait until scripttrigger0
generate myWfmC
end repeat
Note Script trigger detectors are cleared automatically when Script triggers are "consumed."
For example, you do not need to put a clear instruction
between the wait instructions
in the following script:
generate myWfmA |
The device waits for two Script triggers to occur before generating myWfmB. The same situation is true when a Script trigger is "consumed" by a repeat until instruction or an if/else/end if instruction.
Back to Scripting Instructions