Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4MATLAB)  1.26.2
ContainerLib
Collaboration diagram for ContainerLib:
Container Functions

Container Functions

Description

Use the container function group when you need to access a larger set of data repetitively and with maximum update speed. For example input data you want to read every machine cycle. Using the function m4MContainerCreate you first have to create a container by defining all the elements you want to read with the container. This also defines the memory layout of the container. Following that you can read or write your data using the functions m4MContainerGetUdt or m4MContainerSetUdt. When the container is no longer needed, delete it using m4MContainerDestroy.

Important Note

The addresses of the variables of the container content might changes on every download or online change of the PLC application, so you have to stop and destroy your container before you load the PLC application!

Please ensure you do not destroy a container during accessing it (e.g. update, read information)!

A container is a list of items which are described as so called tags. Each tag identifies a data element which can be read or written. For example a symbolic variable from the PLC or data from the input area of the I/O mapping.

The first argument of a tag always defines the type of data to read or write. The following data sources are available:

  • LOGICLIB_MEMORY_AREA: Accessing Input, Output and Marker area of PLC (%I, %O, %M).
  • LOGICLIB_SYMBOL: Accessing variables and arrays of PLC by symbolic name using symbolic variables. Access requires a symbol configuration of desired variables.
  • IOLIB_FIELBUS_IO: Accessing fieldbus IO data directly from fieldbus driver.
  • ALIGNMENT_DUMMY: Dummy elements to align the subsequent tag.

The arguments for the different data sources are as follows.

LOGICLIB_MEMORY_AREA

  • argument 1: application name. (e.g. "Application")
  • argument 2: area. (Either "INPUT", "OUTPUT" or "MARKER")
  • argument 3: bit offset. (e.g. "0" to read from start offset)
  • argument 4: bit length. (Note: single bit access or byte access supported. E.g. "1", "8", "16", "24", ... )

LOGICLIB_SYMBOL

  • argument 1: symbol name. (e.g. "Application.PlcProg.boDummy")

IOLIB_FIELBUS_IO

  • argument 1: master name. (e.g. "Onboard_I_O")
  • argument 2: slave address. (e.g. "1")
  • argument 3: area. (Either "INPUT" or "OUTPUT")
  • argument 4: bit offset. (e.g. "0" to read from start offset)
  • argument 5: bit length. (Note: single bit access or byte access supported. e.g. "1", "8", "16", "24", ... )

ALIGNMENT_DUMMY

  • argument 1: byte length (Note: only "1", "2", "4" or "8" byte supported)

More Information

For more information, refer to mlpiCore documentation: ContainerLib.

Copyright

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

m4MContainerCreateSingle

m4MContainerCreateSingle

m4MContainerCreateSingle

Container-Function: Create a single data container.

Description

This function creates a new container. It has to be specified if the container is a read or write container. It is not possible to read and write using the same container. To specify the data that has to be read or written, you have to define a tag list for the function. A tag list is a formatted char array of one or multiple tags which are separated by a semicolon (;). Each tag is build of multiple arguments which are separated by comma (,).

Please have a look at container functions for an introduction to the container mechanism.

Attention: The addresses of the variables of the container content might change on every download or online change of the PLC application. So you have to stop data communication and destroy your container before you change the PLC application.

Syntax

[containerHandle, containerSize]         = m4MContainerCreateSingle(...
connection, tagList, accessFlag)
[containerHandle, containerSize, result] = m4MContainerCreateSingle(...
connection, tagList, accessFlag)

Input Arguments

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

tagList specifies tag list items for a single container. The argument must be a 1xL char array for one container with 1 to N tag list items. The maximum length of this char array is defined by the constant M4M_CONST.MEX_CONTAINER_TAGLIST_LENGTH_MAX.

accessFlag defines if the container is a read or write container. The argument is a MlpiContainerAccess enumeration must be scalar.

Output Arguments

containerHandle contains the handle to access the container with further m4MContainer commands. The argument is of type uint32 and is a 1x2 matrix. The first value contains the connectionID and the second value the containerID.

containerSize contains the size of the container in byte. The argument is scalar and of type uint32.

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: mlpiContainerCreate

Copyright

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

m4MContainerCreate

m4MContainerCreate

m4MContainerCreate

Container-Function: Create one or multiple data container.

