GET_4X: Read %MW Words (4x-Register)
Original instructions
Function description
This function copies values from the %MW register area (4x register area for Quantum CPUs) to the variable connected to the output pin VAL.
OFF is the word offset in the %MW register area.
The function copies as many bytes as the size of the output data type connected to the output pin VAL.
The value in OFF may be modified at runtime. If OFF is outside the configured %MW register area, an error message is generated and ENO is set to 0.
The function copies in any case only until the end of the configured %MW area, even if the connected data type could take more data. The remaining part of the connected data type remains untouched by the block in such cases.
EN and ENO can be configured as additional parameters.
Example
This function reads the 16-bit value of register %MW120 (register 400120), if OFF = 120 and the output is of data type INT.
This function reads only 1 word, if OFF addresses the last configured %MW, even if the connected data type is of a larger size than a word.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Offset
GET_4X
ST Output
Representation in ST
Representation:
Output := GET_4X (Offset);
Parameter description
Description of input parameters:
Parameter
Data type
Description
Offset
Offset in the %MW register memory (4x).
Description of output parameters:
Parameter
Data type
Description
Output
Output
Runtime error
For a list of all block error codes and values, see Extension/Compatibility.