Rohde & Schwarz RTP-K99, RTO-K99 User Manual

R&S®RTO-K99, R&S®RTP-K99 R&S®ScopeSuite Automation
Manual
(;ÜçÉ2)
1178895902
Manual
Version 03
This document describes the following R&S options:
R&S®RTO K99 (1326.4419.02)
R&S®RTP K99 (1326.4425.02)
© 2019 Rohde & Schwarz GmbH & Co. KG
Mühldorfstr. 15, 81671 München, Germany
Phone: +49 89 41 29 - 0
Fax: +49 89 41 29 12 164
Email: info@rohde-schwarz.com
Internet: www.rohde-schwarz.com
Subject to change – Data without tolerance limits is not binding.
R&S® is a registered trademark of Rohde & Schwarz GmbH & Co. KG.
Trade names are trademarks of the owners.
1178.8959.02 | Version 03 | R&S®RTO-K99, R&S®RTP-K99
Throughout this manual, products from Rohde & Schwarz are indicated without the ® symbol , e.g. R&S®ScopeSuite is indicated as
R&S ScopeSuite.
R&S®RTO-K99, R&S®RTP-K99

Contents

1 Programming Interface Overview.........................................................5
2 System Requirements for Remote Access and Automation............. 6
3 Requirements for Client Development.................................................8
4 Client Programming with Duplex Communication............................. 9
5 Remote Control Client......................................................................... 10
6 Client Program API Workflow and R&S ScopeSuite States............. 11
7 Programming Interface and Sample Code.........................................13
Contents
3Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
Contents
4Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99

1 Programming Interface Overview

R&S ScopeSuite provides .NET remote programming interface by using Windows Communication Foundation (WCF) technology. It allows the client program to control the R&S ScopeSuite and perform compliance tests while R&S ScopeSuite is running on a local or a remote machine (oscilloscope or a PC).
ScopeSuiteService is hosted by the R&S ScopeSuite. By following WCF unified programming model and duplex communication design patterns, the client creates a proxy of the service and connects to the service via WCF framework. It is then able to control the R&S ScopeSuite by consuming the service.
Programming Interface Overview
ScopeSuiteService works with .NET 4.5 in Windows 7/10 platform.
5Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
2 System Requirements for Remote Access
and Automation
To control the R&S ScopeSuite running on a remote machine (oscilloscope or PC) via a remote programming interface, the following system configurations and requirements should be met:
Software option R&S RTO/RTP-K99 for remote programming interface.
R&S ScopeSuite with firmware version 3.8.0 and above must be installed on the machine.
The oscilloscope must be fully licensed for the targeted compliance test options.
The client computer must be able to access the machine (oscilloscope or a PC) via the network.
The Windows firewall on the machine may need be configured to allow the commu­nication. For example: "Start-> Control Panel -> Windows Firewall -> Allow" programs to communicate through "Windows Firewall -> Windows Communication Foundation"
The IP address of the machine should be known. It is part of the address for the NetTcpBinding configured in the client program.
8734 is the default port number used by ScopeSuiteService on the machine. It is part of the address for NetTcpBInding configured in the client program as well. Alternatively, if you need to use a different port number, simply drop it in “C:\portForService.txt” on the machine on which the R&S ScopeSuite is running.

System Requirements for Remote Access and Automation

Starting the automation option
1. Launch the R&S ScopeSuite. The ScopeSuiteService turns on automatically
and ready for connection.
6Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
System Requirements for Remote Access and Automation
2. If needed, click "Oscilloscope" and configure the settings.
3. If needed, click "Instruments" and configure the settings.
4. If you want to automate any VNA test cases, pre-calibration procedure is required.
More specific, in R&S ScopeSuite, execute the VNA test cases with "Expert Mode" > "Disabled" so that the VNA calibration is performed and the settings are saved. If "Expert Mode" > "Enabled", VNA test automation uses the saved pre-calibration data.
5. Run your client program.
6. For test cases that require test fixture calibration and/or disturbing signal generator calibration, e.g. "Ethernet 1000Base-T Peak Output Voltage with Disturber (40.6.1.2.1)", there are default values in the session. If you want to calibrate the test fixture and/or disturbing signal generator, you can execute one of the test cases in the session with "Expert Mode" > "Disabled". Then the calibrated value is saved in the session. If "Expert Mode" > "Enabled", the value (either default or calibrated) in the session is applied during test execution.
7Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99

3 Requirements for Client Development

For developing the client program, ScopeSuiteService.dll need to be referenced. The client can be an application written in .NET C# or other .NET languages.
A simple client executable and sample code in C# are provided.
Requirements for Client Development
8Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
4 Client Programming with Duplex Communi-
cation
The client in general does the following to consume ScopeSuiteService and per­form server-side operations remotely.
Adds RSScopeSuiteService.dll as reference
Implements ICallback to establish the connection with service and handle call­back messages.
Call APIs defined in IService to control the R&S ScopeSuite remotely. For most of the API operations, the service will callback to notify the client when the targeted operation is complete or any state information needs an update.
Refer to sample code and RSServiceInterface.chm for details.

Client Programming with Duplex Communication

9Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99

5 Remote Control Client

The RemoteControlClient can be used to test the ScopeSuiteService and the cli­ent-service connection. It is also an example of a C# based remote client with a source code provided.
Remote Control Client
10Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
6 Client Program API Workflow and
R&S ScopeSuite States
The client program connects to the service and controls the R&S ScopeSuite to per­form tests based on session management.
There are three ScopeSuiteState:
HomePage:
SessionSelectionPage:
SessionManagementPage:

Client Program API Workflow and R&S ScopeSuite States