Description

This function creates a new container. It has to be specified if the container is a read or write container. It is not possible to read and write using the same container. To specify the data that has to be read or written, you have to define a tag list for the function. A tag list is a formatted char array of one or multiple tags which are separated by a semicolon (;). Each tag is build of multiple arguments which are separated by comma (,).

Please have a look at container functions for an introduction to the container mechanism.

Attention: The addresses of the variables of the container content might change on every download or online change of the PLC application. So you have to stop data communication and destroy your container before you change the PLC application.

Syntax

[containerHandle, containerSize]         = m4MContainerCreate(...
connection, tagList, accessFlag)
[containerHandle, containerSize, result] = m4MContainerCreate(...
connection, tagList, accessFlag)

Input Arguments

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

tagList specifies tag list items for one or multiple container. The argument must be a MxN cell array for M container with 1 to N tag list items. Each cell must be a row char vector. As each container can have between 1 and N tag list items cells can be empty.

accessFlag defines if the container is a read or write container. The argument is a MlpiContainerAccess enumeration and can be scalar or a Mx1 matrix. If the argument is scalar the value is valid for all container. If the argument is a Mx1 matrix the value in the i-th row is valid for the container in the i-th row of tagList.

Output Arguments

containerHandle contains the handle(s) to access the container with further m4MContainer command. The argument is of type uint32 and can be a 1x2 matrix or Mx2 matrix. Each row is a pair of two values, the connectionID and the containerID. The first column contains the connectionID(s) and the second column the containerID(s).

containerSize contains the size of the container in byte. The argument is of type uint32 and can be scalar or a Mx1 matrix.

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: mlpiContainerCreate

Copyright

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

m4MContainerDestroy

m4MContainerDestroy

m4MContainerDestroy

Container-Function: Destroy one or multiple data container.

Description

This function destroys one or multiple container which have been created using m4MContainerCreate. Container consume memory resources of the server. You should therefore destroy any container the MATLAB application no longer needs!

Please have a look at container functions for an introduction to the container mechanism.

Syntax

m4MContainerDestroy(connection, containerHandle)
result = m4MContainerDestroy(connection, containerHandle)

Input Arguments

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

containerHandle defines the container handle(s) of the container that shall be destoyed. The argument must be of type uint32 and can be a 1x2 matrix or Mx2 matrix. The values are returned by the function m4MContainerCreate.

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: mlpiContainerDestroy

Copyright

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

m4MContainerGetData64

m4MContainerGetData64

m4MContainerGetData64

Container-Function: Get data from container raw data stream.

Description

This function converts a byte order of a tag list item in the container data stream into the corresponding variable data. The function handles data types logical, uint8, int8, uint16, int16, uint32, int32, uint64, int64, single, double and char. The function can convert scalar variables as well as 2D and 3D arrays of numeric and logical values. Variables of PLC type STRING must be a 1xL char array. In order to define the data type and size of the output argument data it has to be predefined prior to calling the function.

Note: If argument data is of type char and the string in the PLC variable has the length L, the trailing NULL will not be read from the stream as in MATLAB the trailing NULL is not needed. However, the function m4MContainerSetData will add the NULL termination in the container data stream.

This function does not support Code Generation.

Syntax

[data] = ...
m4MContainerGetData64(itemInfo, contStream, numItem, data)
[data, result] = ...
m4MContainerGetData64(itemInfo, contStream, numItem, data)

Input Arguments

itemInfo must contain the item information of the container. It must be read with the function m4MContainerGetItemInformation before using the function m4MContainerGetData64. The argument must be a Mx1 array of type MlpiContainerItemInformation.

contStream must contain the raw data of the container. It must be read with the function m4MContainerGetUdt before using the function m4MContainerGetData64. The argument must be a 1xN array of type uint8.

numItem defines the position of the item in the tag list of the container for which the data shall be read. The argument must be of type uint32.

data defines the type and size of the output argument of the function. The argument can be scalar, a 2D or a 3D array. The argument must be of type logical, uint8, int8, uint16, int16, uint32, int32, uint64, int64, single, double or char corresponding to the data type of the variable or data read from the MLPI target. If the data type is char the argument must be a 1xL array. The number of elements of data must be lower or equal to M4M_CONST.MEX_ARRAY_ELEMENTS_MAX.

