I would like to use Shared memory to exchange data between CodeSys and C++ app. However, I realized the speed of communication is very slow.
Every 50ms, I write data from C++ to memory and Codesys read it, but Codesys missed data in some period cycle.
Does anyone know how speed of this kind of exchange data using shared memory? Please help me, I would very appreciate and welcome your helps.
Thank you,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made my code based on this example, but speed communication is very slow.
Can I use UDP to exchange data between C++ and PLC? What library should I use? I see that there are many library such as CAA net base, SysSocket,...
Best regards,
PHUC
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
I would like to use Shared memory to exchange data between CodeSys and C++ app. However, I realized the speed of communication is very slow.
Every 50ms, I write data from C++ to memory and Codesys read it, but Codesys missed data in some period cycle.
Does anyone know how speed of this kind of exchange data using shared memory? Please help me, I would very appreciate and welcome your helps.
Thank you,
Hi,
we need more Information:
On which plc are you doing this?
This should work way faster.
BR
Edwin
Hi Mr. Edwin Schwellinger,
I use Codesys Control RTE SL which is in following link:
https://store.codesys.com/codesys-contr ... __store=en
Anyway, could you please let me know which is fastest way to exchange data between PLC and C++ applicaiton?
Best regards,
Mr. PHUC
Hi,
yes ok should be way faster....
Are you using this example here?
https://store.codesys.com/shared-memory ... tml#System Requirements
BR
Edwin
Hi Mr. Edwin,
I made my code based on this example, but speed communication is very slow.
Can I use UDP to exchange data between C++ and PLC? What library should I use? I see that there are many library such as CAA net base, SysSocket,...
Best regards,
PHUC
Hi vmphuc,
I have done the similar project for share memory with VB. net, as my cycle time is about 10ms. And data will not lost.
to have this kind of share memory or udp data exchange is also depend how you structure the data you want to exchange.
You can always have a practice that also have a fix length data to transfer, then you can have a fast cycle time to exchange data.