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

Newbe need help to understand memory usage in Codesys

sundbergad
2016-10-08
2016-10-12
  • sundbergad - 2016-10-08

    Hi guys, I'm new to this tool Codesys and is trying to create a plc system as the client and a pc as the server/controller of the PLC.
    We have inherited an old 800M PLC system and I like to update and convert it into cheaper systems like AC500.

    Today, the system sends a ascii message to the plc and there it is parsed out using case .. of.
    Now to my problem, I have multiple physical I/O's to controls ie valv/rods to handle and from the case I call to the valv/rod nr to execute.

    I've created a function block using CFC. and a input-variable to call. Global variables for global usage

    The message (Telegram) is read, if any exists every 500ms,
    The total executiontime for functionValv() is 70 sec.

    After 60 sec I want to place another call to prepare execution of other programs/functions
    first call |----------------------------------------------------||-----other exec----|
    sec call |---------------------------------------------------||---

    In my CASE steg OF
    1:
    functionValve( en:=Enabled, parameterArray:= parameters);

    2:
    functionValve( en:=Enabled, parameterArray:= parameters);
    ...

    OR
    functionValv1:functionValv();
    CASE steg OF
    1:
    functionValve1( en:=Enabled, parameterArray:= parameters);

    2:
    functionValve2( en:=Enabled, parameterArray:= parameters);
    ...

    OR
    funcArray[1] := functionValv1;
    funcArray [2] functionValv2;

    CASE steg OF
    1:
    funcArraysteg;
    2:
    funcArraysteg;
    ....

    Now my question is,
    What would be the working and best way to create the calls?

    /anders

     
  • sundbergad - 2016-10-09

    Hi to myself

    I've managed to resolve my problem, as to understanding that:
    I can have one implementation of my function block and

    I've also understood that I have to make input assignment to make a controlled usage, ie I'm creating my own datatype, make variables and configure them on startup and modify during runtime and use as input on function calls.

    What I don't understand sofar is how the memory usage is for my instances above. Will I run out of memory a.s.o.
    Time will tell

    /a

     
  • rickj - 2016-10-12

    If the platform is PC based you are swimming in a vast sea of bytes and will take quite some time before you reach any shore.

     

Log in to post a comment.