Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4MATLAB)  1.26.2
IoLib
Collaboration diagram for IoLib:
I/O Functions

I/O Functions

Description

This function group contains functions to control and manage, read and write fieldbus I/Os.

More Information

For more information, refer to mlpiCore documentation: IoLib.

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoReadFieldbusIo

m4MIoReadFieldbusIo

m4MIoReadFieldbusIo

IO-Function: Read data from a fieldbus slave.

Description

This function reads scalar or array data from fieldbus I/Os.

Note: Read the introduction in Fundamentals of MLPI Programming carefully to avoid unexpected results of this function as the IO access is shared with the target PLC.

Syntax

[data] = ...
m4MIoReadFieldbusIo(connection, masterName, slaveAddress, ...
area, dataType, offset)
[data, result] = ...
m4MIoReadFieldbusIo(connection, masterName, slaveAddress, ...
area, dataType, offset)
[data] = ...
m4MIoReadFieldbusIo(connection, masterName, slaveAddress, ...
area, dataType, offset, numElements)
[data, result] = ...
m4MIoReadFieldbusIo(connection, masterName, slaveAddress, ...
area, dataType, offset, numElements)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name of the fieldbus master. The argument must be a 1xL char array.

slaveAddress defines the address of the fieldbus slave. The argument must be a 1xL char array.

memArea defines if the data is read from the fieldbus input or output area. The argument must be a scalar MlpiIoFieldbusArea enumeration.

dataType defines the data type of the output argument data. The argument must be a scalar MlpiType enumeration.

offset defines the offset within the I/O range of the fieldbus slave. If the type of data is logical, the offset is a bit-offset. Otherwise the offset is a byte-offset. The argument must be a scalar uint32 value.

Optional Input Arguments

numElements defines the number of elements that shall be read. The argument must be a scalar uint32 value. The optional argument is to read an array of elements from the fieldbus slave.

Output Arguments

data contains the values read from the fieldbus slave. The argument is scalar if no input argument numElements is provided. The argument is a Mx1 matrix. The number M is equal to numElements if there are enough elements to read from the fieldbus slave. If the function was not able to read the specified number of elements, M will be smaller accordingly. The data type of this argument will be as specified by the input argument dataType.

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. If the function call fails, other output arguments will be set to NaN. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: Read fieldbus I/O

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoReadFieldbusMasterInfo

m4MIoReadFieldbusMasterInfo

m4MIoReadFieldbusMasterInfo

IO-Function: Read information about a fieldbus master.

Description

This function reads information about one or multiple fieldbus masters.

This function does not support code generation.

Syntax

[masterInfo]         = m4MIoReadFieldbusMasterInfo(connection,...
masterName)
[masterInfo, result] = m4MIoReadFieldbusMasterInfo(connection,...
masterName)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name of the fieldbus master. The argument can be a 1xL char array or a Mx1 cell array. If it is a cell array all cells must be 1xL char arrays.

Output Arguments

masterInfo contains information about the fieldbus master. The argument is a scalar MlpiIoFieldbusMasterInfo or a Mx1 matrix with MlpiIoFieldbusMasterInfo structures.

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. If the function call fails, other output arguments will be set to NaN. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: mlpiIoReadFieldbusMasterInfo

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoReadFieldbusMasterList

m4MIoReadFieldbusMasterList

m4MIoReadFieldbusMasterList

IO-Function: Read name list of available fieldbus masters.

Description

This function reads the name list of the available fieldbus masters on the target.

This function does not support code generation.

Syntax

[masterList]         = m4MIoReadFieldbusMasterList(connection)
[masterList, result] = m4MIoReadFieldbusMasterList(connection)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

Output Arguments

masterList contains the names of the fieldbus masters. The argument is a Mx1 cell array. Each cell is a 1xL char array with the name of the fieldbus master.

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. If the function call fails, other output arguments will be set to NaN. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: mlpiIoReadFieldbusMasterList

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoReadFieldbusSlaveInfo

m4MIoReadFieldbusSlaveInfo

m4MIoReadFieldbusSlaveInfo

