The RMP Motion Controller APIs

◆ CreateDigitalInput() [5/5]

static IOPoint* CreateDigitalInput ( MotionController controller,
uint64_t  memoryAddress,
int32_t  bitNumber 
)
static
Description:
Parameters
controllerYour motion controller object
memoryAddressthe memory address you want to target
bitNumberThe bit number relative to the memory address
Returns
(IOPoint*) A pointer to the newly created IOPoint.
Sample Code:
IOPoints
const int NODE_INDEX = 0; // The EtherCAT Node we will be communicating with
//const int INPUT_INDEX = 0; // The PDO Index in that Node
const int OUTPUT_INDEX = 0; // The PDO Index in that Node
// IOPoint input0 = IOPoint.CreateDigitalInput(controller.IOGet(NODE_INDEX), INPUT_INDEX); // Automatically gets the memory index of a specified node and input index
IOPoint output0 = IOPoint.CreateDigitalOutput(controller.IOGet(NODE_INDEX), OUTPUT_INDEX); // Automatically gets the memory index of a specified node and input index
output0.Set(false);
controller.SampleWait(1);
Assert.False(output0.Get(), "The getter function should return a value equal to false");
RSI::RapidCode::MotionController::SampleWait
void SampleWait(uint32_t samples)
Wait for controller firmware to execute samples.
RSI::RapidCode::MotionController::IOGet
IO * IOGet(int32_t nodeNumber)
IOGet returns a pointer to an IO object using its node number and initializes its internals.