News:

  • June 10, 2026, 05:27:19 AM

Login with username, password and session length

Author Topic: PD  (Read 12031 times)

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
PD
« on: February 20, 2018, 12:24:06 PM »
If I do not put "not c15" in rung 23, c15 stays "on". Why? does the PD command need to finish? C15 is not retentive. C0-C100 are set to non-retentive.
Is there a better way to increment V105 before leaving the stage?

C12 Goes "Off" when someone hits the stop PB and the cutting stops before it reaches the target. Looks like the rung activates before C15 Completes. So I added the "not c15".

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: PD
« Reply #1 on: February 20, 2018, 12:41:00 PM »
Is there supposed to be an attachment I'm not seeing?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: PD
« Reply #2 on: February 21, 2018, 06:08:44 AM »
whoops

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: PD
« Reply #3 on: February 21, 2018, 07:27:02 AM »
Interesting.  The issue is that without that NOT contact, stage S5 can transition via JMP within that first scan.  Since C15 is ON when S5 is disabled, the 2nd scan behavior of the PD that turns C15 OFF never runs (because S5 only ran 1 scan).

But WITH that NOT contact, S5 is guaranteed to run at least 2 scans, allowing the PD box to turn ON C15 that first scan, then turn C15 OFF on the second scan.

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: PD
« Reply #4 on: February 21, 2018, 07:41:42 AM »
Like Franji1 said, the PD has to reset the PD bit on the second scan.
So as long as one of your JMP statements will always be true inside that stage, then you could eliminate the one-shot altogether, and just place the INC on the first rung.
Otherwise, just place a RST C15 on the same rung as the INC.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: PD
« Reply #5 on: February 21, 2018, 10:29:26 AM »
I would place the INC V105 in parallel with the JMP to this stage, wherever it is. Then in this stage eliminate all the C15 stuff and the INC V105 of course. That way the stage just contains the three mutually exclusive JMPs.
An output is a PLC's way of getting its inputs to change.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: PD
« Reply #6 on: February 21, 2018, 01:48:24 PM »
Thanks, I moved the INC to the previous stage and eliminated the C12 and all that stuff. I put the INC on the same rung as the JMP command but just above the JMP command. I seen straight things happen putting jmp before any other command on the same rung. I thought everything was read and processed before the jmp happens? It has to do with the scanning?

posted example. just randomly picked a few things to explain what I am saying.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: PD
« Reply #7 on: February 21, 2018, 02:58:59 PM »
I seen straight things happen putting jmp before any other command on the same rung. I thought everything was read and processed before the jmp happens? It has to do with the scanning?

"JMP" is a logical term, not an actual GOTO.  So the actual instruction scan continues whether the JMP was executed or not.

All JMP really does is 2 things:
1. Disable the SG you are in (so a JMP S5 within SG S2 will turn OFF the S2 stage bit immediately), but the logic within S2 will continue for that current PLC scan
2. Enable the SG you are jumping to (so S5 will be set ON)

That's all JMPs do.  JMP does NOT affect the scanning within the current stage at all.

SGSET just SETs the bit for the S# in the SGSET.  SGRST just RESETs the bit for the S# in the SGRST.  Likewise, these do NOT affect the instruction scanning.

And, the magic of Stage, is that on the scan AFTER an ENABLED stage is DISABLED, TERMINATION LOGIC gets executed one time for all the instructions in the newly disabled Stage.  This is what makes OUT coils turn OFF, and other instructions "reset".

Note that the EXIT instruction DOES IMMEDIATELY EXIT by changing the instruction pointer to the end of the code-block.  So EXIT WILL "jump" logic.