APIs, concepts, guides, and more

◆ AddressGet() [1/2]

uint64_t AddressGet ( RSIControllerAddressType type)
Description:
AddressGet returns the host address for a particular MotionController value.
Parameters
typeUse RSIControllerAddressType.
Returns
(int32_t) The (host) controller memory addr for specified value.

IO: Input & Output

const int INPUT_INDEX = 0;
const int OUTPUT_INDEX = 1; // the PDO Index in the user buffer
// get user buffer address for simulated IO point storage
UInt64 userBufferAddress = controller.AddressGet(RSIControllerAddressType.RSIControllerAddressTypeUSER_BUFFER, 0);
// create simulated IOPoints based on memory address and index
IOPoint input0 = IOPoint.CreateDigitalInput(controller, userBufferAddress, INPUT_INDEX);
IOPoint output0 = IOPoint.CreateDigitalOutput(controller, userBufferAddress, OUTPUT_INDEX);
// get & set an output
bool outVal = output0.Get();
output0.Set(outVal);
Console.WriteLine($"Output 0 value: {outVal}");
// test input operations by directly writing to memory
controller.MemorySet(input0.AddressGet(), 1);
bool inVal = input0.Get();
Console.WriteLine($"Input 0 memory set to 1, value: {inVal}");
controller.MemorySet(input0.AddressGet(), 0);
inVal = input0.Get();
Console.WriteLine($"Input 0 memory set to 0, value: {inVal}");
See also
MotionController::MemoryGet
Examples
CalculateAccelerationFromVelocity.cpp, DifferenceOfPositionUserLimit.cpp, MotionHold.cs, MotionHoldReleasedBySoftwareAddress.cpp, RecordPerformance.cpp, Recorder.cs, UserLimit.cs, UserLimitCommandPositionDirect.cs, io-iopoint-user-buffer.cs, mathblock-calculate-acceleration-from-velocity.cs, mathblock-difference-of-position-userlimit.cs, and mathblock-pdo-copy.cs.