Attribute VB_Name = "ProcessData"
Public Sub GetDataFromHardware()
    If ScrollMode = 0 Then
        Result = sdGetData(DeviceIndex, Ch2Voltage, Ch1Voltage, Ch2HardwareData(0), Ch1HardwareData(0), Controlstate, FiltAndTrigger, levers, level(0), StartCapture, PulseTrigger, PulseTriggerMode, PulseWidth)
    Else
        TimeState.Timer = Timer
        TimeState.Time = Time
        Result = sdGetScrollData(DeviceIndex, Controlstate, levers, TimeState, Ch2Voltage, Ch1Voltage, Ch2ScrollData(0), Ch1ScrollData(0), Ch2DisplayData(0), Ch1DisplayData(0), TriggerPosition, Ch2InGND, Ch1InGND)
    End If
End Sub
Public Sub CopyDataToBuffer()
    If ScrollMode = 0 Then
        If Ch1InGND = False Then
            Result = sdChannelDataBuffer(Controlstate, InterpolationLineMode, Ch1BufferData(0), Ch1HardwareData(0))
        Else
            Result = sdChannelInGND(Ch1Position, Ch1BufferData(0))
        End If
        If Ch2InGND = False Then
            Result = sdChannelDataBuffer(Controlstate, InterpolationLineMode, Ch2BufferData(0), Ch2HardwareData(0))
        Else
            Result = sdChannelInGND(Ch2Position, Ch2BufferData(0))
        End If
        If Controlstate.TIMEBASE < 5 Then
            Dim SoftTrigPosition As Integer
            If Controlstate.TriggerSource = 1 Then
                SoftTrigPosition = sdSoftFindTriggerPoint(Controlstate.TriggerPosition, Controlstate.TIMEBASE, levers.Ch1TriggerLevel, FiltAndTrigger.TriggerSlope, Ch1BufferData(0))
                Result = sdSoftFindTriggerPointCopy(Controlstate.TriggerPosition, SoftTrigPosition, Ch2BufferData(0))
            Else
                If Controlstate.TriggerSource = 0 Then
                    SoftTrigPosition = sdSoftFindTriggerPoint(Controlstate.TriggerPosition, Controlstate.TIMEBASE, levers.Ch2TriggerLevel, FiltAndTrigger.TriggerSlope, Ch2BufferData(0))
                    Result = sdSoftFindTriggerPointCopy(Controlstate.TriggerPosition, SoftTrigPosition, Ch1BufferData(0))
                End If
            End If
        End If
    End If
End Sub
Public Sub GetDisplayData()
    If ScrollMode = 0 Then
        Result = sdGetDisplayData(Controlstate, Ch1DisplayData(0), Ch1BufferData(0))
        Result = sdGetDisplayData(Controlstate, Ch2DisplayData(0), Ch2BufferData(0))
    End If
End Sub
Public Sub DataToDisplay()
    Dim i
    If XYMode = False Then
        If Ch1Enabled = True Then
            Result = sdDisplayData(MainForm.DisplayPicture.hdc, DisPicture, PointOrLine, Ch1DisplayData(0), CH1_color)
        End If
        If Ch2Enabled = True Then
            Result = sdDisplayData(MainForm.DisplayPicture.hdc, DisPicture, PointOrLine, Ch2DisplayData(0), CH2_color)
        End If
    Else
        Result = sdDisplayDataXYMode(MainForm.DisplayPicture.hdc, DisPicture, PointOrLine, Ch1DisplayData(0), Ch2DisplayData(0))
    End If
End Sub
