APIs, concepts, guides, and more
axis-config-ampfault.cs
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 Axis Config AmpFault");
// get rmp objects
using MotionController controller = MotionController.Get();
try
{
Helpers.CheckErrors(controller);
Axis axis = controller.AxisGet(Constants.AXIS_INDEX);
// set
axis.AmpEnableSet(false); // disable the amp
axis.AmpFaultActionSet(RSIAction.RSIActionABORT); // set the action that will occur when there is an amp fault.
axis.AmpFaultTriggerStateSet(false); // set the state of the amp fault.
axis.AmpFaultDurationSet(1); // set the duration (seconds) required before the Amp Fault event triggers.
// get
bool isEnabled = axis.AmpEnableGet();
RSIAction faultAction = axis.AmpFaultActionGet();
bool faultTriggerState = axis.AmpFaultTriggerStateGet();
double faultDuration = axis.AmpFaultDurationGet();
Console.WriteLine($"Amp Enabled: {isEnabled}");
Console.WriteLine($"Fault Action: {faultAction}");
Console.WriteLine($"Fault Trigger State: {faultTriggerState}");
Console.WriteLine($"Fault Duration: {faultDuration}");
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
Constants used in the C# sample apps.
const int AXIS_INDEX
Default: 0.
Definition _constants.cs:12
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Definition _helpers.cs:15
Helpers class provides static methods for common tasks in RMP applications.
Definition _helpers.cs:5
RSIAction AmpFaultActionGet()
Get the Amp Fault action.
bool AmpEnableGet()
Get the state of the Amp Enable Output.
void AmpFaultActionSet(RSIAction action)
Set the Amp Fault action.
void AmpFaultTriggerStateSet(bool state)
Set the trigger state of the Amp Fault input.
double AmpFaultDurationGet()
Get the duration required before the Amp Fault event triggers.
bool AmpFaultTriggerStateGet()
Get the Amp Fault trigger state.
void AmpFaultDurationSet(double seconds)
Set the duration required before the Amp Fault event triggers.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Definition rsi.h:5870
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
static MotionController * Get()
Get an already running RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
Definition rsi.h:800
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
RSIAction
Action to perform on an Axis.
Definition rsienums.h:1115