import ch.psi.pshell.epics.CAS as CAS
import random
class Waveform(ReadonlyRegisterBase, ReadonlyRegisterArray):
    def doRead(self):
        ret = []
        for i in range(self.getSize()):
            ret.append(random.random())
        ret = to_array(ret, 'd')
        return ret
        
    def getSize(self):
        return 1000


wf = Waveform("wf")
wf.initialize()
print wf.read()[0]

casN = CAS("TESTCAS:VAL", wf, 'double')
print casN    

print caget("TESTCAS:VAL")