start_rt_control

This function starts the Real-time Control (RT) data stream over UDP. After configuration of input/output schema and connection establishment, this function begins sending and receiving real-time data frames between the PC and the controller.

Definition
DRFLEx.h within class CDRFLEx, public section

bool start_rt_control() {
    return _start_rt_control(_rbtCtrlUDP);
};

Parameter
None

Return

Value

Description

1

The start request was sent.

0

The start request could not be sent.

Note

This function does not wait for the controller to acknowledge the request. Conditions such as not being connected or not having set a version are not detected here, and the controller does not report a refused start. To confirm the start, check that time_stamp in read_data_rt becomes non-zero and advances.

Note

  • Starts both input and output streaming as configured by set_rt_control_input and set_rt_control_output.

  • Must be called after successful connect_rt_control.

  • Real-time streaming uses UDP and runs independently of TCP-based DRFL APIs.

  • When the controller ends the RT session, it reports an alarm to the set_on_rt_log_alarm callback, and RT data stops.

  • RT has no disconnect notification. To detect a lost RT link, check that time_stamp in read_data_rt or the RT callback keeps advancing.

Example

drfl.connect_rt_control("192.168.137.100", 12347);

std::string version = "v1.0";
float period = 0.001f;   // 1 msec = 1 kHz
int lossCount = 4;

// Configure RT output and start streaming
drfl.set_rt_control_output(version, period, lossCount);

if (drfl.start_rt_control())
    printf("RT streaming started.\n");
else
    printf("Failed to start RT streaming.\n");

In this example, the function activates real-time data exchange between the PC and the controller, allowing the application to read and write RT data frames at a 1 kHz update rate.

Tips

  • Always configure RT input/output versions before starting the stream.

  • Stop streaming using stop_rt_control before disconnecting.

  • High-frequency update (e.g., 0.001 s) may require elevated thread scheduling priority.