IO-Function: Read information about a fieldbus master.

Description

This function reads information about one or multiple fieldbus slaves connected to one fieldbus master.

This function does not support code generation.

Syntax

[slaveInfo]         = m4MIoReadFieldbusSlaveInfo(connection,...
masterName,slaveName)
[slaveInfo, result] = m4MIoReadFieldbusSlaveInfo(connection,...
masterName,slaveName)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name of the fieldbus master. The argument can be a 1xL char array or a scalar cell array. If it is a cell array the cell must be 1xL char array.

slaveName defines the name of fieldbus slaves. The argument can be a 1xL char array or a Mx1 or 1xM cell array. If it is a cell array all cells must be 1xL char arrays.

Output Arguments

slaveInfo contains information about the fieldbus slaves. The argument is a scalar MlpiIoFieldbusSlaveInfo or a Mx1 matrix with MlpiIoFieldbusSlaveInfo structures.

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. If the function call fails, other output arguments will be set to NaN. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: mlpiIoReadFieldbusSlaveInfo

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoReadFieldbusSlaveInfos

m4MIoReadFieldbusSlaveInfos

m4MIoReadFieldbusSlaveInfos

IO-Function: Read information about a fieldbus master.

Description

This function reads information about one or multiple fieldbus slaves connected to one fieldbus master.

This function does not support code generation.

Syntax

[slaveInfo]         = m4MIoReadFieldbusSlaveInfos(connection,...
masterName,numSlaves)
[slaveInfo, result] = m4MIoReadFieldbusSlaveInfos(connection,...
masterName,numSlaves)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name of the fieldbus master. The argument can be a 1xL char array or a scalar cell array. If it is a cell array the cell must be 1xL char array.

numSlaves defines the number of fieldbus slaves to be read. The argument must be a scalar real numeric value from 1 to 512. Internally the value will be casted to uint32.

Output Arguments

slaveInfo contains information about the fieldbus slaves. The argument is a scalar MlpiIoFieldbusSlaveInfo or a Mx1 matrix with MlpiIoFieldbusSlaveInfo structures. M is the number of slaves connected to the master. M is smaller than numSlaves if there are less than numSlaves slaves connected.

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. If the function call fails, other output arguments will be set to NaN. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: mlpiIoReadFieldbusSlaveInfos

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoReadFieldbusSlaveList

m4MIoReadFieldbusSlaveList

m4MIoReadFieldbusSlaveList

IO-Function: Read name list of available fieldbus masters.

Description

This function reads the name list of all fieldbus slaves connected to a fieldbus master.

This function does not support code generation.

Syntax

[slaveList]         = m4MIoReadFieldbusSlaveList(connection)
[slaveList, result] = m4MIoReadFieldbusSlaveList(connection)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

Output Arguments

slaveList contains the names of the fieldbus slaves. The argument is a Mx1 cell array. Each cell is a 1xL char array with the name of the fieldbus slave.

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. If the function call fails, other output arguments will be set to NaN. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: mlpiIoReadFieldbusSlaveList

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoUdtFieldbusIo

m4MIoUdtFieldbusIo

m4MIoUdtFieldbusIo

IO-Function: Update fieldbus slaves.

Description

This function performs a bus cycle to update the fieldbus I/Os of all attached slaves of one or multiple masters.

Note: Read the introduction in Fundamentals of MLPI Programming carefully to avoid unexpected results of this function as the IO access is shared with the target PLC.

Syntax

result = m4MIoUdtFieldbusIo(connection, masterName)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name(s) of the fieldbus master(s). The argument can be a 1xL char array, a Mx1 cell array or a 1xM cell array. If the argument is a cell array all cells must be 1xL char arrays.

Output Arguments

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: Read fieldbus I/O

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoUdtSingleFieldbusIo

m4MIoUdtSingleFieldbusIo

m4MIoUdtSingleFieldbusIo

IO-Function: Update fieldbus slaves.

Description

This function performs a bus cycle to update the fieldbus I/Os of all attached slaves of a master.

