I'm trying to access this memory with a C# application, but I get "Unable to Find Specified File". I suspect that Codesys and/or Visual Studio code alters the name I choose? Being in Windows, I cant find a way to see the mapped memory list.
~~~
using (var mmfRead = MemoryMappedFile.OpenExisting("CodesysDataShare",MemoryMappedFileRights.ReadWrite))
~~~
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In Windows I need create shared memory in PC software and connect from CODESYS.
If shm is not GLOBAL doesn't work due different users between runtime and PC software.
PC software need admin privileges. Name need "Global\\" before key.
Very unsafe!!!
If CODESYS create shared I cannot find key PC side.
In Linux I can create shared memory as standard user, bind in the runtime docker, use keys without any "Global\\".
Much more safe!!!
If CODESYS create shared you need play with permissions to use app as standard user. I prefer create form PC software as standard user.
Last edit: mondinmr 2024-01-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got the shared memory example. I'm pretty sure I'm successfully created a memory space, CreateResult returns 18.
I'm trying to access this memory with a C# application, but I get "Unable to Find Specified File". I suspect that Codesys and/or Visual Studio code alters the name I choose? Being in Windows, I cant find a way to see the mapped memory list.
~~~
using (var mmfRead = MemoryMappedFile.OpenExisting("CodesysDataShare",MemoryMappedFileRights.ReadWrite))
~~~
In Windows I need create shared memory in PC software and connect from CODESYS.
If shm is not GLOBAL doesn't work due different users between runtime and PC software.
PC software need admin privileges. Name need "Global\\" before key.
Very unsafe!!!
If CODESYS create shared I cannot find key PC side.
In Linux I can create shared memory as standard user, bind in the runtime docker, use keys without any "Global\\".
Much more safe!!!
If CODESYS create shared you need play with permissions to use app as standard user. I prefer create form PC software as standard user.
Last edit: mondinmr 2024-01-30