![]() |
VSG60 API
|
There are two primary ways to generate waveforms with the VSG60 API:
Before any generation can occur, the device must be opened and initialized. Opening and initializing a device through the API is performed through the vsgOpenDevice or vsgOpenDeviceBySerial functions. These functions will perform the full initialization of the device and if successful, will return an integer handle which can be used to reference the device for the remainder of your program. See the list of all VSG60 devices connected to the PC via the vsgGetDeviceList function.
To output a static waveform, either once, or repeatedly, use basic signal generation.
For a list of all examples, please see the examples/ folder in the SDK.
Basic signal generation involves configuring the generator and then using one of the following functions:
Waveforms are provided as interleaved I/Q complex pairs. The API can output the waveform once using the vsgOutputWaveform function, or continually generate the waveform using the vsgRepeatWaveform function.
The vsgOutputWaveform is a blocking function which returns once fully output. When a waveform is on repeat, any changes in configuration will cause the waveform to be paused, and then restarted once reconfiguration has completed.
Submitting a trigger or I/Q data through the vsgSubmitIQ function will stop any waveforms on repeat.
Calling vsgAbort will end any active waveforms on repeat.
For long waveform generation or for transmitting a complex sequence of events such as frequency hopping or triggers, a collection of functions are available in the API which allow a user to buffer a sequence of configuration and transmit events.
For a list of all examples, please see the examples/ folder in the SDK.
The following functions can be buffered/queued:
Roughly 1/5th of a second of I/Q data can be buffered. If the buffer is full and vsgSubmitIQ data is called, the function blocks until space is available in the buffer.
Calling vsgAbort will cause all I/Q data in the buffer to be dumped and any pending frequency/level changes to be completed in the order received.
When finished, you can close the device and free all resources related to the device with the vsgCloseDevice function. Once closed, the device will appear in the open device list again. It is possible to open and close a device multiple times during the execution of a program.
Recalibration is performed by calling the vsgRecal function which retrieves the current device temperature and recalibrates the device for the current device settings. This will interrupt any signal generation currently in progress.
Large temperature changes affect signal generation in the form of reduce amplitude accuracy and reduced spurious performance, and it is recommended to reconfigure the device after large environmental changes and during device warmup.
Recalibration can occur automatically during periods of activity that include frequency changes, but when generating the same signal for long periods of time, or after a long period of inactivity, a recalibration is recommended.