Performs scheduled measurements and writes data to a file