The aim of the research was to determine the change in the volume of fluid slug moving in the milk pipeline for calculating the initial length of the fluid slug and thus the air slug length. This allows to control the fluid and air inlet valve during circulatory washing of milking equipment with milk line and provides a stable plug flow during washing. The article deals with the problems of formation of a wave flow and plug flow regime in a milk line in dependance to the degree of filling and shear stress on the surface of the phases. As the result, the dependence curves have been obtained. They show that when the degree of filling the milk line with liquid is from 0.4d to 0.6d, the probability of slug formation decreases. To determine the loss of a fluid slug volume moving in a milk line, mathematical calculations with the use of the boundary layer theory have been carried out. As the result, the curves of the time of fluid and air intake into the system depending on the length and diameter of the milk pipeline have been obtained. These engineering calculation methods allow to set the operating parameters of the valves for fluid and air inlet into the system during washing. To calculate the parameters of pipelines with an internal diameter of 48, 63, 70 and 98 mm often used in milking equipment, a Delphi-based program was written. The article provides an example of calculating the time of opening and closing the valve for the inlet of fluid and air during washing for a milk line with 48 mm pipe diameter, 120 m length and pressure in the system of 48 kPa. Experimental studies have confirmed the reliability of the calculations, the loss of the liquid plug length for the milk pipeline Ø50. 8 mm is on average 5 cm per 1 meter of the fluid path.