APIs, concepts, guides, and more

◆ MemorySet()

void MemorySet ( uint64_t address,
int32_t data )
Description:
MemorySet writes a value into controller memory
Parameters
addressAny address (host) in the controller's memory.
dataThe data to write.
Sample Code:
IO: Input & Output
const int INPUT_INDEX = 0;
const int OUTPUT_INDEX = 1; // The PDO Index in that Node
UInt64 userBufferAddress = controller.AddressGet(RSIControllerAddressType.RSIControllerAddressTypeUSER_BUFFER, 0); // Grabing an memory address to store a simulated IO point.
IOPoint input0 = IOPoint.CreateDigitalInput(controller, userBufferAddress, INPUT_INDEX); // Automatically gets the memory index of a specified node and input index
IOPoint output0 = IOPoint.CreateDigitalOutput(controller, userBufferAddress, OUTPUT_INDEX); // Automatically gets the memory index of a specified node and input index
//---ACT/ASSERT---
output0.Set(false);
Assert.That(output0.Get(), Is.False, "The getter function should return a value equal to false");
output0.Set(true);
Assert.That(output0.Get(), Is.True, "The getter function should return a value equal to true");
controller.MemorySet(input0.AddressGet(), 0);
Assert.That(input0.Get(), Is.False, "The getter function should return a value equal to false");
controller.MemorySet(input0.AddressGet(), 1);
Assert.That(input0.Get(), Is.True, "The getter function should return a value equal to true");
See also
MemoryGet
Examples
InputOutput.cs, MotionHold.cs, MotionHoldReleasedBySoftwareAddress.cpp, and UserLimit.cs.