A method of jetting a viscous medium onto a substrate, the method comprising: providing viscous medium to a jetting chamber of an ejector, said jetting chamber comprising an open connection, or inlet, to the channel of the feeder providing the viscous medium to the chamber; and being characterised by the following steps: operating an impacting device (6, 7), wherein the impacting device (6, 7) comprises a freely moving piston, which is not restricted in its movement by a valve, seat or stop, and which motion is controlled by voltage and/or current over time and that have a returning position, or end position, for its reciprocating movement which varies over time, so that a length of stroke varies over time, configured to be in direct contact with the viscous medium to directly impact and displace a volume of the viscous medium in the chamber, to perform a reciprocating movement with a variable stroke length, such that viscous medium is jetted through a nozzle, connected to the chamber, towards the substrate; and monitoring a displacement of the impacting device performing a reciprocating movement inside the jetting chamber, wherein the monitored displacement of the impacting device is used in least one of the following ways: - as input data affecting a feeding rate of viscous medium to the jetting chamber; or - to identify a failure mode based on a comparison between the displacement of the impacting device and at least one reference parameter value. providing viscous medium to a jetting chamber of an ejector, said jetting chamber comprising an open connection, or inlet, to the channel of the feeder providing the viscous medium to the chamber; and being characterised by the following steps: operating an impacting device (6, 7), wherein the impacting device (6, 7) comprises a freely moving piston, which is not restricted in its movement by a valve, seat or stop, and which motion is controlled by voltage and/or current over time and that have a returning position, or end position, for its reciprocating movement which varies over time, so that a length of stroke varies over time, configured to be in direct contact with the viscous medium to directly impact and displace a volume of the viscous medium in the chamber, to perform a reciprocating movement with a variable stroke length, such that viscous medium is jetted through a nozzle, connected to the chamber, towards the substrate; and monitoring a displacement of the impacting device performing a reciprocating movement inside the jetting chamber, wherein the monitored displacement of the impacting device is used in least one of the following ways: - as input data affecting a feeding rate of viscous medium to the jetting chamber; or - to identify a failure mode based on a comparison between the displacement of the impacting device and at least one reference parameter value. operating an impacting device (6, 7), wherein the impacting device (6, 7) comprises a freely moving piston, which is not restricted in its movement by a valve, seat or stop, and which motion is controlled by voltage and/or current over time and that have a returning position, or end position, for its reciprocating movement which varies over time, so that a length of stroke varies over time, configured to be in direct contact with the viscous medium to directly impact and displace a volume of the viscous medium in the chamber, to perform a reciprocating movement with a variable stroke length, such that viscous medium is jetted through a nozzle, connected to the chamber, towards the substrate; and monitoring a displacement of the impacting device performing a reciprocating movement inside the jetting chamber, wherein the monitored displacement of the impacting device is used in least one of the following ways: - as input data affecting a feeding rate of viscous medium to the jetting chamber; or - to identify a failure mode based on a comparison between the displacement of the impacting device and at least one reference parameter value. - as input data affecting a feeding rate of viscous medium to the jetting chamber; or - to identify a failure mode based on a comparison between the displacement of the impacting device and at least one reference parameter value.