While installing the software, it places the following sample programs into two locations on your C: drive—both locations contain the same files:
ControlByGUI
SimpleControl
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\Bluetooth\Samples
C:\ProgramData\Keysight\Signal Studio\Bluetooth\Samples
C:\Documents and Settings\All Users\Application Data\Keysight\Signal Studio\Bluetooth\Samples
C:\Documents and Settings\<user name>\Application Data\Keysight\Signal Studio\Bluetooth\Samples
You can create an API program by performing the following general steps. This sequence is demonstrated in the Main.cs file found in the SimpleControl sample program folder located in the above paths.
This sequence is demonstrated in the Main.cs file (C:\ProgramData\Keysight\Signal Studio\Bluetooth\Samples\SimpleControl\Main.cs).
Create API object.
Configure the instrument connection.
Configure the waveform.
Generate and download the waveform to the signal generator.
Before editing the sample programs, make backup copies of all files. To save the edited files, right-click each file, select Properties, and de-select the Read-only attribute.
The Simple Control project (...\Samples\SimpleControl\SimpleControl.sln) provides a basic program for generating and downloading waveforms using API commands.
To view the code, open the SimpleControl.sln file using the Microsoft Visual C# .NET IDE, or open the Main.cs file using a text editor, such as Notepad. Since the SimpleControl.sln program flow does not use the API GUI, you will see only the code contained in the Main.cs file in the Code Editor, as shown in Figure 1.
Figure 1. Main.cs displayed in the Microsoft Visual C# .NET IDE
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 N7606B 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 N7606B Signal Studio user interface, but are sent directly to the API instance of the Signal Studio application and subsequently to the signal generator.
Ensure that the .dll file Keysight.SignalStudio.N7606B is correctly displayed under References in the Solution Explorer. If the file is not listed, add it as follows:
Select
. A window opens in which you can select the reference files.Locate the directory (the listed paths assume that you installed Signal Studio for Bluetooth in the default location):
Windows XP—C:\Program Files\Keysight\Signal Studio\Bluetooth
Windows 7—C:\Program Files (x86)\Keysight\Signal Studio\Bluetooth
Highlight "Keysight.SignalStudio.N7606.dll".
Click
to add the file in the project as a reference.
Figure 2. API graphical user interface
To view the C# code in the API_TEST project, select the TestApiForm.cs tab in the Code Editor window in the Microsoft Visual C# .NET IDE and. See Figure 3
Figure 3. TestApiForm.cs displayed in the Microsoft Visual C# .NET IDE