The all-rounder struck his third hundred of the campaign as the home side recovered from 63-5 to make 271. Then pace bowler Joe Leach made a treble breakthrough to reduce Glamorgan to 32-3 at the close.
Warwickshire are reported to have made an approach to their local rivals about the possibility of signing Barnard who is out of contract at the end of the summer.
And the 26-year-old again showed his quality with the bat.
“Have I been in better form? Probably, statistically no,” said Barnard. “Everything is clicking quite nicely at the minute. I had a tiny bit of luck as well which always helps.
“But I’m loving my batting. I just want to keep better and better and it’s nice to put a run of consistent scores together.
“This one has been really satisfying, to get it in a low-scoring game so far.”
Rob Keogh’s first century since the season’s opening game led the run glut for Northamptonshire against Warwickshire at Wantage Road.
The county’s longest serving player struck 130 as the hosts reached 420-6.