Codesys #11: Move & Jump instructions in Codesys

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ส.ค. 2024
  • In this video, you will learn how to use the Move and Jump instructions in CODESYS using ladder logic.

ความคิดเห็น • 9

  • @kwagner49
    @kwagner49 ปีที่แล้ว

    Thank you. This is an extremely informative video.

  • @abdulwaheedrashid
    @abdulwaheedrashid ปีที่แล้ว +1

    Hello, thank you for the tutorials. It seems like if you activate PB1 before activating the Condiion contact, the program will not jump, so you have to first make sure that the condition contact is activated first. Is there a way around this?

    • @industrial_automation
      @industrial_automation  ปีที่แล้ว

      Hello Abdulwahed. That's right. Because as I explain in one of the comments for this tutorial Codesys and CPU starts to run the code each cycle from the first network to last one. Imagine we press first PB1. With the first network OP1 will be on. at the next network condition is not active, so this network will be run. the next 2 cycles will make op2 and op3 on. now we activate condition. As previous cycle first network will make op1 again on. then condition is active and cpu will jump to 4. Network and 3. Network will not be run. But the question is that why op2 is still on? That's on because of previous cycle. In the previous cycle pb1 was active and so op2 will be turned on. but this time this network will not be executed and nowhere else we have defined a code to turned it off again. So Answer to your question: the program jump but the op2 is activated from previous cycle. To see this better change the pb1 after condition network and use another contact. You will see this network will not be executed when the condition is on and what happened in previous cycle will remain.

  • @lizettenordstromstigdotter6059
    @lizettenordstromstigdotter6059 ปีที่แล้ว +1

    I would like more lessons in codesys. I dont have HDL section, (and no insert label...)I dont know how to get the icons inte the toolbar.

    • @industrial_automation
      @industrial_automation  ปีที่แล้ว

      Hi. With pleasure, I will make the Codesys Tutorial complete in the future.
      Which section do you mean HDL in Codesys???
      If you don't see the icon go from Tools to Customize, then from the tab Toolbar reset the toolbar to the default with the reset button at the right.

  • @filipvrljic7815
    @filipvrljic7815 ปีที่แล้ว +1

    #7.33 min when condition is on and PB1 is on,I understand why OP3 is on and why is OP2 is off. But why is OP1 on. It(OP1) has nothing to do with Jump block.

    • @industrial_automation
      @industrial_automation  ปีที่แล้ว

      CPU runs the codes from the first line to the last. (in ladder logic language from first network to the last one). When the condition is not activated, the first network will be executed --> PB1 is true so the OP1 will be turned on.
      second network CPU makes nothing because condition is not activated.
      CPU goes to the next network --> CPU sees PB1 is true so OP2 will be turen on.
      next network is executed also excactly like previous one and OP3 will be on.
      all these happen in 5 ms (according to the cpu cycle time can be more or less) so we think all the networks are executed simultaneously.
      now we activate the condition. --> cpu execute the first network --> PB1 is true so the OP1 will be true.
      next network --> condition is active and the code says to the CPU: Hey CPU ignore what is happenning and go to the network that the jump labe is :) so the network after that will not be executed and next step just network of jump will be run.
      this will be repeated next cycle and OP1 will be always on because it is before the jump network and it is not affected by this network. Try to replace this network after Condition and before jump network. you will see this time OP1 will not be on.

  • @endprg6477
    @endprg6477 2 ปีที่แล้ว +1

    And how is it on ST?

    • @industrial_automation
      @industrial_automation  2 ปีที่แล้ว +2

      When the training of all the functions and operators in the ladder logic language is finished, I will start the training in ST. But you can use these codes in ST for move and jump:
      Move:
      var2:= MOVE(var1);
      Jump:
      op1:=PB1;
      IF condition THEN
      JMP Jump;
      END_IF
      op2:=PB1;
      Jump: op3:=PB1;