2System Requirements for Remote Access and Automation............. 6
3Requirements for Client Development.................................................8
4Client Programming with Duplex Communication............................. 9
5Remote Control Client......................................................................... 10
6Client Program API Workflow and R&S ScopeSuite States............. 11
7Programming 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
1Programming 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
2System 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&SRTO/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 communication. 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
3Requirements 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
4Client Programming with Duplex Communi-
cation
The client in general does the following to consume ScopeSuiteService and perform server-side operations remotely.
●
Adds RSScopeSuiteService.dll as reference
●
Implements ICallback to establish the connection with service and handle callback 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
5Remote Control Client
The RemoteControlClient can be used to test the ScopeSuiteService and the client-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
6Client Program API Workflow and
R&S ScopeSuite States
The client program connects to the service and controls the R&S ScopeSuite to perform 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
7Programming Interface and Sample Code
RSScopeSuiteService has three components exposed to the client as programming
interfaces: TestData, IService and ICallback
7.1RSScopeSuiteService.TestData
7.1.1Compliance 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.2Test 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 session folder.
Programming Interface and Sample Code
RSScopeSuiteService.IService
7.2RSScopeSuiteService.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&SScopeSuite 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 ScopeSuite.
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 successfully.
GetScopeSuiteState
●
Gets the state of the R&SScopeSuite 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&SScopeSuite.
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 session 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.
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.3RSScopeSuiteService.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 program.
The proxy is used by the client to connect to the service and control the R&S ScopeSuite 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.2ICallback.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...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.