Announcement

Collapse
No announcement yet.

JMP instruction

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • JMP instruction

    When I JMP to a stage further down a program, what happens to Out coils in the stage?

    In sample below, when X0 turns on does Y0 stay on, or is there blip in the output? What about when X0 turns off?

    Code:
    // Rung $Main#1
    SG $Main.S0
    
    // Rung $Main#2
    OUT Y0
    
    // Rung $Main#3
    STR X0
    JMP $Main.S1
    
    // Rung $Main#4
    SG $Main.S1
    
    // Rung $Main#5
    OUT Y0
    
    // Rung $Main#6
    STRN X0
    JMP $Main.S0
    Last edited by TheGreatMarklar; 06-21-2019, 12:17 PM. Reason: removed //Offset lines


  • #2
    In a reverse JMP with the OUT instruction, yes, there will be a single scan when the output is off. In a forward JMP, it will not. If that is a problem, use SET/RST. We debated whether to try to prevent that, but it would have greatly increased the complexity of the implementation. Given that there was an alternative with SET/RST, we chose KISS.

    X0 affects when the transition between stages occurs, but doesn't affect the termination behavior.

    Comment



    • #3
      OK. What about with internal coils? If C0 is turned off by a stage JMP, what happens in logic between the JMP from stage and the JMP to stage?

      Comment



      • #4
        Originally posted by TheGreatMarklar View Post
        OK. What about with internal coils? If C0 is turned off by a stage JMP, what happens in logic between the JMP from stage and the JMP to stage?
        Basically the same behavior as Y. When a stage is disabled, termination for that stage will be executed on the following scan. The OUT instruction's termination code writes the element off, so the element will be off between the terminated stage and the enabled stage. The OUT behavior may not be acceptable for all cases, so don't hesitate to use SET/RST if you are concerned.

        Comment



        • #5
          Am I correct in that in the DL processors the termination action took place during the next scan after a JMP?
          thePLCguy

          Bernie

          Comment



          • #6
            Originally posted by bcarlton View Post
            Am I correct in that in the DL processors the termination action took place during the next scan after a JMP?
            Not sure. Didn't have access to Koyo's implementation. That is the way ours works though.

            Comment



            • #7
              Originally posted by bcarlton View Post
              Am I correct in that in the DL processors the termination action took place during the next scan after a JMP?
              That is correct Bernie.
              If you have an urgent issue, please contact AutomationDirect's Technical Support team.

              AutomationDirect.com Technical Support: 1(800) 633-0405 or (770) 844-4200 Email Tech Support

              Comment

              Working...
              X