RSLOGIX TON DN bit not changing

jaiiyer

Member
Join Date
Dec 2022
Location
Vancouver
Posts
9
Hi,
I am using the DN bit to stop the timer. However the DN bit doesnt change state. Please see the attached image. Any help is appreciated.

TON DN bit.png
 
Your timer bit will go done for one scan when it reaches 300 seconds, but it will immediately reset and start timing again with your inclusion of the XIO of the same timer DN bit in series with the TON.
 
Hi, thanks for the reply.
but wouldnt on the next scan cycle the output on first rung go low. which will make the second and third rung low as well?
 
Thank you.. Yes you are right.

But when OTE Carton_ZN09.Motor_AutoStart on Rung 1 goes high it makes the OTE Carton_ZN09.Motor_Run go high which runs the motor.

then the timer starts because of
XIC Carton_ZN09.Motor_AutoStart and XIC Carton_ZN09.PEC_Clear and
XIO Carton_ZN09.Stop_Tmr.DN

when the timer reaches 300 then for the next scan cycle the Carton_ZN09.Stop_Tmr.DN will go high.

That should open the XIO Carton_ZN09.Stop_Tmr.DN on Rung 1.

which should drop the OTE Carton_ZN09.Motor_AutoStart to "0"

which should open XIC Carton_ZN09.Motor_AutoStart on Rung 3 stopping the timer and

also should drop OTE Carton_ZN09.Motor_Run which stops the motor. But the motor doesnt stop.
 
I think you have a fundamental misunderstanding of how to use a PLC.

What you think you are telling it that it 'should' do isn't what you are telling it 'to do'.

The PLC will flawlessly execute the logic you input into it, every time.
It's not about what the program should be doing, it's about what it is actually doing.

Why do you expect the .dn to stop the timer?

Why is it on Rung 0 and Rung 2?

What exactly are you trying to do here?
 
When the PLC behaves not as you expect it to, the fundamental and critical trick to debug PLC behavior, is to always, always, always assume it behaves exactly as you told it to.

The way to implement that trick is to assume that something is wrong with your expectation, and finding the flaw there.

  1. Your timer bit will go done for one [the first] scan [cycle] when it reaches 300 seconds, but it will immediately reset and start timing again with your inclusion of the XIO of the same timer DN bit in series with the TON.
  2. Hi, thanks for the reply.
    but wouldnt on the next [second] scan cycle the output on first rung go low. which will make the second and third rung low as well?
  3. Yes, but what happens on the third scan cycle?
TL;DR

First of all, the [XIO Carton_ZN09.Stop_Tmr.DN] on the third rung is unnecessary and can be removed, because

  • if it evaluates to True, then the third rung is dependent on the evaluation of [XIC Carton_ZN09.Auto_Start], which can only be True if the previous evaluation of [XIO Carton_ZN09.Stop_Tmr.DN] was True on the first rung, and
  • if it evaluates to False, then the third rung is already False, because Carton_ZN09.Auto_Start must be 0 from the first rung, which means the [XIC Carton_ZN09.Auto_Start] on the third rung evaluated to False.
But the motor doesnt stop.
Are you sure about that?

Would you know the motor stopped* if it stopped for only one scan cycle of one, or just a few, milliseconds?

* Of course the motor would not physically stop, but Carton_ZN09.Motor_Run could become 0 for only one scan cycle without noticeably affecting the motor, don't you agree?

Does Carton_ZN09.Stop_Tmr.ACC approach 300000 and then reset to 0?

  1. If Carton_ZN09.Stop_Tmr.DN becomes 1 on the third rung during scan cycle N,
  2. then on the second scan cycle N+1, everything happens as you expect: .Auto_Start and .Motor_Run both become 0; but note that, after the .Motor_Run bitbox becomes 0 on the first rung, that the .Stop_Tmr will also be reset on that same scan (N+1), which will return .Stop_Tmr.DN to 0.
  3. Then on the the third scan cycle N+2,
    1. .Motor_AutoStart becomes 1 on the first rung because the [XIO .Stop_Tmr.DN] evaluates to True when .Stop_Tmr.DN is 0, and
    2. then .Motor_Run becomes 1 on the second rung because [XIC .Motor_AutoStart] evaluates to True,
      1. because .Motor_AutoStart is now 1 from the first rung, and
    3. then the timer starts again, after being reset on the previous scan (N+1), because [XIC .Motor_AutoStart] evaluates to True,
      1. because .Motor_AutoStart is now 1 from the first rung.
 
I think you have a fundamental misunderstanding of how to use a PLC.

What you think you are telling it that it 'should' do isn't what you are telling it 'to do'.

The PLC will flawlessly execute the logic you input into it, every time.
It's not about what the program should be doing, it's about what it is actually doing.

Why do you expect the .dn to stop the timer?

Why is it on Rung 0 and Rung 2?

What exactly are you trying to do here?

+1.

Watch the first few entries of this video series: https://www.youtube.com/watch?v=T3tnXu-Eywc&list=PLB1ACAF773A15BFB1

Pay particular attention to when Ron talks about the scan cycle.
 
Also note that, if the motor is running and the TON timer on the third rung has not expired, AND then Carton_ZN09.PEC_Clear becomes 0, then the motor will continue to run (i.e. Carton_ZN09.Motor_Run and Carton_ZN09.Motor_Run will both remain 1) and the TON timer will be continually reset so its .DN will never become 1.
 
It may make it easier to read, or perhaps not, but the attached image below is a more compact version of OP's logic, with one exception: the XIC CARTON_LINE_ENABLE has been removed and it is assumed that it evaluates to True.

One other observation: the ORed pair of XIOs BST XIO Carton_ZN08.PEC_Clear NXB XIO Carton_ZN09.PEC_Clear NXB ... on the first branch are probably unnecessary as they can neither start anything that is not already started, nor stop anything that is not already stopped.

TON DN bit.png
 
good stuff. if this is not a homework assignment and if you are interested, tell us what you are trying to achieve, because I am fairly certain it can be done much more concisely and clearly.
 
I am at a site. The program was written by someone else who is not with the company any more. So i was trying to decipher why the motor doesnt stop. It doesn't because of the XIC bit Carton_Stage_Boxes_OFF_Delay.DN keeps it running. Thats what the requirement of the process is.
 

Similar Topics

Hi, I'm just looking for a simple way to make a button in excel (via VBA I presume) to toggle a bit in RSLogix 5000. I just got FactoyTalkLinx...
Replies
9
Views
548
How do i use the TON command to monitor the number of hours something stays on for? what would the preset value be in this case? Or is there...
Replies
12
Views
4,509
Hi, So I have one push button(non-latch momentary) and would like use it to trigger two function sequences with the short press for primary...
Replies
3
Views
2,002
How can I add the "Go To..." function to the RSLogix 5000's Standard Toolbar?
Replies
9
Views
3,597
I am using RSLogix Emulate 5000 to test my program. There are several timers in my application. Whenever I run my program, ACC in one of the TON...
Replies
6
Views
4,550
Back
Top Bottom