The invention provides a milking device having at least one teat cup connectable to a teat of a dairy animal, and a method of controlling the milking device. A measuring sensor measures the amount of milk secreted. Data regarding the dairy animal are collected in a control unit. The method includes the steps of: providing a milking frequency determined in a first manner at a first lactation phase and a milking frequency determined in a second, different manner at a later, second lactation phase, for example, the stimulation phase and the stable phase, respectively, wherein the first manner results in a higher milking frequency than the second manner in the same circumstances; identifying a dairy animal and determining the associated milking frequency; milking the dairy animal dependent on the milking frequency; determining the milk production; and switching from the first to the second lactation phase, dependent on the milk production.