Table Of Contents

Digital Source and Capture Opcodes

Last Modified: November 23, 2020

Syntax Parameters Description
capture_start(waveformName) waveformName is the name of the capture waveform. The name can begin with a letter or underscore (_) and is limited to A-Z, a-z, 0-9, or _ characters. You can use up to 512 capture waveforms on the digital pattern instrument at a time. When you load the pattern, an error results when the combined loaded patterns include more than 512 waveforms. Starts capturing a waveform as configured in the test program with the NI-Digital Source/Capture API or waveform file (.digicapture).
capture -- Stores pin state data for each pin specified in the capture waveform. In parallel mode, the capture opcode stores one sample. In serial mode, each serial capture engine can be configured for one specific pin. On vectors with the capture opcode, the value on that pin is shifted in until the number of bits you specified for the sample width have been shifted, at which point the sample is stored. Always use a pattern value of V for the pin(s) being captured. Capture behavior is undefined for any value other than V.

Refer to the instrument specifications for more information about the number of samples you can capture for all patterns in a burst operation.

You can combine the capture opcode with the following opcodes on a single vector by separating the opcodes with a comma:
  • capture_stop
  • clear_seqflag
  • clear_signal
  • end_loop
  • match
  • repeat
  • set_loop
  • set_seqflag
  • set_signal
  • source
  • source_start
  • source_d_replace
capture_stop -- Ends capture of the waveform initiated by the capture_start opcode on a previous vector.
source_start(waveformName) waveformName is the name of the capture waveform. The name can begin with a letter or underscore (_) and is limited to A-Z, a-z, 0-9, or _ characters. You can use up to 512 capture waveforms on the digital pattern instrument at a time. When you load the pattern, an error results when the combined loaded patterns include more than 512 waveforms. Starts sourcing a waveform as configured in the test program with the NI-Digital Source and Capture API or waveform file (.tdms).
spd-note-note
Note  

A required delay of 3 µs must pass between the start of the vector that uses this opcode and the subsequent start of a vector that uses a source opcode or source_start opcode. You can create and reserve a time set with a known period to meet the delay requirement.

source -- Uses source data to replace pin state data for each D pin state in the vector. In parallel mode, the source opcode sends one sample. In serial mode, each serial source engine can be configured for one specific pin. On vectors with the source opcode and a D for that pin, the bit is shifted in until the number of bits you specified for the sample width have been shifted. When the number of bits you specified for the sample width have been shifted, execution moves on to the next sample. Waveforms behave as a circular buffer, meaning that when execution reaches the end of the waveform, it returns to the beginning of the waveform automatically.
You can combine the source opcode with the following opcodes on a single vector by separating the opcodes with a comma:
  • capture
  • capture_start
  • capture_stop
  • clear_seqflag
  • clear_signal
  • end_loop
  • match
  • repeat
  • set_loop
  • set_seqflag
  • set_signal
source_d_replace (sourcePinState0, sourcePinState1) sourcePinState0 specifies the pin state to replace source memory 0. Valid values include 0, 1, L, H, X.

sourcePinState1 specifies the pin state to replace source memory 1. Valid values include 0, 1, L, H, X.

Changes the behavior of source memory values 0 and 1 for all subsequent vectors with the source opcode and a D for that pin. By default, a 0 in the source data translates to pin state 0, or drive logical low, and a 1 in the source data translates to pin state 1, or drive logical high.

You cannot combine the source opcode with the source_d_replace opcode. Include at least one vector of separation between source_start and any source opcode that uses source_d_replace to replace source pin states. You must include a 3 μs delay from the vector with source_start to the vector before the source opcode.

Example 1

source_start(source_waveform)   sample_timeset  X X;
                                timeset_3us     X X; // Reserved time set configured with a known period (3 us) to meet the delay requirement. 
source                          sample_timeset  D H;
halt                            sample_timeset  X X;

Example 2

capture_start(waveform_name)     sample_timeset  X X; // Start capture waveform with a capture waveform name of 'waveform_name'.
repeat(100), capture             sample_timeset  V 1; // Capture with a repeat opcode.
capture                          sample_timeset  V 1; // Capture on a single vector.
capture_stop                     sample_timeset  X X; // End capture from the waveform.
halt                             sample_timeset  X X;

Example 3

capture_start(capture_waveform) sample_timeset  X X; // Start capture waveform with a capture waveform name of 'capture_waveform'.
source_start(source_waveform)   sample_timeset  X X;
                                timeset_3us     X X; // Reserved time set configured with a known period (3 us) to meet the delay requirement for source_start. 
repeat(65535), source, capture  sample_timeset  D V; // Source and capture with a repeat opcode. 
repeat(65535), source, capture  sample_timeset  D V; // Source and capture with a repeat opcode.
repeat(65535), source, capture  sample_timeset  D V; // Source and capture with a repeat opcode.
repeat(65535), source, capture  sample_timeset  D V; // Source and capture with a repeat opcode.
repeat(65535), source, capture  sample_timeset  D V; // Source and capture with a repeat opcode. 
capture_stop                    sample_timeset  X X; // End capture from the waveform. 
halt                            sample_timeset  X X;

Recently Viewed Topics