def on_count(obj=nil, &block)
      @on_count_obj = obj
      @on_count = Proc.new { |device, obj_ptr, index, time, counts|
	    yield self, @inputs[index], time, counts, object_for(obj_ptr)
	}
      Klass.set_OnCount_Handler(@handle, @on_count, pointer_for(obj))
    end
def on_count(obj=nil, &block)
      @on_count_obj = obj
      @on_count = Proc.new { |device, obj_ptr, index, time, counts|
	    yield self, @inputs[index], time, counts, object_for(obj_ptr)
	}
      Klass.set_OnCount_Handler(@handle, @on_count, pointer_for(obj))
    end
Sets an count handler callback function. This is called when ticks are counted on an frequency counter input, or when the timeout expires

 @param [String] obj Object to pass to the callback function. This is optional.
 @param [Proc] Block When the callback is executed, the device and object are yielded to this block.
 @example
     fc.on_count do |device, input, time, count, obj|
       puts "Channel  #{input.index}:  #{count} pulses in #{time} microseconds"
     end
 As this runs in it's own thread, be sure that all errors are properly handled or the thread will halt and not fire any more.
 @return [Boolean] returns true or raises an error