Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 301
Creating and Downloading Waveform Files
Programming Examples
Visual Basic Programming Examples
Creating I/Q Data—Little Endian Order
On the documentation CD, this programming example’s name is
“
Create_IQData_vb.txt
.”
This Visual Basic programming example, using Microsoft Visual Basic 6.0, uses
little endian order data, and performs the following functions:
— error checking
— I an Q integer array creation
— I an Q data interleaving
— byte swapping to convert to big endian order
— binary data file storing to a PC or workstation
Once the file is created, you can download the file to the signal generator using
FTP (see
).
'******************************************************************
' Program Name: Create_IQData
' Program Description: This program creates a sine and cosine wave
using 200 I/Q data
' samples. Each I and Q value is represented by a 2 byte integer. The
sample points are
' calculated, scaled using the AMPLITUDE constant of 32767, and then
stored in an array
' named iq_data. The AMPLITUDE scaling allows for full range I/Q
modulator DAC values.
' Data must be in 2's complemant, MSB/LSB big-endian format. If your
PC uses LSB/MSB
' format, then the integer bytes must be swapped. This program
converts the integer
' array values to hex data types and then swaps the byte positions
before saving the
' data to the IQ_DataVB file.
'******************************************************************
Private Sub Create_IQData()
Dim index As Integer
Dim AMPLITUDE As Integer
Dim pi As Double
Dim loByte As Byte
Dim hiByte As Byte
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...