Chapter 3 125
ProgrammingExamples
Reading Trace Data Using ASCII Format (RS-232)
Reading Trace Data Using ASCII Format (RS-232)
/******************************* *****************************/
/* Reading Trace Data using ASCI I Format (RS-232) */
/* */
/* This example is for the E44xx B ESA Spectrum Analyzers */
/* and E740xA EMC Analyzers. */
/* */
/* This C programming example do es the following. */
/* The SCPI instrument commands used are given as */
/* reference. */
/* */
/* - Opens an RS-232 session at COM1/COM2 */
/* - Clears the Analyzer */
/* - Resets the Analyzer */
/* *RST */
/* - Set the input port to the 5 0 MHz amplitude reference */
/* CAL:SOUR:STAT ON */
/* - Query for the number of swe ep points (for firmware */
/* revisions A.04.00 and later ). Default is 401. */
/* SENS:SWE:POIN? */
/* - Set the analyzer to single sweep mode */
/* INIT:CONT 0 */
/* - Sets the analyzer center fr equency and span to 50 MHz */
/* SENS:FREQ:CENT 50 MHZ */
/* SENS:FREQ:SPAN 50 MHZ */
/* - Trigger a sweep */
/* INIT:IMM */
/* - Check for operation complet e */
/* *OPC? */
/* - Specify dBm Unit */
/* UNIT:POW DBM */
/* - Set the analyzer trace data ASCII */
/* FORM:DATA: ASC */
/* - Trigger a sweep */
/* INIT:IMM */
/* - Check for operation complet e */
/* *OPC? */
/* - Query the trace data */
/* TRAC:DATA? TRACE1 */
/* - Remove the "," from the ACS II data */
/* - Save the trace data to an A SCII file */
/* - Close the session */
/******************************* *****************************/