Find Peaks, Max and Min

Hi there, I try to automatize the calculation of the weight difference of a silo for certain time periods. The signal of the silo weight is shown in the attached image. There are always time periods of charging (weight increase: almost a step function) and discharging the silo (slow weight decrease). I'm interested in how much of the charged matter was used between two charges of the silo. Until now I made this manually. Then I tried the PeakFind. Min and Max etc. functions in IGOR, but didn't get a good result.
Does somebody have an idea?
Thank you...K.
An approach I suggest is to create a wave of "charging" times or points by detecting the large step-like increases. You may want to set a minimum increase threshold for this. The 'Differentiate' operation might be an easy way to assist this. Then to find the used matter, simply integrate ('Integrate' operation) the original data wave between adjacent charging points, taking into account the time scaling.
Finding the charging points by the differentiate operation is a good approach.
Maybe the following function does what you want:
function detUsage(silo)
    wave silo
    make/n=0/o/free usage_tmp,usageX_tmp
    variable i=0,mmin=pnt2x(silo,0),mmax=pnt2x(silo,numpnts(silo)-1),V_max2
    Differentiate silo/D=silo_diff
    findpeak/q/r=(mmin,mmax)/m=(0.1*silo_diff(mmin)) silo_diff
    V_max2=wavemax(silo,mmin,V_LeadingEdgeLoc)
    do
        if(V_flag!=0)
            killwaves/z silo_diff
            extract/o usageX_tmp,usageX,usage_tmp>0
            extract/o usage_tmp,usage,usage_tmp>0
            return 0
        endif
        wavestats/q/r=(mmin,V_LeadingEdgeLoc) silo
        usage_tmp[i]={V_max2-V_min}
        usageX_tmp[i]={V_minloc}
        wavestats/q/r=(V_LeadingEdgeLoc,V_TrailingEdgeLoc) silo
        V_max2=V_max
        mmin=V_TrailingEdgeLoc
        findpeak/q/r=(mmin,mmax)/m=(0.1*silo_diff(V_maxloc)) silo_diff
        i+=1
    while(1)
end