Jump Opcodes
- Updated2026-01-30
- 3 minute(s) read
Jump opcodes control conditional branching in a pattern. Use these opcodes to branch to a specified label when the selected condition is true.
Conceptual Overview
The jump and jump_if opcodes direct the execution flow to a label. The jump opcode does this action unconditionally, while the jump_if opcode does so when the system meets a specific condition. These conditions include the following items:- failed
- matched
- seqflag
- trigger
Syntax Reference
| Syntax | Description |
|---|---|
| jump(label) | Executes the current vector and then executes the vector the label specifies. Execution continues from the vector the label defines. |
| jump_if([!]failed, label) | Jumps when the failed condition is true. |
| jump_if([!]seqflag, label) | Jumps when the specified sequencer flag is set. |
| jump_if([!]matched, label) | Jumps when the matched condition is true. |
| jump_if([!]trigger, label) | Jumps when the specified trigger is asserted. |
Parameter Definitions
The following parameters specify conditions or targets for jump instructions. Use these
conditions or targets in jump_if opcodes to control
execution flow.failed—Indicates any comparison failure in the current pattern burst. The system excludes
vectors that you executed within the last 80 cycles or vectors with the
match opcode. Use the
repeat opcode to implement an 80-cycle
delay.
label—Any local label within the pattern file or any label exported from another pattern
file.
matched—Indicates that the vector executed exactly 80 cycles prior matched. Refer to
instrument specifications for pipeline latency details when hardware versions
change.
seqflag—Specifies a sequencer flag parameter.
trigger—Specifies a trigger parameter.
Valid values:
- seqflag0
- seqflag1
- seqflag2
- seqflag3
Valid values:
- trig0
- trig1
- trig2
- trig3
Note Use NI-TClk to
synchronize instruments when you apply seqflag or
trigger across multiple instruments.
Note See Pattern Responses to Comparisons for more
information about synchronizing multiple instruments and about parameters on vectors that
span more than one instrument or more than one site.
Evaluation Differences
The system evaluates the matched parameter and the !failed parameter differently. Similarly, !matched parameter and the failed parameter have distinct evaluations. For more details, see the descriptions of the matched parameter and failed parameter.
Special Considerations
Additional steps are necessary when using the following opcodes or the following
parameters.
- match opcode
- matched parameter of the jump_if opcode or the exit_loop_if opcode in burst patterns
- failed parameter of the jump_if opcode or the exit_loop_if opcode in burst patterns
Synchronization Requirements for Comparison Results
If a pattern bursts across multiple synchronized digital pattern instruments, enable each
instrument to process comparison results. Use Enable Match… for each
synchronized instrument to process comparison results. Use one of the following options to
enable comparison result processing for synchronized instruments.
- niDigital Enable Match Fail Combination VI
- EnableMatchFailCombination .NET method
- niDigital_EnableMatchFailCombination C function
Branching on failed with an 80‑Cycle Pipeline Delay
// Assume that no failed comparisons have occurred before this vector. sample_timeset L; // This vector will not fail even if the previous vector evaluates to false // because it does not meet the required minimum number of cycles to wait. jump_if(failed, error) sample_timeset X; continue: repeat(78) sample_timeset X; // Pipeline delay must be at least 80 cycles after the last failure. // If it is less than 80, the !failed condition is always true. // If it is 80 or greater, the !failed condition reflects the result of // the comparison. // The jump to the end label executes if the !failed condition is true. // If the failed condition is asserted because of a comparison 80 cycles ago, // the pattern does not branch to the end label and continues to the next // vector with the error label. jump_if(!failed, end) sample_timeset X; error: halt sample_timeset X; end: halt sample_timeset X;