我觉得不是溢出问题啊,编译器会提示overflow的,是什么导致自动退出呢
主要是这里出现的问题:Dim DataTargetWaveL1() As Double, DataTargetWaveL2() As Double, DataTargetWaveL3() As Double
Dim dataStart As Double, dataEnd As Double, dataInterval As Double
Dim DataCounts1 As Long, DataCounts2 As Long, DataCounts3 As Long
Dim dataByte(5) As Long
Dim i As Long, j As Long
Dim LinedataW As Double, Linedata As Double'上面是声明,都是Double,就不会溢出吧
 Do While i <= DataCounts1 And (StopMove = False)
    
            If i = 0 Then
                Busy = True
                StrReceiver = ""
                MSComm1.Output = "V" & 255 & Chr$(13)
                Call Delay
                Call fnMoveTWaveL(1, DataTargetWaveL1(0) - 100)
            Else
                Busy = True
                StrReceiver = ""
                MSComm1.Output = "V" & CurrentSpeed & Chr$(13)
                Call Delay
            End If
            Call fnMoveTWaveL(1, DataTargetWaveL1(i))
            StrReceiver = ""
            Com_mode = 9
            Busy = True
            MSComm1.Output = "I" & Chr$(13)
            Call Delay
            For j = 0 To 2
                dataByte(j) = Asc(Mid(StrReceiver, j + 1, 1))
            Next j
            LinedataW = DataTargetWaveL1(i)
            Linedata = dataByte(0) + dataByte(1) * 128 + dataByte(2) * 16384
            
            If Linedata > 100000 Then
            Call MsgBox("采样大于100000,退出采样!", vbInformation, "")
            GoTo EndHandler
            End If
            If Linedata > 32767 Then Linedata = Linedata - 65536
''前面是从下位机取数,后面是画线            SetRange LinedataW, Linedata
            TChart1.Series(SamplingLineNum).AddXY LinedataW, Linedata, "", clTeeColor  
            ChartGrid1.Chart = TChart1
            ChartGrid1.Rows.Row = i + 2 '(0 and 1 are Header and Field names)
            ChartGrid1.Cols.Col = ChartGrid1.Cols.Count - 1
            SamplingDelay
            i = i + 1
            DoEvents
        Loop
因为采到一定点数就退出了IDE