This example shows how data can be exchanged between a CODESYS controller and
other processes by means of shared memory.
In the sample project, data from a CODESYS controller is shared with other processes
by means of shared memory. The CODESYS package includes additional implementation examples
in C (Linux), C# (Windows), and C++ (Windows).
The CODESYS package includes the following examples:
The project uses shared memory to read and write data with the SysShm library.
The DataExchange structure is used for data exchange. Values from shared memory
is read to the variable deInstRead. The variable deInstWrite is used for
writing values to shared memory. The values of deInstWrite are changed in each cycle.
The values of both variables are displayed in the visualization.
The following examples read the value of deInstWrite and write to the variable deInstRead:
C program for Linux to read and write data be means of shared memory
C++ program for Windows to read and write data be means of shared memory
C# program for Windows to read and write data be means of shared memory
The application SyncExample shows how data can be read and written synchronously via shared memory.
C++ program for Windows for synchronized reading and writing of data via shared memory.
In this example the data exchange is done by the application SyncExample.