Brktman (Customer) asked a question.

I need help with an off delay timer code issue.

I am trying to keep an output on for a few seconds after a sensor turns off the output. I added a delay timer and thought that would work in keeping the output on for a few seconds after the sensor is tripped. The delay happens but only delays the time to the next step in the drum. I want to keep the output on not delay the next step in the drum. What am I missing and doing wrong?Screenshot (48)


  • Todd Dice (Customer)

    I tried to zoom into your image and it just blurs. Are you attempting to control Y105 within and out of the drum instruction? If so, that's not a good idea. Use a C bit in the drum and use it in a N.O. contact and your timer's contact in an "OR" branch to operate the Y105 output. I would also recommend making the Y105 not a Set/Reset output.

  • Brktman (Customer)

    Screenshot (52)I'm only trying to control Y105 outside the drum. If I use a NO contact along with an OR branch, won't Y105 reset when either one of those are true, not both? I need the contact- which is a through beam sensor- to trip, then wait a few seconds before it resets Y105 to off.

    This should be easier to see above..

    Expand Post
    • Todd Dice (Customer)

      1. I see Y105 as output 9 in the drum image, so even though you're not doing anything with it in the drum instruction, it's not good practice to include it in the drum.
      2. Change your step 7 duration to 1, so when you're at step 7 it's the timer taking over the time at that step and not the step 7 duration value.
      3. If 5000ms is a "must be" time frame, change timer T2's SetPoint to 4999.
      4. Just realized your T2 needs to be ON-delay, and you'll need to latch a C-bit to have it time when you trigger your prox.
      5. You're just have to experiment more to get the process you wish to do.
      Expand Post
  • Garry (Customer)

    +1 @Todd Dice (Customer)​ 

    The following code should do what you require.

    Click Off Delay Code SampleYou will see that the through-beam sensor sets the C1 bit. This bit is then used to start an on-delay timer for the duration that you want.

    Once the timer expires, the conveyor (Y015) and C1 are reset.

    I hope this helps you out.

    Regards,

    Garry

    https://accautomation.ca/series/click-plc/

     

     

    Expand Post
    • Brktman (Customer)

      Awesome, thank you! That makes sense to use the C bit to turn on with the through beam then use an ON delay instead of the Off delay like I was trying. This also has to return to the drum at step 8 after the T2 is complete. Is the red mark the proper location to accomplish this?

       

      I still have to clean up the drum and remove Y105 and another output that has been removed. I used timed output in the drum to operate Y105 in the previous program.

      Screenshot (56)Screenshot (56)_LI

      Expand Post
      • Todd Dice (Customer)

        @birktman I'd change the compare from Equal to Greater Than, so if the drum is at any step above 7 it will reset as long as the timer is timed out.

  • Brktman (Customer)

    Thanks guys. This should help with an issue I’m having still. The X004 is being used as a bag sensor. The issue I’m encountering is the bag is still in front of the sensor at step 1 of the drum. There is only a short period where X004 is not true (probably between step 2 and 3). I suppose I could change the order of drum but then it would start out of the proper sequence. Is there a way to render X004 inactive until what is now step 7 (which sounds like Todd’s suggestion because it would be in the reset until step 7), would I still need to reorder the drum still for that solution?Hopefully I explained that well enough.

     

    Expand Post
    • Todd Dice (Customer)

      Without knowing the process you're attempting to control, I can only guess and give suggestions. You could add a compare condition to the Y105 SET so the X4 contact is limited to a certain point in your drum.

       

      Another suggestion I have is describe "what" the sensor does in addition to what type it is. For example, "Reflective sensor detects bag." It adds additional clarity to what the things do.

      Expand Post
  • Brktman (Customer)

    It is a bag opener and sealer. There’s an actuator with a cylinder that has suction cups attached. Cylinder extends grabs a bag and retracts, actuator turns 180 and cylinder extends pushing bag against additional cups. Cylinder retracts again to open bag (step 7 in drum). Product is dropped in via conveyor- activated by x004, bag gets closed by x003 and stopping conveyor. Sealer bars extend sealing the bag. While bag is sealing, machine is in the process of grabbing another bag via actuator turning etc. This is step one of the drum.

     

    The problem is the cups once in while don’t pull a bag down. So that’s why I’m trying to add the bag sensor reflective x004. And use it to start the conveyor. Then use the through beam x003 to stop the conveyor after contents flow past.

     

    So the issue is the bag is still being sensed (x003 reflective) while the drum resets at step 1 because it is in the process of being sealed and still detected. Hopefully it’s clearer now. Let me know if I left out anything critical.

    Expand Post
10 of 22