Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
Read variable using symbols
Collaboration diagram for Read variable using symbols:

Functions

MLPIRESULT mlpiLogicReadVariableBySymbolBool8 (const MLPIHANDLE connection, const WCHAR16 *symbol, BOOL8 *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolChar (const MLPIHANDLE connection, const WCHAR16 *symbol, CHAR *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolUchar (const MLPIHANDLE connection, const WCHAR16 *symbol, UCHAR *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolShort (const MLPIHANDLE connection, const WCHAR16 *symbol, SHORT *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolUshort (const MLPIHANDLE connection, const WCHAR16 *symbol, USHORT *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolLong (const MLPIHANDLE connection, const WCHAR16 *symbol, LONG *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolUlong (const MLPIHANDLE connection, const WCHAR16 *symbol, ULONG *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolLlong (const MLPIHANDLE connection, const WCHAR16 *symbol, LLONG *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolUllong (const MLPIHANDLE connection, const WCHAR16 *symbol, ULLONG *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolFloat (const MLPIHANDLE connection, const WCHAR16 *symbol, FLOAT *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolDouble (const MLPIHANDLE connection, const WCHAR16 *symbol, DOUBLE *data)
 
MLPIRESULT mlpiLogicReadVariableBySymbolString (const MLPIHANDLE connection, const WCHAR16 *symbol, WCHAR16 *data, const ULONG numElements)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayBool8 (const MLPIHANDLE connection, const WCHAR16 *symbol, BOOL8 *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayChar (const MLPIHANDLE connection, const WCHAR16 *symbol, CHAR *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUchar (const MLPIHANDLE connection, const WCHAR16 *symbol, UCHAR *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayShort (const MLPIHANDLE connection, const WCHAR16 *symbol, SHORT *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUshort (const MLPIHANDLE connection, const WCHAR16 *symbol, USHORT *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayLong (const MLPIHANDLE connection, const WCHAR16 *symbol, LONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUlong (const MLPIHANDLE connection, const WCHAR16 *symbol, ULONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayLlong (const MLPIHANDLE connection, const WCHAR16 *symbol, LLONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUllong (const MLPIHANDLE connection, const WCHAR16 *symbol, ULLONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayFloat (const MLPIHANDLE connection, const WCHAR16 *symbol, FLOAT *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayDouble (const MLPIHANDLE connection, const WCHAR16 *symbol, DOUBLE *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiLogicReadVariableBySymbolArrayVoid (const MLPIHANDLE connection, const WCHAR16 *symbol, void *data, const ULONG dataSize, ULONG *dataSizeRet)
 

Detailed Description

The following functions provide symbolic read access to logic variables.

Attention
The addresses of the variables of the symbolic access might change on every download, reset origin or online change of the PLC application, so you have to stop each variable access before you load or change the PLC application!

The table shows the PLC data types within the IEC61131 environment 'IndraLogic' and the corresponding data types within the C/C++ environment (e.g. 'Workbench OEM') of the MLPI. On reading variables by symbols, on default, you use the functions below named after the MLPI data type like mlpiLogicReadVariableBySymbolUlong. If you include the header mlpiLogicHelper.h, you can also use the equivalent functions named after the IEC61131 data types like mlpiLogicReadVariableBySymbolDword or like mlpiLogicReadVariableBySymbolUdint.

Number of Bits Data types of PLC Data types of MLPI
8 BOOL BOOL8
8 SINT CHAR
16 INT SHORT
32 DINT LONG
64 LINT LLONG
8 USINT UCHAR
16 UINT USHORT
32 UDINT ULONG
64 ULINT ULLONG
8 BYTE UCHAR
16 WORD USHORT
32 DWORD ULONG
64 LWORD ULLONG
32 REAL FLOAT
64 LREAL DOUBLE
8n STRING WCHAR16
16n WSTRING WCHAR16

Function Documentation

MLPIRESULT mlpiLogicReadVariableBySymbolBool8 ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
BOOL8 data 
)

This function reads a boolean value (BOOL, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 BOOL8 data = FALSE;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolBool8(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolChar ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
CHAR data 
)

This function reads an 8 bit signed value (SINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 CHAR data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolChar(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolUchar ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
UCHAR data 
)

This function reads an 8-bit unsigned value (BYTE, USINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 UCHAR data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolUchar(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolShort ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
SHORT data 
)

This function reads a 16-bit signed value (INT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 SHORT data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolShort(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolUshort ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
USHORT data 
)

This function reads a 16-bit unsigned value (WORD, UINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 USHORT data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolUshort(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolLong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
LONG data 
)

This function reads a 32-bit signed value (DINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 LONG data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolLong(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolUlong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
ULONG data 
)

This function reads a 32-bit unsigned value (DWORD, UDINT, TIME, DATE, DATE_AND_TIME, ..., MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 ULONG data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolUlong(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolLlong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
LLONG data 
)

This function reads a 64-bit signed value (LINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 LLONG data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolLlong(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolUllong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
ULLONG data 
)

This function reads a 64-bit unsigned value (LWORD, ULINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 ULLONG data = 0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolUllong(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolFloat ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
FLOAT data 
)

This function reads a 32-bit floating point value (single precision, REAL, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 FLOAT data = 0.0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolFloat(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolDouble ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
DOUBLE data 
)

This function reads a 64-bit floating point value (double precision, LREAL, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 DOUBLE data = 0.0;
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolDouble(connection, L"Application.PlcProg.x1", &data);
MLPIRESULT mlpiLogicReadVariableBySymbolString ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
WCHAR16 data,
const ULONG  numElements 
)

This function reads a character string value (STRING, MlpiLogicType) from a variable by symbolic access. You can use this function not only for string variables, but also for other simple types and arrays of simple types. In this case, the function returns a string representation of the given value. The values of a string represented array will be separated by spaces. The reading of values as a string can be useful if you only want to display the variable as a string and you don't need to know the type of the variable.

Hint:
From version 1.4.0.0 of the MLPI server this function supports arrays of simple types and furthermore different display types to show the string represented values in hexadecimal, decimal, binary or boolean format. To use the display extension you have to add a prefix to your symbol. The prefixes are defined in the helper header "mlpiLogicHelper.h". Hint: From Version 1.11.8.0 of the MLPI server this function supports data types TIME, DATE, DATE_AND_TIME, and TIME_OF_DAY
Data types of PLC Valid prefixes for argument 'symbol' Example of argument 'symbol' Example of result 'data'
BOOL none L"Application.PlcProg.locVarBool" L"TRUE"
MLPI_READ_VAR_DISPLAY_TYPE_BOOLEAN L"BLN:Application.PlcProg.locVarBool" L"TRUE"
MLPI_READ_VAR_DISPLAY_TYPE_DEC L"DEC:Application.PlcProg.locVarBool" L"1"
MLPI_READ_VAR_DISPLAY_TYPE_HEX L"HEX:Application.PlcProg.locVarBool" L"0x01"
MLPI_READ_VAR_DISPLAY_TYPE_BIN L"BIN:Application.PlcProg.locVarBool" L"0b0000.0001"
BYTE, WORD, DWORD, LWORD none L"Application.PlcProg.locVarByte" L"222"
MLPI_READ_VAR_DISPLAY_TYPE_DEC L"DEC:Application.PlcProg.locVarByte" L"222"
MLPI_READ_VAR_DISPLAY_TYPE_HEX L"HEX:Application.PlcProg.locVarByte" L"0xDE"
MLPI_READ_VAR_DISPLAY_TYPE_BIN L"BIN:Application.PlcProg.locVarByte" L"0b1101.1110"
USINT, UINT, UDINT, ULINT none L"Application.PlcProg.locVarUint" L"42"
MLPI_READ_VAR_DISPLAY_TYPE_DEC L"DEC:Application.PlcProg.locVarUint" L"42"
MLPI_READ_VAR_DISPLAY_TYPE_HEX L"HEX:Application.PlcProg.locVarUint" L"0x2A"
MLPI_READ_VAR_DISPLAY_TYPE_BIN L"BIN:Application.PlcProg.locVarUint" L"0b0010.1010"
SINT, INT, DINT, LINT none L"Application.PlcProg.locVarInt" L"-16982"
MLPI_READ_VAR_DISPLAY_TYPE_DEC L"DEC:Application.PlcProg.locVarInt" L"-16982"
MLPI_READ_VAR_DISPLAY_TYPE_HEX L"HEX:Application.PlcProg.locVarInt" L"0xBDAA"
MLPI_READ_VAR_DISPLAY_TYPE_BIN L"BIN:Application.PlcProg.locVarInt" L"0b1011.1101.1010.1010"
REAL, LREAL none L"Application.PlcProg.locVarReal" L"3.141592"
STRING, WSTRING none L"Application.PlcProg.locVarString" L"Don't panic!"
TIME none L"Application.PlcProg.locVarTime " L"5d12h34m15s12ms"
DATE none L"Application.PlcProg.locVarTime " L"2010-03-29"
DATE_AND_TIME none L"Application.PlcProg.locVarTime " L"2010-03-29-15:36:30"
TIME_OF_DAY none L"Application.PlcProg.locVarTime " L"15:36:30.123"
Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the value(s) will be stored.
[in]numElementsNumber of WCHAR16 elements in 'data' available to read.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the value of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 WCHAR16 data[4096] = L"";
3 MLPIRESULT result = mlpiLogicReadVariableBySymbolString(connection, L"Application.PlcProg.x1", data, _countof(data));
MLPIRESULT mlpiLogicReadVariableBySymbolArrayBool8 ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
BOOL8 data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of Boolean values (BOOL, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of BOOL8 elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 BOOL8 data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayBool8(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayChar ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
CHAR data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 8-bit signed values (SINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of CHAR elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 CHAR data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayChar(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUchar ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
UCHAR data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 8-bit unsigned values (BYTE, USINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of UCHAR elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 UCHAR data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayUchar(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayShort ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
SHORT data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 16-bit signed values (INT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of SHORT elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 SHORT data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayShort(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUshort ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
USHORT data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 16-bit unsigned values (WORD, UINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of USHORT elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 USHORT data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayUshort(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayLong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
LONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 32-bit signed values (DINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of LONG elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 LONG data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayLong(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUlong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
ULONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 32-bit unsigned values (DWORD, UDINT, TIME, DATE, DATE_AND_TIME, ..., MlpiLogicType) from a variable. by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of ULONG elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 ULONG data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayUlong(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayLlong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
LLONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 64-bit signed values (LINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of LLONG elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 LLONG data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayLlong(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayUllong ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
ULLONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 64-bit unsigned values (LWORD, ULINT, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of ULLONG elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 ULLONG data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayUllong(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayFloat ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
FLOAT data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 32-bit floating point values (single precision, REAL, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of FLOAT elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 FLOAT data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayFloat(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayDouble ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
DOUBLE data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 64-bit floating point values (double precision, LREAL, MlpiLogicType) from a variable by symbolic access.

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]numElementsNumber of DOUBLE elements in 'data' available to read.
[out]numElementsRetNumber of elements used.
Returns
Return value indicating success (>=0) or error (<0).
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 DOUBLE data[10];
3 ULONG numElementsRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayDouble(connection, L"Application.PlcProg.x1", data, _countof(data), &numElementsRet);
MLPIRESULT mlpiLogicReadVariableBySymbolArrayVoid ( const MLPIHANDLE  connection,
const WCHAR16 symbol,
void *  data,
const ULONG  dataSize,
ULONG dataSizeRet 
)

This function reads user-defined data type values from a variable by symbolic access (raw reading).

Parameters
[in]connectionHandle for multiple connections.
[in]symbolSymbol variable of PLC application.
[out]dataPointer to variable where the values will be stored.
[in]dataSizeNumber of bytes in 'data' available to read.
[out]dataSizeRetNumber of bytes used.
Returns
Return value indicating success (>=0) or error (<0).
Note
It's highly recommended to use MLPI IEC data types (like MLPI_IEC_LREAL, MLPI_IEC_USINT, ... see mlpiGlobal.h) for an user defined structure.
Example:
1 // Read the values of the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 DUT data;
3 ULONG dataSizeRet = 0;
4 memset(data, 0, sizeof(data));
5 MLPIRESULT result = mlpiLogicReadVariableBySymbolArrayVoid(connection, L"Application.PlcProg.x1", &data, sizeof(data), &dataSizeRet);