Topic: DMD0010 REFWRITE - Write Value Indirectly |
|
The Write Value Indirectly (REFWRITE) instruction writes the specified value to the bit or numeric memory block at a specified offset in the Do-more CPU (structure elements are not supported). The numerical element is referenced by the appropriate block number (reference type) from the following list, and the offset of the desired element within that block. This method of indirectly addressing memory locations is often called the "pointer" method.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Value is the value to be written. This can be any constant value, any readable bit location, or any readable numeric location.
Reference Type (Memory Block Number) is the destination memory block number from the following table. Typically this will be a register location that will contain the desired memory block number. If the Reference Type is not a valid memory block number, $IndexError (ST129) will be ON.
Reference ID (Offset into Memory Block) is the offset within the selected memory block where the Value
will be written. Typically this will be a register location that will contain the offset value. This can be any constant value from 0 to 65535 or any readable
numeric location. If the Reference ID value exceeds the size of the block $IndexError (ST129) will be ON.
The following image shows the default layout of the predefined Bit and Numeric memory block numbers. Any user created blocks will be assigned a unique block number when they are created. These block numbers can be seen in the Memory Configuration page of the System Configuration dialog.
|
|
See Also:
REFWRITE - Write Value Indirectly
|
|
Related Topics:
STRCOPYR - Copy a Range of Strings
|
|
Rung Example:
|
|