#This program enables to test any of the methods of the classes AFG5000 and AWG5000
import pyvisa
import AWG_5000

try:
    # Initialize VISA
    rm = pyvisa.ResourceManager()

    # List connected resources
    resources = rm.list_resources()
    print(f"\n\n\nConnected devices: {resources}")

    #Intrumetn TCP/IP address
    address_listed = resources[1]
    address_not_listed = "TCPIP0::192.168.0.83::inst0::INSTR"

    #If you use NI MAX or similar, you can also use one of the adresses in the list 
    master = rm.open_resource(address_not_listed)

    #Master Encoding: Necessary if you use non-ascii characters, like accented vocals.
    master.encoding = "latin-1"

    # Ask device ID
    idn = master.query("*IDN?")
    print(f"The device's ID is: {idn}\n")

    #Initialize AWG_5062
    Master = AWG_5000.AWG5000(master, 2)





    #Instructions to try
except Exception as e: print(f"The following exception has occured: {e}")