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.

PLC 1:

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.
Either the possible error outputs as well as timeouts of the function blocks from the library can be reacted and a new query can be triggered or the queries are executed deliberately delayed after the system start.
It is recommended in the PLC program not to query values from the MDP immediately after the system start, but to consider a small waiting time. How large this should be depends on various parameters (such as the performance of your control computer), and can therefore not be given as a general rule. Typically it is in the range of 10-60 seconds.

TwinCAT 3: Previous library:

PLC 2:

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.
Future extensions will no longer be performed in the Tc2_MDP library. It is not recommended to use the Tc2_MDP library for new projects. All functionalities of the Tc2_MDP library can also be found in the new 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:

TwinCAT 2:

A description of the corresponding TwinCAT 2 PLC TcMDP library can be found in the documentation entitled:

Requirements

MDP version

Beckhoff Automation
Device Driver

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.