I run the script, also I carefully checked the scrip's difference with my previous example (because this example runs at MXG (N5182A), mine is ESG E4438C), good thing is they are the same.
After running it, all the errors shown in the Error Queue are:
The same problem, it can set the frequency, power, turn ON or OFF the display, but just cannot binblockwrite the data to the machine. Do you have any other suggestions to debug this? Thank you SO MUCH for your help!
Try putting a breakpoint in the code at the line where *RST is being printed. Then step through every line of code and see which line causes an ERR on the screen of the instrument. I suspect the E4438C behaves differently than the M5182A and does not support one of the SCPI commands resulting in the ERR code -113.
My guess is the E4438 does not support this commands:
:SOURce:RADio:ARB:CLOCk:SRATe
If so, you will need to remove this commands from your code and find alternative SCPI commands. Look at the manual here: http://literature.cdn.keysight.com/litweb/pdf/E4400-90622.pdf?id=549153
http://www.mathworks.com/help/instrument/examples/generating-and-downloading-a-baseband-signal-to-an-rf-signal-generator.html
You can step through and see where things error out on the instrument.