Overview
This example, based on the Distributed Control and Automation Framework (DCAF), illustrates data sharing between C/C++ and LabVIEW applications, running in parallel on NI Linux RT hardware targets, using Linux shared memory. The LabVIEW Real-Time (LVRT) application example creates Linux shared memory as the interface to other processes.
Description
This example demonstrates how C and LVRT applications can share scanned single point data from hardware I/O of NI Linux RT CompactRIO (cRIO) hardware using Linux shared memory. The example LabVIEW Real-Time (LVRT) application uses NI Scan Engine on NI CompactRIO (cRIO) for scanned hardware I/O data access, and creates Linux shared memory as the interface to other processes. The LVRT application uses the Distributed Control and Automation Framework (DCAF), and implements a semaphore Linux IPC mechanism as a timing signal to enable synchronous execution of a complimenting example C application.
Requirements
Hardware
- NI CompactRIO 906x or 903x*
* The project can be modified to use any NI Linux RT target.
Software
- LabVIEW 2014 or later
- LabVIEW Real-Time Module
- NI CompactRIO Driver, version 16 or later
Steps to Implement or Execute Code
The DCAF Linux Shared Memory example, as well as supporting components can be installed directly from VI Package Manager.
Instructions for the example can be found at: Linux Shared Memory and DCAF Example
Additional Information or References
DCAF Shared Memory Module Documentation
Linux Shared Memory and DCAF Example Tutorial
Linux RT Utilities
A Match Made in Memory - C/C++ and LabVIEW RT Inter-Process Communication on NI Linux RT (NIWeek 2017 Session)