Public start_data As Long Public stop_data As Long Public ampstart_data As Long Public ampstop_data As Long Private Sub addressBox_Change() Call amp_out End Sub Private Sub ampBox4_Change() amp_f = ampBox4.Value If amp_f = "ON" Then ampBox3.Enabled = True AmpButton2.Enabled = True AsBox1.Enabled = True AsBox2.Enabled = True Call ampsweep_out Else Call amp_out Call freq_out ampBox3.Enabled = False AmpButton2.Enabled = False AsBox1.Enabled = False AsBox2.Enabled = False End If End Sub Private Sub AmpButton1_Click() rfout_f = ampBox2.Value If rfout_f = "ON" Then ampBox2.Value = "OFF" ampBox4.Value = "OFF" on_f = "R0" Else ampBox2.Value = "ON" on_f = "R1" End If Call card_open eg.AsciiLine = on_f Call card_close End Sub Private Sub AmpButton2_Click() Call ampsweep_out End Sub Private Sub ampSpin3_spindown() ampBox3.Value = ampBox3.Value - 1 a_data1 = ampBox3.Value a = Val(a_data1) End Sub Private Sub CommandButton1_Click() taniBox1.AddItem "dBm" 'DM taniBox1.AddItem "dBuV" 'DB taniBox1.AddItem "V" 'VL taniBox1.AddItem "mv" 'MV taniBox1.AddItem "uv" 'UV modBox1.AddItem "OFF" modBox1.AddItem "AM" modBox1.AddItem "FM" modbox2.AddItem "OFF" modbox2.AddItem "INT 400Hz" modbox2.AddItem "INT 1KHz" modbox2.AddItem "EXIT AC" modbox2.AddItem "EXIT DC" FsBox2.AddItem "S" FsBox2.AddItem "mS" FsBox3.AddItem "ON" FsBox3.AddItem "OFF" ampBox4.AddItem "ON" ampBox4.AddItem "OFF" AsBox2.AddItem "S" AsBox2.AddItem "mS" freqBox41.Value = 100 freqBox42.Value = 0 freqBox43.Value = 0 ampBox1.Value = -10 modBox1 = "OFF" FreqBox51.Enabled = False FreqBox52.Enabled = False FreqBox53.Enabled = False FreqButton1.Enabled = False FsBox1.Enabled = False FsBox2.Enabled = False Call card_open eg.AsciiLine = "FR" eg.AsciiLine = "100000000" eg.AsciiLine = "HZ" eg.AsciiLine = "AP" eg.AsciiLine = "-10" eg.AsciiLine = "DM" Call card_close End Sub Private Sub FreqBox41_Change() d_data1 = freqBox41.Value a = Val(d_data1) If a >= 1050 Then a = 1050 freqBox41.Value = str(a) b = 0 c = 0 freqBox42.Value = str(b) freqBox43.Value = str(c) End If Call freq_out End Sub Private Sub freqBox42_Change() d_data2 = freqBox42.Value b = Val(d_data2) If b >= 999 Then b = 999 End If If b < 0 Then b = 0 End If freqBox42.Value = str(b) Call freq_out End Sub Private Sub freqBox43_Change() d_data3 = freqBox43.Value c = Val(d_data3) If c >= 999 Then c = 999 End If If c < 0 Then c = 0 End If freqBox43.Value = str(c) Call freq_out End Sub Private Sub FreqButton1_Click() Call freqsweep_out End Sub Private Sub FsBox1_Change() Call freqsweep_out End Sub Private Sub FsBox2_Change() Call freqsweep_out End Sub Private Sub Fsbox3_change() sweep_f = FsBox3.Value If sweep_f = "ON" Then FreqBox51.Enabled = True FreqBox52.Enabled = True FreqBox53.Enabled = True FreqButton1.Enabled = True FsBox1.Enabled = True FsBox2.Enabled = True Call freqsweep_out Else Call card_open Call start_freq Call freq_out Call card_close FreqBox51.Enabled = False FreqBox52.Enabled = False FreqBox53.Enabled = False FreqButton1.Enabled = False FsBox1.Enabled = False FsBox2.Enabled = False End If End Sub Private Sub freqSpin41_SpinDown() freqBox41.Value = freqBox41.Value - 1 d_data1 = freqBox41.Value a = Val(d_data1) If a < 0 Then a = 0 freqBox41.Value = str(a) End If Call freq_out End Sub Private Sub freqSpin41_SpinUp() freqBox41.Value = freqBox41.Value + 1 d_data1 = freqBox41.Value a = Val(d_data1) If a >= 2060 Then a = 2060 freqBox41.Value = str(a) b = 0 c = 0 freqBox42.Value = str(b) freqBox43.Value = str(c) End If Call freq_out End Sub Private Sub freqSpin42_SpinDown() freqBox42.Value = freqBox42.Value - 1 d_data2 = freqBox42.Value b = Val(d_data2) If b < 0 Then b = 0 freqBox42.Value = str(b) End If Call freq_out End Sub Private Sub freqSpin42_SpinUp() freqBox42.Value = freqBox42.Value + 1 d_data2 = freqBox42.Value b = Val(d_data2) If b > 999 Then b = 999 freqBox42.Value = str(b) End If Call freq_out End Sub Private Sub freqSpin43_SpinDown() freqBox43.Value = freqBox43.Value - 1 d_data3 = freqBox43.Value b = Val(d_data3) If b < 0 Then b = 0 freqBox43.Value = str(b) End If Call freq_out End Sub Private Sub freqSpin43_SpinUp() freqBox43.Value = freqBox43.Value + 1 d_data3 = freqBox43.Value b = Val(d_data3) If b > 999 Then b = 999 freqBox43.Value = str(b) End If Call freq_out End Sub Private Sub modBox1_Change() mod_d1 = modBox1.Value Select Case mod_d1 Case "OFF" modbox2.Enabled = False modBox3.Enabled = False modBox4.Enabled = False Case "AM" modbox2.Enabled = True modBox3.Enabled = True modBox4.Enabled = True modBox3.Value = 100 modBox4.Value = "%" Call mod_out3 Case "FM" modbox2.Enabled = True modBox3.Enabled = True modBox4.Enabled = True modBox3.Value = 0 modBox4.Value = "KHz" Call mod_out3 End Select Call mod_out End Sub Private Sub modbox2_Change() Call mod_out2 End Sub Private Sub modbox3_Change() mod_d3 = modBox3.Value a = Val(mod_d3) If a < 0 Then a = 0 modBox3.Value = str(a) End If If a > 100 Then a = 100 modBox3.Value = str(a) End If Call mod_out3 End Sub Private Sub modSpin1_SpinDown() modBox3.Value = modBox3.Value - 1 mod_d3 = modBox3.Value a = Val(mod_d3) If a < 0 Then a = 0 modBox3.Value = str(a) End If Call mod_out3 End Sub Private Sub modSpin1_SpinUp() modBox3.Value = modBox3.Value + 1 mod_d3 = modBox3.Value a = Val(mod_d3) If a > 100 Then a = 100 modBox3.Value = str(a) End If Call mod_out3 End Sub Private Sub ampSpin1_SpinDown() ampBox1.Value = ampBox1.Value - 1 Call amp_out End Sub Private Sub ampSpin1_SpinUp() ampBox1.Value = ampBox1.Value + 1 Call amp_out End Sub Private Sub ampSpin2_SpinDown() ampBox1.Value = ampBox1.Value - 0.1 Call amp_out End Sub Private Sub ampSpin2_SpinUp() ampBox1.Value = ampBox1.Value + 0.1 Call amp_out End Sub Private Sub freq_out() Call start_freq Call card_open eg.AsciiLine = "FR" eg.AsciiLine = start_data eg.AsciiLine = "HZ" Call card_close End Sub Private Sub amp_out() amp_d1 = ampBox1.Value a = Val(amp_d1) tani = taniBox1.Value Call card_open eg.AsciiLine = "AP" eg.AsciiLine = a Select Case tani Case "dBm" eg.AsciiLine = "DM" Case "dBuV" eg.AsciiLine = "DU" Case "V" eg.AsciiLine = "VL" Case "mv" eg.AsciiLine = "MV" Case "uv" eg.AsciiLine = "UV" End Select Call card_close End Sub Private Sub mod_out() mod_d1 = modBox1.Value Call card_open Select Case mod_d1 Case "OFF" eg.AsciiLine = "AMOF" eg.AsciiLine = "FMOF" eg.AsciiLine = "FR" modbox2.Value = "OFF" modbox2.Enabled = False modBox3.Value = 0 modBox3.Enabled = False modBox4.Value = "%" modBox4.Enabled = False Case "AM" eg.AsciiLine = "AM" eg.AsciiLine = "ON" Case "FM" eg.AsciiLine = "FMON" End Select Call card_close End Sub Private Sub mod_out2() mod_d1 = modBox1.Value mod_d2 = modbox2.Value Call card_open Select Case mod_d1 Case "OFF" Case "AM" eg.AsciiLine = "AM" Case "FM" eg.AsciiLine = "FM" End Select Select Case mod_d2 Case "OFF" eg.AsciiLine = "OF" Case "INT 400Hz" eg.AsciiLine = "NT" eg.AsciiLine = 400 eg.AsciiLine = "HZ" Case "INT 1KHz" eg.AsciiLine = "NT" eg.AsciiLine = 1 eg.AsciiLine = "KZ" Case "EXIT AC" eg.AsciiLine = "XA" Case "EXIT DC" eg.AsciiLine = "XD" End Select Call card_close End Sub Private Sub mod_out3() mod_d1 = modBox1.Value mod_d3 = modBox3.Value a = Val(mod_d3) Call card_open Select Case mod_d1 Case "OFF" Case "AM" eg.AsciiLine = "AM" eg.AsciiLine = a eg.AsciiLine = "PC" Case "FM" eg.AsciiLine = "FM" eg.AsciiLine = a eg.AsciiLine = "KZ" End Select Call card_close End Sub Private Sub card_open() address_no = addressBox.Value eg.CardOpen eg.ActiveAddress = address_no eg.Delimiter = eg.DELIMs.Cr End Sub Private Sub card_close() eg.CardCLose End Sub Private Sub taniBox1_Change() mod_tani = taniBox1.Value Call card_open eg.AsciiLine = "AP" Select Case mod_tani Case "dBm" eg.AsciiLine = "DM" Case "dBuV" eg.AsciiLine = "DU" Case "V" eg.AsciiLine = "VL" Case "mV" eg.AsciiLine = "MV" Case "uV" eg.AsciiLine = "UV" End Select Call card_close End Sub Private Sub start_freq() freq_start1 = freqBox41.Value freq_start2 = freqBox42.Value freq_start3 = freqBox43.Value astart = Val(freq_start1) bstart = Val(freq_start2) cstart = Val(freq_start3) freq_start4 = astart * 1000000 + bstart * 1000 + cstart start_data = str(freq_start4) End Sub Private Sub stop_freq() freq_stop1 = FreqBox51.Value freq_stop2 = FreqBox52.Value freq_stop3 = FreqBox53.Value astop = Val(freq_stop1) bstop = Val(freq_stop2) cstop = Val(freq_stop3) freq_stop4 = astop * 1000000 + bstop * 1000 + cstop stop_data = str(freq_stop4) End Sub Private Sub freqsweep_out() sweep_time = FsBox1.Value sweep_m = FsBox2.Value Call start_freq Call stop_freq If stop_data < start_data Then MsgBox "START周波数より大きくしてください" Else Call card_open eg.AsciiLine = "FASA" eg.AsciiLine = "ST" eg.AsciiLine = sweep_time Select Case sweep_m Case "S" eg.AsciiLine = "SC" Case "mS" eg.AsciiLine = "MS" End Select eg.AsciiLine = "FA" eg.AsciiLine = start_data eg.AsciiLine = "HZ" eg.AsciiLine = "FB" eg.AsciiLine = stop_data eg.AsciiLine = "HZ" Call card_close End If End Sub Private Sub ampsweep_out() start_amp = ampBox1.Value stop_amp = ampBox3.Value sweep_time = AsBox1.Value st = Val(sweep_time) sweep_tani = AsBox2.Value Select Case sweep_tani Case "S" stm = "SC" Case "mS" stm = "MS" End Select If stop_amp < start_amp Then stop_amp = start_amp ampBox3.Value = stop_amp Else Call card_open eg.AsciiLine = "ST" eg.AsciiLine = st eg.AsciiLine = stm eg.AsciiLine = "AA" eg.AsciiLine = start_amp eg.AsciiLine = "DM" eg.AsciiLine = "AB" eg.AsciiLine = stop_amp eg.AsciiLine = "DM" Call card_close End If End Sub