Note: Read the introduction in Fundamentals of MLPI Programming carefully to avoid unexpected results of this function as the IO access is shared with the target PLC.

Syntax

result = m4MIoUdtSingleFieldbusIo(connection, masterName)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name of the fieldbus master. The argument must be a 1xL char array.

Output Arguments

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: Read fieldbus I/O

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoWriteFieldbusIo64

m4MIoWriteFieldbusIo64

m4MIoWriteFieldbusIo64

IO-Function: Write data to a fieldbus slave.

Description

This function writes data to I/Os of a fieldbus slave.

This function does not support code generation.

Note: Read the introduction in Fundamentals of MLPI Programming carefully to avoid unexpected results of this function as the IO access is shared with the target PLC.

Caution: The function allows writing to an input which is valid for some particular cases. In general, do not write to physical inputs.

Syntax

m4MIoWriteFieldbusIo64(connection, masterName, slaveAddress, ...
memArea, offset, data)
result = m4MIoWriteFieldbusIo64(connection, masterName, ...
slaveAddress, memArea, offset, data)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name of the fieldbus master. The argument must be a 1xL char array.

slaveAddress defines the address of the fieldbus slave. The argument must be a 1xL char array.

memArea defines if the data will be written to the fieldbus input or output area. The argument must be a scalar MlpiIoFieldbusArea enumeration.

offset defines the offset within the I/O range of the fieldbus slave. If the type of data is logical, the offset is a bit-offset. Otherwise the offset is a byte-offset. The argument must be a scalar uint32 value.

data defines the values that will be written to the fieldbus slave. The argument can be scalar, a Mx1 matrix or a 1xM matrix. The data type of the value must be predefined. The argument can have the following data types: logical, uint8, int8, uint16, int16, uint32, int32, uint64, int64, single or double. Other data types are not supported.

Output Arguments

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: Write fieldbus I/O

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0

m4MIoWriteFieldbusIo

m4MIoWriteFieldbusIo

m4MIoWriteFieldbusIo

IO-Function: Write data to a fieldbus slave.

Description

This function writes data to I/Os of a fieldbus slave.

Note: Read the introduction in Fundamentals of MLPI Programming carefully to avoid unexpected results of this function as the IO access is shared with the target PLC.

Caution: The function allows writing to an input which is valid for some particular cases. In general, do not write to physical inputs.

Syntax

m4MIoWriteFieldbusIo(connection, masterName, slaveAddress, ...
memArea, offset, data)
result = m4MIoWriteFieldbusIo(connection, masterName, ...
slaveAddress, memArea, offset, data)

Input Arguments

connection defines the connection that will be used. The argument must be scalar and of type MlpiConnection.

masterName defines the name of the fieldbus master. The argument must be a 1xL char array.

slaveAddress defines the address of the fieldbus slave. The argument must be a 1xL char array.

memArea defines if the data will be written to the fieldbus input or output area. The argument must be a scalar MlpiIoFieldbusArea enumeration.

offset defines the offset within the I/O range of the fieldbus slave. If the type of data is logical, the offset is a bit-offset. Otherwise the offset is a byte-offset. The argument must be a scalar uint32 value.

data defines the values that will be written to the fieldbus slave. The argument can be scalar, a Mx1 matrix or a 1xM matrix. The data type of the value must be predefined. The argument can have the following data types: logical, uint8, int8, uint16, int16, uint32, int32, single or double. Other data types are not supported.

Output Arguments

result contains the return value of the MLPI function. The argument is scalar and of type int32. Negative values indicate a failed function call. For details refer to the section Error Identification and Handling in Fundamentals of MLPI Programming.

Example Files

Here you will find instructions to use the examples.

The following example is available in the folder ./mlpi/mlpi4MATLAB/bin:

See also

Reference to mlpiCore

This function maps to the mlpiCore function: Write fieldbus I/O

Copyright

Legal notice and version: © 2017 Bosch Rexroth Corporation http://www.boschrexroth.com DC-AE/EAS1 (MGo) Library version: 1.26.2.0.0