Juliencr (Customer) asked a question.

A better way to programme an emergency stop on Productivity PLC

I'm programming a test bench with the help of a grafcet and I'm trying to find a way to programme an emergency stop that will deactivate all steps at the same time. I don't want to add a contact at each step to deactivate them since I have a 100 to 150 step. I try to find a way with UDS (user defined structures) or array without success. Did someone have a solution to my problem?


  • Juliencr (Customer)

    Hi Durallymax and everyone. here's my conclusion.

     

    The most flexible solution that I try is with an array. I will put every step of every subprogram in the array. The first thing to do is to add a "Fill array" function for every step you want to activate with a "first scan bit". For each step after that, you do a "rotate array" if following each other in the array. If not, do a "fill array" to the proper step and another one to delete the old one.

    • Array test final
    Selected as Best
  • Adisharr (Customer)

    Consider using an integer for your step instead of bits that way you can just write a 0 into your 'step' and that will reset them all.

    step_exampleYou'll need to use a compare contact in front of each step since you're using an integer.

    Expand Post
  • Todd Dice (Customer)

    Never tried this, but what if you placed all your code in a "Run When Called" task, and have your emergency stop call the task when the emergency stop is not pressed?

    • Durallymax (Customer)

      The outputs in the task will retain their states which can be problematic if not accounted for.

    • Juliencr (Customer)

      Love the simple solution, but you cannot call a task from a called task and also I find the "call task " not flexible enough. When your task is done you cannot send it somewhere else. it has to be the rung after the call task function and it's really a pain for program organization. Maybe for a simpler program.

  • bcarlton (Customer)

    If you do this check that outputs controlled within the task are turned off, if that is what your response to an emergency stop requires. While hazardous motion devices ​should be stopped external to the PLC watch which outputs are still on when exiting the emergency stop condition.

    • Juliencr (Customer)

      Yes, I have an external relay that stops the actuators, but I still need a way to tell the program to stop the program at any step and return to the first step.

  • Durallymax (Customer)

    Are they unique steps(only one on at a time)?

    If you have 100-150 steps, I'd be building the sequencer into an array and mapping the outputs that way but the key is the current step. Make 1 your all stop step and write that into the current step when e-stop is set. If it needs to resume previous step, store that somewhere but don't let it go back until estop is reset AND operator has a secondary acknowledgement.

    Expand Post
    • Juliencr (Customer)

      No, I have about 3-10 tasks running at the same time depending on where I'm at in the program.

       

      I did some tests and I got this simple program. I can't test it right now since I don't have the PLC near me. What I can understand is I need a second array at each step to déactivate the previous one. And I would not need the subrung to maintain and deactivate the step.

      • Array test
      • Durallymax (Customer)

        If I understand correctly, there are 150 steps, but they are not sequential and multiple may be used at the same time?

         

        Without knowing the system it's hard to speculate. I break sequencers down into sections that can interoperate and haven't ran into too many situations where that didn't work on some level.

         

        Example, a cleaning process master sequencer that controls the cleaning step. Within each step, different valves are used depending on the circuit selected. This is determined in the valve sequencers. Each step may have it's own specific sequence to follow.

         

        Below is a basic framework. The outputs are mapped as Bit of Word and a pin chart created in excel to generate the integers and provide better documentation. It compromises readability to create better readability IMO. Debugging is easier and its less messy IMO. However, once steps are a bit more randomized, pointing it to the right steps can add a layer of complexity. I have not run into many situations like that, but would use some sort of array to hold where the sequencer should be pointed to at the conclusion of its current step.

        I put everything in one task for screenshot, but generally the filling of the arrays is done elsewhere along with the math and other conditionals to determine what is moved into them. The entire sequencer fits into three rungs regardless of size. The rest is just mapping outputs, conditionals and set points which are very easy to scale and keep track of.

         

        Screenshot 2022-02-15 111020

        Expand Post
10 of 12