Sample22: Automation Device Driver (ADD): Access DPRAM

This article describes how to implement a TwinCAT 3 C++ driver which acts as a TwinCAT Automation Device Driver (ADD) accessing the DPRAM.

Download

Here you can access the source code for this sample:

https://github.com/Beckhoff/TC1300_Samples/tree/main/S22-ADD

Notice

Configuration details

Read the configurations details below prior to the activation.

1. Open the zip file that it contains in TwinCAT 3 by clicking on Open Project ….
2. Select your target system.
3. Build the sample on your local machine (e.g. Build->Build Solution).
4. Note the actions listed on this page under Configuration.
5. Activate the configuration by clicking Sample22: Automation Device Driver (ADD): Access DPRAM 1:.
The sample is ready for operation.

Description

This sample is intended to switch the Link Detect bit of the network adapter (i.e. of an CX5010) cyclically on and off.

The C++ module is connected to the NOV/DP-RAM device via the PciDeviceAdi interface pointer of the C++ module.

Configuration

To make the sample work, the hardware addresses must be configured to match your own hardware.
Check the PCI configuration:

Sample22: Automation Device Driver (ADD): Access DPRAM 2:

To check whether the communication with NOV/DPRAM is set up correctly, use the DPRAM (Online) view:

Sample22: Automation Device Driver (ADD): Access DPRAM 3: