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

Functions

MLPIRESULT mlpiIoWriteFieldbusIoBool8 (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG bitOffset, const BOOL8 data)
 
MLPIRESULT mlpiIoWriteFieldbusIoChar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const CHAR data)
 
MLPIRESULT mlpiIoWriteFieldbusIoUchar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const UCHAR data)
 
MLPIRESULT mlpiIoWriteFieldbusIoShort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const SHORT data)
 
MLPIRESULT mlpiIoWriteFieldbusIoUshort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const USHORT data)
 
MLPIRESULT mlpiIoWriteFieldbusIoLong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const LONG data)
 
MLPIRESULT mlpiIoWriteFieldbusIoUlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const ULONG data)
 
MLPIRESULT mlpiIoWriteFieldbusIoLlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const LLONG data)
 
MLPIRESULT mlpiIoWriteFieldbusIoUllong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const ULLONG data)
 
MLPIRESULT mlpiIoWriteFieldbusIoFloat (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const FLOAT data)
 
MLPIRESULT mlpiIoWriteFieldbusIoDouble (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const DOUBLE data)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayChar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const CHAR *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayUchar (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const UCHAR *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayShort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const SHORT *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayUshort (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const USHORT *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayLong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const LONG *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayUlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const ULONG *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayLlong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const LLONG *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayUllong (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const ULLONG *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayFloat (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const FLOAT *data, const ULONG numElements)
 
MLPIRESULT mlpiIoWriteFieldbusIoArrayDouble (const MLPIHANDLE connection, const WCHAR16 *masterName, const WCHAR16 *slaveAddress, const MlpiIoFieldbusArea area, const ULONG byteOffset, const DOUBLE *data, const ULONG numElements)
 

Detailed Description

These functions write to 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 writing fieldbus I/Os, on default, you use the functions below named after the MLPI data type like mlpiIoWriteFieldbusIoUchar. If you include the header mlpiIoHelper.h, you can furthermore use the equivalent functions named after the IEC61131 data types like mlpiIoWriteFieldbusIoByte or like mlpiIoWriteFieldbusIoUsint.

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

This function writes a bit to 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.
[in]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 BOOL8 data = TRUE;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG bitOffset = 3;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoBool8(connection, masterName, slaveAddress, area, bitOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoChar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const CHAR  data 
)

This function writes the 8-bit signed data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 CHAR data = -1;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoChar(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoUchar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const UCHAR  data 
)

This function writes the 8-bit unsigned data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 UCHAR data = 2;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoUchar(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoShort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const SHORT  data 
)

This function writes the 16-bit signed data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 SHORT data = -1;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoShort(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoUshort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const USHORT  data 
)

This function writes the 16-bit unsigned data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 USHORT data = 2;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoUshort(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoLong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const LONG  data 
)

This function writes the 32-bit signed data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 LONG data = -1;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoLong(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoUlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const ULONG  data 
)

This function writes the 32-bit unsigned data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 ULONG data = 2;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoUlong(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoLlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const LLONG  data 
)

This function writes the 64-bit signed data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the outputs of the Profibus DP slave.
2 LLONG data = -1;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoLlong(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoUllong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const ULLONG  data 
)

This function writes the 64-bit unsigned data value to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the outputs of the Profibus DP slave.
2 ULLONG data = 2;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoUllong(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoFloat ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const FLOAT  data 
)

This function writes the 32-bit floating point data value (single precision) to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 FLOAT data = 1.234;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoFloat(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoDouble ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const DOUBLE  data 
)

This function writes the 64-bit floating point data value (double precision) to 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]dataData value to be written to the fieldbus I/O.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data value to the output of the Profibus DP slave.
2 DOUBLE data = 1.23456789;
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoDouble(connection, masterName, slaveAddress, area, byteOffset, data);
MLPIRESULT mlpiIoWriteFieldbusIoArrayChar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const CHAR data,
const ULONG  numElements 
)

This function writes an array of 8-bit signed data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 CHAR data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayChar(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayUchar ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const UCHAR data,
const ULONG  numElements 
)

This function writes an array of 8-bit unsigned data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 UCHAR data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayUchar(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayShort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const SHORT data,
const ULONG  numElements 
)

This function writes an array of 16-bit signed data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 SHORT data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayShort(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayUshort ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const USHORT data,
const ULONG  numElements 
)

This function writes an array of 16-bit unsigned data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 USHORT data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayUshort(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayLong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const LONG data,
const ULONG  numElements 
)

This function writes an array of 32-bit signed data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 LONG data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayLong(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayUlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const ULONG data,
const ULONG  numElements 
)

This function writes an array of 32-bit unsigned data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 ULONG data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayUlong(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayLlong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const LLONG data,
const ULONG  numElements 
)

This function writes an array of 64-bit signed data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 LLONG data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayLlong(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayUllong ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const ULLONG data,
const ULONG  numElements 
)

This function writes an array of 64-bit unsigned data values to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 ULLONG data[] = {1, 85};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayUllong(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayFloat ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const FLOAT data,
const ULONG  numElements 
)

This function writes an array of 32-bit floating point data values (single precision) to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 FLOAT data[] = {1.234, 9.876};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusmlpiIoWriteFieldbusIoArrayFloatIo(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));
MLPIRESULT mlpiIoWriteFieldbusIoArrayDouble ( const MLPIHANDLE  connection,
const WCHAR16 masterName,
const WCHAR16 slaveAddress,
const MlpiIoFieldbusArea  area,
const ULONG  byteOffset,
const DOUBLE data,
const ULONG  numElements 
)

This function writes an array of 64-bit floating point data values (double precision) to 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]dataData values to be written to the fieldbus I/O.
[in]numElementsNumber of elements in data available to write.
Returns
Return value indicating success (>=0) or error (<0).
Example
1 // Write the data values to the output of the Profibus DP slave.
2 DOUBLE data[] = {1.23456789, 9.87654321};
3 WCHAR16 masterName[] = L"Profibus_DP_Master";
4 WCHAR16 slaveAddress[] = L"3";
5 MlpiIoFieldbusArea area = MLPI_IO_AREA_OUTPUT;
6 ULONG byteOffset = 0;
7 MLPIRESULT result = mlpiIoWriteFieldbusIoArrayDouble(connection, masterName, slaveAddress, area, byteOffset, data, _countof(data));