Using Reference Examples with Your System

Use the RF Recording Software reference examples for your application.

Complete the following general steps.
  1. 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"
  2. 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); 
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. Call Start to begin initiation through the required services of committed tasks. The tasks begin acquiring the requested data.
    client.Start();
  8. 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.
  9. Call Close to close the current session and reset the services.
    client.Close();