index=0 def calc(): global index index += 1 ret= tscan(sin, 10, 0.1, tag="scan " + str(index)) #ret= tscan(sin, 10, 0.1) v = max(ret.getReadable(0)) return float(v) class PseudoDev(Readable): def read(self): return calc() d= PseudoDev() ret= lscan(inp, (d), 0, 40, 5, 0.2, tag="output") #ret= lscan(inp, (d), 0, 40, 5, 0.2)