Moku model: Moku Pro
Operating system: Ubuntu 22
Software version: 587
Bug or support request description:
So I have an issue with multi-instruments whenever I try generating signals with Python. I cannot see the signal. For example, I’m trying to generate two signals, a square wave and a sine wave using ArbitraryWavegenerator and Wavegenerator instruments. i have connected the Output1 and Output2 ports of the Moku Pro to an external oscilloscope and I cannot see the signal when multi-instrument mode is enabled. When using only the Wavegenerator instrument, then I’m able to see both signals.
this is my code for multi-instrument mode:
from moku.instruments import MultiInstrument
from moku.instruments import Oscilloscope, WaveformGenerator,ArbitraryWaveformGenerator
m = MultiInstrument('192.168.73.1', platform_id=4,force_connect=True)
try:
wg = m.set_instrument(1, ArbitraryWaveformGenerator)
wg1=m.set_instrument(2, WaveformGenerator)
osc = m.set_instrument(3, Oscilloscope)
connections = [dict(source="Input1", destination="Slot1InA"),
dict(source="Slot1OutA", destination="Slot3InA"),
dict(source="Slot3OutA", destination="Output1"),
dict(source="Input2", destination="Slot2InA"),
dict(source="Slot2OutA", destination="Slot3InB"),
dict(source="Slot3OutB", destination="Output2")]
print(m.set_connections(connections=connections))
wg.generate_waveform(channel=1, sample_rate='Auto',
lut_data=list(m_sequence_output[1]), frequency=100e6,
amplitude=1)
wg1.generate_waveform(channel=2, type="Sine",amplitude=1.0,frequency=80e6)
osc.set_timebase(-5e-8, 5e-8, strict=False) #this has to be set well to work.
# osc.set_source(channel=1, source='Output2')
data = osc.get_data(timeout=60, wait_reacquire=False, wait_complete=True)
And this is the code for Wavegenerator only:
import numpy as np
from moku.instruments import ArbitraryWaveformGenerator,WaveformGenerator
from Msequence import msequence,repeat_bits
polynomial_coefficients = [4,3]
m_sequence_output = msequence(polynomial_coefficients)
i=WaveformGenerator('192.168.73.1', force_connect=True)
t=np.linspace(0,1,100)
not_sq=np.zeros(len(t))
for h in np.arange(1,15,2):
not_sq += (4/(np.pi*h)) * np.cos(2*np.pi*h*t)
not_sq=not_sq/max(abs(not_sq))
i.generate_waveform(channel=1, type="Sine",amplitude=1.0,frequency=100e6)
i.generate_waveform(channel=2, type="Square",amplitude=1.0,frequency=80e6,duty=50)
Any idea why I’m having this issue?