The RMP Motion Controller APIs
Memory.cpp
#include "rsi.h" // Import our RapidCode Library.
#include "HelperFunctions.h" // Import our SampleApp helper functions.
using namespace RSI::RapidCode;
void memoryMain()
{
Axis *axis ;
uint64_t addr;
// Initialize MotionController class. (PCI board)
// initialize Axis (0)
axis = controller->AxisGet(0);
try
{
// get a controller host address for axis memory
addr = axis->AddressGet(RSIAxisAddressType::RSIAxisAddressTypeACTUAL_POSITION);
printf("Axis Host address is 0x%llx Firmware Address is 0x%x\n", addr, controller->FirmwareAddressGet(addr));
printf("Value is %lf\n", controller->MemoryDoubleGet(addr)); // ACTUAL_POSITION is a 64-bit double
}
catch (RsiError const& err)
{
printf("\n%s\n", err.text);
}
controller->Delete(); // Delete the controller as the program exits to ensure memory is deallocated in the correct order.
system("pause"); // Allow time to read Console.
}
RSI::RapidCode::RsiError
The RsiError object contains information about any RapidCode API object's error/exception.
Definition: rsi.h:90
RSI::RapidCode::MotionController::Delete
void Delete(void)
Delete the MotionController and all its objects.
RSI::RapidCode::MotionController::CreateFromSoftware
static MotionController * CreateFromSoftware()
Initialize and start the RMP EtherCAT controller.
RSI::RapidCode
RSI::RapidCode::MotionController::AxisGet
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
RSI::RapidCode::MotionController::MemoryDoubleGet
double MemoryDoubleGet(uint64_t address)
Read a 64-bit double value from controller memory.
RSI::RapidCode::MotionController
The MotionController object represents the RMP INtime soft motion controller.
Definition: rsi.h:743
RSI::RapidCode::Axis
The Axis object manages a single physical axis on a motion controller.
Definition: rsi.h:5852
RSI::RapidCode::Axis::AddressGet
uint64_t AddressGet(RSIAxisAddressType addressType)
Get the an address for some location on the Axis.
HelperFunctions.CheckErrors
static void CheckErrors(RapidCodeObject rsiObject)
Check if the RapidCode Object has any errors.
Definition: HelperFunctions.cs:64
RSI::RapidCode::MotionController::FirmwareAddressGet
uint32_t FirmwareAddressGet(uint64_t hostAddress)
Convert a host controller address to a firmware address.