Announcement

Collapse
No announcement yet.

Hobbyboards dual counter reset

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hobbyboards dual counter reset

    How can I reset the counters on the board?
    False triggering gave me counts way too high.
    I use the board for rain counting and it is now on 90055584446.94 mm
    I removed the power and added a switch between the battery, but no reset.
    Is a software reset possible?
    Would be nice to reset the counters at the start of a new year automatically.
    Attached Files
    Peter

    http://ohh.pcgsm.nl

    #2
    I have the same issue with a cumulative counter (gas flow in my case) almost every time mcsXap1wire.exe is restarted. I believe the count is stored in the .ini file under [DEVICES_VALUE] so you can reset it there. You might want to ping the author (Michael McSharry) on the exact format of the DEVICES_VALUE strings to be sure the meaning of each field.
    Best regards,
    -Mark-

    If you're not out on the edge, you're taking up too much room!
    Interested in 3D maps? Check out my company site: Solid Terrain Modeling

    Comment


      #3
      What shows in the source for the .ini string in the section ONEWIRE history key is below. This has evolved from what was provided by Midon Designs for handling the Temp05 counter data.

      '(1)
      '(2) Counter wrap count
      '(3) Accum for Weighted Average
      '(4) Day of Month last reading
      '(5) Prior Sample
      '(6) Date of Prior Sample
      '(7) Yesterday's Count
      '(8) Offset

      This ini file is read and written each time the device is polled to assure it is current if a power cycle or whatever occurs. 31 bits of the DS2423 counter is used.

      The primary calculation is the current DS2423 reading vs. the value obtained from (7).

      If (7) is more than current counter reading then a wrapped around is assumed otherwise the daily total is computed as the current reading - (7)

      The computed value is (1) * 2147483648.0 + daily total

      This value is then scaled to account for units of measure and calibrations.

      Don't understand why restarts would negatively affect the result. If some hints could be provided then I can see if something could be done about it. There are checks made to assure reasonable data is being provided from the .ini file.

      Comment


        #4
        But how can I reset the counter to 0?
        Peter

        http://ohh.pcgsm.nl

        Comment


          #5
          There is no provision to command the DS2423 for a reset. The (5) item in the .ini file for the specific device history was the last value read. If you set the (7) item to the same value then the value of whatever being measured will be 0 for the day and start incrementing from that point. xapmcsOneWire always computes changes so it does not matter what the actual counter value happens to be.

          Comment


            #6
            This is my history values:
            rain_history2=;0;0;7;975;1/7/2016 21:05:37;942;0
            rain_history6=;671;0;7;975;1/7/2016 21:05:37;975;0
            I have set history6 no 7 to 975, same as number 5
            But *** rain a is 465518097923.77 mm
            How can I change it to 0 mm?
            *** rain is the total rain fallen as long as I have the rain counter, but I want to start at zero at the beginning of a new year.
            Peter

            http://ohh.pcgsm.nl

            Comment


              #7
              The application accumulates daily counts. These daily counts are then intended to go into a database. From the database you perform queries to get the totals for whatever period you desire.

              If you want to set your total for today to be 0 then you set the #7 value to the #5 value as you have done, but you also have a value of 671 in #1 which means you are indicating that the counter has wrapped around 671 times today. Change this #1 value to 0.

              The #5 value should be the same as the hardware counter value. If additional counts have accumulated while you are doing your editing then you will need to redo it to account for the change.


              Code:
              '(1)
              '(2) Counter wrap count
              '(3) Accum for Weighted Average
              '(4) Day of Month last reading
              '(5) Prior Sample
              '(6) Date of Prior Sample
              '(7) Yesterday's Count
              '(8) Offset
              
              671;  ... change to 0
              0;
              7;
              975;
              1/7/2016 21:05:37;
              975;
              0
              
              0;
              0;
              7;
              975;
              1/7/2016 21:05:37;
              942;  ... change to 975 if you want to set today's value for this one to zero also
              0

              Comment

              Working...
              X