NI PXI/PXI-5412/5421/5422/5441/5442 Memory Usage

NI Signal Generator

NI 5412/5421/5422/5441/5442
Waveform and Generation Instruction Memory Size


Waveform Memory Size

Waveforms are stored in the NI 5412/5421/5422/5441/5442 onboard memory in contiguous blocks. These blocks are allocated in multiples of 128 bytes. This allocation style means that while waveform sizes may be multiples of four samples (eight bytes) on the NI 5412/5421/5422/5441 and one sample (two bytes on the NI 5442), the amount of onboard memory allocated for each waveform is a multiple of 128 bytes. The following figure represents the total memory of a device and shows memory that was initially empty, but it now has multiple waveforms written to it, nearly filling the device memory.



The amount of memory that a waveform takes up in the onboard memory is relatively easy to calculate using the following two rules.

  1. Each sample in the waveform uses two bytes of memory space. Four bytes are used when the onboard signal processing block is enabled and the Data Processing Mode property is set to Complex or the NIFGEN_ATTR_OSP_DATA_PROCESSING_MODE is set to NIFGEN_VAL_OSP_COMPLEX.
  2. Memory is written to in blocks of 128 bytes (2 bytes on the 5442).

Calculate the memory size by multiplying the number of samples in the waveform by two (or four) and then rounding this value up to the nearest multiple of 128.

Examples

  1. A waveform containing 16 samples occupies 32 bytes in memory. By rounding up to the nearest multiple of 128, you can determine that the waveform occupies 128 bytes in memory.
  2. A waveform containing 64 samples occupies 128 bytes in memory. By rounding up to the nearest multiple of 128, you can determine that the waveform occupies 128 bytes in memory.
  3. A waveform containing 68 samples occupies 136 bytes in memory. By rounding up to the nearest multiple of 128, you can determine that the waveform occupies 256 bytes in memory.
  4. A waveform containing 10,000 samples occupies 20000 bytes in memory. By rounding up to the nearest multiple of 128, you can determine that the waveform occupies 20,096 bytes in memory.
  5. A waveform containing 64 complex samples occupies 256 bytes in memory. By rounding up to the nearest multiple of 256, you can determine that the waveform occupies 256 bytes in memory. This example is only possible with the onboard signal processing block enabled.

Instruction Memory Size

The NI 5412/5421/5422/5441/5442 uses a waveform generation engine that processes instructions that govern how a waveform or a sequence of waveforms is generated. These instructions determine which waveforms are generated, how the device responds to triggers, how many times a waveform is looped, when Marker events are generated, and so forth. The instructions depend on the output mode, trigger mode, trigger source, waveforms in onboard memory, and sequence lists that are configured. The instructions are stored in the onboard memory along with the waveform data. The calculations to determine the instruction size that is stored in the onboard memory depends on the NI-FGEN output mode and the NI-FGEN trigger mode. The following table includes basic equations for determining the amount of memory, in bytes, that are used for the different generation configurations.


Instruction Memory Size* Formulae
Arbitrary Waveform Mode
Size in bytes = 256 per waveform
Arbitrary Sequence Mode

N = Number of segments in sequence
Stepped: Size in bytes = 208 + (80 * N)
Continuous: Size in bytes = 208 + (64 * N)
Single: Size in bytes = 80 + (64 * N)
Burst: Size in bytes = 160 + (128 * N)
*The instruction size in memory is the size, in bytes, rounded up to the nearest multiple of 128 bytes.

Examples

  1. The memory size required to generate a waveform in Arbitrary Waveform mode is always 256 bytes of onboard memory for that specific waveform. Each waveform that is saved to onboard memory uses 256 byes of memory for instructions.
  2. The memory size required to generate a waveform using Arbitrary Sequence mode and Stepped trigger mode with 50 segments in a sequence list is determined by the following formula:

    Size in Bytes = 208 + (80 × 50) = 4,208 bytes.

    Size in memory = 4208 coerced up to the next multiple of 128 = 4,224 bytes.

  3. The memory size required to generate a waveform using Arbitrary Sequence mode and Continuous trigger mode with 500 segments in a sequence list is determined by the following formula:

    Size in Bytes = 208 + (64 × 500) = 32,208 bytes.

    Size in memory = 32,208 coerced up to the next multiple of 128 = 32,256 bytes.

  4. The memory size required to generate a waveform using Arbitrary Sequence mode and Single trigger mode with 1,003 segments in a sequence list is determined by the following formula:

    Size in Bytes = 80 + (64 × 1,003) = 64,272 bytes.

    Size in memory = 64,272 coerced up to the next multiple of 128 = 64,284 bytes.

  5. The memory size required to generate a waveform using Arbitrary Sequence mode and Burst trigger mode with 2345 segments in a sequence list is determined by the following formula:

    Size in Bytes = 160 + (128 × 2,345) = 300,320 bytes.

    Size in memory = 300,320 coerced up to the next multiple of 128 = 300,416 bytes.

