Information model
Modules – categorization of hardware and software information
The Beckhoff Device Manager categorizes various hardware and software data in an information model via modules.
- A module categorizes several pieces of hardware and software information in logical groups, e.g. CPU, mainboard, TwinCAT.
- The Device Manager automatically generates modules on system startup based on the actual IPC hardware and software. Modules therefore do not have a static address but a dynamic address, which is generated when the Device Manager is started, based on the identified hardware and software of the IPC.
- A module contains several tables that subdivide the hardware and software information for respective modules into logical subgroups. Each module contains at least one "Header" table containing general information on the module, plus at least one data table.
- A particular entry in the table is addressed via its subindex.
The following information is required to read specific data via the Device Manager:
- The (dynamic) address of the table containing the required information. A table can be addressed via a unique address.
- The SubIndex within the table representing the desired information (e.g. CPU temperature).
For PLC programming convenient function blocks are available, which facilitate access to the required data (see samples for PLC programming). The following information on addressing can therefore be skipped for PLC programming.
Finding the address of a table
To read a particular piece of hardware or software information via the Device Manager it is necessary to determine its precise position in the information model, based on the index of the surrounding table and its subindex.
Index:
The index of the table consists of 16 bits and is configured as follows:
0x | a | nn | x |
Hex preamble | Area code (4 bits) | Module ID (8 bits) | Table ID (4 bits) |
Area code (4 bits): describes which area this address should address.
Module ID (8 bits): clearly identifies the dynamic position of the respective module and is automatically generated by the Device Manager at system startup. It can be determined by querying the table 0xF020 (Device Area).
Table ID (4 bits): identifies the table within a module.
Depending on the area used, the module ID and the table ID may be consolidated, e.g. for the Device Area, which does not have any modules.
SubIndex:
The subindex for a required piece of information can be found in the list of available modules (Configuration Area).
Example
In this example the NIC module is to be addressed for reading the IP address of the network card (NIC). Remember: Device Manager modules are generated automatically based on the actually available hardware and software. In table 0xF020 of the Device Area a list of all automatically generated modules can be queried. Each row in this table represents a module, consisting of the respective module type in the high word and the dynamically created module ID in the low word. The content of table 0xF020 may look as follows, for example:
SubIndex | Value | Description |
---|---|---|
0 | 5 | Number of entries in this table |
1 | 0x 000C 0000 | Module "Memory" |
2 | 0x 000B 0001 | Module "CPU" (core 1) |
3 | 0x 000B 0002 | Module "CPU" (core 2) |
4 | 0x 0002 0003 | Module "NIC" |
The value returned to SubIndex 4 consists of the searched module type "NIC" (0x0002) in the high word and the dynamic module ID (0x0003) in the low word. Since the list is sorted based on the dynamic module IDs, the dynamic module ID always corresponds to the subindex minus one.
The complete index is now configured as follows, based on the scheme mentioned above:
0x | a | nn | x |
0x | 8 | 03 | 1 |
| Area code (in this case: Configuration Area) | Module ID (results from the table 0xF020) | Table ID (1 = NIC properties) |
The properties of the network card are therefore stored at address 0x8031. According to the specification of the NIC module, the IP address of the network card can now be read under address 0x8031 at its subindex 2. The return value corresponds to one of the defined data types.