|
Facilidade de uso
140: Opens an IO path for sending binary data to the signal generator. 150: Creates an ASCII string representation of the number of bytes in the waveform. 160 to 170: Finds the number of digits in Nbytes. 190: Sends the first part of the SCPI command, MEM:DATA along with the name of the file, data_file, that will receive the waveform data. The name, data_file, will appear in the signal generator’s memory catalog. 200 to 210: Sends the rest of the ASCII header. 230: Sends the binary data. Note that PSGb is the binary IO path. 240: Sends an End-of-Line to terminate the transmission. 250 to 260: Closes the connections to the signal generator. 290: End the program. Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide Creating and Downloading Waveform Files Programming Examples Creating and Downloading E443xB Waveform Data Using HP BASIC for Windows On the documentation CD, this programming example’s name is “e443xb_hpbasicWin2.txt.” The following program shows you how to download waveforms using HP Basic for Windows into volatile ARB memory. This program is similar to the following program example as well as the previous examples. The difference between BASIC for UNIX and BASIC for Windows is the way the formatting, for the most significant bit (MSB) on lines 110 and 120, is handled. To download into non-volatile ARB memory, replace line 160 with: 160 OUTPUT @ESG USING "#,K";":MMEM:DATA ""NVARBI:testfile"", #" and replace line 210 with: 210 OUTPUT @ESG USING "#,K";":MMEM:DATA ""NVARBQ:testfile"", #" First, the I waveform data is put into an array of integers called Iwfm_data and the Q waveform data is put into an array of integers called Qwfm_data. The variable Nbytes is set to equal the number of bytes in the I waveform data. This should be twice the number of integers in Iwfm_data, since an integer is 2 bytes. Input integers must be between 0 and 16383. In the Output commands, USING “#,K” formats the data. The pound symbol (#) suppresses the automatic EOL (End of Line) output. This allows multiple output commands to be concatenated as if they were a single output. The “K” instructs HP Basic to output the following numbers or strings in the default format. 10 ! RE-SAVE "ARB_IQ_Win_file" 20 Num_points=200 30 ALLOCATE INTEGER Iwfm_data(1:Num_points),Qwfm_data(1:Num_points) 40 DEG 50 FOR I=1 TO Num_points 60 Iwfm_data(I)=INT(8191*(SIN(I*360/Num_points))+8192) 70 Qwfm_data(I)=INT(8191*(COS(I*360/Num_points))+8192) 80 NEXT I 90 PRINT "Data Generated" 100 Nbytes=2*Num_points 110 ASSIGN @Esg TO 719 120 !ASSIGN @Esgb TO 719;FORMAT MSB FIRST 130 Nbytes$=VAL$(Nbytes) 140 Ndigits=LEN(Nbytes$) 150 Ndigits$=VAL$(Ndigits) 160 OUTPUT @Esg USING "#,K";":MMEM:DATA ""ARBI:file_name_1"",#" 170 OUTPUT @Esg USING "#,K";Ndigits$ 180 OUTPUT @Esg USING "#,K";Nbytes$ 190 OUTPUT @Esgb;Iwfm_data(*) 200 OUTPUT @Esg;END 210 OUTPUT @Esg USING "#,K";":MMEM:DATA ""ARBQ:file_name_1"",#" 220 OUTPUT @Esg USING "#,K";Ndigits$ 230 OUTPUT @Esg USING "#,K";Nbytes$ 240 OUTPUT @Esgb;Qwfm_data(*) Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide Creating and Downloading Waveform Files Programming Examples 250 OUTPUT @Esg;END 260 ASSIGN @Esg TO * 270 ASSIGN @Esgb TO * 280 PRINT 290 PRINT "*END*" 300 END Program Comments 10: Program file name. 20 Sets the number of points in the waveform. 30: Defines arrays for I and Q waveform points. Sets them to be integer arrays. 40: Sets HP BASIC to use degrees for cosine and sine functions. 50: Sets up loop to calculate waveform points. 60: Calculates I waveform points. 70: Calculates Q waveform points. 80: End of loop. 160 and 210: The I and Q waveform files have the same name 90 to 300: See the table on page 268 for program comments. Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide Creating and Downloading Waveform Files Programming Examples Creating and Downloading E443xB Waveform Data Using HP Basic for UNIX On the documentation CD, this programming example’s name is “e443xb_hpbasicUx2.txt.” The following program shows you how to download waveforms using HP BASIC for UNIX. It is similar to the previous program example. The difference is the way the formatting for the most significant bit (MSB) on lines is handled. First, the I waveform data is put into an array of integers called Iwfm_data and the Q waveform data is put into an array of integers called Qwfm_data. The variable Nbytes is set to equal the number of bytes in the I waveform data. This should be twice the number of integers in Iwfm_data, since an integer is represented 2 bytes. Input integers must be between 0 and 16383. In the Output commands, USING “#,K” formats the data. The pound symbol (#) suppresses the automatic EOL (End of Line) output. This allows multiple output commands to be concatenated as if they were a single output. The “K” instructs HP BASIC to output the following numbers or strings in the default format. 10 ! RE-SAVE "ARB_IQ_file" 20 Num_points=20...
Este manual também é adequado para os modelos :Electricidade - E8663B (2.38 mb)
Electricidade - N5181A/82A (2.38 mb)
Electricidade - N5183A (2.38 mb)