import vxi11Device
import numpy as np
import struct,time,sys

if __name__=="__main__":

	awg=vxi11Device.Vxi11Device("A-33600-00000.dhcp.lbl.gov","inst0")
#	awg.write("*CLS\n")
#	awg.write("*RST\n")
#	time.sleep(2)
	awg.write("*IDN?\n")
	print awg.read()
	awg.write("freq?\n")
	print awg.read()
	awg.write("volt?\n")
	print awg.read()
	awg.write("volt:unit vpp")
	awg.write("volt:unit?")
	print awg.read()

	awg.write("rosc:sour:auto on")
	awg.write("freq %s \n"%sys.argv[1])
	awg.write("volt %s mV\n"%sys.argv[2])
	awg.write("outp %s \n"%('on' if eval(sys.argv[3]) else 'off'))
	print sys.argv[3],('on' if eval(sys.argv[3]) else 'off')

	awg.write("freq?\n")
	print awg.read()
	awg.write("volt?\n")
	print awg.read()
	awg.write("volt:unit?")
	print awg.read()

