CODESYS Shared Memory - Article no.000019
Shared Memory
The shared memory can be used
to exchange data within a target system when no direct
communication is possible, e.g. the data exchange with an external
visualization.
How to create this shared memory and how to read and write to it is shown in
this example.
Product description
Two applications are used for
demonstration. Both must run on one target device.
The first one creates a shared memory and writes some values into it and the
second one reads from it.
Whenever direct communication
within a target system is not possible, shared memory
can be used to exchange data.
More information
Write_App: This application
creates a shared memory object and writes
some strings into the memory.
Read_App: This application
tries to open the shared memory and read the data
in two different ways. On the one hand a data string of a given size is read.
On the other hand, the pointer to the first element is fetched and incremented
until
the "End of Text" sign is reached. Afterwards the Memory is
deleted.
Both applications have to be
downloaded to the target device, by "Multiple Download"
or a separate download from each application.
To open a second CODESYS
Control, open the Windows "Start menu". Go to "CODESYS Control
Win V3"
and open the "CODESYS Control Win V3". This is now running next to
"CODESYS Control Win Sys Tray".