Output Arguments

data contains the data from the container according to the predefined input argument data.

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 the output argument data will not be modified. 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

No reference in mlpiCore

Copyright

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

m4MContainerGetData

m4MContainerGetData

m4MContainerGetData

Container-Function: Get data from container raw data stream.

Description

This function converts a byte order of a tag list item in the container data stream into the corresponding variable data. The function handles data types logical, uint8, int8, uint16, int16, uint32, int32, single, double and char. The function can convert scalar variables as well as 2D and 3D arrays of numeric and logical values. Variables of PLC type STRING must be a 1xL char array. In order to define the data type and size of the output argument data it has to be predefined prior to calling the function.

If data is a 1xL char array all characters following a char(0) character in the contStream raw data stream will be set to char(0) to avoid arbitrary characters read from the argument contStream.

This function does not support data types uint64 and int64.

Note: If argument data is of type char and the string in the PLC variable has the length L, the trailing NULL will not be read from the stream as in MATLAB the trailing NULL is not needed. However, the function m4MContainerSetData will add the NULL termination in the container data stream.

Syntax

[data] = ...
m4MContainerGetData(itemInfo, contStream, numItem, data)
[data, result] = ...
m4MContainerGetData(itemInfo, contStream, numItem, data)

Input Arguments

itemInfo must contain the item information of the container. It must be read with the function m4MContainerGetItemInformation before using the function m4MContainerGetData. The argument must be a Mx1 array of type MlpiContainerItemInformation.

contStream must contain the raw data of the container. It must be read with the function m4MContainerGetUdt before using the function m4MContainerGetData. The argument must be a 1xN array of type uint8.

numItem defines the position of the item in the tag list of the container for which the data shall be read. The argument must be of type uint32.

data defines the type and size of the output argument of the function. The argument can be scalar, a 2D or a 3D array. The argument must be of type logical, uint8, int8, uint16, int16, uint32, int32, single, double or char corresponding to the data type of the variable or data read from the MLPI target. If the data type is char the argument must be a 1xL array. The number of elements of data must be lower or equal to M4M_CONST.MEX_ARRAY_ELEMENTS_MAX.

Output Arguments

data contains the data from the container according to the predefined input argument data.

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 the output argument data will not be modified. 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

No reference in mlpiCore

Copyright

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

m4MContainerGetHandlesOfContainer

m4MContainerGetHandlesOfContainer

m4MContainerGetHandlesOfContainer

Container-Function: Read the handles of all data container.

Description

This function returns the container handles of all container.

Syntax

[containerHandle]         = m4MContainerGetHandlesOfContainer(connection)
[containerHandle, result] = m4MContainerGetHandlesOfContainer(connection)

Input Arguments

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

Output Arguments

containerHandle contains the handles of all container. The argument is a Mx2 matrix of type uint32. The first column contains the connectionIDs and the second column the containerIDs. M is equal to the number of available container.

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: mlpiContainerGetHandlesOfContainer

Copyright

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

m4MContainerGetInformation

m4MContainerGetInformation

m4MContainerGetInformation

Container-Function: Get information about a MLPI container.

Description

This function reads the information as structure array from one or multiple MLPI container.

Syntax

itemInfo = ...
m4MContainerGetInformation(connection, containerHandle)
[itemInfo, result] = ...
m4MContainerGetInformation(connection, containerHandle)

Input Arguments

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

containerHandle defines the handle of one of multiple container. The argument must be of type uint32 and is a Mx2 matrix. The matrix defines the pairs of connectionID and containerID. The first column determines the connectionID and the second column the containerID. M must be smaller than the maximum number of container defined in M4M_CONST.

Output Arguments

itemInfo contains the information of the container. The argument is a Mx1 MlpiContainerInformation structure array with information about the container. M is equal to the number of container handles.

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: mlpiContainerGetInformation

Copyright

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

m4MContainerGetItemInformation

m4MContainerGetItemInformation

m4MContainerGetItemInformation

Container-Function: Get information about tag list items in a MLPI container.

Description

This function returns the item information of a container as array of structures. Each element in the array contains information about a single item within the container. This includes information about type, size and offset of the item within the container data stream. You can use this function to read information about the memory layout of the container data stream that is returned by m4MContainerGetUpdate_help.

