Barnes appeared before an army examining board which was meeting at the time in Philadelphia and, pursuant to its recommendation, he was commissioned an assistant surgeon on June 15, 1840. he was assigned for his first duty to the United States Military Academy. After only a few months of duty, he was ordered to accompany a detachment of recruits to Florida, where hostilities were in progress against the Seminole Indians. For the two following years, he served successively at eight posts in that state, much of the time giving professional service to two or more posts at the same time, owing to the shortage of medical officers. Notable in his field service of this period was his accompanying Brigadier General Willam Harney's expedition through the Everglades during the Second Seminole War.