Keysight E4428C ESG RF Programming Manual page 309

Signal generators
Table of Contents

Advertisement

AMPLITUDE = 32767
pi = 3.141592
Dim intIQ_Data(0 To 2 * SAMPLES - 1)
ReDim iq_data(0 To (4 * SAMPLES - 1)) 'Need MSB and LSB bytes for each integer value: 800
'Create an integer array of I/Q pairs
For index = 0 To (SAMPLES - 1)
intIQ_Data(2 * index) = CInt(AMPLITUDE * Sin(2 * pi * index / SAMPLES))
intIQ_Data(2 * index + 1) = CInt(AMPLITUDE * Cos(2 * pi * index / SAMPLES))
Next index
'Convert each integer value to a hex string and then write into the iq_data byte array
'MSB, LSB ordered
For index = 0 To (2 * SAMPLES - 1)
strSrc = Hex(intIQ_Data(index)) 'convert the integer to a hex value
If Len(strSrc) <> 4 Then
strSrc = String(4 - Len(strSrc), "0") & strSrc
End If
hiHex = Mid$(strSrc, 1, 2)
loHex = Mid$(strSrc, 3, 2)
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
iq_data(2 * index + 1) = loByte
Next index
'Now write the data to the file
FileHandle = FreeFile()
numPoints = UBound(iq_data) 'Get the number of bytes in the file
Open strFilename For Binary Access Write As #FileHandle Len = numPoints + 1
Keysight Signal Generators Programming Guide
' Scale the amplitude for full range of the signal generators
' I/Q modulator DAC
'Array for I and Q integers: 400
'Get the first two hex values (MSB)
'Get the next two hex values (LSB)
'MSB into first byte
'LSB into second byte
'Get a file number
Creating and Downloading Waveform Files
'Convert to hex format i.e "800F
'Pad with 0's if needed to get 4
'characters i.e '0' to "0000"
Programming Examples
301

Advertisement

Table of Contents
loading

Table of Contents