News:

  • June 10, 2026, 09:08:29 AM

Login with username, password and session length

Author Topic: What would cause a stage program to only have one stage active...?  (Read 20461 times)

samuelgmaurer

  • Newbie
  • *
  • Posts: 8
What would cause a stage program to only have one stage active...?

One is "Always On, or Always True", and the second is where the program is stuck in a stage ...?
“All truths are easy to understand once They are discovered;
the point is to discover them” - Galileo

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: What would cause a stage program to only have one stage active...?
« Reply #1 on: November 25, 2013, 10:19:49 AM »
Stage S133 (invoked when the EStop is ON) resets everything except S0. You may look for that.
An output is a PLC's way of getting its inputs to change.

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: What would cause a stage program to only have one stage active...?
« Reply #2 on: November 29, 2013, 01:09:03 AM »
The jump instruction resets the stage bit of the stage in which it occurs. All rungs in the stage still
finish executing during the current scan, even if there are other rungs in the stage below the jump
instruction!

Try to give each timer it's own unique timer number.
Example:
1. Stage S43 transition to S44 when T2 timer is done.
2. S43 status bit is turned OFF.
3. T2 in S43 is still running until the end of the current scan.
4. S44 timer T2 now conflicts with T2 in S43 or any other active stage that has T2 in it.

Also the timer status bit for T2 will not reset as long as any of the T2 timers are running.

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: What would cause a stage program to only have one stage active...?
« Reply #3 on: November 29, 2013, 09:15:17 AM »
Add a little more:
The attached PDF file is from the Do-more software. The program runs. Only thing is that all the timers run at the same time. The problem is the early stages turns off but the timer is still running until the end of the current scan. The T0 timer will not reset when a JMP to a stage is evaluated.

The Do-more program poped up a warning of the use of the same timer number in multiple rungs. The DirectLogic software will not give you this warning.
« Last Edit: November 29, 2013, 09:37:29 AM by LWgreys »

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: What would cause a stage program to only have one stage active...?
« Reply #4 on: November 29, 2013, 09:36:22 AM »

After playing around and trying out things on the 260 I found that in stage programming that every instruction is still evaluated during each scan of the logic.
This is incorrect.
From DS5 help:
Quote
Stages are used in RLL PLUS programs to create a structured program, similar to a flowchart. Each program stage denotes a program segment. When the program segment, or stage, is active, the logic within that segment is executed. If the stage is off, or inactive, the logic is not executed and the CPU skips to the next active stage.

Study the Manual for your CPU (downloadable from AD). You will find a whole section devoted to stage programming that will help you to understand exactly how it works. Stages are a great thing when used properly, or they can be a nightmare when improperly implemented.
Circumstances don't determine who we are, they only reveal it.

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

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: What would cause a stage program to only have one stage active...?
« Reply #5 on: November 29, 2013, 09:40:57 AM »
I had to go back and fix the Test2 to show what is really happening.
The newly uploaded PDF is correct. Try running it.


Also I did read the manual.
He is what the DirectLogic manual it said with the JMP instruction:
The Jump instruction allows the program to transition from
an active stage which contains the jump instruction to
another stage which is specified in the instruction. The jump
will occur when the input logic is true. The active stage that
contains the Jump will be deactivated 1 scan after the Jump
instruction is executed.


Note the "deactivated 1 scan after the Jump instruction is executed".

In the TEST2.PDF I uploaded by the logic it should take 15 seconds to run once. Right?
Wrong! It runs in 5 seconds.

« Last Edit: November 29, 2013, 10:14:39 AM by LWgreys »

milldrone

  • Full Member
  • ***
  • Posts: 48
  • I'm changing my attitude to thumbs up
Re: What would cause a stage program to only have one stage active...?
« Reply #6 on: November 29, 2013, 11:13:41 AM »



. The active stage that
contains the Jump will be deactivated 1 scan after the Jump
instruction is executed.





To illustrate that what the manual says is correct try placing stage 2 at the top of the ladder then stage 1 with stage 0 at the end, the ladder will take 15 seconds to go from stage 2 to stage 2
« Last Edit: November 29, 2013, 11:15:37 AM by milldrone »
Vaughn

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: What would cause a stage program to only have one stage active...?
« Reply #7 on: November 29, 2013, 12:01:12 PM »
OOPs, Me wrong, me bad.
It's the do-more that does it. Simulator that is.
Have to plug in the Do-more plc to see if it does it also.
Sorry!

Ran the same logic on my test DL 206 and it would take one extra scan per stage to complete the logic even tho the T0 timer is running in each stage. The jmp would reset the timer on the next scan. Which add one scan to the timer of the next stage as the timer was reset after it was turned on from the previous scan. You can see this in the single scan test mode.
After running another test I removed the TMR from Stage S1. The program still will run and the counter still increments.
This shows that the T0 status did not reset during the jump to stage transition until the end of the current scan of the logic.

Something to watch-out for.
« Last Edit: November 29, 2013, 12:20:12 PM by LWgreys »

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: What would cause a stage program to only have one stage active...?
« Reply #8 on: November 29, 2013, 12:10:53 PM »
Did on more test.
Took the TMR out of the S2 stage and ran the program again.
It now just runs as if there is no timer as the timer in S0 stage never resets but all the stages are still running.

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: What would cause a stage program to only have one stage active...?
« Reply #9 on: November 29, 2013, 12:31:35 PM »
Yes the Do-more PLC does the same thing.
The program which should take 15 seconds to run, runs in 5 seconds.
But the DL 206 did run the same program in 15 seconds + 3 added scans.

LWgreys

  • Hero Member
  • *****
  • Posts: 117
Re: What would cause a stage program to only have one stage active...?
« Reply #10 on: November 29, 2013, 01:57:22 PM »
I have look for the stuck in a stage and still don't see one other than one of the control relays is set wrong.
I've done that put in a NC when I wanted a NO contact.
May be something with C6 and C10.
Are these two set by some other means like a display panel?

In my PLC program, I have multi-stages running simultaneous for a multi-tasking process which runs remote I/O. That's why I was writing about the timers. After four rewrites and 28 major changes and 24 minor fixes It runs like a champ.
Had my far share of hang-ups in testing and debugging the ladder logic.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6158
  • Yes Pinky, Do-more will control the world!
Re: What would cause a stage program to only have one stage active...?
« Reply #11 on: November 29, 2013, 10:54:11 PM »
Yes the Do-more PLC does the same thing.
The program which should take 15 seconds to run, runs in 5 seconds.
But the DL 206 did run the same program in 15 seconds + 3 added scans.



The issue is in how stage termination is run and how that affects the timer's reset. That's why we warn about using the same timer...you can get strange behavior. It might work as you expect if you were to call RSTT on the timer on the same rung as the JMP.
"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