Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 337
Creating and Downloading User–Data Files
User File Data (Bit/Binary) Downloads
8 Send the user file data stored in the array (databuffer) to the signal generator.
— iwrite() sends the data specified in databuffer to the signal generator (session
identifier specified in id).
— The third argument of iwrite(), bytesToSend, contains the length of the databuffer
in bytes. In this example, it is 2000.
— The fourth argument of iwrite(), 0, means there is no END of file indicator in the
data.
In many programming languages, there are two methods to send SCPI commands
and data:
— Method 1 where the program stops the data download when it encounters
the first zero (END indicator) in the data.
— Method 2 where the program sends a fixed number of bytes and ignores
any zeros in the data. This is the method used in our program.
For your programming language, you must find and use the equivalent of method
two. Otherwise you may only achieve a partial download of the user file data.
9 Send the terminating carriage (\n) as the last byte of the waveform data.
— iwrite() writes the data “\n” to the signal generator (session identifier specified in
id).
— The third argument of iwrite(), 1, sends one byte to the signal generator.
— The fourth argument of iwrite(), 1, is the END of file indicator, which the program
uses to terminate the data download.
To verify the user file data download, see “Commands for Bit File Downloads” on page 338
and “Commands for Binary File Downloads” on page 339.
Line Code Description—Download User File Data