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