In our setup, we are using an AFG to send a trigger sequence (using a burst of a single repetition, activated by software trigger) to another device. The whole setup is integrated into a single Python script, so the overall sequence runs automatically. So I just need to make sure once the script is through the section where the AFG is being set up, that the AFG is actually ready to run. I want the script to block until the AFG is all done and is ready for the software trigger.
I did a couple quick tests. For this, I prepare a waveform that is 7585 points long (so copying will take some real time). Running it in the console looks like this:
>>> if True:
t0 = time()
afg.wvfm_copy(1, 'EMEM') # copy from EMEM to USER1
t1 = time()
print(f'Elapsed time: {t1 - t0:.3F} sec')
Elapsed time: 0.000 sec
>>> if True:
t0 = time()
afg.wvfm_copy(1, 'EMEM') # copy from EMEM to USER1
afg._dev.query('*OPC?')
t1 = time()
print(f'Elapsed time: {t1 - t0:.3F} sec')
'0'
Elapsed time: 0.780 sec
In execution, there is a noticeable delay until `0` prints out.
This looks to me like the AFG won't process the *OPC?
command until it has finished copying data. The query
method will then wait (up to the VISA timeout limit, which here is 2 sec) for the *OPC?
query to return anything, which effectively blocks until completion.
By the way, I have not sent the *WAI
command.
Does this make sense and align with what you have been able to test?