Jump to a process

Inna
2020-12-10
2020-12-10
  • Inna - 2020-12-10

    Hello,
    I am new to Codesys Ladder programming. We are converting our Ladder application to Codesys LD. Our application has several processes. Each process handles different subjects. Each process is activated by a Jump To Subprocess element - see the attached file
    I'm looking for a way to implement the same thing (jump from a process to a different process ) with Codesys LD.

    Thanks

     

    Last edit: Inna 2020-12-10
  • i-campbell

    i-campbell - 2020-12-10

    I am not 100% sure what your JSP does. It is either labels or boxes. Labels will jump and not come back. Boxes will jump and then return.
    Labels
    Right click the rung and 'Insert Label'.
    To jump to the label, either Ctrl+L or drag a Jump from the Toolbox>General>Jump.
    Box with EN/ENO
    Right click your PRG in the Tree. Select Add Object > Method
    In the PRG either Ctrl+Shift+E, or drag your new method from Toolbox>POUs>

     
    πŸ‘
    2
  • Inna - 2020-12-10

    Thank you very much for your response.
    It seems that Box object does match our needs.
    Some additional questions:
    1.What is the pros of using a Method for defining an additional "process" over a POU ?
    2.Can I use an empty Box instead of Box with EN/ENO?
    Thank you, again.

     
  • i-campbell

    i-campbell - 2020-12-10
    1. There are no pros one over the other. Yes, you can use either.
    2. You cannot use a Box, because in Ladder, all elements need a boolean in and a boolean out. If the first VAR INPUT and first VAR OUTPUT of your POU or Method is a BOOL, then you can use a Box. In this case, it will be called every scan regardless of the rung state.
     
    πŸ‘
    1

Log in to post a comment.