You burn calories by simply living, not only the exercise you do. Your BMR (Basal Metabolic Rate) is an estimate of calories used to keep you breathing, maintaining body temperature, etc.
Among many BMR calculators, here is a link to one...
http://www.dieting-review.com/bmrcalc.htm
So for example, if you were a 30 year old, 5'4" female who weighed 150 pounds, your BMR would be approximately 1459. Your 1700 calories would cause you to gain weight if you did absolutely no activities. If your 230 calories on the tredmill were the ONLY thing that you did, you would stay about even, eating 1700 calories, and buring 1689.