APIs, concepts, guides, and more

🔹 RPCs

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

🔹 Request

message NetworkRequest {
// Common request header.
RSI.RapidServer.RequestHeader header = 1;
optional NetworkConfig config = 2;
optional NetworkAction action = 3;
}

🔹 Response

message NetworkResponse {
// Common response header. Always check the response header for errors.
RSI.RapidServer.ResponseHeader header = 1;
optional NetworkConfig config = 2;
optional NetworkAction action = 3;
optional NetworkInfo info = 4;
optional NetworkStatus status = 5;
}

🔹 Config

🔹 Action

message NetworkAction {
// Shutdown the network.
optional Shutdown shutdown = 1;
// Start the network.
optional Discover discover = 2;
optional Start start = 3;
optional DiscoverAndStart discover_and_start = 4;
// Evaluate network timing.
optional TimingMetricsEnable timing_metrics_enable = 5;
optional TimingMetricsDisable timing_metrics_disable = 6;
optional TimingMetricsClear timing_metrics_clear = 7;
// Used to override firmware values with your custom outputs.
repeated OutputOverride output_override = 8;
// Generate ENI file
optional EniGenerate eni_generate = 9;
// Creating the object does the job.
message Shutdown { }
message Discover {
// Default: MotionController::NetworkStartTimeoutMillisecondsDefault which is 30000 ms.
optional uint32 timeout_milliseconds = 3;
}
message Start {
// Default: RSINetworkStartModeOPERATIONAL.
optional RSINetworkStartMode mode = 1;
// Default: MotionController::NetworkStartTimeoutMillisecondsDefault which is 30000 ms.
optional uint32 timeout_milliseconds = 2;
}
message DiscoverAndStart {
// Default: RSINetworkStartModeOPERATIONAL.
optional RSINetworkStartMode mode = 1;
// Default: MotionController::NetworkStartTimeoutMillisecondsDefault which is 30000 ms.
optional uint32 timeout_milliseconds = 2;
}
message TimingMetricsEnable {
// Determines when low_count increases.
optional uint32 low_threshold = 1;
// Determines when high_count increases.
optional uint32 high_threshold = 2;
}
message TimingMetricsDisable {}
message TimingMetricsClear {}
message OutputOverride {
// Index of the output.
int32 index = 1;
// Turn on or off overriding of the firmware value with the override_value.
optional bool override = 2;
// Your custom value rather than our intended firmware value.
optional int64 override_value = 3;
}
message EniGenerate {
// result of the attempt to generate the ENI file.
optional RSINetworkEniResult result = 1;
// resulting output from rsiconfig (which is used to generate the ENI file)
optional string output = 2;
}
}

🔹 Info

message NetworkInfo {
RSINetworkType type = 1;
int32 pdo_input_count = 4;
int32 pdo_output_count = 5;
// Collection of all Network PDO Inputs.
repeated PdoInputInfo pdo_inputs = 6;
// Collection of all Network PDO Outputs.
repeated PdoOutputInfo pdo_outputs = 7;
message PdoInputInfo {
string name = 1;
AddressInfo address_info = 2;
int32 bit_size = 3;
int32 bit_offset = 4;
}
message PdoOutputInfo {
string name = 1;
AddressInfo sent_value_address = 2;
AddressInfo override_value_address = 3;
AddressInfo firmware_value_address = 4;
int32 bit_size = 5;
int32 bit_offset = 6;
}
}

🔹 Status

message NetworkStatus {
RSINetworkState state = 1;
int32 node_count = 2;
int32 counter = 3;
bool synchronized = 4;
RSINetworkStartError last_start_error = 5;
// output logged from RMPNetwork when it closes.
string log_message = 6;
// NetworkTiming in RapidCode. Used to evaluate stability.
TimingMetricsStatus timing_metrics = 7;
// Collection of all Network PDO Inputs.
repeated PdoInputStatus pdo_inputs = 8;
// Collection of all Network PDO Outputs.
repeated PdoOutputStatus pdo_outputs = 9;
message TimingMetricsStatus {
// Most recent value.
uint32 delta = 1;
// Lowest recorded since last clear.
uint32 min_recorded = 2;
// Highest recorded since last clear.
uint32 max_recorded = 3;
// Count below low_threshold since last clear.
uint32 low_count = 4;
// Count above high_threshold since last clear.
uint32 high_count = 5;
}
message PdoInputStatus {
// The index of this PDO in RMP firmware.
int32 index = 1;
// The raw 64-bit value of this PDO.
int64 value = 2;
}
message PdoOutputStatus {
// The index of this PDO in RMP firmware.
int32 index = 1;
// The raw 64-bit value that was sent on the network.
int64 sent_value = 2;
// The raw 64-bit override value that can be written by software.
int64 override_value = 3;
// The raw 64-bit value that the RMP is going to send, unless overridden.
int64 firmware_value = 4;
// Whether or not the override_value is being used.
bool override_enabled = 5;
}
}