Unable to download phasemeter file

Moku model: Moku Pro
Operating system: Ubuntu 22
Software version: 587

I’m trying to log phase meter data and save it on my computer. Unfortunately, it doesn’t work.

Sample code is:

m = MultiInstrument('192.168.###', platform_id=4,force_connect=True)

# wg = m.set_instrument(1, ArbitraryWaveformGenerator)
wg = m.set_instrument(1, WaveformGenerator)
wg1 = m.set_instrument(2, WaveformGenerator)
osc = m.set_instrument(3, Oscilloscope)
ph = m.set_instrument(4, Phasemeter)
# wg1=m.set_instrument(2, ArbitraryWaveformGenerator)
# osc = m.set_instrument(2, Oscilloscope)
    



# connections2 = [dict(source="Input1", destination="Slot1InA"),
#                     dict(source="Slot1OutA", destination="Slot3InA"),
#                     dict(source="Slot1OutA", destination="Output1"),
#                     dict(source="Input2", destination="Slot2InA"),
#                     dict(source="Slot2OutA", destination="Slot3InB"),
#                     dict(source="Slot2OutA", destination="Output2")]


connections = [dict(source="Input1", destination="Slot1InA"),
                    dict(source="Slot1OutA", destination="Slot3InA"),
                    dict(source="Slot1OutA", destination="Output1"),
                    dict(source="Input2", destination="Slot2InA"),
                    dict(source="Slot2OutA", destination="Slot3InB"),
                    dict(source="Slot2OutA", destination="Output2"),
                    dict(source="Input3", destination="Slot4InA"),
                    dict(source="Input4", destination="Slot4InB"),
                    dict(source="Slot4OutA", destination="Output3"),
                    dict(source="Slot4OutB", destination="Output4")
                   
                    ]



    
#connection2 works.

print(m.set_connections(connections=connections))

# wg.generate_waveform(channel=1, sample_rate='Auto',
#                         lut_data=list(m_sequence_output[1]), frequency=80e6,
#                         amplitude=1)

wg.generate_waveform(channel=1,
                        type='Sine', frequency=80e6,
                        amplitude=1)
# wg.generate_waveform(channel=2, sample_rate='Auto',
#                         lut_data=list(sine), frequency=100e6,
#                         amplitude=1)
wg1.generate_waveform(channel=1,
                        type='Sine', frequency=85e6,
                        amplitude=1)
osc.set_timebase(-5e-8, 5e-8, strict=False)  #this has to be set well to work.
data = osc.get_data(timeout=60, wait_reacquire=False, wait_complete=True)

data2=ph.get_data()
response=ph.start_logging(duration=60)
ph.start_logging(duration=60, comments='Sample_Script')


file_name=response['file_name']
local_path='/home/lab/Desktop/DI/Data/'
target='persist'
ph.download(target, file_name, local_path)

I keep getting [Errno 2] No such file or directory: …

yet the directory exists.

Do you know why I’m facing this?

Hi @bonhardt ,

First of all, you will need to add a 60 seconds sleep in your code before you download the file.

After that, it is necessary to have a specific file name when you download the file. For example, these two lines specified a file name with a .li extension.

temp_filename = FILE_PATH + "/high_res_data-" + time.strftime('%d-%m-%Y-%H_%M_%S')
i.download("ssd", file_name, temp_filename + ".li")

For more information, please refer to this Knowledge Base.

Best regards,
Hank