Announcement

Collapse
No announcement yet.

Productivity 2000 Timers/Coils staying "ON" or "TRUE"

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


  • Productivity 2000 Timers/Coils staying "ON" or "TRUE"

    Hello,

    I have been having trouble with a program I'm working on that has several very simple rungs of code. These rungs have a comparative contact at the beginning and an on-delay timer set to 1 second as the output instruction.

    The comparative contact is based on weights of a certain product. The contact goes "true" if the weight of tote A is "greater than" or "equal to" a desired value. If the contact is true, an on-delay timer set for 1 sec engages. After 1 sec completes the "Done" bit SETS a Pump Shutdown Bit.

    Now here is the problem...
    Today while testing this code, I intentionally adjusted parameters to mimic an overflow scenario to test if this Shutdown feature worked correctly. Good News is IT DID WORK! The Bad News is I couldn't RESET it. The timer stayed "ON" even though the comparative contact was "FALSE". Therefore, not allowing me to RESET the Shutdown Bit.

    Keep in mind...
    Directly below this rung, is another rung with a NO contact that is a RESET bit(linked to an HMI) that is used to RESET the shutdown bit if weight is below the shutdown value.

    Any ideas as to why this timer is staying engaged even though the contact controlling it is false?


  • #2
    If you could post a screenshot of your code, it would be easier for us to diagnose your issue.
    Why worry? If you've done the best you can, worrying won't make it any better

    - Walt Disney

    Comment



    • #3
      Here are a couple screenshots of my code. These shots show code for liquid 2 out of 4 liquids. All four liquids have the same code for each in different tasks. The first bit of code you see is the 'call task' . (to see the whole screenshot you may need to save it and view it from another window)

      The second bit of code is the actual task.
      What I was having trouble with was Rung 10. The comparative contact was 'false' and the timer did not reset. Therefore, not allowing me to reset the shutdown bit using Rung 13.

      Hopefully this is enough information to help solve this issue.

      Click image for larger version  Name:	P2000 Code 2.PNG Views:	0 Size:	6.0 KB ID:	124471Click image for larger version  Name:	P2000 Code 1.PNG Views:	0 Size:	33.3 KB ID:	124470
      Last edited by Jody Boehs; 08-06-2019, 08:13 AM.

      Comment



      • #4
        I can't make out the rung numbering

        Comment



        • #5
          When timers are included inside of tasks that are not running all the time, they can exhibit some strange behavior.
          Is this task stopping before the condition for the rung required is true?

          Comment



          • #6
            Originally posted by RogerR View Post
            When timers are included inside of tasks that are not running all the time, they can exhibit some strange behavior.
            Is this task stopping before the condition for the rung required is true?
            This is quite possibly the problem! It takes approximately 2-4 minutes to refill this tote. Now I know the PLC scans a lot faster than that. Its running this task multiple times during a refill cycle and the refill cycle may be ending when the PLC is running a different task.

            Any solution for this?

            Can I RESET the DONE bit on that timer at the end of the task? Since I have the 'pump shutdown bit' as a SET coil, this may work, correct?

            Comment



            • #7
              Originally posted by kewakl View Post
              I can't make out the rung numbering
              Sorry the rung numbers must have got cut off in the screenshot.

              Click image for larger version

Name:	P2000 Code 4.PNG
Views:	57
Size:	26.3 KB
ID:	124480

              Click image for larger version

Name:	P2000 Code 3.PNG
Views:	56
Size:	34.5 KB
ID:	124479


              Comment



              • #8
                I don't know if you can change the state of the time done bit with the task not running.

                The least dependent process would be to keep the task running until all the logic and timed out conditions required are met.
                Alternately add a C bit coil to the logic line that runs the task.
                Use this C bit in your future logic to turn on/off things when the task is not running.

                If there is more logic or timers than can be managed with one task, break it into more tasks.

                Comment



                • #9
                  it is hard for me to see what is exactly going on since the screenshots get smooshed so small, but it looks to me like your compare contact is in a main task, and it calls a sub task that does something specific like your overflow shutoff. If I had to guess, I would bet that you are exiting the task and no longer calling it after your set your shutoff bit on. Likely as the compare contact or something goes false. Then you have nothing that is removing the shutoff bits cause you are no longer calling the task that does that?

                  The timer done bit *should* go off when the task is done, but again timers can work really funny a lot of time in conditional tasks so that may not be the case for your code. This could be causing problems as well if the done bit is trying to stay on and keep "set"ing the shutoff bit.

                  Comment



                  • #10
                    Originally posted by RogerR View Post
                    I don't know if you can change the state of the time done bit with the task not running.

                    The least dependent process would be to keep the task running until all the logic and timed out conditions required are met.
                    Alternately add a C bit coil to the logic line that runs the task.
                    Use this C bit in your future logic to turn on/off things when the task is not running.

                    If there is more logic or timers than can be managed with one task, break it into more tasks.
                    So this C bit would be SET/RESET using the Call Task logic...and then I would use it as a NO/NC contact in the Task that is run by the Call Task logic, correct? (if that makes sense)

                    Do C bits turn off when the task ends?

                    Comment



                    • #11
                      Originally posted by Jody Boehs View Post

                      So this C bit would be SET/RESET using the Call Task logic...and then I would use it as a NO/NC contact in the Task that is run by the Call Task logic, correct? (if that makes sense)

                      Do C bits turn off when the task ends?
                      out coils turn off when their rung goes false, which should happen when a task is no longer active (except when timer bits are acting funny). If a bit was set, then it will stay on no matter what until it gets reset

                      Comment



                      • #12
                        Since this is a shutdown procedure I may just split it off into its own task that runs every scan. The fact that timers may behave oddly inside a task was a new thought for me. I learned something that will help in my future programming.

                        Thanks a lot for your help.

                        Comment

                        Working...
                        X