Python API Moku Pro Oscilloscope Single Trigger & wait_reaquire Inconsistency

Hi guys.

Just to start, as I know it is important, I am using a moku pro with firmware version 555 and the python moku library version 2.2. I believe these are the most up to date at the time of writing this? (I do not see any indication for a firmware update on the desktop app, and I am not sure there is any place to manually check for those on it)

To act as a test, I was utilizing the following code:

osc = Oscilloscope('', force_connect=True)
osc.set_timebase(-100e-6, 500e-6)
osc.set_source(1, 'Input1')
osc.set_frontend(1, impedance='1MOhm', coupling='DC', range='4Vpp')
osc.set_source(2, 'Input2')
osc.set_frontend(1, impedance='1MOhm', coupling='DC', range='40Vpp')
osc.set_source(3, 'None')
osc.set_source(4, 'None')
osc.set_trigger(type='Edge', source='Input2', level=1, mode='Single')
blah = osc.get_data(timeout=300, wait_reacquire=True)
plt.plot(blah['time'], blah['ch2'])

My intention was to read a signal on input1 with a trigger (in the form of an externally generated pulse) corresponding to input 2 (assuming the trigger could be 5V and that I could manually/by hand trigger it to go off with a button push; each time, I try to vary the trigger pulse’s width so that I have some indication of what data is returning).

When the moku is freshly turned on, the code works as expected. My program waits until I trigger the signal, and then clearly relays back the data corresponding to the set time frame about that trigger.

My problem happens if I try to run the code again after I already did that once while leaving the machine on. No matter what I try, I cannot get the moku to wait and return newer data. Result is always the same: the first data captured is always returned again.

Using strictly the code above, this is honestly expected and even the desired action. However, my issue is that I do not know how I can reset the moku to wait for another new measurement. I have tried sending commands to change the trigger mode to Auto or Normal before setting it to Single, but the result is the same. Similarly, if I relinquish ownership and then reconnect in between it also still only keeps the first data in its buffer and immediately returns it without waiting or measuring anew. I would certainly like to avoid needing to tell the machine to go into an entirely new instrument (or worse off, restart the instrument every time I need to measure) a new triggered signal.

Naturally, using the machine in the Normal trigger mode from the start would achieve my results so long as I only have a single trigger pulse. But, I am still left with the question: How can I clear the buffer/communicate to the instrument that I need a newly triggered signal after I have gotten a signal in the “Single” trigger mode? In the desktop app, this is similar to the action of hitting the play button at the bottom after recording a signal in the “Single” trigger mode, telling the machine it is welcome to wait and record again manually.

Upon further testing, I have also found that in the Normal trigger mode, old data can likewise end up being returned without there being a wait for a new signal. The key is that I need a way to have the instrument not return old data, but instead to wait on a new measurement. Per the documentation, I believed that such was the functionality of wait_reacquire; however, the result is the same whether or not this value is set to True or False.

Hi Trajectory989,

we have been looking into this ‘single’ trigger via Python - thank you very much for the detailed description ! We have duplicated the issue and are looking into how to resolve,