Private Sub mo_bt_buzz_manual_Click()
 Dim i As Integer
 Dim al_res As Long
 Dim ab_old_prc_no As Byte
 Dim aba_res(300) As Byte
 Dim al_errno As Long
 Dim as_prc_no(10) As Byte
 Dim al_res_len As Long
 Dim as_res As String
 Dim as_wt_dat As String
 Dim aba_ttt(300) As Byte
 
 aba_ttt(0) = &H5
 aba_ttt(1) = &H3
 aba_ttt(2) = &H3
 aba_ttt(3) = &H3
 aba_ttt(4) = &H3
 'execute the ms_wt command
 ab_old_prc_no = buzz_manual(1, aba_ttt(0))
 'wait response from the unit.
 Do
    al_res = chk_res(VarPtr(aba_res(0)), VarPtr(al_res_len), VarPtr(as_prc_no(0)), VarPtr(al_errno))
    delay (10)
 Loop While al_res <> 1

 'convert BCD into ASC
 If al_res_len < 300 Then
    For i = 1 To al_res_len Step 1
       as_res = as_res & Hex(aba_res(i - 1)) & " "
    Next i
 End If
  
'Log Display
 mo_et_viw = _
 "[Magnetic card write]    " & Chr$(13) & Chr$(10) _
 & "aba_res  :" & as_res & Chr$(13) & Chr$(10) _
 & "al_res_len :" & al_res_len & Chr$(13) & Chr$(10) _
 & "al_errno :" & al_errno & Chr$(13) & Chr$(10) _
 & "as_prc_no:" & as_prc_no(0)
 
 'Exception handling
 If as_prc_no(0) <> ab_old_prc_no Then
    MsgBox ("Exception handling ---------- 1")
 End If
 
 If al_errno <> 0 Then
    MsgBox ("Exception handling ---------- 2")
 End If
 
 '
 'Etc processing, "as_stat" variable check ...
End Sub


Private Sub mo_bt_mi_wt_blk_Click()
 Dim i As Integer
 Dim al_res As Long
 Dim ab_old_prc_no As Byte
 Dim aba_res(300) As Byte
 Dim al_errno As Long
 Dim as_prc_no(10) As Byte
 Dim al_res_len As Long
 Dim as_res As String
 Dim as_wt_dat As String
 Dim aba_ttt(300) As Byte
 
 aba_ttt(0) = &H1
 aba_ttt(1) = &H2
 aba_ttt(2) = &H3
 aba_ttt(3) = &H4
 aba_ttt(4) = &H5
 aba_ttt(5) = &H6
 aba_ttt(6) = &H7
 aba_ttt(7) = &H8
 
 aba_ttt(8) = &H9
 aba_ttt(9) = &HF
 aba_ttt(10) = &H11
 aba_ttt(11) = &H12
 aba_ttt(12) = &HAA
 aba_ttt(13) = &HBB
 aba_ttt(14) = &HCC
 aba_ttt(15) = &HFF
 
 'execute the ms_wt command
 ab_old_prc_no = mi_wt_blk(2, 2, aba_ttt(0))
 'wait response from the unit.
 Do
    al_res = chk_res(VarPtr(aba_res(0)), VarPtr(al_res_len), VarPtr(as_prc_no(0)), VarPtr(al_errno))
    delay (10)
 Loop While al_res <> 1

 'convert BCD into ASC
 If al_res_len < 300 Then
    For i = 1 To al_res_len Step 1
       as_res = as_res & Hex(aba_res(i - 1)) & " "
    Next i
 End If
  
'Log Display
 mo_et_viw = _
 "[Magnetic card write]    " & Chr$(13) & Chr$(10) _
 & "aba_res  :" & as_res & Chr$(13) & Chr$(10) _
 & "al_res_len :" & al_res_len & Chr$(13) & Chr$(10) _
 & "al_errno :" & al_errno & Chr$(13) & Chr$(10) _
 & "as_prc_no:" & as_prc_no(0)
 
 'Exception handling
 If as_prc_no(0) <> ab_old_prc_no Then
    MsgBox ("Exception handling ---------- 1")
 End If
 
 If al_errno <> 0 Then
    MsgBox ("Exception handling ---------- 2")
 End If
 
 '
 'Etc processing, "as_stat" variable check ...
End Sub