Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 303
Creating and Downloading Waveform Files
Programming Examples
strSrc = Hex(intIQ_Data(index)) 'convert the integer to a hex
value
If Len(strSrc) <> 4 Then
strSrc = String(4 - Len(strSrc), "0") & strSrc 'Convert to
hex format i.e "800F
End If 'Pad with 0's
if needed to get 4
'characters
i.e '0' to "0000"
hiHex = Mid$(strSrc, 1, 2) 'Get the first two hex values
(MSB)
loHex = Mid$(strSrc, 3, 2) 'Get the next two hex values
(LSB)
loByte = CByte("&H" & loHex) 'Convert to byte data type LSB
hiByte = CByte("&H" & hiHex) 'Convert to byte data type MSB
iq_data(2 * index) = hiByte 'MSB into first byte
iq_data(2 * index + 1) = loByte 'LSB into second byte
Next index
'Now write the data to the file
FileHandle = FreeFile() 'Get a file number
numPoints = UBound(iq_data) 'Get the number of bytes in the file
Open strFilename For Binary Access Write As #FileHandle Len =
num 1
On Error GoTo file_error
For index = 0 To (numPoints)
data = iq_data(index)
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...