EasyManuals Logo
Home>Agilent Technologies>Inverter>E8257D

Agilent Technologies E8257D User Manual

Agilent Technologies E8257D
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #273 background imageLoading...
Page #273 background image
Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide 263
Creating and Downloading Waveform Files
Programming Examples
AMPLITUDE = 32767 ' Scale the amplitude for full range of the signal generators
' I/Q modulator DAC
pi = 3.141592
Dim intIQ_Data(0 To 2 * SAMPLES - 1) 'Array for I and Q integers: 400
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 '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 = numPoints + 1

Table of Contents

Other manuals for Agilent Technologies E8257D

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies E8257D and is the answer not in the manual?

Agilent Technologies E8257D Specifications

General IconGeneral
BrandAgilent Technologies
ModelE8257D
CategoryInverter
LanguageEnglish

Related product manuals