Sample22: Automation Device Driver (ADD): Access DPRAM

This article describes how to implement a TC3 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.

Note

Configuration details

Read the configurations details below prior to the activation.

1. Unpack the downloaded ZIP file.
2. Open the zip file that it contains in TwinCAT 3 by clicking on Open Project ….
3. Select your target system.
4. Build the sample on your local machine (e.g. Build->Build Solution).
5. Note the actions listed on this page under Configuration.
6. Activate the configuration by clicking on 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: