Using Reference Examples with Your System
- Updated2024-07-03
- 2 minute(s) read
Using Reference Examples with Your System
Use the RF Recording Software reference examples for your application.
-
Create your project and import your implementation of the RPS client. You can create
your project however you want.
Note You will need an implementation for a RF Recording Software client to interact with the application. Refer to RPS Client File (rps_client.cpp) for an example C++ client file and RPS Client Header File (rps_client.h) for an example client header.
#include "rps_client.h"
-
Instantiate a new instance for the RPS client by creating a gRPC channel that targets
the server hosting the application. When you run RPS.exe, it will output
the IP address and port that the application is running on., as shown in the following
example:
std::string target = "localhost:32003"; auto clientChannel = grpc::CreateChannel(target, grpc::InsecureChannelCredentials()); RpsClient client(clientChannel);
-
Call Initialize—using a unique name for the session—to initialize the
client:
client.Initialize("client_session");
Note The RPS service stores session names, allowing the application to oversee open sessions. -
Call AcquisitionCreateTask—including parameters for the task name and
instrument names—to create an acquisition task:
client.AcquisitionCreateTask("acq_task", "5841_00,5841_01");
Note The RPS application uses tasks to organize recording parameters. -
Configure task parameters—such as fetch size and synchronization settings—to capture
the correct data you want to record. The following example sets the frequency for the
task:
client.AcquisitionSetFrequency("acq_task", 5000000000);
Note Refer to RPS Protocol File (rps.proto) for examples of supported task parameters. -
Call Commit to begin RF Recording Software
transmission of the configured task to the other services:
client.Commit();
Note RF Recording Software does not interact with any other services until you call Commit. When you call Commit, all required services—ICsc, STsc, and RPDSsc—must be running for the configuration to be applied. -
Call Start to begin initiation through the required services of
committed tasks. The tasks begin acquiring the requested data.
client.Start();
-
Call StreamGetStatus and check the done flag to
verify the task status. Read any_overflow and
samples_streamed to check for overflow and that samples are being
streamed.
client.StreamGetStatus(stream_configuration_name, stream_status, task_names, device_names, samples_to_stream, samples_streamed, overflow, any_overflow, done);
Note NI recommends that you check the status of your tasks after calling Start on your RF Recording Software client to know when the task completes. -
Call Close to close the current session and reset the services.
client.Close();
Related Information
- RPS Client File (rps_client.cpp)
You can use this example C++ client file as the basis for an RPS client class.
- RPS Client Header File (rps_client.h)
You can use this example C++ client file as the basis for your RPS client header file.
- RPS Protocol Buffer File (rps.proto)
Plain text of the RPS protocol buffer file (protofile).