Palak,
If the idea is to capture values and timestamps for a few PVs to an external file outside of CSS, I would suggest using pyepics and a script like this:
#####
from time import sleep
from datetime import datetime
from epics import PV
pvs = [PV('PVNAME1'), PV('PVNAME2'), PV('PVNAME3')
fout = open('PVlist.txt', 'w')
header = ['# Time ']
for pv in pvs:
header.append(pv.pvname)
header = ' '.join(header)
fout.write("%s\n" % header)
while True:
try:
thisline = [str(datetime.now())]
for pv in pvs:
thisline.append(pv.get(as_string=True))
thisline = ' '.join(thisline)
fout.write("%s\n" % thisline)
fout.flush()
sleep(0.01)
except KeyboardInterrupt:
break
fout.close()
####
You definitely want a short "sleep()" in your loop. If you're really worried about missing events (or if you're worried that you will be capturing too many repeated values) It might be better to use a more sophisticated approach using monitor callbacks so that values are written to a file every time they change, but only when they change.
A few comments on your script: