This class includes the source code of all our SampleAppsCS helper functions.
Helper functions were created to reduce code. Please note that if you would like to use this classes on your personal project you will have to replicate this class.
- Warning
- This is a sample program to assist in the integration of the RMP motion controller with your application. It may not contain all of the logic and safety features that your application requires. We recommend that you wire an external hardware emergency stop (e-stop) button for safety when using our code sample apps. Doing so will help ensure the safety of you and those around you and will prevent potential injury or damage.
The sample apps assume that the system (network, axes, I/O) are configured prior to running the code featured in the sample app. See the Configuration page for more information.
📜 Check Errors
Check the RSIError log for any logged errors. Read and print all the errors. Ignore warnings.
{
bool hasErrors = false;
System.Text.StringBuilder errorStringBuilder = new System.Text.StringBuilder();
{
{
errorStringBuilder.AppendLine("WARNING: " + error.Message);
}
else
{
hasErrors = true;
errorStringBuilder.AppendLine("ERROR: " + error.Message);
}
}
if (errorStringBuilder.Length > 0)
{
Console.WriteLine(errorStringBuilder.ToString());
}
if (hasErrors)
{
throw new Exception(errorStringBuilder.ToString());
}
}
📜 Start the Network
Start the network and print any errors encountered.
{
{
Console.WriteLine("Starting Network..");
}
{
for (int i = 0; i < messagesToRead; i++)
{
}
Console.WriteLine("Expected OPERATIONAL state but the network did not get there.");
}
else
{
Console.WriteLine("Network Started");
}
}
📜 Create and Ready Axis
public Axis CreateAndReadyAxis(
int AxisNumber)
{
ResetAxis(axis);
return axis;
}
📜 Reset Axis
public void ResetAxis(
Axis myAxis)
{
EnableAmp(myAxis);
}
📜 Enable Axis Amp
public void EnableAmp(
Axis myAxis)
{
}