'--------------------------------------------------------------------------------------------
'This sub sends out a sweep command to sweep the points in a band
' It is a resumable sub and uses completion functions to signal to
' other application modules
Public Sub setBandSweepAndScan(band As Int, start As Double, _
stop As Double, BandMargin As Double, NoPoints As Int, rbw As Int)
'Construct the frequency strings
Dim startStr As String
Dim stopStr As String
Main.scanCompleteFlag = False
scanDataStreamText = ""
noValidScanLines = 0
Main.noScanBytesTotalExpected = networkPars.NO_CHARS_IN_SCAN_RESPONSE_PER_LINE * NoPoints + networkPars.NO_CHARS_IN_SCAN_RESPONSE_TERMINATION
Main.noScanBytesReceived = 0
bandNo = band
start = start * 1e6
If start < 1e6 Then
startStr = NumberFormat(start, 1, 0) & "k"
else if start < 1000e6 Then
startStr = NumberFormat(start / 1000000, 1, 0) & "M"
else if start > = 1 Then
startStr = NumberFormat(start / 1e9, 1, 0) & "G"
End If
stop = stop * 1e6
If stop < 1e6 Then
stopStr = NumberFormat(stop, 1, 0) & "k"
else if stop < 1000e6 Then
stopStr = NumberFormat(stop / 1e6, 1, 0) & "M"
else if stop > = 1 Then
stopStr = NumberFormat(stop / 1e9, 1, 0) & "G"
End If
' Sweep the band
Main.dataReceivedFlag = False
chCount = False
dataStr = ""
' noPointsThisScan = NoPoints
cmd = "scan"
commandStr = cmd & " " & startStr & " " & stopStr & " " & NoPoints & " " & 3
noOfPackets = 0
Main.writeCmdSerial(commandStr)
Main.dataReceivedFlag = False
End Sub