NI 5412/5421/5422/5441
Minimum Waveform Size and Quantum
Waveform Size
The NI 5412/5421/5422/5441 onboard memory architecture imposes certain requirements on the waveform size and quantum. The minimum waveform size depends on the output mode and the Trigger Mode. Refer to the module specifications for the minimum waveform size values for the different modes.
Note To provide greater programming flexibility, NI-FGEN does not strictly enforce the minimum waveform sizes stated in the specifications. NI-FGEN enforces a minimum waveform size of four samples for all trigger modes (two if 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 attribute is set to NIFGEN_VAL_OSP_COMPLEX), so it is possible to generate waveforms that are smaller than the sizes given in the specifications. However, the device may not be able to fetch data from onboard memory fast enough to keep up with waveform generation at very high sample rates.
This condition may occur if a segment is looping over a very small waveform, if a segment is generating a marker within a very small waveform, or if triggers are advancing the segments in a sequence very rapidly. When this occurs, NI-FGEN reports Error –1074115901 (0xBFFA4AC3): Device Data Underflow. The simplest way to avoid this condition is to follow the minimum waveform size guidelines in the specifications. If these rules are followed, a data underflow error will not occur under any sample rate. You may be able to develop applications that generate waveforms smaller than those listed in the specifications at slower sample rates. If a data underflow occurs, NI-FGEN reports the error when the generation is aborted, which is typically done by calling the niFgen Abort Generation VI or the niFgen_AbortGeneration function, or if you call the niFgen Wait Until Done, or niFgen Is Done VIs (or the niFgen_WaitUntilDone or niFgen_IsDone functions) while the device is generating a signal. To monitor error conditions during waveform generation, the niFgen Is Done VI or the niFgen_IsDone function can be called repeatedly while the device is generating a signal. |
Quantum
Quantum is the increment in samples that waveform sizes must adhere to. Waveforms must be downloaded in integer multiples of the four samples (or two for complex samples), the quantum for the NI 5412/5421/5422/5441.
For example, if in Arbitrary Waveform mode, you request to load a waveform of seven samples, the task will not complete successfully because the waveform is not an integer multiple of the quantum size. Waveform sizes that meet the conditions include 4, 8, 12, 16, 20, and so on, up to maximum allowable waveform size.
The maximum waveform size allowed depends on the remaining available space in the onboard memory of the device. The remaining available space depends on factors such as any waveforms and generation instructions currently occupying memory space in the onboard memory. The maximum allowable size equals the memory size of the device minus the data already in memory. Query Max Waveform Size property or the NIFGEN_ATTR_MAX_WAVEFORM_SIZE attribute for the current largest size waveform that can be downloaded to the device.
You can download floating point, signed 16-bit binary, or complex floating-point waveforms to the devices Onboard Memory. LabVIEW programmers can refer to niFgen Create Waveform or niFgen Write Waveform VIs for more information. C programmers can refer to niFgen_CreateWaveformF64, niFgen_CreateWaveformI16, niFgen_CreateWaveformComplexF64, niFgen_WriteWaveform, niFgen_WriteBinary16Waveform, or niFgen_WriteWaveformComplexF64 functions for more information.