Can someone kindly help with this code.
I am trying to achieve a string that looks like: instrument.write("FREQ:CENT 2442 MHz")
Unfortunately when I run this code I find out I am getting None as FRE result. So I end up having something like : FREQ:CENT None MHz
I have tried to solve this problem but can not find any solution.
Below is my Program.
----------------------------------------------
I am trying to achieve a string that looks like: instrument.write("FREQ:CENT 2442 MHz")
Unfortunately when I run this code I find out I am getting None as FRE result. So I end up having something like : FREQ:CENT None MHz
I have tried to solve this problem but can not find any solution.
Below is my Program.
----------------------------------------------
def switch_channel_2_4G_20M(Channel_No): switcher = { 1: "2412", 2: "2417", 3: "2422", 4: "2427", 5: "2432", 6: "2437", 7: "2442", 8: "2447", 9: "2452", 10: "2457", 11: "2462", 12: "2467", 13: "2472" } #print switcher.get(Channel_No,"Invalid Frequency") BW = 2 Band = 20 Channel = 1 if BW == 2 and Band == 20: FRE = switch_channel_2_4G_20M(Channel) Frequency = "FREQ:" + "CENT " + str(FRE) + " MHz" instrument.write(Frequency)