The Duke of Gloucester visited Crofton Pumping Station near Great Bedwyn on Saturday as part of its 200th anniversary celebrations and he told the volunteers who have restored and maintained the building he hoped it would still be in use two centuries hence.

The pumping station, which maintains water levels in the Kennet and Avon Canal at its summit, is one of the wonders of Wiltshire and attracts thousands of visitors a year to see the oldest steam engine in the world still operating in the building in which it was installed in 1812.

Kennet and Avon Canal Trust president David Bruce welcomed the Duke and said that it its day the pumping station was cutting edge technology and a great engineering achievement.

He said its restoration was due to “the passion, dedication and skills of countless volunteers over the years”.

The Duke of Gloucester, who had attended the Trooping of the Colour earlier in the day with the Queen, toured the pumping station with Mr Bruce and chatted to the volunteers who maintain the machines.

He praised the men who built places like Crofton pumping station and said: “There were certain clever engineers who could see the possibility of using power in different ways.

“To find a machine still working, still doing what it was intended to do is wonderful... we should look back and thank those people who built these machines.”

Referring to the fact that electric pumps nowadays do the job of maintaining the canal level, the Duke said: “Here are machines that are no longer necessary, but wouldn’t life be poorer without them.”

However, two years ago the 1812 Boulton and Watt engine, which can lift one tonne of water from a well to top up the canal, and the second engine built by Harvey of Hayle and installed in 1846, were pressed into use when the electric pumps failed.