Console.WriteLine("📜 MathBlock: PDO Copy");
const int MB_INDEX = 0;
const int BIAS = 8000;
try
{
{
Console.WriteLine("Network is not started. Please start the network before running this sample app.");
return;
}
{
Console.WriteLine("One or both axes are phantom (not real). Please use real axes for this sample app.");
return;
}
mbConfig.InputAddress0 = torqueActualAddress;
mbConfig.InputAddress1 = userBufferAddr0;
mbConfig.InputDataType0 = INT32;
mbConfig.InputDataType1 = INT32;
mbConfig.Operation = ADD;
mbConfig.ProcessDataType = INT32;
mbConfig.OutputAddress = targetTorqueAddress;
mbConfig.OutputDataType = INT32;
Console.WriteLine($"MathBlock configured to copy axis {Constants.AXIS_0_INDEX} torque actual to axis {Constants.AXIS_1_INDEX} target torque with bias {BIAS}");
Console.WriteLine($"Operation: {mbConfig.Operation}");
Console.WriteLine("✅ MathBlock PDO copy with bias configured successfully");
}
finally
{
}
Constants used in the C# sample apps.
const int AXIS_0_INDEX
Default: 0.
const int AXIS_1_INDEX
Default: 1.
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Helpers class provides static methods for common tasks in RMP applications.
uint32_t NetworkIndexGet(RSINetworkIndexType indexType)
Get the PDO array index for an axis signal mapping.
NetworkNode * NetworkNode
Gets the associated NetworkNode object.
void ErrorLimitActionSet(RSIAction action)
Set the action that will occur when the Error Limit Event triggers.
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()
void MathBlockCountSet(int32_t mathBlockCount)
Set the number of processed MathBlocks in the MotionController.
void MemorySet(uint64_t address, int32_t data)
Write a value to controller memory.
static MotionController * Get()
Get an already running RMP EtherCAT controller.
void NetworkOutputOverrideSet(int32_t index, bool outputOverride)
Set NetworkOutputValue to override RMP cyclic value.
uint64_t AddressGet(RSIControllerAddressType type)
Get the an address for some location on the MotionController.
uint64_t NetworkOutputAddressGet(int32_t index)
Returns an Address of a Network Output.
void SampleWait(uint32_t samples)
Wait for controller firmware to execute samples.
uint64_t NetworkInputAddressGet(int32_t index)
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...
MathBlockConfig MathBlockConfigGet(int32_t mathBlockNumber)
Get a MathBlock configuration.
void MathBlockConfigSet(int32_t mathBlockNumber, MathBlockConfig &config)
Set a MathBlock configuration.
bool Exists()
Returns true if this NetworkNode exists on a physical network.
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
void Abort()
Abort an axis.
RSIMathBlockOperation
MathBlock operations.
RSINetworkState
State of network.
RSIControllerAddressType
Used to get firmware address used in User Limits, Recorders, etc.
RSIDataType
Data types for User Limits and other triggers.
RSIAction
Action to perform on an Axis.
RSINetworkOutputAddressType
Network output address types.
RSINetworkIndexType
Network PDO index types for configuring axis input/output mappings.