generate

NI Script Editor

generate

Use the generate instruction to describe which waveform to generate.

Usages:

  • Generate a waveform written to the device with the Write Named Waveform VI/function for your driver:
    generate <waveform name>
  • Generate a subset of the named waveform:
    generate <waveform name> subset (<start position>, <length>)
    Specify start position and length in samples.
  • Generate the waveform and generate a Marker event when a position(s) within the waveform is generated:
    generate <waveform name> marker0 (<position 1>, <position 2>, ... , <position n>)
    Specify each position in samples. Use the Export Signal VI/function for your driver to specify the destination terminal of the marker. Marker position is zero-based. For example, 0 refers to the first point in the waveform, 999 refers to the 1,000th point in the waveform, and so on.
  • Generate a subset of the named waveform and generate a Marker event when a position(s) within the waveform is generated:
    generate <waveform name> subset(<start position), length>) marker0 (<list of positions>)
    Specify positions and length in samples. When a subset and markers are specified in the same generate instruction, the marker positions are relative to the subset.

Examples (assume myWfm has 1,024 samples):

  • Generate myWfm:
      generate myWfm
  • Generate 10 samples of myWfm starting at sample 40:
      generate myWfm subset (40, 10)
  • Generate myWfm and generate a marker at the start of the waveform (sample 0):
      generate myWfm marker0 (0)
  • Generate myWfm and generate a marker at positions 10 and 80:
      generate myWfm marker0 (10, 80)
  • Generate 10 samples of myWfm starting at sample 40, and generate a marker at position 6 of the subset:
      generate myWfm subset (40, 10) marker0 (6)

Back to Scripting Instructions