Syntax

[itemInfo] = ...
m4MContainerGetItemInformation(connection, containerHandle)
[itemInfo, result] = ...
m4MContainerGetItemInformation(connection, containerHandle)

Input Arguments

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

containerHandle defines the handle of a container. The argument must be of type uint32 and is a 1x2 matrix returned by m4MContainerCreateSingle or m4MContainerCreate . The matrix defines the pair of connectionID and containerID. The first value determines the connectionID and the second value the containerID.

Output Arguments

itemInfo contains the information of the container. The argument is a Mx1 MlpiContainerItemInformation structure array with information about the container tag list items. M is equal to the number of tag list items in the container.

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: mlpiContainerGetItemInformation

Copyright

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

m4MContainerGetName

m4MContainerGetName

m4MContainerGetName

Container-Function: Read name of a single data container.

Description

This function reads the name of a single MLPI container. The name can be a char array with a maximum length of M4M_CONST.CONTAINER_NAME_MAX_LENGTH.

Syntax

[containerName] = ...
m4MContainerGetName(connection, containerHandle)
[containerName, result] = ...
m4MContainerGetName(connection, containerHandle)

Input Arguments

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

containerHandle defines the handle to access the container. The argument must be a 1x2 matrix of type uint32. The first element defines the connectionID and the second element the containerID as returned by the functions m4MContainerCreate or m4MContainerCreateSingle.

Output Arguments

containerName contains the name of the container. The argument is a 1xL matrix of type char.

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: mlpiContainerGetName

Copyright

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

m4MContainerGetNumberOfContainer

m4MContainerGetNumberOfContainer

m4MContainerGetNumberOfContainer

Container-Function: Read total number of data container.

Description

This function returns the total number of container created on a MLPI target. Also including container of other applications.

Syntax

[numContainer]         = m4MContainerGetNumberOfContainer(connection)
[numContainer, result] = m4MContainerGetNumberOfContainer(connection)

Input Arguments

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

Output Arguments

numContainer contains the total number of container. The argument is a scalar uint32 value.

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: mlpiContainerGetNumberOfContainer

Copyright

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

m4MContainerGetSingleItemInformation

m4MContainerGetSingleItemInformation

m4MContainerGetSingleItemInformation

Container-Function: Get information about a single tag list item in a MLPI container.

Description

This function returns the item information of a single item in a container. It returns information about type, size and offset of the item within the container data stream. You can use this function to read information about the memory layout of the container data stream that is returned by m4MContainerGetUpdate. This is similar to the function m4MContainerGetItemInformation. But only a single item is returned plus its tag description.

Syntax

[itemInfo] = ...
m4MContainerGetSingleItemInformation(connection, containerHandle,...
index)
[itemInfo, itemTag] = ...
m4MContainerGetSingleItemInformation(connection, containerHandle,...
index)
[itemInfo, itemTag, result] = ...
m4MContainerGetSingleItemInformation(connection, containerHandle,...
index)

Input Arguments

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

containerHandle defines the handle of a container. The argument must be of type uint32 and is a 1x2 matrix returned by m4MContainerCreateSingle or m4MContainerCreate . The matrix defines the pair of connectionID and containerID. The first value determines the connectionID and the second value the containerID.

index defines the index of the tag list item to be read. The argument must be scalar value of type uint32. Use the function m4MContainerGetInformation to read the number of available items in a container. Note: the index of the first tag list item is 0.

Output Arguments

itemInfo contains the information of the container. The argument is a scalar MlpiContainerItemInformation structure with information about the container tag list item.

itemTag contains the tag definition of the item. The argument is a 1xL char array.

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: mlpiContainerGetSingleItemInformation

Copyright

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

m4MContainerGetSingleTagList

m4MContainerGetSingleTagList

m4MContainerGetSingleTagList

Container-Function: Read tag list of a single data container.

Description

This function reads the tag list of a single MLPI container. The tag list can be a char array with a maximum length of M4M_CONST.MEX_CONTAINER_TAGLIST_LENGTH_MAX.

Syntax

[tagList] = ...
m4MContainerGetSingleTagList(connection, containerHandle)
[tagList, result] = ...
m4MContainerGetSingleTagList(connection, containerHandle)

Input Arguments

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

