|
MLPIRESULT | mlpiLogicWriteVariableBySymbolBool8 (const MLPIHANDLE connection, const WCHAR16 *symbol, const BOOL8 data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolChar (const MLPIHANDLE connection, const WCHAR16 *symbol, const CHAR data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolUchar (const MLPIHANDLE connection, const WCHAR16 *symbol, const UCHAR data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolShort (const MLPIHANDLE connection, const WCHAR16 *symbol, const SHORT data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolUshort (const MLPIHANDLE connection, const WCHAR16 *symbol, const USHORT data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolLong (const MLPIHANDLE connection, const WCHAR16 *symbol, const LONG data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolUlong (const MLPIHANDLE connection, const WCHAR16 *symbol, const ULONG data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolLlong (const MLPIHANDLE connection, const WCHAR16 *symbol, const LLONG data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolUllong (const MLPIHANDLE connection, const WCHAR16 *symbol, const ULLONG data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolFloat (const MLPIHANDLE connection, const WCHAR16 *symbol, const FLOAT data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolDouble (const MLPIHANDLE connection, const WCHAR16 *symbol, const DOUBLE data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolString (const MLPIHANDLE connection, const WCHAR16 *symbol, const WCHAR16 *data) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayBool8 (const MLPIHANDLE connection, const WCHAR16 *symbol, const BOOL8 *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayChar (const MLPIHANDLE connection, const WCHAR16 *symbol, const CHAR *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayUchar (const MLPIHANDLE connection, const WCHAR16 *symbol, const UCHAR *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayShort (const MLPIHANDLE connection, const WCHAR16 *symbol, const SHORT *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayUshort (const MLPIHANDLE connection, const WCHAR16 *symbol, const USHORT *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayLong (const MLPIHANDLE connection, const WCHAR16 *symbol, const LONG *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayUlong (const MLPIHANDLE connection, const WCHAR16 *symbol, const ULONG *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayLlong (const MLPIHANDLE connection, const WCHAR16 *symbol, const LLONG *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayUllong (const MLPIHANDLE connection, const WCHAR16 *symbol, const ULLONG *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayFloat (const MLPIHANDLE connection, const WCHAR16 *symbol, const FLOAT *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayDouble (const MLPIHANDLE connection, const WCHAR16 *symbol, const DOUBLE *data, const ULONG numElements) |
|
MLPIRESULT | mlpiLogicWriteVariableBySymbolArrayVoid (const MLPIHANDLE connection, const WCHAR16 *symbol, const void *data, const ULONG dataSize) |
|
The following functions provide symbolic write 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 writing variables by symbols, on default, you use the functions below named after the MLPI data type like mlpiLogicWriteVariableBySymbolUchar. If you include the header mlpiLogicHelper.h, you can also use the equivalent functions named after the IEC61131 data types like mlpiLogicWriteVariableBySymbolByte or like mlpiLogicWriteVariableBySymbolUsint.
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 |
This function writes a given Boolean value (BOOL, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value 'TRUE' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolBool8(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 8-bit signed value (SINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '42' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolChar(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 8-bit unsigned value (BYTE, USINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '0x2A' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolUchar(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 16-bit signed value (INT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '42' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolShort(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 16-bit unsigned value (WORD, UINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '0x2A' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolUshort(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 32-bit signed value (DINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '42' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolLong(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 32-bit unsigned value (DWORD, UDINT, TIME, DATE, DATE_AND_TIME, ..., MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '0x2A' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolUlong(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 64-bit signed value (LINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '42' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolLlong(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 64-bit unsigned value (LWORD, ULINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '0x2A' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolUllong(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 32-bit floating point value (single precision, REAL, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '1.23' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolFloat(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given 64-bit floating point value (double precision, LREAL, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value '1.23456' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolDouble(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes a given character string value (STRING, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the value that should be written. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the value 'This is a string' to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 WCHAR16 data[]=L"This is a string";
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolString(connection, L"Application.PlcProg.x1", data);
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of Boolean values (BOOL, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of BOOL8 elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 BOOL8 data[] = {TRUE, FALSE};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayBool8(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 8-bit signed values (SINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of CHAR elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayChar(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 8-bit unsigned values (BYTE, USINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of UCHAR elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 UCHAR data[] = {1, 85};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayUchar(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 16-bit signed values (INT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of SHORT elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 SHORT data[] = {-18, 65};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayShort(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 16-bit unsigned values (WORD, UINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of USHORT elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 USHORT data[] = {18, 33};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayUshort(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 32-bit signed values (DINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of LONG elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 LONG data[] = {-42, 99};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayLong(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 32-bit unsigned values (DWORD, UDINT, TIME, DATE, DATE_AND_TIME, ..., MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of ULONG elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 ULONG data[] = {42, 55};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayUlong(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 64-bit signed values (LINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of LLONG elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 LLONG data[] = {-13, 44};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayLlong(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 64-bit unsigned values (LWORD, ULINT, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values should be written. |
[in] | numElements | Number of ULLONG elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 ULLONG data[] = {13, 77};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayUllong(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 32-bit floating point values (single precision, REAL, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of FLOAT elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 FLOAT data[] = {1.234, 9.907};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayFloat(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes an array of 64-bit floating point values (double precision, LREAL, MlpiLogicType) to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | numElements | Number of DOUBLE elements in 'data' available to write. |
- Returns
- Return value indicating success (>=0) or error (<0).
- Example:
1 // Writing the values to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
2 DOUBLE data[] = {1.23456789, 9.87654321};
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayDouble(connection, L"Application.PlcProg.x1", data, _countof(data));
Referenced by utilLogicGetSymbolListExtended().
This function writes user-defined data type values to a variable by symbolic access.
- Parameters
-
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | data | Pointer to variable which contains the values that should be written. |
[in] | dataSize | Number of bytes in data available to read. |
- 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 // Writing the value to the variable 'x1' in the program 'PlcProg' in an application called 'Application'.
3 MLPIRESULT result = mlpiLogicWriteVariableBySymbolArrayVoid(connection, L"Application.PlcProg.x1", &data, sizeof(data));