How to enter both boxes *and* jumps inline in an LD?

2010-06-07
2010-06-17
  • oliver.gramberg - 2010-06-07

    I use CoDeSys 2.3.9. When I enter a conditional jump in the FBD editor like this:

         +----+
         | EQ |
    in---|    |--->>label
     0---|    |
         +----+
    
    ```and then let CoDeSys transform the POU from FBD to LD, I get this:
    

    |                         +----+
    |                         | EQ |
    +---  (empty rung)  ------|EN  |
    |                    in---|    |--->>label
    |                     0---|    |
    |                         +----+

    ```which looks perfect to me.
    I just cannot seem to enter the same in the LD editor manually:
    - When I start with the box and want to add a jump at the box's output, the menu entries for jumps are greyed out.
    - When I start with the jump, adding a box to the jump puts the box in parallel to the jump, not in front of/as the input to the jump, like this:

    |---  (empty rung)  -+--->> label
    |                    |    
    |                    |    +----+
    |                    |    | EQ |
    |                    +----|EN  |
    |                    in---|    |---
    |                     0---|    |
    |                         +----+
    

    (Of course, I can assign the output of the box to a temporary and then jump on that temporary in the next network, but I need it to be in one network only.) Who can help?

     
  • shooter - 2010-06-08

    you are correct in observation, however when converting it looks fine but does not work, it will not jump.

    there is a work around

    make your own EQ block like BLEQ as a pou (functionblock)

    make sure the output is bool and this you can insert into ladder

    test it with a coil parrallel.

    however i still think jumps are bad practice in ladder.

    yes i know siemens and others are full with them.

     
  • oliver.gramberg - 2010-06-17

    Hi shooter,

    thanks for your answer!

    when converting it looks fine but does not work, it will not jump.

    At least in simulation mode, it works for me. I don't have any hardware, so I cannot test.

    make your own EQ block like BLEQ

    Lacking any answer from 3S, this may well be the way to go.

    jumps are bad practice in ladder.

    I totally agree - jumps are bad practice anywhere. I only allow certain arrangements of jumps to emulate an "IF" as available in Structured Text.

    -Oliver

     
  • shooter - 2010-06-17

    if statement is possible with the enable input.

    and in ladder off course.

     

Log in to post a comment.