from wecg400 import *

device = WECG400(get_lib_path())
if not device.connect(-1, 5000):
    print('Error: device is not connected')
    device.free()
    sys.exit()

print('save Sine (10Hz, 5mV, DUT1, LA) to standalone mode...', end='')
sys.stdout.flush()

channel = OutputDut.DUT1.value
device.reset()
device.set_frequency(10.0)
device.set_amplitude(5.0)
device.set_output_lead(channel, OutputLead.Lead_RA.value)
device.set_input_impedance(channel, 1)   # mode 1: 620kΩ
device.save_to_standalone_mode(OutputFunction.Output_Sine.value)

device.free()

print('done')
