Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Speed communication of shared memory solution between CodeSYS and C++

vmphuc
2018-04-24
2018-07-11
  • vmphuc - 2018-04-24

    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,

     
  • eschwellinger

    eschwellinger - 2018-04-24

    Hi,
    we need more Information:
    On which plc are you doing this?
    This should work way faster.
    BR
    Edwin

     
  • vmphuc - 2018-04-26

    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

     
  • vmphuc - 2018-05-02

    Edwin Schwellinger hat geschrieben:
    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

     
  • johnlee - 2018-07-11

    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.

     

Log in to post a comment.