The RMP Motion Controller APIs
MotionController

RPCs

// RPC for MotionController: Sends config/actions, receives updated config, action details, status, and read-only info.
rpc MotionController(MotionControllerRequest) returns (MotionControllerResponse) {};

Request

message MotionControllerRequest {
// Common request header.
RSI.RapidServer.RequestHeader header = 1;
optional MotionControllerConfig config = 2;
optional MotionControllerAction action = 3;
}

Response

message MotionControllerResponse {
// Common response header. Always check the response header for errors.
RSI.RapidServer.ResponseHeader header = 1;
optional MotionControllerConfig config = 2;
optional MotionControllerAction action = 3;
optional MotionControllerInfo info = 4;
optional MotionControllerStatus status = 5;
}

Config

message MotionControllerConfig {
// The number of Axis objects.
optional int32 axis_count = 1;
// The number of MultiAxis objects. (internal MotionCount - AxisCount)
optional int32 multi_axis_count = 2;
// The number of UserLimits.
optional int32 user_limit_count = 3;
// The number of data recorders.
optional int32 recorder_count = 4;
// The sizes of each recorder's buffer.
repeated int32 recorder_buffer_sizes = 5;
// The number of position compensators.
optional int32 compensator_count = 6;
// The number of points for each position compensator.
repeated int32 compensator_point_counts = 7;
// The size of each Axis' frame buffer. Must be power of 2.
repeated int32 axis_frame_buffer_sizes = 8;
// A 32-bit integer for users to specify a version.
optional int32 user_version = 10;
// A double to specify the sample rate in Hertz (samples per second)
optional double sample_rate = 11;
}

Action

message AddressInfo {
// The requested address type.
oneof address_type {
RSIControllerAddressType controller = 1;
RSIMultiAxisAddressType multi_axis = 3;
}
// The 64-bit host address from the server. This address can be used to configure the recorder.
uint64 host_address = 4;
// The data type at this address. Useful for using the Recorder service.
RSIDataType data_type = 5;
// The internal 32-bit firmware address. (What you might see in VM3.)
uint32 firmware_address = 6;
// The 0-based object index for use when accessing Controller Addresses
// Not used with Axis or MultiAxis addresses.
optional int32 index = 7;
// IO bit mask
optional int32 mask = 8;
}
message MotionControllerMemory {
message Integer {
uint64 host_address = 1;
int32 value = 2;
}
message Double {
uint64 host_address = 1;
double value = 2;
}
message Block {
uint64 host_address = 1;
bytes values = 2;
int32 size = 3;
}
oneof memory {
Integer integer = 1;
Double double = 2;
Block block = 3;
}
}
message MotionControllerAction {
// Create a MotionController. You must do this before using any other RapidCode remote service!
optional Create create = 1;
repeated MotionControllerMemory memory_sets = 2;
repeated MotionControllerMemory memory_gets = 3;
repeated AddressInfo address_gets = 4;
optional Shutdown shutdown = 5;
optional ProcessorUsageClear processor_usage_clear = 6;
message Create {
// Path to the RMP firmware (RMP.rta), license file, etc.
optional string rmp_path = 1;
optional string node_name = 2; // [Windows/INtime] INtime Node used for RMP and RMPNetwork.
optional string primary_nic = 3;
optional string secondary_nic = 4;
optional int32 cpu_affinity = 5; // [Linux] CPU used for RMP and RMPNetwork
optional int32 rmp_thread_priority_max = 6; // [Linux] Relative thread priority
//string memorydump_filename = 5;
}
// shutdown the RMP
message Shutdown {}
// clear the RMP's processor usage
message ProcessorUsageClear {}
}

Info

message MotionControllerInfo {
// The RMP serial number.
uint32 serial_number = 1;
// The RapidCode version.
string rapid_code_version = 2;
// RMP firmware version.
string firmware_version = 3;
// The number of licensed Axis objects.
int32 axis_license_count = 4;
repeated AddressInfo addresses = 5;
// Constants from the MotionController object
Constants constants = 6;
message Constants {
// Default time to wait when calling NetworkStart()
uint32 network_start_timeout_milliseconds_default = 1;
// Maximum number of Axis objects supported.
uint32 axis_count_maximum = 2;
// Maximum number of motion objects supported (One required for each Axis and MultiAxis).
uint32 motion_count_maximum = 3;
// Maximum number of nodes allowed on the network.
uint32 network_node_count_maximum = 4;
// maximum number of Recorder objects supported
uint32 recorder_count_maximum = 5;
// Maximum number of Position Compensator objects supported.
uint32 compensator_count_maximum = 6;
// Maximum number of 64-bit values that can be stored in the User Buffer.
uint32 user_buffer_data_count_maximum = 7;
// Maximum number of global Sequencer variables that can be stored.
uint32 sequencer_global_count_maximum = 8;
// Default RMP sample rate in hertz.
double sample_rate_default = 9;
CreationParameters creation_parameters = 10;
message CreationParameters {
// MotionControllerAction::Create::rmp_path maximum string buffer length
uint32 path_length_maximum = 1;
// The default value of MotionControllerAction::Create::cpu_affinity
uint32 cpu_affinity_default = 2;
// The default value of MotionControllerAction::Create::rmp_thread_priority_max
uint32 rmp_thread_priority_maximum_default = 3;
// The range required for RMP and RMPNetwork threads. rmp_thread_priority_max must be greater than or equal to this value.
uint32 rmp_thread_priority_range = 4;
}
}
}

RapidCode calls

SerialNumberGet(), RSI::RapidCode::MotionController::VersionGet() RSI::RapidCode::MotionController::FirmwareVersionGet()

Status

message MotionControllerStatus {
// The RMP sample counter.
int32 sample_counter = 1;
// Network node count.
uint32 network_node_count = 2;
// The percentage of the firmware sample time used by the RMP.
double processor_usage = 3;
// The most recent time (in microseconds) between firmware samples
uint32 firmware_timing_delta = 4;
// The number of 32-bit words free in the RMP firmware memory.
int32 external_memory_size = 9;
}