Ubaidullah_Asif Posted August 11, 2015 Share Posted August 11, 2015 Hi, I run analog discovery Analog In Trigger input code. I want to save the every acquisitions in file but in this code the while loop is not break or ends. can anyone help me in breaking/ending this while loop. loop is: for iTrigger in range(1,101): #begin acquisition dwf.FDwfAnalogInConfigure(hdwf, c_bool(False), c_bool(True)) x = "i" while True: dwf.FDwfAnalogInStatus(hdwf, c_bool(1), byref(sts)) print " i am here!!%s", i i = i+1 if sts.value == DwfStateDone.value : break time.sleep(0.001) dwf.FDwfAnalogInStatusData(hdwf, 0, rgdSamples, 8192) dc = sum(rgdSamples)/len(rgdSamples) print "Acquisition #"+str(iTrigger)+" average: "+str(dc)+"V" any guideline or suggestion? or verified answer Link to comment Share on other sites More sharing options...
attila Posted August 19, 2015 Share Posted August 19, 2015 In the example code the trigger level is set to 1.5V rising edge on channel 1. Make sure to apply input signal to this analog in/scope channel or modify the code according to the signal you want to capture. Link to comment Share on other sites More sharing options...
Question
Ubaidullah_Asif
Hi, I run analog discovery Analog In Trigger input code. I want to save the every acquisitions in file but in this code the while loop is not break or ends. can anyone help me in breaking/ending this while loop. loop is:
for iTrigger in range(1,101):
#begin acquisition
dwf.FDwfAnalogInConfigure(hdwf, c_bool(False), c_bool(True))
x = "i"
while True:
dwf.FDwfAnalogInStatus(hdwf, c_bool(1), byref(sts))
print " i am here!!%s", i
i = i+1
if sts.value == DwfStateDone.value :
break
time.sleep(0.001)
dwf.FDwfAnalogInStatusData(hdwf, 0, rgdSamples, 8192)
dc = sum(rgdSamples)/len(rgdSamples)
print "Acquisition #"+str(iTrigger)+" average: "+str(dc)+"V"
any guideline or suggestion? or verified answer
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.