A method for controlling the operation of a treatment machine for treating a continuous flexible web which movement is guided in a conveyance direction, said treatment machine integrating a plurality of guiding rollers from a feed unit for feeding the flexible web to a take-up unit for taking up the same, and at least one treatment unit placed between said feed unit and said take-up unit, comprising the acquisition of diverse information referring to different operating parameters, including parameters referring to performing adjustments, to different operation states of the treatment machine over time, each of said different operation states being defined by a series of detected parameters of said feed unit, treatment unit and/or take-up unit, said operation states comprising at least: • one preparation state of said machine in which preparation and/or adjustment operations of element and/or parameter are performed in said feed unit, treatment unit and/or take-up unit, • one production state of said machine in which a treatment task is performed on said flexible web as it is moving, applied by means of said at least said one treatment unit; • one stop state of the treatment machine in which none of the preparation and/or adjustment or treatment activities is being performed wherein said acquisition of diverse information comprises the steps of: a) monitoring the operating parameters of the different operation states of said at least one treatment unit, and/or feed unit, and/or take-up unit for treating, feeding or taking up the flexible web by means of sensors; b1) analyzing by means of a programmable control device the monitored operating parameters; b2) automatically detecting by means of said programmable control device a relevant variation or combinations of relevant variations exceeding predefined threshold values in at least one of the parameters of at least one of said units (10, 20, 30), and automatically inferring from said relevant variation the start of one of said operation states (E1, E2, E3) and/or the end of one of said operation states (E1, E2, E3); c) communicating and storing said start and/or end of an operation state (E1, E2, E3) together with a temporary register in a local or remote state register; and d) performing the sequence of steps a) to c) throughout a control cycle of the treatment machine, at least at predefined points in time, detecting later starts and/or ends of operation states (E1, E2, E3) characterized in that the method further comprises to determine, and store in the state register, the start of the production state by verifying the performance, during a specific predefined time uninterruptedly and without relevant variation, of the treatment task performed on the flexible web and by assigning the entire period of time during which said treatment task has been performed uninterruptedly and without relevant variation as part of said production state. • one preparation state of said machine in which preparation and/or adjustment operations of element and/or parameter are performed in said feed unit, treatment unit and/or take-up unit, • one production state of said machine in which a treatment task is performed on said flexible web as it is moving, applied by means of said at least said one treatment unit; • one stop state of the treatment machine in which none of the preparation and/or adjustment or treatment activities is being performed a) monitoring the operating parameters of the different operation states of said at least one treatment unit, and/or feed unit, and/or take-up unit for treating, feeding or taking up the flexible web by means of sensors; b1) analyzing by means of a programmable control device the monitored operating parameters; b2) automatically detecting by means of said programmable control device a relevant variation or combinations of relevant variations exceeding predefined threshold values in at least one of the parameters of at least one of said units (10, 20, 30), and automatically inferring from said relevant variation the start of one of said operation states (E1, E2, E3) and/or the end of one of said operation states (E1, E2, E3); c) communicating and storing said start and/or end of an operation state (E1, E2, E3) together with a temporary register in a local or remote state register; and d) performing the sequence of steps a) to c) throughout a control cycle of the treatment machine, at least at predefined points in time, detecting later starts and/or ends of operation states (E1, E2, E3)