Files
x12sa/script/test/CompareTimestampIocAndPc.py
2017-09-15 12:01:58 +02:00

20 lines
552 B
Python

import datetime
def after(rec, scan):
cache = bpm6a.takeTimestamped()
path = get_exec_pars().group+"/time"
pathpc = get_exec_pars().group+"/timepc"
if rec.index==0:
create_dataset(path, 's')
create_dataset(pathpc, 's')
time_str = str(datetime.datetime.fromtimestamp(cache.timestampNanos/1e9))
append_dataset(path, time_str , type = 's')
time_str = str(datetime.datetime.fromtimestamp(time.time()))
append_dataset(pathpc, time_str , type = 's')
mscan(bpm6a, bpm6a, -1, 10.0, after_read = after)