MotionController Axis MultiAxis IO IOPoint NetworkNode RsiError
Sample Apps Changelog

RapidCode API

ErrorLog.cs
using RSI.RapidCode.dotNET; // Import our RapidCode Library.
using System;
namespace SampleAppsCS
{
class ErrorLog
{
static void Main(string[] args)
{
try
{
// Constants
const int AXIS_NUMBER = 2; // Specify which axis/motor to control.
// Initialize RapidCode Objects
MotionController controller = MotionController.CreateFromSoftware(/*@"C:\RSI\X.X.X\"*/); // Insert the path location of the RMP.rta (usually the RapidSetup folder)
SampleAppsCS.HelperFunctions.CheckErrors(controller); // [Helper Function] Check that the controller has been initialize correctly.
Axis axis = controller.AxisGet(AXIS_NUMBER);
PrintErrors(controller);
SampleAppsCS.HelperFunctions.StartTheNetwork(controller); // [Helper Function] Initialize the network. (Function logic at the bottom of source code)Axis axis = controller.AxisGet(AXIS_NUMBER); // Initialize Axis Class. (Use RapidSetup Tool to see what is your axis number)
SampleAppsCS.HelperFunctions.CheckErrors(axis); // [Helper Function] Check that the axis has been initialize correctly.
}
catch (Exception e)
{
Console.WriteLine(e.Message); // If there are any exceptions/issues this will be printed out.
}
Console.WriteLine("\n\nPress Any Key To Exit"); // Allow time to read Console.
Console.ReadKey();
}
private static void PrintErrors(MotionController rsiClass)
{
RsiError err;
while (rsiClass.ErrorLogCountGet() > 0)
{
err = rsiClass.ErrorLogGet();
Console.WriteLine("%s\n", err.text);
}
}
}
}