niRFSG_AllocateArbWaveform

NI-RFSG C Function

niRFSG_AllocateArbWaveform

C Function Prototype

ViStatus niRFSG_AllocateArbWaveform (ViSession vi, ViConstString name, ViInt32 size_in_samples);

Purpose

Allocates onboard memory space for the waveform. Use this function to specify the total size of a waveform before writing the data. You only need to use this function if you are calling the niRFSG_WriteArbWaveform function multiple times to write a large waveform in blocks.

If direct download is enabled, NI-RFSG reserves the appropriate amount of onboard memory for the specified waveform. If direct download is disabled, NI-RFSG allocates host memory that can hold the requested number of samples. Refer to the NIRFSG_ATTR_DIRECT_DOWNLOAD attribute for more information about enabling or disabling direct download.

The niRFSG_WriteArbWaveform function returns an error if you write more data than the amount of memory allocated for it. If you do not write the entire allocation, the signal generator generates uninitialized data in the unwritten portions of the waveform. If you allocate a waveform prior to writing it, NI-RFSG ignores the moreDataPending parameter in the niRFSG_WriteArbWaveform function. The NI-RFSG device must be in the Configuration state before you call the niRFSG_AllocateArbWaveform function.

Note Note  Direct Download is always enabled on the NI 5672.

Supported Devices: NI 5670/5671/5672

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. The ViSession handle is obtained from the niRFSG_init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.

Default Value: None

name ViConstString Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.
size_in_samples ViInt32 Specifies the number of samples to reserve in the onboard memory for the specified waveform.

Return Value

Name Type Description
status ViStatus Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. Examine the status code from each call to an instrument driver function to determine if an error occurred.

To obtain a text description of the status code, call the niRFSG_error_message function. To obtain additional information about the error condition, call the niRFSG_GetError function. To clear the error information from the driver, call the niRFSG_ClearError function.

The general meaning of the status code is as follows:

ValueMeaning
0Success
Positive ValuesWarnings
Negative ValuesErrors