σはデータ(または確率分布)の標準偏差(ばらつきを表す量)
<参考>
amp0,phs0:B/R1 S21
amp1,phs1:R2/R1 S21
amp2,phs2:A/R1 S11
①NAコピー移動(NA_file_copy_sel(i))
・波面/受信
amp0,phs0 → PHS_RX_F*_AMP.csv PHS.csv
・波面/送信
amp2,phs2 → PHS_TX_F*_AMP.csv PHS.csv
・パターン/受信/AZ
amp0,phs0 → PTN_ACT_RX_AZ_AMP_Sig.csv,Az.csv
amp1,phs1 → PTN_ACT_RX_AZ_PHS_Sig.csv,Az.csv
・パターン/受信/EL
amp0,phs0 → PTN_ACT_RX_EL_AMP_Sig.csv,El.csv
amp2,phs2 → PTN_ACT_RX_EL_PHS_Sig.csv,El.csv
・パターン/送信/AZ
amp2,phs2 → PTN_ACT_TX_AZ_PHS_Sig.csv,Az.csv
・パターン/送信/EL
amp2,phs2 → PTN_ACT_TX_EL_PHS_Sig.csv,El.csv
②平均処理&配列格納(phs_file_read(i))
③取得データ→結果ファイル出力(file_save())
・結果保存先指定(HAMEN\,PATTAN\)+ SMin, Bypass
・★Combo13.ItemIndex = 0 →"補正前_", 1→"補正後_" ⇐他にないか調べる
・point +1, beam, PHS_AMP(point,0,beam), PHS_PHS(point,0,beam)
~PHS_AMP(point,10,beam), PHS_PHS(point,10,beam)
波面測定のファイル関係の流れ
パターン
・コピー実行
ポート1から信号を発生する場合
R1レシーバー:ポートから出力している信号をモニター
Aレシーバー:ポート1に反射され戻ってきた信号を測定
Bレシーバー:被測定物を通ってポート2に到達した信号を測定
B/R1:S21
R2/R1:
A/R1:S11
(参考)
A/R2:S12
B/R2:S22
IFBW:レシーバの測定バンド(帯域)幅に相当。バンド幅が狭くすればノイズが下がるが、測定に時間がかかる。必要な測定精度を考えて最適なIFBWを決める必要がある。
広いIFBWでCALをとり、測定時にIFBWを狭くしても意味がない。CALデータに既に広いIFBWに相当するノイズが含まれてしまう。
1.開始
2.ポジショナーのポイント数算出((開始ー終了)÷間隔)+1
3.パターン測定開始
4.NA接続状態確認
5.「試験開始移動」表示
6.ポジショナー初期設定(間隔、SPEED、開始、終了)
7.開始位置移動(開始位置ー1)
8.NA試験開始(start)
9.ポジショナー移動待ち(開始位置になるまで)
10.「試験開始位置に移動完了」
11.NA(OUTP ON)コマンド送信
12.NA(start ポイント数)ソケット送信
13.NA状態確認ループ(NA_BUSY=1で脱出)
14.FTEに試験開始コマンド送信
15.電源入力
16.ポジショナ速度設定(測定時)
17.ポジショナ移動開始(終了位置+1)
18.試験状態監視タイマー
19.NA状態確認
20.NA_BUSY=0になるまでループ
21.「データ転送中」表示
22.コピー実行
22.平均処理&配列格納
23.ファイル保存
24.「パターン測定終了」表示
25.FTEに試験終了コマンド送信
26.NA(stop)ソケット送信
27.「試験結果を表示します」表示
以上
Private Sub file_seve_all_act()
Dim point, freq_num, beam_num, ave_num As Integer
Dim deg As Double
Dim pc_path As String
Dim amp_all_path As String
If RadioButton5.checked = True Then
pc_path = PATTAN_path & "SMin"
Else
pc_path = PATTAN_path & "Bypass"
End If
Select Case TEST_MODE
Case 2
amp_all_path = pc_path & "_ACT_RX_AZ_F" & freq_num + 1 & "_ALL.csv"
Case 3
amp_all_path = pc_path & "_ACT_RX_EL_F" & freq_num + 1 & "_ALL.csv"
Case 4
amp_all_path = pc_path & "_ACT_TX_AZ_F" & freq_num + 1 & "_ALL.csv"
Case 5
amp_all_path = pc_path & "_ACT_TX_EL_F" & freq_num + 1 & "_ALL.csv"
End Select
For freq_num = FREQ_START To FREQ_START + FREQ_COUNT Step 1
Using csv_f As New StreamWriter(amp_all_path, False, System.Text.Encoding.GetEncoding("Shift_JIS"))
csv_f.WriteLine("JOB," & TextBox1.Text & ",SN," & TextBox2.Text & ",作業者," & Textbox3.text & ",試験日," & meas_time)
csv_f.WriteLine("周波数,F" & freq_num + 1 & ",BEAM,ALL")
csv_f.WriteLine(",BEAM1,BEAM1,BEAM2,BEAM2,BEAM3,BEAM3,BEAM4,BEAM4,BEAM5,BEAM5,BEAM6,BEAM6,BEAM7,BEAM7,BEAM8,BEAM8,BEAM9,BEAM9,BEAM10,BEAM10,BEAM11,BEAM11,BEAM12,BEAM12,BEAM13,BEAM13,BEAM14,BEAM14,BEAM15,BEAM15,BEAM16,BEAM16,BEAM17,BEAM17,BEAM18,BEAM18,BEAM19,BEAM19,BEAM20,BEAM20,BEAM21,BEAM21,BEAM22,BEAM22,BEAM23,BEAM23,BEAM24,BEAM24,BEAM25,BEAM25,BEAM26,BEAM26,BEAM27,BEAM27,BEAM28,BEAM28,BEAM29,BEAM29,BEAM30,BEAM30,BEAM31,BEAM31,BEAM32,BEAM32")
csv_f.WriteLine("角度,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ,Σ,Δ")
For point = 0 To POINT_NUM - 1 Step 1
deg = NumericUpDown67.Value + (point * NumericUpDown69.Value)
csv_f.WriteLine(deg & "," &
PTN_AMP_SIG(point, freq_num, 0) & "," & PTN_AMP_DLT(point, freq_num, 0) & "," &
PTN_AMP_SIG(point, freq_num, 1) & "," & PTN_AMP_DLT(point, freq_num, 1) & "," &
PTN_AMP_SIG(point, freq_num, 2) & "," & PTN_AMP_DLT(point, freq_num, 2) & "," &
PTN_AMP_SIG(point, freq_num, 3) & "," & PTN_AMP_DLT(point, freq_num, 3) & "," &
PTN_AMP_SIG(point, freq_num, 4) & "," & PTN_AMP_DLT(point, freq_num, 4) & "," &
PTN_AMP_SIG(point, freq_num, 5) & "," & PTN_AMP_DLT(point, freq_num, 5) & "," &
PTN_AMP_SIG(point, freq_num, 6) & "," & PTN_AMP_DLT(point, freq_num, 6) & "," &
PTN_AMP_SIG(point, freq_num, 7) & "," & PTN_AMP_DLT(point, freq_num, 7) & "," &
PTN_AMP_SIG(point, freq_num, 8) & "," & PTN_AMP_DLT(point, freq_num, 8) & "," &
PTN_AMP_SIG(point, freq_num, 9) & "," & PTN_AMP_DLT(point, freq_num, 9) & "," &
PTN_AMP_SIG(point, freq_num, 10) & "," & PTN_AMP_DLT(point, freq_num, 10) & "," &
PTN_AMP_SIG(point, freq_num, 11) & "," & PTN_AMP_DLT(point, freq_num, 11) & "," &
PTN_AMP_SIG(point, freq_num, 12) & "," & PTN_AMP_DLT(point, freq_num, 12) & "," &
PTN_AMP_SIG(point, freq_num, 13) & "," & PTN_AMP_DLT(point, freq_num, 13) & "," &
PTN_AMP_SIG(point, freq_num, 14) & "," & PTN_AMP_DLT(point, freq_num, 14) & "," &
PTN_AMP_SIG(point, freq_num, 15) & "," & PTN_AMP_DLT(point, freq_num, 15) & "," &
PTN_AMP_SIG(point, freq_num, 16) & "," & PTN_AMP_DLT(point, freq_num, 16) & "," &
PTN_AMP_SIG(point, freq_num, 17) & "," & PTN_AMP_DLT(point, freq_num, 17) & "," &
PTN_AMP_SIG(point, freq_num, 18) & "," & PTN_AMP_DLT(point, freq_num, 18) & "," &
PTN_AMP_SIG(point, freq_num, 19) & "," & PTN_AMP_DLT(point, freq_num, 19) & "," &
PTN_AMP_SIG(point, freq_num, 20) & "," & PTN_AMP_DLT(point, freq_num, 20) & "," &
PTN_AMP_SIG(point, freq_num, 21) & "," & PTN_AMP_DLT(point, freq_num, 21) & "," &
PTN_AMP_SIG(point, freq_num, 22) & "," & PTN_AMP_DLT(point, freq_num, 22) & "," &
PTN_AMP_SIG(point, freq_num, 23) & "," & PTN_AMP_DLT(point, freq_num, 23) & "," &
PTN_AMP_SIG(point, freq_num, 24) & "," & PTN_AMP_DLT(point, freq_num, 24) & "," &
PTN_AMP_SIG(point, freq_num, 25) & "," & PTN_AMP_DLT(point, freq_num, 25) & "," &
PTN_AMP_SIG(point, freq_num, 26) & "," & PTN_AMP_DLT(point, freq_num, 26) & "," &
PTN_AMP_SIG(point, freq_num, 27) & "," & PTN_AMP_DLT(point, freq_num, 27) & "," &
PTN_AMP_SIG(point, freq_num, 28) & "," & PTN_AMP_DLT(point, freq_num, 28) & "," &
PTN_AMP_SIG(point, freq_num, 29) & "," & PTN_AMP_DLT(point, freq_num, 29) & "," &
PTN_AMP_SIG(point, freq_num, 30) & "," & PTN_AMP_DLT(point, freq_num, 30) & "," &
PTN_AMP_SIG(point, freq_num, 31) & "," & PTN_AMP_DLT(point, freq_num, 31) & "," &
PTN_AMP_SIG(point, freq_num, 32) & "," & PTN_AMP_DLT(point, freq_num, 32))
Next
End Using
Next
End Sub
Private Sub calc_send_code()
Dim smin_tx_code(96, 32) As Integer
Dim smin_rx_code(96, 32) As Integer
Dim bypass_tx_code(96, 32) As Integer
Dim bypass_rx_code(96, 32) As Integer
Dim code_point As Integer = 16384
Dim send_code(code_point) As Integer
Dim gain_num, mod_num, port_num As Integer
Dim file_num, sosi_num, freq_num, code_num As Integer
Dim read_path As String = ""
Dim pc_path As String = ""
Dim fp, point_num As Integer
Dim buf As String
Dim strline() As String
For file_num = 0 To 3 Step 1
Select Case file_num
Case 0
read_path = HAMEN_path & "SMin_TX_HOSEI_CODE.csv"
Case 1
read_path = HAMEN_path & "Bypass_TX_HOSEI_CODE.csv"
Case 2
read_path = HAMEN_path & "SMin_RX_HOSEI_CODE.csv"
Case 3
read_path = HAMEN_path & "Bypass_TX_HOSEI_CODE.csv"
End Select
If System.IO.File.Exists(read_path) Then
sosi_num = 0
Try
fp = FreeFile()
FileOpen(fp, read_path, OpenMode.Input)
Do Until EOF(fp)
buf = LineInput(fp)
strline = Split(buf, ",")
If strline(0) = "素子" Then
Do Until EOF(fp)
buf = LineInput(fp)
strline = Split(buf, ",")
For freq_num = 0 To 31 Step 1
Select Case file_num
Case 0
smin_tx_code(sosi_num, freq_num) = Int(strline(freq_num + 1))
Case 1
bypass_tx_code(sosi_num, freq_num) = Int(strline(freq_num + 1))
Case 2
smin_rx_code(sosi_num, freq_num) = Int(strline(freq_num + 1))
Case 3
bypass_rx_code(sosi_num, freq_num) = Int(strline(freq_num + 1))
End Select
sosi_num = sosi_num + 1
Next
Loop
End If
Loop
Catch ex As Exception
TextBox18.AppendText("ファイル取得エラー(" & ex.Message & ")" & vbCrLf)
End Try
Else
'ファイルがない場合は0xFFを配列に読み込む
For sosi_num = 0 To 95 Step 1
For freq_num = 0 To 31 Step 1
Select Case file_num
Case 0
smin_tx_code(sosi_num, freq_num) = &HFF
Case 1
bypass_tx_code(sosi_num, freq_num) = &HFF
Case 2
smin_rx_code(sosi_num, freq_num) = &HFF
Case 3
bypass_rx_code(sosi_num, freq_num) = &HFF
End Select
Next
Next
End If
'フラッシュROM、書き込みフォーマット
code_num = 0
For freq_num = 0 To 31 Step 1
For gain_num = 0 To 1 Step 1
For mod_num = 0 To 15 Step 1
For port_num = 0 To 1 Step 1
If gain_num = 0 Then
For sosi_num = 0 To 7 Step 1
If port_num = 0 Then
If sosi_num < 6 Then
send_code(code_num) = smin_tx_code(mod_num * 6 + sosi_num, freq_num)
Else
send_code(code_num) = &HFF
End If
code_num = code_num + 1
Else
If sosi_num < 6 Then
send_code(code_num) = smin_rx_code(mod_num * 6 + sosi_num, freq_num)
Else
send_code(code_num) = &HFF
End If
code_num = code_num + 1
End If
Next
Else
For sosi_num = 0 To 7 Step 1
If port_num = 0 Then
If sosi_num < 6 Then
send_code(code_num) = bypass_tx_code(mod_num * 6 + sosi_num, freq_num)
Else
send_code(code_num) = &HFF
End If
code_num = code_num + 1
Else
If sosi_num < 6 Then
send_code(code_num) = bypass_rx_code(mod_num * 6 + sosi_num, freq_num)
Else
send_code(code_num) = &HFF
End If
code_num = code_num + 1
End If
Next
End If
Next
Next
Next
Next
Next
pc_path = HAMEN_path & "HOSEI_CODE.bin"
If System.IO.File.Exists(pc_path) Then
If DialogResult.OK = MessageBox.Show("「HOSEI_CODE.bin」のファイルが存在します。" & vbCrLf & "上書きしますか?", "確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) Then
Using wr As New BinaryWriter(New FileStream(pc_path, FileMode.Create))
For point_num = 0 To code_point - 1 Step 1
wr.Write(send_code(point_num))
Next
End Using
Else
MessageBox.Show("「HOSEI_CODE.bin」は更新されていません!")
End If
Else
'新規作成
Using wr As New BinaryWriter(New FileStream(pc_path, FileMode.Create))
For point_num = 0 To code_point - 1 Step 1
wr.Write(send_code(point_num))
Next
End Using
End If
End Sub