Files
x12sa/script/bpm1s_TimestampTable.py
2017-09-14 12:02:44 +02:00

19 lines
460 B
Python

import datetime
def after(rec, scan):
path = get_exec_pars().group+"/TimeIOC"
if rec.index==0:
create_dataset(path, 's')
nanos = bpm1s_4ch.timestampNanos
dt = datetime.datetime.fromtimestamp(nanos/1e9)
time_str = str(dt).ljust(26,'0') + str(int(nanos % 1e3)).zfill(3)
append_dataset(path, time_str , type = 's')
mscan(bpm1s_4ch, bpm1s_ch, -1, 1000.0, after_read = after)
#mscan(bpm6b, bpm6b, 5)
#tscan(bpm6a, b5, 2.0)