Keysight E4428C ESG RF Programming Manual page 312

Signal generators
Table of Contents

Advertisement

Creating and Downloading Waveform Files
Programming Examples
FileHandle = FreeFile()
On Error GoTo errorhandler
With SigGen
.IO.Timeout = 5000
.WriteString "*RST"
End With
numPoints = (FileLen(strFilename))
ReDim iq_data(0 To numPoints - 1)
Open strFilename For Binary Access Read As #FileHandle
On Error GoTo file_error
For index = 0 To (numPoints - 1)
Get #FileHandle, index + 1, data
iq_data(index) = data
Next index
Close #FileHandle
'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?"
response = SigGen.ReadString
Call MsgBox("Data downloaded to the signal generator", vbOKOnly, "Download")
Exit Sub
errorhandler:
MsgBox Err.Description, vbExclamation, "Error Occurred", Err.HelpFile, Err.HelpContext
Exit Sub
file_error:
Call MsgBox(Err.Description, vbOKOnly)
Close #FileHandle
End Sub
304
'Set up the signal generator to accept a download
'Timeout 50 seconds
'Reset the signal generator.
'Get number of bytes in the file: 800 bytes
'Dimension the iq_data array to the
'size of the IQ_DataVB file: 800 bytes
'Write the IQ_DataVB data to the iq_data array
'(index+1) is the record number
'Close the file
'Wait for the operation to complete
'Signal generator reponse to the OPC? query
'Display any error message
'Open the file for binary read
Keysight Signal Generators Programming Guide

Advertisement

Table of Contents
loading

Table of Contents