containerHandle defines the handle to access the container. The argument must be a 1x2 matrix of type uint32. The first element defines the connectionID and the second element the containerID as returned by the functions m4MContainerCreate or m4MContainerCreateSingle.

Output Arguments

tagList contains the tag list of the container. The argument is a 1xL matrix of type char.

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: mlpiContainerGetTagList

Copyright

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

m4MContainerGetTagList

m4MContainerGetSingleTagList

m4MContainerGetSingleTagList

Container-Function: Read tag list of multiple data container as cell array.

Description

This function reads the tag list of one or multiple MLPI container. The tag lists can be a char array with a maximum length of M4M_CONST.MEX_CONTAINER_TAGLIST_LENGTH_MAX. This function does not support code generation.

Syntax

[tagList] = ...
m4MContainerGetSingleTagList(connection, containerHandle)
[tagList, result] = ...
m4MContainerGetSingleTagList(connection, containerHandle)

Input Arguments

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

containerHandle defines the handle to access the container. The argument must be a Mx2 matrix of type uint32. The first column defines the connectionIDs and the second column the containerIDs as returned by the functions m4MContainerCreate or m4MContainerCreateSingle.

Output Arguments

tagList contains the tag lists of one or multiple container. The argument is a Mx1 cell array with 1xL char arrays in each cell.

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: mlpiContainerGetTagList

Copyright

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

m4MContainerGetUdt

m4MContainerGetUdt

m4MContainerGetUdt

Container-Function: Get update from read container.

Description

This function reads the data from read container.

Syntax

[containerData]         = m4MContainerGetUdt(connection,...
containerHandle)
[containerData, result] = m4MContainerGetUdt(connection,...
containerHandle)

Input Arguments

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

containerHandle defines the handle of the write container. The argument must be of type uint32 and is a 1x2 matrix. The row vector defines the pair of the connectionID and the containerID. The first value determines the connectionID and the second value the containerID.

Output Arguments

containerData contains the raw data from the container. The argument is a numeric 1xN array with raw data for the container. N is the containerSize returned by the function m4MContainerCreate. Each array element contains the raw data as uint8.

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: mlpiContainerUpdate

Copyright

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

m4MContainerSetData64

m4MContainerSetData64

m4MContainerSetData64

Container-Function: Set data to container raw data stream.

Description

This function sets the byte order of a tag list item in the container data stream. The function handles data types logical, uint8, int8, uint16, int16, uint32, int32, uint64, int64, single, double and char. The function can set scalar variables as well as 2D and 3D arrays of numeric and logical variables. Values for symbolic variables of type STRING must be 1xL char array. While L must be equal to the array length. The NULL termination byte will be added in the container data stream automatically. The container data stream must be predefined. Handle the type definition of the argument data with caution as a modification of the length may corrupt the byte order of the container data stream.

This function does not support Code Generation.

Important note: The user has to ensure that the definition of the input argument data matches the corresponding data on the MLPI target.

Syntax

[contStream] = ...
m4MContainerSetData64(itemInfo, contStream, numItem, data)
[contStream, result] = ...
m4MContainerSetData64(itemInfo, contStream, numItem, data)

Input Arguments

itemInfo must contain the item information of the container. It must be read with the function m4MContainerGetItemInformation before using the function m4MContainerSetData64. The argument must be a Mx1 array of type MlpiContainerItemInformation.

contStream defines the raw data of the container. The argument must be a 1xN array of type uint8. N must be the container size returned by the function m4MContainerCreateSingle. After setting the container raw data stream the stream can be send to the MLPI target using the function m4MContainerSetUdt.

numItem defines the position of the item in the tag list of the container for which the data shall be set. The argument must be of type uint32.

data defines the type and size of the data that will be set to the container raw data stream. The argument can be scalar, a 2D or a 3D array. The argument must be of type logical, uint8, int8, uint16, int16, uint32, int32, uint64, int64, single, double or char corresponding to the data type of the variable or data read on the MLPI target. The number of elements of data must be lower or equal to M4M_CONST.MEX_ARRAY_ELEMENTS_MAX. If the data type is char the argument must be a 1xL array. The trailing NULL will be added as element number L+1. Handle the predefinition of data with caution as an invalid data type or data size may corrupt other data in the raw data stream. The function doe not check if the data type or size of the argument data matches the corresponding data on the MLPI target.

