26 lines
1.3 KiB
Python
26 lines
1.3 KiB
Python
import time
|
|
|
|
C=Channel('X07MB-OP2:SMPL-DONE',type='i') # readback sampling finished
|
|
S=Channel('X07MB-OP2:SMPL') # star sampling (TTL signal)
|
|
wait_value=1
|
|
print(C.read)
|
|
print('Value before pressing button' ,C.read(),'wait for', wait_value)
|
|
|
|
print('press button, in 2 sec,X07MB-OP2:SMPL-DONE should turn from 0 to 1 ')
|
|
|
|
t0=time.time()
|
|
|
|
print('time',time.time()-t0)
|
|
S.putq(1)
|
|
print('Value after pressing button before .wait_for_value',C.read(),'wait for', wait_value)
|
|
print('time before wait ',(time.time()-t0))
|
|
# now wait for
|
|
#C.wait_for_value(wait_value,timeout=5)
|
|
cawait('X07MB-OP2:SMPL-DONE',wait_value,timeout=7)
|
|
print('time after wait ',(time.time()-t0))
|
|
print('Value after .wait_for_valuea',C.read())
|
|
print('..... done .... ')
|
|
print('read X07MB-OP2:SMPL-DONE with caget',caget('X07MB-OP2:SMPL-DONE','i'))
|
|
|
|
|