ALucas (Customer) asked a question.

How to implement a Pause Button and a Clear Button Feature into a BRX Code

Hello!

I am trying to implement a Pause Button and a Clear Button Feature to my current BRX PLC project. The project currently has a timer (OFFDTMR function) that counts down for a user defined time, during which time it has an output be triggered on connected to a VFD.

We want the pause button to be able to pause the timer when pressed, and the clear button to be clear the timer/ stop the task. I am using a BX-DM1E-10ED13-D BRX PLC and a EA3-T6CL C-more Micro HMI that the buttons will be pressed on.

Any ideas?

Thank you for your help in advanced!

Adam L


  • Garry (Customer)

    Hi @ALucas (Customer)​,

    Here is a quick demo using the BRX simulator.

    BRX pause timer downX1 is the pause

    X2 is the clear (Causes the ACC to go to 0 and output on.)

    X3 is the reset.

    Note: The HMI will have internal memory bits.

     

    I hope this helps you out.

    Regards,

    Garry

    Expand Post
    Selected as Best
  • ALucas (Customer)

    Hello Garry!

    Where are the Clock Pulse bits located? Also would I want to use the down counter for this or up/down counter?

    • Garry (Customer)

      Hi @ALucas (Customer)​ 

      The pulse bits are located at the following:

      ST3 - 1 Minute

      ST4 - 1 Second

      ST5 - 100 ms

      ST6 - 50 ms

      Since you are replacing the OFFDTMR, I would use a down counter so they would function simarly.

      Regards,

      Garry

      Expand Post
  • PouchesInc (Customer)

    Personally, I would do it with a standard timer function built into the BRX, and when the "pause" button is pressed it would copy the timer's current time (accumulator in Do-More speak?) to a memory address and then the pause button bit itself would block power flow to the timer turning it off. When the pause button is turned off on the panel, power would be able to flow to the timer again and it would turn on, and when the pause bit goes down copy the stored current time back to the timer's data.

     

    A clear button would just reset the pause bit and whatever bit turned the timer on in the first place, and also copy a 0 to the stored time memory location.

    Expand Post
    • ALucas (Customer)

      I thought to try this as well, but the memory doesn't take a "Snap Shot" of the time left, it will continue to go down along with the actual time value

  • Garry (Customer)

    Hi @ALucas (Customer)​,

    Here is a quick demo using the BRX simulator.

    BRX pause timer downX1 is the pause

    X2 is the clear (Causes the ACC to go to 0 and output on.)

    X3 is the reset.

    Note: The HMI will have internal memory bits.

     

    I hope this helps you out.

    Regards,

    Garry

    Expand Post
    Selected as Best
    • ALucas (Customer)

      Thank you so much! when I have time will implement this and update you on this!!

    • ALucas (Customer)

      I implemented this code bocks into my program and it works great on the sim! Now im trying to have the C-more trigger the X1 Bit on the BRX but every time i press the button/ switch on the C-more, it flashes for a moment and reverts back to the off position. Any thoughts on what im doing wrong?

      • PouchesInc (Customer)

        X bits are for physical inputs and Y are for physical outputs. You should not ever and often times cannot control them from a button on a HMI. You need to control C bits, and write logic that passes the bit state of the C bit to the logic or output that you want.

      • ALucas (Customer)

        I've tried using the control bits, but they only stay on for about 40ish seconds then turn off again, resetting the program

10 of 14