Output Arguments

contStream contains the raw data for the container according to the input argument data and the predefined input argument contStream. The argument is a 1xN array of type uint8

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 the output argument contStream will not be modified. 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

No reference in mlpiCore

Copyright

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

m4MContainerSetData

m4MContainerSetData

m4MContainerSetData

Container-Function: Set data to container raw data stream.

Description

This function sets the byte order of a tag list item in the container data stream. The function handles data types logical, uint8, int8, uint16, int16, uint32, int32, single, double and char. The function can set scalar variables as well as 2D and 3D arrays of numeric and logical variables. Values for symbolic variables of type STRING must be 1xL char array. While L must be equal to the string length. The NULL termination byte will be added in the container data stream automatically. The container data stream must be predefined. Handle the type definition of the argument data with caution as a modification of the length may corrupt the byte order of the container data stream.

This function does not support data types uint64 and int64.

Important note: The user has to ensure that the definition of the input argument data matches the corresponding data on the MLPI target.

Syntax

[contStream] = ...
m4MContainerSetData(itemInfo, contStream, numItem, data)
[contStream, result] = ...
m4MContainerSetData(itemInfo, contStream, numItem, data)

Input Arguments

itemInfo must contain the item information of the container. It must be read with the function m4MContainerGetItemInformation before using the function m4MContainerSetData. The argument must be a Mx1 array of type MlpiContainerItemInformation.

contStream defines the raw data of the container. The argument must be a 1xN array of type uint8. N must be the container size returned by the function m4MContainerCreateSingle. After setting the container raw data stream the stream can be send to the MLPI target using the function m4MContainerSetUdt.

numItem defines the position of the item in the tag list of the container for which the data shall be set. The argument must be of type uint32.

data defines the type and size of the data that will be set to the container raw data stream. The argument can be scalar, a 2D or a 3D array. The argument must be of type logical, uint8, int8, uint16, int16, uint32, int32, single, double or char corresponding to the data type of the variable or data read on the MLPI target. The number of elements of data must be lower or equal to M4M_CONST.MEX_ARRAY_ELEMENTS_MAX. If the data type is char the argument must be a 1xL array. The trailing NULL will be added as element number L+1. Handle the predefinition of data with caution as an invalid data type or data size may corrupt other data in the raw data stream. The function doe not check if the data type or size of the argument data matches the corresponding data on the MLPI target.

Output Arguments

contStream contains the raw data for the container according to the input argument data and the predefined input argument contStream. The argument is a 1xN array of type uint8

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 the output argument contStream will not be modified. 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

No reference in mlpiCore

Copyright

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

m4MContainerSetName

m4MContainerSetName

m4MContainerSetName

Container-Function: Set name of a single data container.

Description

This function sets the name of a single MLPI container. The name can be a char array with a maximum length of M4M_CONST.CONTAINER_NAME_MAX_LENGTH.

Syntax

result = m4MContainerSetName(connection, containerHandle, containerName)

Input Arguments

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

containerHandle defines the handle to access the container. The argument must be a 1x2 matrix of type uint32. The first element defines the connectionID and the second element the containerID as returned by the functions m4MContainerCreate or m4MContainerCreateSingle.

containerName defines the name of the container. The argument must be a 1xL matrix of type char with L smaller than M4M_CONST.CONTAINER_NAME_MAX_LENGTH+1.

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: mlpiContainerSetName

Copyright

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

m4MContainerSetUdt

m4MContainerSetUdt

m4MContainerSetUdt

Container-Function: Write data to write container.

Description

This function writes new data to a write container.

Syntax

m4MContainerSetUdt(connection, containerHandle, containerData)
result = m4MContainerSetUdt(connection, containerHandle,...
containerData)

Input Arguments

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

containerHandle defines the handle of the write container. The argument must be of type uint32 and is a 1x2 matrix. The row vector defines the pair of the connectionID and the containerID. The first value determines the connectionID and the second value the containerID.

containerData defines the raw data for the container. The argument must be a numeric 1xN array with raw data for the container. N must be the containerSize returned by the function m4MContainerCreate. Each array element defines the raw data as uint8.

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: mlpiContainerUpdate

Copyright

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