<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Shared Memory Requested Size</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6d22cd0607/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6d22cd0607/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/6d22cd0607/</id><updated>2024-07-04T16:29:56.518000Z</updated><subtitle>Recent posts to Shared Memory Requested Size</subtitle><entry><title>Shared Memory Requested Size</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6d22cd0607/?limit=25#5e9b" rel="alternate"/><published>2024-07-04T16:29:56.518000Z</published><updated>2024-07-04T16:29:56.518000Z</updated><author><name>viktorr</name><uri>https://forge.codesys.com/u/viktorr/</uri></author><id>https://forge.codesys.com9190fc68c64f300017be2c6d7a3acacb7f7b754a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Derek,&lt;br/&gt;
I recognize this is an older post, but i was wondering if found any ways to remedy this. I am running into what i think is the same problem you had here.&lt;/p&gt;
&lt;p&gt;Thank you in advance for any information,&lt;br/&gt;
Viktor&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Shared Memory Requested Size</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6d22cd0607/?limit=25#853b" rel="alternate"/><published>2024-07-04T16:29:53.301000Z</published><updated>2024-07-04T16:29:53.301000Z</updated><author><name>viktorr</name><uri>https://forge.codesys.com/u/viktorr/</uri></author><id>https://forge.codesys.coma15b17c6e213248a3faef9ae178e447b015f0e51</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Derek,&lt;br/&gt;
I recognize this is an older post, but i was wondering if found any ways to remedy this. I am running into what i think is the same problem you had here.&lt;/p&gt;
&lt;p&gt;Thank you in advance for any information,&lt;br/&gt;
Viktor&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Shared Memory Requested Size</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/6d22cd0607/?limit=25#131d" rel="alternate"/><published>2022-04-06T05:52:39.224000Z</published><updated>2022-04-06T05:52:39.224000Z</updated><author><name>dchiu</name><uri>https://forge.codesys.com/u/dchiu/</uri></author><id>https://forge.codesys.com1ece8604fdd704b29561cad345beb90f620c0e90</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have encountered an issue trying to establish stable communication between CODESYS and a C++ process under CODESYS Linux SL.&lt;/p&gt;
&lt;p&gt;I followed the shared memory example provided on CODESYS store and was able to read/write into a shared memory created by an external C++ process. &lt;/p&gt;
&lt;p&gt;However when I tried to scale the application up with multiple named shared memory, problem occurs with some of the shared memory size. &lt;br/&gt;
Multiple shared memory were created using POSIX shm_open()in C++, and has no problem when reading and writing by multiple processes without CODESYS. However as soon as CODESYS is started,  CODESYS SysSharedMemoryOpen2() will cause unexpected behavior for a certain shared memory size.&lt;/p&gt;
&lt;p&gt;For example, if I have 2 shared memory reads, shm1 and shm2. shm1 would behave perfectly, but shm2 will display ulSize=0 (declared to be size 48 in the program) as soon as the PLC goes into RUN state. &lt;br/&gt;
When I checked in /dev/shm for the problematic shared memory size, the shared memory size seems to be normal(48 as allocated). pResult of the CODESYS SysSharedMemoryOpen2() yields no error as well(ERR_OK 16#00)&lt;/p&gt;
&lt;p&gt;This problem only occurs occasionally in Linux SL 4.2.0, I could allocate a larger memory size than necessary(100)and the application would work sometimes. &lt;/p&gt;
&lt;p&gt;I tried to remedy this by updating the PLC to 4.4.1. Now the problem occurs every single time and cannot be worked around by adjusting with pulSize parameter. &lt;/p&gt;
&lt;p&gt;Has anyone encountered something similar?&lt;br/&gt;
Is there any suggestion on solving this problem?&lt;/p&gt;
&lt;p&gt;Thank you for your time&lt;br/&gt;
Derek&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>