War with Mexico
In 1842, Barnes was assigned to Fort Jesup, Louisiana, where he remained until 1846 when with the beginning of the Mexican–American War, he joined the 2nd U.S. Dragoons en route to Corpus Christi to join the army being mobilized for the invasion of Mexico from the north. He served with the cavalry column of Major General Zachary Taylor's army during its advance to Monterey. Later transferred to Lieutenant General Winfield Scott's forces before Veracruz, he served with Major General William J. Worth's division during the siege and capture of that city. During the advance upon Mexico City, he was chief surgeon of the cavalry brigade and participated in the battles of Cerro Gordo, Contreras, Churubusco, and Molina del Rey, in the storming of Chapultepec and the capture of the capital.
During the thirteen years that intervened between this time and the Civil War, Barnes served in a succession of posts in widely separated parts of the country. He served at Fort Croghan and other posts in Texas, in the plains country at Fort Scott, Fort Leavenworth, and Camp Center (now Fort Riley), on the Pacific coast at San Francisco, Fort Vancouver and the Cascades, while between times he saw tours of duty at Baltimore, Fort McHenry, Philadelphia, and West Point. He was promoted to major and surgeon on August 29, 1856.
Marriage at Fort Leavenworth, KS to Mary (7) Thurston Fauntleroy b. 1825 d. 1911, dau of Col. Thomas Turner Fauntleroy b. 1795 d. 1883 (later of the 1st Cavalry out of Fort Union, New Mexico Terr. 1851–1861) and Ann Magill b. 1792 d. 1862, dau Col. Charles Magill of Winchester, VA.