No announcement yet.

Encoder counts getting reset to 0 on power cycle

  • Filter
  • Time
  • Show
Clear All
new posts

  • Encoder counts getting reset to 0 on power cycle

    I am using an H2-CTRIO-2 high speed counter card along with a Do-more H2-DM1E plc to track encoder counts. The issue is that whenever the plc is powered off and back on or when it is switched into program mode, the encoder count ($CTRIO_005_C1F1.iReg1) gets reset to zero.

    I have "Is Retentive" checked for all of the $CTRIO heap memory items, yet the encoder count is still getting reset. This occurs whether or not I have Channel C set to "Reset Function 1".

    I need to be able to retain the encoder count during a power cycle. I am pretty certain the Direct Logic plc's did retain the counts. What is the best way to keep my encoder counts from getting reset during a power cycle or a switch into program mode with the Do-more plcs?

    I suppose I could store the encoder count in a v-memory location on every scan, and then restore it to the ctrio structure on $firstscan. But I thought I would ask here first to see if there was a better way to get the ctrio structure to retain it.


  • #2
    That is what you have to do. Store it in a PLC memory location and then do a system write back to the module with CTREGWR command. See Do-more help topic DMD0527 for a code example.
    If you have an urgent issue, please contact AutomationDirect's Technical Support team. Technical Support: 1(800) 633-0405 or (770) 844-4200 Email Tech Support