niBTSG_ReadWaveformFromFile
- Updated2025-04-08
- 2 minute(s) read
Reads a waveform from a TDMS file. You can save this file using the Generation Interactive Example for Bluetooth. The niBTSG_ReadWaveformFromFile function returns the I/Q complex waveform data that you can subsequently download to an RF signal generator device.
Syntax
int32 __stdcall niBTSG_ReadWaveformFromFile(ViChar filePath, ViChar waveformName, int64_t offset, int64_t count, float64 *t0, float64 *dt, NIComplexNumber waveform, int32 waveformSize, int32 *actualNumWaveformSamples, float64 *iqRate, float64 *headroom, int32 *eof)
Remarks
In addition to the I/Q complex waveform data, the Generation Interactive Example for Bluetooth also saves the NIBTSG_ATTR_HEADROOM and NIBTSG_ATTR_IQ_RATE attributes of the waveform to the file. Use the niBTSG_ReadWaveformFromFile function or TDMS file attributes in your programming environment to read the values of these attributes. The NI_RF_IQRate and NI_RF_Headroom attributes are located in the following locations within the TDMS file.
Attribute Name | Datatype | Group Name | Channel Name |
---|---|---|---|
NI_RF_IQRate | float64 | waveforms | niBT SG Waveform |
NI_RF_Headroom | float64 | waveforms | niBT SG Waveform |
Parameters
Name | Direction | Type | Description |
---|---|---|---|
filePath | [out] | ViChar | Specifies the complete path to the TDMS file from which the BT Generation reads the waveform. |
waveformName | [out] | ViChar | Specifies the name of the waveform to read from the file. |
offset | [in] | int64_t | Specifies the number of samples into the waveform at which the function begins reading the I/Q data. The default value is 0. If you set count to 1,000 and offset to 2, the function returns 1,000 samples, starting from index 2 and ending at index 1,002. |
count | [in] | int64_t | Specifies the maximum number of samples of the I/Q complex waveform to read from the file. The default value is -1, which returns all samples. If you set count to 1,000 and offset to 2, the function returns 1,000 samples, starting from index 2 and ending at index 1,002. |
t0 | [out] | float64 * | Returns the starting time, in seconds. |
dt | [out] | float64 * | Returns the time interval between baseband I/Q samples, in seconds. |
waveform | [out] | NIComplexNumber | Returns the array of baseband complex I/Q samples. |
waveformSize | [in] | int32 | Specifies the waveform size, in samples. |
actualNumWaveformSamples | [out] | int32 * | Returns the actual length of the waveform. |
iqRate | [out] | float64 * | Returns the I/Q rate, in samples per second (S/s), of the waveform. |
headroom | [out] | float64 * | Returns the headroom of the waveform. This value is expressed in dB. |
eof | [out] | int32 * | Indicates whether the end of file has been reached with this read. |
Returns
Returns the status code of this operation. The status code either indicates success or describes an error or warning. Examine the status code from each call to an niBT SG function to determine if an error has occurred. To obtain a text description of the status code and additional information about the error condition, call the niBTSG_GetErrorString function. The general meaning of the status code is as follows:
Value | Meaning |
---|---|
0 | Success |
Positive Values | Warnings |
Negative Values | Errors |