📄 testmodule2.bas
字号:
Attribute VB_Name = "TestModule2"
Option Explicit
Public bQuitApp As Boolean, bAppRunning As Boolean
' This module is for testing repeating sending ATE commands
Sub TestLoop2()
Dim lTrials As Long, i As Integer, bError As Boolean
Dim iConsecutiveFailureCount As Integer
frmMain.DisplayMsg "Test Loop starts"
frmMain.StopTestLoop = False
Do While Not frmMain.StopTestLoop And Not oComm.Connect(sUUT, False)
DoEvents
Sleep 1000
Loop
frmMain.DisplayMsg sUUT & " Connected"
bAppRunning = True
Do While Not frmMain.StopTestLoop
lTrials = lTrials + 1
iConsecutiveFailureCount = 0
' try until I2C connected
With oComm
DoEvents
For i = 1 To 100
bError = False
If frmMain.StopTestLoop Then Exit For
If aAteCommand(i) <> Empty Then
frmMain.DisplayMsg lTrials & ". Send AteCmd " & i, False
.SendHex aAteCommand(i)
.ReadBytes (Len(aAteResponse(i)) + 1) \ 3, , lfAteCmdTimeout
If .ResultHexStr <> aAteResponse(i) Then
frmMain.DisplayMsg "AteCmd" & i & " response incorrect !"
oResultLog.WriteLine ":" & .ResultHexStr
bError = True
End If
If bError Then
frmMain.DisplayMsg "Invalid response"
frmMain.UpCountFailure
'oResultLog.WriteLine ":" & .ResultHexStr
If Len(.ResultHexStr) <> Len(aAteResponse(i)) And bStopOnLengthError _
Or bStopOnContentError Then
frmMain.StopTestLoop = True
.CloseComm
MsgBox "Error occurred !" & vbCrLf & .ResultHexStr, vbCritical, "Error"
End If
Exit For
End If
Sleep iPauseBetweenAteCmd
End If
Next
End With
Loop
frmMain.DisplayMsg "Test loop stopped !"
bAppRunning = False
If bQuitApp Then Unload frmMain
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -