RE: Scan time.
Hello @Martin PLCnext Team# ,
Would you mind to jump into this conversation?
I am implementing an algorithm to be uploaded on a PLCnext AXC F 2152. I am developing the main program as my main ST editor and some other functions generating the demanded information and data. Reducing my computation time, I am trying to divide the main code into four different submodules and then I am going to call each module once the triggering condition will be satisfied. I am going to define a scan time of, lets say, 60 [ms] for the main program (ST code). It means that each module have to have a scan time lower than 15 [ms] which is the ideal situation for me. Wrt the brief intro, I just wondering to know, how can I assign the scan time in my ST code in the way that each submodule will own it's own individual scan time. I need to have a timing table to assign priorities to my sub modules.
Thank you so much for your attention,
Best regards,
Mehran.
Would you mind to jump into this conversation?
I am implementing an algorithm to be uploaded on a PLCnext AXC F 2152. I am developing the main program as my main ST editor and some other functions generating the demanded information and data. Reducing my computation time, I am trying to divide the main code into four different submodules and then I am going to call each module once the triggering condition will be satisfied. I am going to define a scan time of, lets say, 60 [ms] for the main program (ST code). It means that each module have to have a scan time lower than 15 [ms] which is the ideal situation for me. Wrt the brief intro, I just wondering to know, how can I assign the scan time in my ST code in the way that each submodule will own it's own individual scan time. I need to have a timing table to assign priorities to my sub modules.
Thank you so much for your attention,
Best regards,
Mehran.
Comments
Will this do what you need?
Thank you for your response.
Yes it seems that I can add different cyclic with the probability of having one instance for each. Although it would works for me if I could wrap up everything in a single worksheet, question is that if it's worth to separate everything in individual ST worksheets? I mean speed wise.
Best regards,
Mehran.
Note:
--- I can not use the "Eclipse Plug-in" for this project.
--- I would rather to use commands instead of building 100 cyclic tasks in the "task and event environment".
--- Everything have to be implemented in ST code.
Best Regards,
Mehran.
It seems like one requirement is that the project must be developed entirely in Structured Text, or at least in an IEC 61131-3 language, so unfortunately no C++ or C#.
There is no concept of "threads" in the IEC 61131 specification (as far as I know), and the closest we can get in PLCnext Engineer is Execution and Synchronisation Manager instances, which run on different cores, and so effectively represent parallel threads of execution. Even though each ESM represents a single execution thread, it is possible for higher priority tasks to interrupt lower priorty tasks within the same ESM.
I am not sure what you mean by "queues" in this case - a task queue would be difficult to implement in PLCnext Engineer, but it might be possible to implement a simpler data queuing mechanism depending on the requirements of the project.
It would be worth talking to the technical experts in your local Phoenix Contact office, who (depending on where you are) are likely to be able to give you advice on how to structure a PLCnext Engineer project to meet specific application requirements.