Hi Sal,

I guess you are using Ancestry to find John and Margaret. As you probably know, their transcriptions have a lot of errors. Some will never be guessed at, so it's best to just view the original image!

All the census are available at
http://www.scotlandspeople.gov.uk.
Here's the 1871:
Address: 44 Harbour Street, Ayr, AyrshireJohn Barlow, head, mar., 54, Corpl Staff Ayrshire Militia, b. England
Margaret ", wife, mar., 42, dressmaker, b. Ireland
Edward ", son, unm., 22, bugler Staff Ayrshire Militia, b. Ireland
Margaret ", dau., unm., 13, scholar, b. Ayr, Ayrshire
Sarah ", dau., unm., 10, scholar, b. Ayr, Ayrshire
Sophia ", dau., unm., 7, scholar, b. Ayr, Ayrshire
Anne Maria ", dau., unm., 5, scholar, b. Ayr, Ayrshire
You can read a bit more about the Militia here:
http://www.south-ayrshire.gov.uk/galleries/ayr800/ayr_military.htmhume