While installing the software, it places the following sample programs into two locations on your C: drive—both locations contain the same files:
ControlByGUI
RemotingByGUI
SimpleControl
SimpleRemoting
The two of the sample programs ControlByGUI and SimpleControl are provided to illustrate the basic program flow for automating signal configuration and playback in a .NET programming environment.
Using Microsoft Visual C# .NET, or a similar IDE, you can use these sample projects as a starting point to develop your own API programs.
C:\Users\<user name>\AppData\Roaming\Keysight\Signal Studio\W-CDMA-HSPA+\Samples
C:\ProgramData\Keysight\Signal Studio\W-CDMA-HSPA+\Samples
C:\Documents and Settings\All Users\Application Data\Keysight\Signal Studio\W-CDMA-HSPA+\Samples
C:\Documents and Settings\<user name>\Application Data\Keysight\Signal Studio\W-CDMA-HSPA+\Samples
Create API object.
Configure the instrument connection.
Clear all carriers.
Configure the waveform.
Add Test Model 1 with 64 DPCH downlink carrier.
Generate and download the waveform to the signal generator.
Turn on the RF output.
End program and turn off the RF output.
Before editing the sample programs, make backup copies of all files. To save the files, you will need to right-click each file, select Properties, and de-select the Read-only attribute.
When upgrading the software from Release 3.3 or earlier to the current release, or upgrading from Option EFP to Option FFP in the current release, there may be a need to add or replace a name space in the existing API programs for them to work (see the following table):
Current Software Release Options |
Release 3.3 or Earlier—Migrate API Programs to Current Software Release |
Current Release (Upgrade from EFP to FFP) |
|||
---|---|---|---|---|---|
Not Recompiling |
Recompiling |
Not Recompiling |
Recompiling |
||
Option EFP |
1 |
2 |
--- |
--- |
--- |
Option FFP |
--- |
--- |
1 |
3 |
4 |
No name space addition needed.
Add name space "using Agilent.SignalStudio.N7600B.API.WCDMABasic;".
Add name space "using Agilent.SignalStudio.N7600B.API.WCDMA2Basic;".
Replace name space "using Agilent.SignalStudio.N7600B.API.WCDMABasic;" with "using Keysight.SignalStudio.N7600B.API.WCDMA2Basic;".
As shown in the table, if you do not recompile an existing API program when upgrading to the latest software release or to another option, there is no need to add the name space. However when upgrading to Option FFP, if you do not modify and recompile the programs, you will not be able to use the additional functionality that comes with the option.
Adding the required name space means that the program will contain three name space statements as shown in the following examples:
Option EFP
using Agilent.SignalStudio.N7600;
using Agilent.SignalStudio.N7600.API;
using Agilent.SignalStudio.N7600B.API.WCDMABasic;
Option FFP
using Agilent.SignalStudio.N7600;
using Agilent.SignalStudio.N7600.API;
using Agilent.SignalStudio.N7600B.API.WCDMA2Basic;
Failure to add the proper name space results in an error during compiling:
Error 1 The type or namespace name '<class name> could not be found (are you missing a using directive or an assembly reference?) <path to the program that contains the class> <line #> <column #> <program name>
The SimpleControl sample project (...\Samples\SimpleControl\SimpleControl.sln), provides a simple, basic program to generate and download waveforms using API commands.
To view the code, open SimpleControl.sln using the Microsoft Visual C# .NET application, or open Main.cs using another text editor, such as Notepad. Since the SimpleControl.sln program flow does not use a .NET GUI, you will see only the code contained in the Main.cs file in the Code Editor, as shown in Figure 1, below:
Figure 1. Source code of Main.cs in Microsoft Visual C# .NET
Using Microsoft Visual C# .NET, or a similar IDE, open the API_TEST project (...\Samples\ControlByGUI\API_TEST.sln). This displays a .NET API graphical user interface with two API mode selections (see Figure 2):
– settings that you configure using the .NET API GUI are displayed in the N7600B Signal Studio user interface, and are subsequently sent to the signal generator via the Signal Studio application. The Signal Studio GUI is automatically displayed when you select Debug mode. Using this mode allows you to see how changes in your program modify the parameters in the Signal Studio software interface.
– settings that you configure using the .NET API are not displayed in the N7600B Signal Studio user interface, but are sent directly to the API instance of the Signal Studio application and subsequently to the signal generator.
To view the C# code in the API_TEST project, select the
tab in the Code Editor window (see Figure 3).Ensure that the .dll file Keysight.SignalStudio.N7600 is correctly displayed under References in the Solution Explorer.
Figure 2. API Graphical User Interface displayed in Microsoft Visual C# .NET
Figure 3. Source code of TestApiForm.cs in Microsoft Visual C# .NET