Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
Read fieldbus I/O
Collaboration diagram for Read fieldbus I/O:

Functions

MLPIRESULT mlpiIoReadFieldbusIoBool8 (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG bitOffset, BOOL8 *data)
 
MLPIRESULT mlpiIoReadFieldbusIoChar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, CHAR *data)
 
MLPIRESULT mlpiIoReadFieldbusIoUchar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, UCHAR *data)
 
MLPIRESULT mlpiIoReadFieldbusIoShort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, SHORT *data)
 
MLPIRESULT mlpiIoReadFieldbusIoUshort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, USHORT *data)
 
MLPIRESULT mlpiIoReadFieldbusIoLong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, LONG *data)
 
MLPIRESULT mlpiIoReadFieldbusIoUlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, ULONG *data)
 
MLPIRESULT mlpiIoReadFieldbusIoLlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, LLONG *data)
 
MLPIRESULT mlpiIoReadFieldbusIoUllong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, ULLONG *data)
 
MLPIRESULT mlpiIoReadFieldbusIoFloat (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, FLOAT *data)
 
MLPIRESULT mlpiIoReadFieldbusIoDouble (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, DOUBLE *data)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayChar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, CHAR *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayUchar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, UCHAR *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayShort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, SHORT *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayUshort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, USHORT *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayLong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, LONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayUlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, ULONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayLlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, LLONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayUllong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, ULLONG *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayFloat (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, FLOAT *data, const ULONG numElements, ULONG *numElementsRet)
 
MLPIRESULT mlpiIoReadFieldbusIoArrayDouble (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, DOUBLE *data, const ULONG numElements, ULONG *numElementsRet)
 

Detailed Description

These functions read from fieldbus I/Os.

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 fieldbus I/Os, on default, you use the functions below named after the MLPI data type like mlpiIoReadFieldbusIoUlong. If you include the header mlpiIoHelper.h, you can furthermore use the equivalent functions named after the IEC61131 data types like mlpiIoReadFieldbusIoDword or like mlpiIoReadFieldbusIoUdint.

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 mlpiIoReadFieldbusIoBool8 ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  bitOffset,
BOOL8 data 
)

This function reads a bit from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]bitOffsetBit offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 BOOL8 data = FALSE;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[]= L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG bitOffset = 3;
7 MLPIRESULT result = mlpiIoReadFieldbusIoBool8(connection, masterName, slaveAddress, area, bitOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoChar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
CHAR data 
)

This function reads the 8-bit signed data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 CHAR data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[]= L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoChar(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoUchar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
UCHAR data 
)

This function reads the 8-bit unsigned data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 UCHAR data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoUchar(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoShort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
SHORT data 
)

This function reads the 16-bit signed data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 SHORT data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoShort(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoUshort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
USHORT data 
)

This function reads the 16-bit unsigned data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data, where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 USHORT data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoUshort(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoLong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
LONG data 
)

This function reads the 32-bit signed data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data, where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 LONG data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoLong(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoUlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
ULONG data 
)

This function reads the 32-bit unsigned data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 ULONG data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoUlong(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoLlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
LLONG data 
)

This function reads the 64-bit signed data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 LLONG data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoLlong(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoUllong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
ULLONG data 
)

This function reads the 64-bit unsigned data value from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 ULLONG data = 0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoUllong(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoFloat ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
FLOAT data 
)

This function reads the 32-bit floating point data value (single precision) from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 FLOAT data = 0.0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoFloat(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoDouble ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
DOUBLE data 
)

This function reads the 64-bit floating point data value (double precision) from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data value from the input of the Profibus DP slave.
2 DOUBLE data = 0.0;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 MLPIRESULT result = mlpiIoReadFieldbusIoDouble(connection, masterName, slaveAddress, area, byteOffset, &data);
MLPIRESULT mlpiIoReadFieldbusIoArrayChar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
CHAR data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 8-bit signed data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 CHAR data[2];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayChar(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayUchar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
UCHAR data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 8-bit unsigned data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the inputs of the Profibus DP slave.
2 UCHAR data[4];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayUchar(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayShort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
SHORT data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 16-bit signed data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 SHORT data[6];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayShort(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayUshort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
USHORT data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 16-bit unsigned data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 USHORT data[4];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayUshort(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayLong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
LONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 32-bit signed data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 LONG data[4];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayLong(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayUlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
ULONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 32-bit unsigned data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the inputs of the Profibus DP slave.
2 ULONG data[8];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayUlong(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayLlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
LLONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 64-bit signed data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[out]dataPointer to data where the value will be stored.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 LLONG data[2];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayLlong(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayUllong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
ULLONG data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 64-bit unsigned data values from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 ULLONG data[4];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayUllong(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayFloat ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
FLOAT data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 32-bit floating point data values (single precision) from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 FLOAT data[6];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayFloat(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);
MLPIRESULT mlpiIoReadFieldbusIoArrayDouble ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
DOUBLE data,
const ULONG  numElements,
ULONG numElementsRet 
)

This function reads an array of 64-bit floating point data values (double precision) from a fieldbus I/O.

Parameters
[in]connectionHandle for multiple connections.
[in]masterNameName of fieldbus master. The name of the fieldbus master is the name of the regarding master node in your IndraWorks project. You can also retrieve the list of configured master names by using the function mlpiIoReadFieldbusMasterList.
[in]slaveAddressAddress of fieldbus slave.
[in]areaI/O area of access (0==MLPI_IO_AREA_INPUT, 1==MLPI_IO_AREA_OUTPUT).
[in]byteOffsetByte offset within the I/O range of the fieldbus slave.
[in]numElementsNumber of elements in data available to read.
[out]numElementsRetPointer to data where number of elements in complete data will be stored.
[out]dataPointer to data where the value will be stored.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Read the data values from the input of the Profibus DP slave.
2 DOUBLE data[4];
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_INPUT;
6 ULONG byteOffset = 2;
7 ULONG numElementsRet = 0;
8 memset(data, 0, sizeof(data));
9 MLPIRESULT result = mlpiIoReadFieldbusIoArrayDouble(connection, masterName, slaveAddress, area, byteOffset, &data, _countof(data), numElementsRet);