Total Memory Size

The following examples show how to calculate total memory for an application. The examples use each of the four trigger modes for the Arbitrary Sequence mode and use varying numbers of waveforms, waveform sizes, and number of segments in the sequences.


Note  The following examples only consider the memory used for instructions for one sequence. It is possible to create and save to memory the instructions for as many sequences as the available free memory allows.


Examples

  1. An application requires using three waveforms with the following sizes: 72, 132, and 260 samples. The waveforms are generated by using Arbitrary Sequence mode and Single trigger mode to configure 20,000 segments in a sequence list. The following tables show all the numbers used to determine the total memory stored in the onboard memory: 1,281,408 bytes.

    Waveforms Samples Bytes Rounded Size
    A
    72
    144
    256
    B
    132
    264
    384
    C
    260
    520
    640
    Memory Size =
    1,280


    Number of Segments in Sequence
    Memory Calculation
    Bytes Rounded Size
    20,000
    80 + (64 * 20,000) =
    1,280,080
    1,280,128


    Total Onboard Memory Used = 1,281,408 bytes



  2. An application requires using six waveforms with the following sizes: 480, 260, 960, 492, 516, and 604 samples. The waveforms are generated by using Arbitrary Sequence mode and Burst trigger mode to configure 10,000 segments in a sequence list. The following table shows all the numbers used to determine the total memory stored in the onboard memory: 135,296 bytes.

    Waveforms Samples Bytes Rounded Size
    A
    480
    960
    1,024
    B
    260
    520
    640
    C
    960
    1,920
    1,920
    D
    492
    984
    1,024
    E
    516
    1,032
    1,152
    F
    604
    1,208
    1,280
    Memory Size =
    7,040


    Number of Segments in Sequence
    Memory Calculation
    Bytes Rounded Size
    10,000
    160 + (128 * 10,000) =
    128,160
    128,256


    Total Onboard Memory Used = 135,296 bytes



  3. An application requires using five waveforms with the following sizes: 10,000; 1,000,000; 2,000,000; 30,000,000; and 5,000 samples. The waveforms are generated by using Arbitrary Sequence mode and Stepped trigger mode to configure 2,000 segments in a sequence list. The following table shows all the numbers used to determine the total memory stored in the onboard memory: 66,190,464 bytes.

    Waveforms Samples Bytes Rounded Size
    A
    10,000
    20,000
    20,096
    B
    1,000,000
    2,000,000
    2,000,000
    C
    2,000,000
    4,000,000
    4,000,000
    D
    30,000,000
    60,000,000
    60,000,000
    E
    5,000
    10,000
    10,112
    Memory Size =
    66,030,208


    Number of Segments in Sequence
    Memory Calculation
    Bytes Rounded Size
    2,000
    208 + (80 * 2,000) =
    160,208
    160,256


    Total Onboard Memory Used = 66,190,464 bytes



  4. An application requires using seven waveforms with the following sizes: 1,000; 2,000; 2,000, 10,000; 20,000; 500; and 260 samples. The waveforms are generated by using Arbitrary Sequence mode and Continuous trigger mode to configure 100 segments in a sequence list. The following table shows all the numbers used to determine the total memory stored in the onboard memory: 78,720 bytes.

    Waveforms Samples Bytes Rounded Size
    A
    1,000
    2,000
    2,048
    B
    2,000
    4,000
    4,096
    C
    2,000
    4,000
    4,096
    D
    10,000
    20,000
    20,096
    E
    20,000
    40,000
    40,064
    F
    500
    1,000
    1,024
    G
    260
    520
    640
    Memory Size =
    72,064


    Number of Segments in Sequence
    Memory Calculation
    Bytes Rounded Size
    100
    208 + (64 * 100) =
    6,608
    6,656


    Total Onboard Memory Used = 78,720 bytes



  5. An application requires using seven complex waveforms with the following sizes: 500; 1,000; 1,000, 5,000; 10,000; 250; and 130 samples with the OSP block enabled and the Data Processing Mode property set to Complex or the NIFGEN_ATTR_OSP_DATA_PROCESSING_MODE attribute set to NIFGEN_VAL_OSP_COMPLEX. Additionally, the signal generator is configured for Arbitrary Sequence mode and Continuous trigger mode with 100 segments in a sequence list. The following table shows all the numbers used to determine the total memory stored in the onboard memory: 78,720 bytes.

    Waveforms Samples Bytes Rounded Size
    A
    500
    2,000
    2,048
    B
    1,000
    4,000
    4,096
    C
    1,000
    4,000
    4,096
    D
    5,000
    20,000
    20,096
    E
    10,000
    40,000
    40,064
    F
    250
    1,000
    1,024
    G
    130
    520
    640
    Memory Size =
    72,064


    Number of Segments in Sequence
    Memory Calculation
    Bytes Rounded Size
    100
    208 + (64 * 100) =
    6,608
    6,656


    Total Onboard Memory Used = 78,720 bytes