If you're here to go to the great wall at badaling, and if you have a subway card for Beijing, you can enter the station with that card. No need to buy a ticket.
The timetable for the S2 suburban commuter trains to get to Badaling. Costs CNY6 one-way. 1.5 hour long ride to Badaling. Top is to Yangqing. Bottom is return times. Subject to change.
S2 sucks! There is no place where you can ever find out exactly when the train leaves. Plus they even require you have more than 16 in your transportation card while the ticket only costs 6.