Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 307
Creating and Downloading Waveform Files
Programming Examples
numPoints = (FileLen(strFilename)) 'Get number of bytes in the
file: 800 bytes
ReDim iq_data(0 To numPoints - 1) 'Dimension the iq_data array
to the
'size of the IQ_DataVB file:
800 bytes
Open strFilename For Binary Access Read As #FileHandle 'Open the
file for binary read
On Error GoTo file_error
For index = 0 To (numPoints - 1) 'Write the IQ_DataVB data to the
iq_data array
Get #FileHandle, index + 1, data '(index+1) is the record
number
iq_data(index) = data
Next index
Close #FileHandle 'Close the file
'Write the command to the Header string. NOTE: syntax
Header = "MEM:DATA ""/USER/WAVEFORM/IQ_DataVB"","
'Now write the data to the signal generator's non-volatile memory
(NVWFM)
SigGen.WriteIEEEBlock Header, iq_data
SigGen.WriteString "*OPC?" 'Wait for the operation to
complete
response = SigGen.ReadString 'Signal generator reponse to
the OPC? query
Call MsgBox("Data downloaded to the signal generator", vbOKOnly,
"Download")
Exit Sub
errorhandler:
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...