Hello Ewjammer,
Multirecord IQ acquisition will work similar to one record example called "GettingStartedIQ" in C and CVI examples.
You will need to change basically the amount of memory you want to reserve and your waveform info now will have more parameters. Here would be the example of the modified acquisition section of the code:
ViStatus status;
ViInt32 numberOfSamples, numRecords;
ViReal64 timeout = 10;
int i;
/* waveforms */
NIComplexNumber* dataPtr = NULL;
ViReal64* IDataPtr = NULL;
ViReal64* QDataPtr = NULL;
niRFSA_wfmInfo* wfmInfo;
/* get the number of samples specified by user */
GetCtrlVal (gui, GUI_SAMPLES_PER_RECORD, &numberOfSamples);
GetCtrlVal (gui, GUI_NUM_RECORDS, &numRecords);
/* allocate memory for the data */
dataPtr = malloc (sizeof (NIComplexNumber) * numberOfSamples * numRecords);
IDataPtr = malloc (sizeof (ViReal64) * numberOfSamples * numRecords);
QDataPtr = malloc (sizeof (ViReal64) * numberOfSamples * numRecords);
wfmInfo = malloc (sizeof (niRFSA_wfmInfo) * numRecords);
checkWarn (
niRFSA_Initiate (session));
checkWarn (
niRFSA_FetchIQMultiRecordComplexF64 (session, "0", 0, numRecords,
numberOfSamples, 10, dataPtr, wfmInfo));
/* get the I and Q data from the complex number array */
for (i = 0; i < (numberOfSamples * numRecords); ++i)
{
IDataPtr[i] = dataPtr[i].real;
QDataPtr[i] = dataPtr[i].imaginary;
}And from the help file you see that the waveforms (records) come sequentially:
| NIComplexNumber* |
Returns the acquired waveform for each record fetched. The waveforms are
written sequentially in the array. Allocate an array at least as large as
numberOfSamples times numberOfRecords for this
parameter.
|
Hope this helps,
Gerardo O.
RF SW Engineering R&D
National Instruments