Console.WriteLine("📜 Sample Apps Setup");
KillExistingController();
var creationParams = GetCreationParameters();
Console.WriteLine($"RMP path: {creationParams.RmpPath}");
Console.WriteLine($"Use hardware: {Constants.USE_HARDWARE}");
Console.WriteLine($"Axis count: {controller.AxisCountGet()}");
{
Axis? currentAxis =
null;
if (i == 0)
{
}
else if (i == 1)
{
}
if (currentAxis != null)
{
Console.WriteLine($" Axis {i}: Motor Type = {currentAxis.MotorTypeGet()}");
Console.WriteLine($" Axis {i}: UserUnits = {currentAxis.UserUnitsGet()}");
}
}
{
#if WINDOWS
createParams.RmpPath =
Constants.
RMP_WINDOWS_PATH;
#elif LINUX
#endif
return createParams;
}
static void SetupController(
MotionController controller,
int userAxisCount,
bool useHardware)
{
if (useHardware)
{
}
{
throw new Exception(
"The Sample Apps are configured to use Phantom Axes, but the network is not in the UNINITIALIZED or SHUTDOWN state.\n" +
"If you intended to run with hardware, then set USE_HARDWARE to true in config.json\n" +
"Otherwise, shutdown the network before running the sample apps with phantom axes.");
}
if (useHardware)
{
if (axisCount < userAxisCount)
{
throw new Exception(
$"Error! Not enough axes configured. Expected {userAxisCount} axes but only found {axisCount} axes.\n" +
"Please configure the axes in your hardware setup.");
}
}
else
{
if (userAxisCount != initialAxisCount)
{
}
for (int i = 0; i < userAxisCount; i++)
{
}
}
}
static void KillExistingController()
{
try
{
}
catch
{
}
finally
{
}
}
Constants used in the C# sample apps.
const bool USE_HARDWARE
Default: false.
const int AXIS_COUNT
Default: 2.
const int AXIS_0_INDEX
Default: 0.
const int AXIS_1_USER_UNITS
Default: 1.
const int RMP_CPU_AFFINITY
Default: 0.
const string RMP_LINUX_PATH
Default: /rsi.
const int AXIS_0_USER_UNITS
Default: 1.
const string RMP_NIC_PRIMARY
Default: "".
const int AXIS_1_INDEX
Default: 1.
const string RMP_NODE_NAME
Default: NodeA.
static void SetupControllerForHardware(MotionController controller)
Sets up the controller for hardware use by resetting it and starting the network.
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
static void ConfigurePhantomAxis(MotionController controller, int axisIndex)
Configures a phantom axis on the controller.
Helpers class provides static methods for common tasks in RMP applications.
void UserUnitsSet(double countsPerUserUnit)
Sets the number of counts per User Unit.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
RSINetworkState NetworkStateGet()
static MotionController * Get()
Get an already running RMP EtherCAT controller.
static MotionController * Create(CreationParameters *creationParameters)
Initialize and start the RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
void Shutdown()
Shutdown the controller.
int32_t AxisCountGet()
Get the number of axes processing.
int32_t MotionCountGet()
Get the number of Motion Supervisors available in the firmware.
void AxisCountSet(int32_t axisCount)
Set the number of allocated and processed axes in the controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
RSINetworkState
State of network.
CreationParameters for MotionController::Create.