def setup_incrementer_calcout(calcout, scan=None, limit=100000):
    """
    setup calcout record as an incrementer

    PARAMETERS

    calcout : object
        instance of :class:`CalcoutRecord`

    scan : text or int or None
        any of the EPICS record `.SCAN` values, 
        or the index number of the value,
        set to default if `None`,
        default: `.1 second`

    limit : int or None
        set the incrementer back to zero 
        when this number is reached (or passed),
        default: 100000

    """
    scan = scan or '.1 second'
    calcout.reset()
    calcout.scanning_rate.put('Passive')
    calcout.description.put('incrementer')
    pvname = calcout.calculated_value.pvname.split('.')[0]
    calcout.channels.A.input_pv.put(pvname)
    calcout.channels.B.input_value.put(limit)
    calcout.calculation.put('(A+1) % B')
    calcout.scanning_rate.put(scan)
    calcout.hints = {'fields': ['input_value']}
    calcout.read_attrs = ['input_value']
