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

How can I use the MOVE operator in INSTRUCTION LIST in Codesys?

2021-06-19
2021-06-19
  • gabrielragnark

    gabrielragnark - 2021-06-19

    Hello, Im trying to use de MOVE operator with instruction list but im not being very successful, someone know how to use that?

    I want to move 30 or 40 seconds to the timer.PT, I took a screenshot so u guys can see

    (Sorry If I posted in the wrong forum)

     
  • gabrielragnark

    gabrielragnark - 2021-06-19

    I want to do that but in IL

     
  • Fless

    Fless - 2021-06-19

    in the help for 3.5.10 is an example.
    No, idea why it's not in newer help versions.

    https://help.codesys.com/webapp/_cds_operator_move;product=codesys;version=3.5.10.0

     
    • aliazzz

      aliazzz - 2021-06-19

      Instruction List (IL) is officially deprecated from the latest IEC61131-3 norm (3rd edition 2013). CODESYS v3.5 merely supports it for backwards compatibility.

      https://plcopen.org/status-iec-61131-3-standard
      See chapter "deprecated".

      This means you use it at your own risk and it is not recommended to develop new software in this language. It is also advised to phase out any old IL code and replace it for an implementation in another language.

       
      • gabrielragnark

        gabrielragnark - 2021-06-19

        Hello Aliazz, im using IL just for studying, so I think its OK, but, thank you for the advice!

         
    • gabrielragnark

      gabrielragnark - 2021-06-19

      Thank you Fless, Appreciated it!

       
  • gabrielragnark

    gabrielragnark - 2021-06-19

    I was doing here, but how can I put a initial value in var1? for example, IF i want 30 seconds i would press a button (an open contact in ladder) and the timer would go to 30 seconds, and if i press 40 seconds it will go to 40.

    Because I have to declare var1 as a time variable, so I cant set it to true or false, then everytime it will change to 30 seconds, but I wanna do a option that the person could change to 40 seconds or 30.

     
  • gabrielragnark

    gabrielragnark - 2021-06-19

    It will change instantly, but I want like a open contact that I can close to move the value to the .pt, is it possible in instruction list?

     
  • i-campbell

    i-campbell - 2021-06-19

    you will have to JMPC code which you dont want to call.

         LD   xVar1
         JMPC skip
         LD   var2
         ST   var3
    skip: 
    
     
  • gabrielragnark

    gabrielragnark - 2021-06-19

    If xVar1 is true, then will jump to skip? and If false will continue doing the var2 load and var3 store?
    And I will have to do a subroutine to put in the skip?

     

Log in to post a comment.