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

Pointers vs structure performance

fabou3377
2014-08-31
2014-09-03
  • fabou3377 - 2014-08-31

    Hi,

    what the better way in term of performance when we have 1 FB Master and n FB Slave and we need exchange information between them.

    1) Create a struture and pass it with a VAR_IN_OUT to master and slave FB

    2) Create a pointer parameter to master in the FB slave

    Thanks in advance.

     
  • shooter - 2014-09-02

    var in out means you will have a bigger structure.
    better one structure for out and another for Input.

    see w www.oscat.de w for functions to do communications.

     
  • Ralph Holz - 2014-09-03

    If you just compare the performance of data-transport then both methods are same, also the VAR_IN_OUT is a pointer to the data. With using the VAR_IN_OUT the compiler can checke if there is data connected, if the connected data type is correct, and there is absolutely no risk of pointing to wrong data (caused by a onlinechange).

    So my favorite is : VAR_IN_OUT

    If you where asking the same question in the V3 Forum you got more options (References + Interfaces) Which are defenitly also good ways to transfer "large" amounts of data with a good performance.

    Regards
    Ralph

     

Log in to post a comment.