Samples

The following samples are available for the TwinCAT PLC Library Modular Device Profile.

Sample - Read access to MDP elements

This example offers an introduction to the handling of the function blocks that are available with the TcPlcMDP library.

This example is dedicated to the goal of determining the state of the Compact Flash card in the Embedded PC.
This can be found out via a parameter in the MDP Model. The querying of other parameters takes place analogously to this example.
Hence, this example can also be considered to be a guide to querying any MDP parameter from an MDP module.

Step-By-Step description of this example

Download:
TcPlcMDP_Sample.zip

Sample2 - Write access to MDP elements

This example shows that the write access to MDP elements can be implemented similarly.
In this sample a new IP address is configured. First the DHCP is deactivated and then a new IP address is set.

Download:
TcPlcMDP_Sample2.zip

Sample3 - Query of a module via two ways

This example shows two different ways to get information out of the MDP module CPU.

1. Request of the MDP module CPU with the specific function block.
2. Special request of single MDP elements out of the MDP module CPU with the general function block FB_MDP_ReadElement.
    Request of any possible element out of the MDP modules is possible in the same manner. Adaptation to another element is very easy! All available elements can be requested with this function block.

Samples 1:

For Sample3 the PLC library version 1.2.0 or higher is required.

Samples 2:

The CPU temperature is only available since MDP version 1.5.0. Also this parameter is not supported by every hardware.

Download:
TcPlcMDP_Sample3.zip

Sample4 - Query of complete modules with the specific function blocks

This example shows the easiest access to several MDP modules. Therefor the specific function blocks are used.

Samples 3:

For Sample4 the PLC library version 1.3.0 or higher is recommended.

Samples 4:

Download:
TcPlcMDP_Sample4.zip