At the end of 1627, he was sent as a diplomat to Denmark, which at that time was at war with Ferdinand II of Austria. On his way back early in 1628, he suffered a shipwreck of the coast of Jutland, where Austrian imperial troops happened to be camped. These captured him and sent him to Vienna, where he would remain imprisoned until February 1629. On his return he was not reinstated in his naval functions. In the summer of that year he married, and in 1630 he became councillor and in 1632 alderman ("schepen") of the city of Amsterdam.