|
Controller.MemoryGet
Description
Returns the controller memory location specified by the address string argument.
Overload 1 assumes the default data type for the controller memory location.
Overload 2 has a third argument which specifies the data type for the data to be read.
Version History
Introduced in MPX 2.0.
Result
Double
Arguments
Overload 1
| |
| Argument |
Type |
Description |
| Address |
String |
The controller memory location to return. This string can be obtained from the VM3 application. |
|
Overload 2
| |
| Argument |
Type |
Description |
| Address |
String |
The controller memory location to return. This string can be obtained from the VM3 application. |
| dataType |
Mpx.DataType |
The data type to be used when reading the memory from the controller. |
|
Common Exceptions
| |
| Error |
Occurs when... |
| Argument |
The address argument string does not represent a valid address. |
|
Visual Basic
Syntax
Function MemoryGet(address As String) As Double
Function MemoryGet(address As String, dataType As Mpx.DataType) As Double
Sample Code
| |
' Map.UserBuffer enumeration takes 1 additional index,
' the index of the user buffer
Dim addressString As String = controller.Map.StringGet(Mpx.Map.UserBuffer, 0);
Dim userBufferValue As Double = controller.MemoryGet(addressString); |
Sample Application
C#
Syntax
double MemoryGet(string address);
double MemoryGet(string address, Mpx.DataType dataType);
Sample Code
| |
string strAdd;
//Map.UserBuffer enumeration takes 1 additional index.
//The index of the user buffer
strAdd = controller.Map.StringGet(Mpx.Map.UserBuffer, 0);
double x = controller.MemoryGet(strAdd);
|
See Also
MemorySet
Enumerations
DataType
Applications
VM3
|