You can use PI config commands to extract the data from PI System
There are couple of ways to do this
1. Using PI Config
Set up a batch job which can dump data to a text file , below is a sample for setting up the batch file
@istr tag, starttime, endtime
@ostr tag, value, time
sinusoid, *-1d, *
2. Developing custom code that will export the data from required tag.
3. Using PI Integrator for BA with target as text file.
Retrieving data ...