Sample programs are located in these default installation directories:
C# Examples |
C:\ProgramData\Keysight\Signal Studio\WLAN\ApiSample\CS |
Visual Basic.Net Examples |
C:\ProgramData\Keysight\Signal Studio\WLAN\ApiSample\VB |
Before you start to run these examples, make sure you have added "Agilent.SignalStudio.N7617.dll" and "Agilent.SignalStudio.dll" as the references to your API Project in Microsoft Visual Studio .NET 2003 IDE. The following steps, using Microsoft Visual Studio .NET 2003 IDE, outline a procedure for adding these references, if needed. The steps may vary depending on your development environment.
From the
menu, create a new project or open an existing project in your Visual Studio.Net programming environment.Select
.A window opens in which you can select the reference files. Locate the directory C:\Program Files\Keysight\Signal Studio\WLAN (This assumes that you installed Signal Studio for WLAN 802.11a/b/g/n/ac/ah/ax in the default location). Highlight "Agilent.SignalStudio.N7617.dll" and "Agilent.SignalStudio.dll".
Click
to add them in the project as references.This procedure provides information on how to build a typical program to generate, download, and run an 802.11a/b/g/j/p waveform using the WLAN API in C# programming code. See Tips for troubleshooting help.
4. Generate, Download, and Run the Waveform
This procedure provides information on how to build a typical program to generate, download, and run an Mx2 802.11n waveform package using the WLAN API in C# programming code. See Tips for troubleshooting help.
5. Generate, Download, and Run the Waveform
This procedure provides information on how to build a typical program to generate, download, and run an Mx2 802.11ac waveform package using the WLAN API in C# programming code. See Tips for troubleshooting help.
5. Generate, Download and Run the Waveform
This procedure provides information on how to build a typical program to generate, download, and run an Mx2 802.11ah waveform package using the WLAN API in C# programming code. See Tips for troubleshooting help.
5. Generate, Download and Run the Waveform
This procedure provides information on how to build a typical program to generate, download, and run an Mx2 802.11ax waveform package using the WLAN API in C# programming code. See Tips for troubleshooting help.
5. Generate, Download and Run the Waveform
These commands specify how the software creates an API project handler:
using Agilent.SignalStudio.N7617;
LegacyAPI api = new LegacyAPI();
Connect to the signal generator using the correct address format:
GPIB(board address)::(primary address)::(secondary address)::INSTR
TCPIP0::(IP address)::INSTR
For example, if the signal generator is connected via LAN, and the IP address is 192.168.100.10, the VISA name is
"TCPIP0::192.168.100.10::INSTR".
string inst = "TCPIP0::192.168.100.10::INSTR";
bool connected = api.ConnectInstrument (inst);
Get a carrier object.
Agilent.SignalStudio.N7617.CarrierLegacy carrier = waveformSetup.Carrier[0];
Get the signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen = api.Hardware.OneSG;
Set the RF frequency to 2.412 GHz (1e9)
sigGen.Frequency = 2.412e9;
Set the amplitude to -30.0 dBm.
sigGen.Amplitude = -30.0;
Generate and download the waveform to the signal generator, then run it.
api.Download();
Turn the signal generator's RF output on.
api.Hardware.OneSG.RfOutputEnabled = true;
api.Hardware.UpdateToInstrument();
Turn off the RF output.
api.Hardware.SignalGenerator.RFOutputEnabled = false;
api.Hardware.UpdateToInstrument();
These commands specify how the software creates an API project handler:
using Agilent.SignalStudio.N7617;
MimoAPI api = new MimoAPI ();
Before connecting to the signal generator, select the MIMO function:
api.SetMimoFunction(MimoFunction.MIMO_Mx2_2SG);
Connect to the signal generators using the correct address format:
GPIB(board address)::(primary address)::(secondary address)::INSTR
TCPIP0::(IP address)::INSTR
For example, if the two signal generators are connected via LAN, and the IP addresses are 192.168.100.10 and 192.168.100.11 respectively, the VISA names are
"TCPIP0::192.168.100.10::INSTR" and "TCPIP0::192.168.100.11::INSTR".
string inst1 = "TCPIP0::192.168.100.10::INSTR";
string inst2 = "TCPIP0::192.168.100.11::INSTR";
bool connected = api1.ConnectInstrument (inst1, inst2);
Select the spatial mapping scheme and MCS index:
api.WaveformSetup.Config.SpatialMappingScheme = SpatialMappingScheme.SpatialExpansion;
api.WaveformSetup.Config.McsIndex.Index = 15;
Get the first signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen0 = api.Hardware.SGArray[0];
Get the second signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen1 = api.Hardware.SGArray[1];
Set the RF frequency to 2.412 GHz (1e9).
sigGen0.Frequency = 2.412e9;
sigGen1.Frequency = 2.412e9;
Set the amplitude to -30.0 dBm.
sigGen0.Amplitude = -30.0;
sigGen1.Amplitude = -30.0;
Generate and download the waveform packages to the signal generators, then run them.
api.Download();
Turn the signal generator's RF output on.
sigGen0.RfOutputEnabled = true;
sigGen1.RfOutputEnabled = true;
api.Hardware.UpdateToInstrument();
Turn off the RF output.
sigGen0.RfOutputEnabled = false;
sigGen1.RfOutputEnabled = false;
api.Hardware.UpdateToInstrument();
If an error occurs, the software produces an exception.
Using try..catch() is a way to program the software's API to capture exceptions.
You may use try..catch() for each method call or one try..catch() for all methods to call. The example below opens the
settings file test1.scp and displays an error message if the software produces an exception.
string FullpathFilename1 = "C:\\Program Files\\Keysight\\Signal Studio\\N7617B WLAN\\test1.scp";
LegacyApi api = new LegacyApi ();
try
{
api.OpenSettingsFile(FullpathFilename1);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
These commands specify how the software creates an API project handler:
using Agilent.SignalStudio.N7617;
Wlan11acAPI api = new Wlan11acAPI();
Before connecting to the signal generator, select the MIMO function:
api.SetWlan11acFunction(Mimo11acFunction.MIMO_MxN_1SG);
Connect to the signal generators using the correct address format:
GPIB(board address)::(primary address)::(secondary address)::INSTR
TCPIP0::(IP address)::INSTR
For example, if the two signal generators are connected via LAN, and the IP addresses are 192.168.100.10 and 192.168.100.11 respectively, the VISA names are "TCPIP0::192.168.100.10::INSTR" and "TCPIP0::192.168.100.11::INSTR".
string inst1 = "TCPIP0::192.168.100.10::INSTR";
string inst2 = "TCPIP0::192.168.100.11::INSTR";
bool connected = api1.ConnectInstrument (inst1, inst2);
Get an IEEE 802.11ac object.
Agilent.SignalStudio.Wlan11ac.CarrierSetup carrier = api.WaveformSetup.CarrierConfig;
Get a User object.
UserSetup usr = api.WaveformSetup.CarrierConfig.UserSetups[0];
Get a MPDU object.
MpduSetup mpdu = api.WaveformSetup.CarrierConfig.UserSetups[0].MpduSetups[0];
Select the spatial mapping scheme:
api.WaveformSetup.CarrierConfig.SpatialMappingScheme = Agilent.SignalStudio.Wlan11ac.SpatialMappingScheme.SpatialExpansion;
Get the first signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen0 = api.Hardware.SGArray[0];
Get the second signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen1 = api.Hardware.SGArray[1];
Set the RF frequency to 2.412 GHz (1e9).
sigGen0.Frequency = 2.412e9;
sigGen1.Frequency = 2.412e9;
Set the amplitude to -30.0 dBm.
sigGen0.Amplitude = -30.0;
sigGen1.Amplitude = -30.0;
Generate and download the waveform packages to the signal generators, then run them.
api.Download();
Turn the signal generator's RF output on.
sigGen0.RfOutputEnabled = true;
sigGen1.RfOutputEnabled = true;
api.Hardware.UpdateToInstrument();
Turn off the RF output.
sigGen0.RfOutputEnabled = false;
sigGen1.RfOutputEnabled = false;
api.Hardware.UpdateToInstrument();
These commands specify how the software creates an API project handler:
using Agilent.SignalStudio.N7617;
using Agilent.SignalStudio;
using Agilent.SignalStudio.Wlan11ah;
Wlan11ahAPI api = new Wlan11ahAPI();
Before connecting to the signal generator, select the MIMO function:
api.SetWlan11ahFunction(Mimo11ahFunction.MIMO_MxN_1SG);
Connect to the signal generators using the correct address format:
GPIB(board address)::(primary address)::(secondary address)::INSTR
TCPIP0::(IP address)::INSTR
For example, if the two signal generators are connected via LAN, and the IP addresses are 192.168.100.10 and 192.168.100.11 respectively, the VISA names are "TCPIP0::192.168.100.10::INSTR" and "TCPIP0::192.168.100.11::INSTR".
string inst1 = "TCPIP0::192.168.100.10::INSTR";
string inst2 = "TCPIP0::192.168.100.11::INSTR";
bool connected = api1.ConnectInstrument (inst1, inst2);
Get an IEEE 802.11ah object.
Agilent.SignalStudio.Wlan11ah.SignalSetup carrier = api.WaveformSetup.SignalConfig;
Get a User object.
UserSetup usr = api.WaveformSetup.SignalConfig.UserSetups[0];
Get a MPDU object.
MpduSetup mpdu = api.WaveformSetup.SignalConfig.UserSetups[0].MpduSetups[0];
Select the spatial mapping scheme:
api.WaveformSetup.SignalConfig.SpatialMappingScheme = Agilent.SignalStudio.Wlan11ah.SpatialMappingScheme.SpatialExpansion;
Get the first signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen0 = api.Hardware.SGArray[0];
Get the second signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen1 = api.Hardware.SGArray[1];
Set the RF frequency to 920 MHz (1e6).
sigGen0.Frequency = 920e6;
sigGen1.Frequency = 920e6;
Set the amplitude to -30.0 dBm.
sigGen0.Amplitude = -30.0;
sigGen1.Amplitude = -30.0;
Generate and download the waveform packages to the signal generators, then run them.
api.Download();
Turn the signal generator's RF output on.
sigGen0.RfOutputEnabled = true;
sigGen1.RfOutputEnabled = true;
api.Hardware.UpdateToInstrument();
Turn off the RF output.
sigGen0.RfOutputEnabled = false;
sigGen1.RfOutputEnabled = false;
api.Hardware.UpdateToInstrument();
These commands specify how the software creates an API project handler:
using Agilent.SignalStudio.N7617;
Wlan11axAPI api = new Wlan11axAPI();
Before connecting to the signal generator, select the MIMO function:
api.SetWlan11axFunction(Mimo11axFunction.MIMO_MxN_1SG);
Connect to the signal generators using the correct address format:
GPIB(board address)::(primary address)::(secondary address)::INSTR
TCPIP0::(IP address)::INSTR
For example, if the two signal generators are connected via LAN, and the IP addresses are 192.168.100.10 and 192.168.100.11 respectively, the VISA names are "TCPIP0::192.168.100.10::INSTR" and "TCPIP0::192.168.100.11::INSTR".
string inst1 = "TCPIP0::192.168.100.10::INSTR";
string inst2 = "TCPIP0::192.168.100.11::INSTR";
bool connected = api1.ConnectInstrument (inst1, inst2);
Get an IEEE 802.11ax object.
Agilent.SignalStudio.Wlan11ax.CarrierSetup carrier = api.WaveformSetup.CarrierConfig;
Get a User object.
UserSetup usr = api.WaveformSetup.CarrierConfig.UserSetups[0];
Get a MPDU object.
MpduSetup mpdu = api.WaveformSetup.CarrierConfig.UserSetups[0].MpduSetups[0];
Select the spatial mapping scheme:
api.WaveformSetup.CarrierConfig.SpatialMappingScheme = Agilent.SignalStudio.Wlan11ax.SpatialMappingScheme.SpatialExpansion;
Get the first signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen0 = api.Hardware.SGArray[0];
Get the second signal generator object.
Agilent.SignalStudio.N7617.SigGenConfigD sigGen1 = api.Hardware.SGArray[1];
Set the RF frequency to 2.412 GHz (1e9).
sigGen0.Frequency = 2.412e9;
sigGen1.Frequency = 2.412e9;
Set the amplitude to -30.0 dBm.
sigGen0.Amplitude = -30.0;
sigGen1.Amplitude = -30.0;
Generate and download the waveform packages to the signal generators, then run them.
api.Download();
Turn the signal generator's RF output on.
sigGen0.RfOutputEnabled = true;
sigGen1.RfOutputEnabled = true;
api.Hardware.UpdateToInstrument();
Turn off the RF output.
sigGen0.RfOutputEnabled = false;
sigGen1.RfOutputEnabled = false;
api.Hardware.UpdateToInstrument();