Topic: DMD0113 REF - Read Value Indirectly |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This instruction can only be used in the Expression parameter of the Calculate Expression (MATH) instruction.
The Read Value Indirectly (REF) math function returns the value of the specified bit or numerical element. The element is referenced by the appropriate block number from the following chart, and the offset of the desired element within that block.
The parameter list of this function takes two expression parameters separated by a comma between the bounding parentheses. Any expression parameter can be a constant value, a bit or numeric memory location, an arithmetic expression, and/or mathematical function or other expressions up to a maximum of 1024 characters. Expressions can be nested, so use of parentheses is recommended to ensure proper evaluation order.
The first parameter specifies the source memory block number from the list of memory block numbers shown in the Memory Configuration tab of the System Configuration dialog. This must reference a Bit or Numeric data block, structure data blocks are not valid.
Note: If the first parameter (Block Number) is not
a valid memory block number, $IndexError (ST129) will be ON. The second
parameter designates the offset within the selected memory block.
This can be any constant value from 0 to 65535 or any readable numeric
location.
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Memory Block Numbers:Note: the complete list of memory block numbers can be seen on the Memory Configuration tab of the System Configuration dialog.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See Also:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Related Topics:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rung Example:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|