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)
SampleAppsCPP::HelperFunctions::CheckErrors(controller);
// initialize Axis (0)
axis = controller->AxisGet(0);
SampleAppsCPP::HelperFunctions::CheckErrors(axis);
try
{
// get a controller host address for axis memory
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.
}