Real Time

Sample API Programs

Sample programs are placed in these default locations when you install the software:

C:\Users\<my account>\AppData\Roaming\Keysight\Signal Studio\Keysight Signal Studio for Short Range Communications\Samples\SimpleControl

Using Microsoft Visual C# .NET or a similar IDE, you can modify these sample projects to develop your own API programs.

Basic Program Flow

You can create an API program by performing the following general steps. This sequence is demonstrated in the Main.cs file (C:\Users\<my account>\AppData\Roaming\Keysight\Signal Studio\Keysight Signal Studio for Short Range Communications\Samples\SimpleControl\Main.cs).

  1. Create an API object.

  2. Configure the instrument connection.

  3. Preset.

  4. Configure the waveform.

  5. Generate and download the waveform to the instrument.

  6. Trigger the sequence on the signal generator to play.

  7. End the program.

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.

Simple Control Project

The Simple Control project (...\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