Figure 6-1: R&S ScopeSuite States
An example of the client program with API workflow can look as follows:
11Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
Client Program API Workflow and R&S ScopeSuite States
Figure 6-2: Example of an API workflow
12Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99

7 Programming Interface and Sample Code

RSScopeSuiteService has three components exposed to the client as programming interfaces: TestData, IService and ICallback

7.1 RSScopeSuiteService.TestData

7.1.1 Compliance Test Options and Test Cases

The client calls IService.GetComplianceTests to get the full lists of compliance test options and test cases supported by remote control in test automation.
Programming Interface and Sample Code
RSScopeSuiteService.TestData

7.1.2 Test Result

The client calls IService.GetSingleTestRunResult to get the test result from the latest single execution of a test case.
13Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
TestRunResult.Result gives the overall pass/fail result from the latest single test case execution.
The client gets the list of Measurement from the latest single test case execution via TestRunResult.Measurements. Instead, the client parses the test result from XmlData and Images, which are consistent with the test result information in the ses­sion folder.
Programming Interface and Sample Code
RSScopeSuiteService.IService

7.2 RSScopeSuiteService.IService

IService exposes the following APIs to the client:
CreateAndOpenSession
Creates and opens a new session from SessionSelectionPage of the R&S ScopeSuite. The complianceType must match the string of
TestData.ComplianceTest.ComplianceTestType.
ExitSession
Exits from the current session. The R&S ScopeSuite returns to the
SessionSelectionPage.
GenerateReport
14Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
Generates a report from the SessionManagementPage page of the R&S Scope­Suite. While the report is generating, service callbacks with messages that start with
"ReportStatus : ".
GetComplianceTest
Gets a list of compliance test options and test cases supported by remote control in test automation.
GetReport
Gets a report from the current session, if the report has been generated success­fully.
GetScopeSuiteState
Gets the state of the R&S ScopeSuite as a ScopeSuiteState.
GetSingleTestRunResult
Get TestResult from a single run of a single test case execution.
GoToHomePage
Goes back to the HomePage from the SessionSelectionPage.
RunSingleTestcase
Selects and run a single test case from SessionManagementPage of the R&S ScopeSuite. Testcase must match TestData.TestCase.ID. When the test case is running, service callbacks with messages that start with
"TestStaus : ".
SelectComplianceTestType
Selects a compliance test type from the HomePage of the R&S ScopeSuite.
SetTestProperty
Sets the test property of the specific test case in the SessionManagementPage. Below is an example in the property file of a test case and it can be found in ses­sion folder. The property name and value to be passed in to the API must match those in the property file. The limits are available as well.
<TestPropertiesConfig> <HdMode showinreport="true" display="HD Mode" unit="">true </HdMode> <ExpertMode showinreport="true" display="Expert Mode" unit="" type="B">false </ExpertMode> </TestPropertiesConfig>
ShowMessageBox
Enables or disables the message box to pop up. It is disabled when the client is connected to the service and enabled when it is disconnected, automatically by the R&S ScopeSuite.
Subscribe
Establishes the connection to the service after a channel is created.
Unsubscribe
Closes the connection to the service.
Programming Interface and Sample Code
RSScopeSuiteService.IService
15Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99

7.3 RSScopeSuiteService.ICallback

7.3.1 Client Implements ICallback

ICallback is the callback contract to IService. The client must implement ICallback and initialize an instance of System.ServiceModel.DuplexChannelFactory
with the remote address and configurations. The channel proxy of IService is then created. Below is an example of implementation:
[CallbackBehavior()]
public class ScopeSuiteCallback : ICallback
{
public IService Proxy = null;
public bool Connect()
{
var binding = new NetTcpBinding("UserServiceBinding");
var factoryBack = new DuplexChannelFactory <IService>
(this, binding, $"net.tcp://{host}:{port}/User");
Proxy = factoryBack.CreateChannel();
return (Proxy.Subscribe());
}
Programming Interface and Sample Code
RSScopeSuiteService.ICallback
public void CallClient(string message)
{
// Handle callback message
}
}
Below is an example of the client configuration. Instead, it can be configured in the pro­gram.
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="UserServiceBinding" closeTimeout="10:00:00" openTimeout="10:00:00"
receiveTimeout="10:00:00" sendTimeout="10:00:00"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint binding="netTcpBinding" bindingConfiguration="UserServiceBinding"
contract="RSScopeSuiteService.IService">
</endpoint>
</client>
</system.serviceModel>
16Manual 1178.8959.02 ─ 03
R&S®RTO-K99, R&S®RTP-K99
The proxy is used by the client to connect to the service and control the R&S Scope­Suite via IService APIs. Below is the sample code continued.
Public ScopeSuiteCallback callbackProxy = new ScopeSuiteCallback ();
bool ret = callbackProxy.Connect(); // connects to service
callbackProxy.Proxy.CreateAndOpenSession();
// calls ScopeSuite to create a session and open it

7.3.2 ICallback.CallClient

ICallback.CallClient is the callback operation for the service to send messages to the client. The client handles the messages received in this operation.
Programming Interface and Sample Code
RSScopeSuiteService.ICallback
During a test case execution, the messages could be TestStatus like:
TestReset
TestLoading
TestLoaded
TestInProgress
TestLaunchError
TestFinished
TestMessageReceived
TestWarningReceived
TestErrorReceived
TestMeasurementsFailed
TestAborted
etc.
During a change of a R&S ScopeSuite state, the message could also be ScopeSuiteState.
During report generation, the messages could be ReportStatus like:
InProgress
Successful
Failed
etc.
17Manual 1178.8959.02 ─ 03
Loading...