Introduction
This example code shows how to generate a continuous sine wave with an RF Vector Signal Generator (VSG) in C# using the RFSG .NET wrapper.
Steps to Complete
The steps below are broken up for each callback function.
Form1:
1.) Initializes the form as well as sets up the values for the Reference clock combo box.
StartButton_Click:
1.) Creates the session for the RFSG using the name in the RFSGDeviceNameTextbox.
2.) Configures the generation mode to continuous sine wave generation.
3.) Configures the reference Clock for the devices to PLL there sample clocks together.
4.) Starts the generation.
5.) Changes the form’s controls so the user can’t change the Device name and the Reference clock source and rate.
CenterFreq_orPower_ValueChanged:
1.) If the power level or center frequency is changed, this function reconfigures the generation with these new values.
OutputEnabledcheckBox_CheckedChanged:
1.) Allows the user to disable the signal output
StopButton_Click:
1.) Aborts the Signal generations session
2.) Changes the form to indicator that the session has ended.
3.) Clears and removes the session
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.