Technical data

156 Agilent Connectivity Guide
6 Programming Your Instruments
CHECK(viWrite(Instrument, SCPIcmd, (ViUInt32)strlen(SCPIcmd),
&actual));
strcpy(SCPIcmd,"*CLS\n"); /* Clear errors and status registers */
CHECK(viWrite(Instrument, SCPIcmd, (ViUInt32)strlen(SCPIcmd),
&actual));
/* Compute waveform */
fprintf(stderr, "Computing Waveform...\n");
strcpy(SCPIcmd, "DATA VOLATILE");
for(i = 1; i <= 5; i++) /* Set rise time (5 points) */
sprintf(SCPIcmd, "%s,%3.1f", SCPIcmd, (double)(i - 1)/5);
for(i = 6; i <= 205; i++)
strcat(SCPIcmd, ",1"); /* Set pulse width (200 points) */
for(i = 206; i <= 210; i++) /* Set fall time (5 points) */
sprintf(SCPIcmd, "%s,%3.1f", SCPIcmd, (double)(210 - i)/5);
for(i = 211; i <= 4000; i++)
strcat(SCPIcmd, ",0"); /* Set remaining points to zero */
strcat(SCPIcmd,"\n");
/* Download data points to volatile memory */
fprintf(stderr,"Downloading Arb...\n");
CHECK(viWrite(Instrument, SCPIcmd, (ViUInt32)strlen(SCPIcmd),
&actual));
fprintf(stderr,"Download Complete\n");
/* Set up arbitrary waveform and output */
strcpy(SCPIcmd,"DATA:COPY PULSE, VOLATILE\n"); /* Copy arb to
non-volatile memory */
CHECK(viWrite(Instrument, SCPIcmd, (ViUInt32)strlen(SCPIcmd),
&actual));