No announcement yet.

DMD Help topic DMD0512 SGSET does what?

  • Filter
  • Time
  • Show
Clear All
new posts

  • DMD Help topic DMD0512 SGSET does what?

    (help version
    I'm pretty sure there is a mistake in said help topic, and I know this is not really the place to report that, but incase I'm just having a brain fart maybe someone can explain how I'm reading it wrong.

    (emphasis added) It is important to note that when this instruction is executed, it does NOT cause an immediate move to the target stage; it simply disables the stage containing this instruction and enables the target stages. This means that any ladder logic instructions between this instruction and the end of the stage will still be executed
    Well, that just seems like a simple error, but the next paragraph doubles down on that:

    "The effect of this instruction will occur the next time the affected stages are normally processed as part of the CPU's scan. When a stage becomes disabled, on the next scan the disabled stage executes Termination Logic where Output (OUT) coils are turned OFF and Timers are reset."

    I actually tried it in the simulator, and then remembered the example for CTAXDYNP where they use SGSET in a stage that needs to stay enabled for the CTAXDYNP.

    Oh! I guess I'm a bit slow (and this forum needs a strikeout attribute), I failed to read the first line in the topic (about 6 times):
    " Unlike the Jump To Stage (JMP) instruction, it does NOT disable the current stage."
    But I'm still wondering if there is any possible way to parse the first bits I quoted that would match reality?

    Speaking "end of stage" I'm not entirely clear on what defines the end of a stage, and related, were/how can one mix regular execute every scan ladder with stages?

    [S1] 'assume disabled
    if something [JMP S2]
    does this "rung" get executed as part of the regular scan ? or is part of the (disabled) S1?

    Remember the old IF - END IF in BASIC (or the much less ambiguous ";" in C)

    Last edited by Tinker; 03-14-2019, 11:34 PM.

  • #2
    That will be fixed in the next version. Good catch!
    There are 10 kinds of people in this world, those who know binary, and those who do not.