APIs, concepts, guides, and more

PREMIUM FEATURE BETA

🔹 RPCs

rpc RTTaskManager (RTTaskManagerRequest) returns (RTTaskManagerResponse) {};
rpc RTTaskManagerBatch(RTTaskManagerBatchRequest) returns (RTTaskManagerBatchResponse) {};

🔹 Request

message RTTaskManagerRequest {
// Common request header.
RSI.RapidServer.RequestHeader header = 1;
// RTTaskManager id.
optional int32 id = 2; // Required for all actions except Create and Discover.
optional RTTaskManagerConfig config = 3;
optional RTTaskManagerAction action = 4;
}

🔹 Response

message RTTaskManagerResponse {
// Common response header. Always check the response header for errors.
RSI.RapidServer.ResponseHeader header = 1;
// RTTaskManager id.
optional int32 id = 2; // When creating a RTTaskManager, this will be the new RTTaskManager's id.
optional RTTaskManagerConfig config = 3;
optional RTTaskManagerAction action = 4;
optional RTTaskManagerInfo info = 5;
optional RTTaskManagerStatus status = 6;
}

🔹 Batch Request and Response

message RTTaskManagerBatchRequest {
// Common request header.
RSI.RapidServer.RequestHeader header = 1;
repeated RTTaskManagerRequest requests = 2;
}
message RTTaskManagerBatchResponse {
// Common response header. Always check the response header for errors.
RSI.RapidServer.ResponseHeader header = 1;
repeated RTTaskManagerResponse responses = 2;
}

🔹 Config

message RTTaskManagerConfig {}

🔹 Action

message RTTaskManagerAction {
// Start a new task manager.
optional Create create = 1;
// Discover the task managers that are currently running.
optional Discover discover = 2;
// Submit and start a new task.
optional TaskSubmit task_submit = 3;
// Set the values of global variables
repeated GlobalValueSet global_value_sets = 4;
// Shutdown the task manager.
optional Shutdown shutdown = 5;
message Create {
// The task manager's creation parameters.
RTTaskManagerCreationParameters creation_parameters = 1;
// The id of the created task manager.
int32 id = 2; // read-only
}
message Discover {
// The ids of all the task managers that were discoverd
repeated int32 manager_ids = 1; // read-only
}
message TaskSubmit {
// The parameters for the task to create.
RTTaskCreationParameters task_creation_parameters = 1;
// The id of the created task
optional int32 task_id = 2; // read-only
}
message GlobalValueSet {
// The value to set the global variable to. See FirmwareValue for details.
FirmwareValue value = 1;
// The name of the global variable to set.
string name = 2;
// The name and directory of the library that contains the global variable.
// (The task functions library)
optional string library_name = 3;
optional string library_directory = 4;
}
message Shutdown {}
}

🔹 Info

message RTTaskManagerInfo {
// The unique id of the task manager.
int32 id = 1;
// The creation parameters that were used to create the task manager.
RTTaskManagerCreationParameters creation_parameters = 2;
// Constants related to the RTTaskManager class.
Constants constants = 4;
message Constants {
// The maximum number of RTTaskManagers that can be created.
int32 rt_task_manager_count_maximum = 1;
// The maximum number of RTTasks that can be created in a single RTTaskManager.
int32 rt_task_count_maximum = 2;
// The name of the RTTaskManager executable.
string rt_task_manager_executable_name = 3;
// Constants related to the RTTaskManager's creation parameters.
CreationParameterConstants creation_parameters = 4;
message CreationParameterConstants {
// The maximum length of the RTTaskManager's directory name.
int32 directory_length_maximum = 1;
// The maximum length of the RTTaskManager's library name and user label.
int32 name_length_maximum = 2;
}
}
}

🔹 Status

message RTTaskManagerStatus {
// The state of the RTTaskManager (dead, running, etc.)
optional RTTaskManagerState state = 1;
// The total number of tasks that have been submitted to the task manager (even if they are no longer running).
optional uint64 task_submission_count = 2;
// The number of cycles (iterations) the task manager has run.
optional int64 cycle_count = 3;
// The time it took for the longest cycle to complete (in nanoseconds).
optional uint64 cycle_time_max = 4;
// The time it took for the shortest cycle to complete (in nanoseconds).
optional uint64 cycle_time_min = 5;
// The mean of the cycle times (in nanoseconds).
optional double cycle_time_mean = 6;
// The time it took for the last cycle to complete (in nanoseconds).
optional uint64 cycle_time_last = 7;
// The ids of the tasks that are currently registered with the task manager.
// (Includes tasks that are not running.)
repeated int32 task_ids = 8;
// The names and values of the global variables that the task manager has access to.
map<string, FirmwareValue> global_values = 9;
}

🔹 Additional Messages

message RTTaskManagerCreationParameters {
// Where the rttaskmanager executable is located (usually the RSI installation directory).
optional string rt_task_directory = 1;
// The platform to run the task manager on. Not needed on Linux. On Windows/INtime,
// use INTIME for real time performance. Only use WINDOWS for debugging.
optional PlatformType platform = 2;
// For INtime managers, the name of the INtime node to run on (usually NodeA).
optional string node_name = 3;
// On Linux, the CPU core to pin the task manager to.
optional int32 cpu_core = 4;
// The task manager's user defined label.
optional string user_label = 5;
// Disable the initialization of the RMP and RapidCode objects on task manager startup and their use in synchronizing task manager cycles.
optional bool no_rmp = 6;
}
PlatformTypeUNKNOWN = 0;
PlatformTypeNATIVE = 1;
PlatformTypeINTIME = 2;
PlatformTypeLINUX = 3;
PlatformTypeWINDOWS = 4;
}
RTTaskManagerStateUNKNOWN = 0;
RTTaskManagerStateDEAD = 1;
RTTaskManagerStateRUNNING = 2;
RTTaskManagerStateSTOPPED = 3;
}
message RTTaskCreationParameters {
// The name of the function to run in the task
string function_name = 1;
// The task functions library directory and name.
optional string library_name = 2;
optional string library_directory = 3;
// The task's user defined label.
optional string user_label = 4;
// The task's priority. 0 is the highest priority, 255 is the lowest.
optional TaskPriority priority = 5;
// Number of times to repeat the task. -1 means infinite.
optional int32 repeats = 6;
// How frequently to run the task in samples
optional int32 period = 7;
// Offset in samples for when to run the task. For example, if the task is set
// to run every 10 samples, and the phase is set to 3, the task will run at
// 3, 13, 23, etc.
optional int32 phase = 8;
// Whether to record execution time metrics for the task.
optional bool enable_timing = 9;
}
message FirmwareValue {
oneof value {
bool bool_value = 1;
int32 int8_value = 2;
uint32 uint8_value = 3;
int32 int16_value = 4;
uint32 uint16_value = 5;
int32 int32_value = 6;
uint32 uint32_value = 7;
float float_value = 8;
double double_value = 9;
int64 int64_value = 10;
uint64 uint64_value = 11;
}
}