PLC
TwinCAT 3:
In order to be able to use the functions of the Beckhoff Device Manager in a TwinCAT PLC program, the TwinCAT 3 PLC library Tc3_IPCDiag must be integrated into the TwinCAT project as reference.
The Device Manager offers a wide range of readable and partly writeable parameters. The available Device Manager parameters are organized in modules in the Configuration area. A module contains all the data for a specific topic, for example the CPU or the fans.
Since the available modules and their contents depend on the components available in the IPC, the list is generated dynamically – depending on which components the current IPC contains or which information types it supports. A module or a parameter therefore cannot be addressed via a fixed address. You first have to determine where exactly the module is located. In the Tc3_IPCDiag library this is done by the function block FB_IPCDiag_Register
. It identifies a register of all available information so that it can be easily accessed from then on. Normally, the function block only needs to be executed once at the beginning.
The function block FB_IPCDiag_ReadParameter
offers an extensive list of parameters, which are grouped according to their MDP area and modules, with the help of the E_IPCDiag_ParameterKey
enumeration.
Below is an excerpt from the enumeration containing more than 150 parameters:
Enumeration value | Comment |
---|---|
E_IPCDiag_ParameterKey.IPCDeviceName | IPC device name, STRING, read/write (MDP general area) |
E_IPCDiag_ParameterKey.CPU_Usage | CPU usage (%), UINT, read-only |
E_IPCDiag_ParameterKey.CPU_Temp | CPU temperature (°C), INT, read-only |
E_IPCDiag_ParameterKey.Fan_Speed | Fan speed (rpm), INT, read-only |
E_IPCDiag_ParameterKey.NIC_IPv4Address | IPv4 address, STRING, read/write |
E_IPCDiag_ParameterKey.TC_VersionBuild | TwinCAT build version, UINT, read-only |
A detailed description of the Tc3_IPCDiag library and easy access to the parameters and Device Manager modules can be found in the documentation of the TwinCAT 3 PLC library Tc3_IPCDiag. There you will also find the Samples chapter with programming examples for a quick introduction to using the PLC library.
Restricted access at the time of system start MDP forms an interface to the hardware. This is independent of TwinCAT. MDP can be accessed from TwinCAT with the PLC library. This is done internally by means of ADS communication. The versatility of the hardware configuration justifies a different initialization phase of the MDP service. It is possible that first PLC cycles are executed while the MDP initialization is not yet completed. |
TwinCAT 3: Previous library:
Update: Tc3_IPCDiag library The TwinCAT 3 PLC library Tc2_MDP is the predecessor to Tc3_IPCDiag. With the new Tc3_IPCDiag library the number of readable parameters has been increased and the user interface has been optimized. It is recommended to use the Tc3_IPCDiag library. |
A detailed description of the Tc2_MDP PLC library and all available function blocks through which TwinCAT 3 accesses the Device Manager modules can be found in the documentation:
- Function blocks of the TwinCAT 3 PLC library “Tc2_MDP” for IPC diagnostics
- Error codes of the TwinCAT 3 PLC library “Tc2_MDP” for IPC diagnostics
- The Tc2_MDP library examples cover the following use cases:
- Querying CPU data (generic)
- Querying the fan state (generic)
- Querying CPU data (specific)
- Reading IPC serial numbers
- Setting the IP address
TwinCAT 2:
A description of the corresponding TwinCAT 2 PLC TcMDP library can be found in the documentation entitled:
- Function blocks of the TwinCAT 2 PLC library “TcMDP” for IPC diagnostics
- Error codes of the TwinCAT 2 PLC library “TcMDP” for IPC diagnostics
- Examples for TwinCAT 2
Requirements
MDP version | Beckhoff Automation | Beckhoff BIOS |
---|---|---|
From version 1.0.7.6 | From v1.22.1.0 | From Q4/2013 |
MDP (Modular Device Profile) is the information model that TwinCAT uses to access the Device Manager data.