Real Time

API Procedures for FM Stereo\ RDS

1. Create API Handle

These commands specify how the software create an API project handler:

using System;

using Keysight.SignalStudio.N7611;

using Keysight.SignalStudio.Hardware;

API api = new API();

BroadcastRadioProject project = api.CreateProject("FM_RDS") as BroadcastRadioProject;

2. Configure Hardware

Connect to the signal generator using the correct address format:

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 = project.ConnectToInstrument(inst);

3. Configure the Waveform

Get the waveform setup object.

Keysight.SignalStudio.N7611.WaveformSetup waveformSetup = project.WaveformSetup;

waveformSetup.WaveformName = "FM_RDS_TEST";

Get the carrier object.

FMCarrier carrier = waveformSetup.Carrier[0] as FMCarrier;  

carrier.AudioSourcePattern = AudioSourcePattern.LOnly;

carrier.RDS.ProgrammeType = ProgrammeType.News_1;

carrier.RDS.AddMessage(MessageType.RadioText);

RDS_BasicTuningAndSwitchingMessage basicMsg = carrier.RDS.Message[0] as RDS_BasicTuningAndSwitchingMessage;

basicMsg.MusicSpeechSwitch = MusicSpeechSwitch.Speech;    

Get the signal generator object.

Keysight.SignalStudio.Hardware.SignalGenerator sigGen = project.Hardware.SignalGenerator;

Set the RF frequency to 100 MHz (1e9)

sigGen.Frequency = 1e9;                    

Set the amplitude to -8.0 dBm.

sigGen.Amplitude = -8.0;             

4. Generate, Download and Run the Waveform

Generates and downloads the waveform to the signal generator, then runs it.

project.Download();

5. Set RF On

Set the signal generator's RF output on.

project.Hardware.SignalGenerator.RFOutputEnabled = true;

project.Hardware.UpdateToInstrument();

6. Set RF Off

Turn off the RF output.

project.Hardware.SignalGenerator.RFOutputEnabled = false;

project.Hardware.UpdateToInstrument();

7. End Program

End the program.

project.Close();

Tips

use try..catch( )

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\\SignalStudio\\Broadcast Radio\\test1.scp";

API api = new API();

BroadcastRadioProject project;

try

{

project = (BroadcastRadioProject) api.OpenSettingsFile(FullpathFilename1);   

}

catch (Exception ex)

{

MessageBox.Show(ex.Message);   

}