1FixAll (Customer) asked a question.

Can Do-more software move the .acc of a counter to another location at 23:59:58 every day?

I need to keep track of daily product by moving the count just before midnight and reset the counter fot the next day. I do this in PLC5, SLC500 and Contrologixs but able to figure out how to do it in Do-More H2 processor.


  • HOST_franji1 (HOST Engineering)

    SEE GARRY'S POST BELOW!

     

    The 3 equal to contacts make sure the time is correct (but it will be that for 1 whole second), so you need to make it an "event" (vs. straight power-flow based) to do the MOVE.

     

    That's what the Leading Edge One-Shot on Powerflow contact does - it creates a ONE SHOT based on the POWER FLOW, not a specific element (i.e. not an edge triggered element contact).

     

    CopyCountAcc1

    Expand Post
  • ADC_PLC_ENG (AutomationDirect)

    Copy and paste the following in the global search at the top of this page.

     

    FAQ-Do-more-What-instruction-is-best-for-moving-copying-data

     

    right click and open the image in a new tab to expand for visibility.

     

    Just as FYI our knowledge articles can be searched via the global search field..

    Expand Post
  • Garry (Customer)

    Yes, the Do-More software can do this for you.

    Domore real time move and reset counter

    In the above code the accumulator will be transferred to D0 (32 bit location) and then the counter accumulator will be set to 0. The copy command is a one shot. You will see the triangle on the enable line of the instruction.

    I hope this helps you out.

    Regards,

    Garry

     

    https://accautomation.ca/series/brx-do-more-plc/

    Expand Post
    • HOST_franji1 (HOST Engineering)

      Like. The edge trigger on the COPY does not require an edge contact. Also, resetting in the same COPY is good (missed that in my post).

    • HOST_franji1 (HOST Engineering)

      FYI: need to change UDT0 to SDT0 to use the actual realtime clock (System Date Time block, not User Date Time block), so SDT0.Hour (aka $Now.Hour), etc.

  • 1FixAll (Customer)

    I put the logic in and it does not move the data. Not sure why.

    • HOST_franji1 (HOST Engineering)

      Is your logic in $Main or another code block (that may not be executing). Click on the Project Browser and expand the logic to show all the code-blocks and turn status ON for the Project Browser. That will highlight the code-blocks that are running. They should be CYAN when running (like contact status).

  • 1FixAll (Customer)

    I figured it out you use SDT0.Hour, Minute and Second and you get the NOW time. I added to the copy 0 to CT0 and it wiped both to zero. So using another Copy One Second latter, all using the = equal too sign.

    • HOST_franji1 (HOST Engineering)

      Yeah, it appears Garry used UDT0, but you needed to use SDT0 ($Now) (System Date Time).

       

      Just use $Now nickname tag. Don't get hung up on the SDT vs. UDT 0, 1, 2, etc. $Now makes sense (it maps to SDT0). So then $Now.Hour, $Now.Minute, etc. It just works.

    • Garry (Customer)

      Sorry my mistake. The following should have been used in my example.

      $Now.Hour

      $Now.Minute

      $Now.Second

       

      Garry