Distributed Control & Automation Framework (DCAF)

cancel
Showing results for 
Search instead for 
Did you mean: 

DCAF Shared Memory Module Documentation

Highlighted

Overview

 

Link DCAF items to Linux shared memory.

 

Description

 

Writes latest value to, and reads latest value from, Linux shared memory on the same NI Linux RT target as the engine in which the module resides.

 

Configuration of the Shared Memory Module

 

 Steps before Configuration

 

  • Add the DCAF Shared Memory Module to the system configuration (right-click "<EngineName>" >> Add >> Other >> Shared Memory)
  • Create Tags that you wish to use to form the Mappings between Linux shared memory and DCAF (example: Scan Engine >> Import from Project >> Generate Tags).

Configuration

 

Left-click on the Shared Memory module. In the "Channel Configuration" tab, select desired "Available Tags," then move them to/from the shared memory mapping.

 

note: tag direction (read/write) will determine which shared memory mapping is possible (example: From Shared Memory).

 

Shm01.JPG

 

 

Save the configuration. If shared memory will be used to communicate tag data with a C/C++ application, a C header file can be generated to facilitate future configuration changes. It is recommended to download the Linux Shared Memory and DCAF Example (available on LabVIEW Tools Network) as a starting point for C and LabVIEW IPC.

 

 

Shm02.JPG


 Source Code Design

 

The DCAF Shared Memory module maps Linux shared memory to the DCAF tag data engine. It relies on DCAF for memory allocation and data dictionary indexing in LabVIEW, and relies on the NI Linux RT IPC, NI Linux RT Utilities, and NI Linux Errno LabVIEW Libraries for Linux shared memory, timing, and Linux error translation duties. These libraries are available as open source collaborations on the NI Systems Engineering GitHub at:

 

https://github.com/NISystemsEngineering/LinuxRT-IPC

https://github.com/NISystemsEngineering/LinuxRTUtilities

https://github.com/NISystemsEngineering/LinuxRTErrno

 

 

Shm03.JPG

Figure 1. Generate Memory Allocation.vi: Translating DCAF configuration channels by data type and channel classification.

 

 

Shm04.JPG

Figure 2. initialize runtime lines.vi: Pass DCAF configuration channels' data dictionary indices to shared memory runtime.

 

 

Shm05.JPG

Figure 3. init data cluster.vi: Create Linux shared memory and bundle pointer and configuration information.

 

 

Software Requirements

 

  • LabVIEW 2014 or later

 

Limitations

 

  • Does not provide for multiple file names per channel data type and direction (example: "Voltages" DBL analog input file, "Currents" DBL analog input file, etc.)
  • Does not automatically import tags from other modules (i.e. Scan Engine module).
  • Shared memory created with a default size of one page (4096 bytes).

 

Installation

 

Install the Shared Memory Module directly from VI Package Manager.

 

Support

 

Please report any issues with this module on our Github repository.

 

You may also post here with questions.

 

Visit Collaborating on the Development of DCAF to learn how to contribute your own improvements to this module directly.

 
Thanks,
Lee Harding
National Instruments
 
0 Kudos
Message 1 of 1
(2,280 Views)