Download Contents - Artisan Technology Group
Transcript
320 SUB Ramp_wave 330 Ramp_wave: !Subprogram which defines ramp waveform 340 COM @Afg,@Afg1,INTEGER Waveform(*) 350 FOR I=1 TO 4096 !calculate waveform points as dac codes 360 370 380 390 Waveform(I)=((I*.00122)/.0025)+2048 NEXT I ! OUTPUT @Afg;“SOUR:ARB:DAC:SOUR INT” !dac data source (internal) 400 OUTPUT @Afg;“SOUR:LIST:SEGM:SEL A”!select segment name 410 420 OUTPUT @Afg USING “#,K”;“SOUR:LIST:SEGM:VOLT:DAC #48192” OUTPUT @Afg1;Waveform(*) !8192 bytes: 4 digits (2 bytes/ampl point) 430 440 450 460 OUTPUT @Afg !CR LF SUBEND ! SUB Rst • • 530 SUB Errmsg • • C and QuickBASIC Program Versions Transferring Data in C The C example program, DACBLOK.C, is in directory “CPROG” and the QuickBASIC example program, DACBLOK.BAS, is in directory “ QBPROG” on the C and QuickBASIC example disk (part number E1340-10036). To transfer Definite Length Block Data to the AFG requires that the data sent with the [SOURce:]LIST[:SEGMent]:VOLTage:DAC command must be contiguous. To do this, send no carriage return (CR) and line feed (LF) before transferring all the data. The send_data function does this as follows (refer to the C function below): 1. Disable EOI and EOL using IOEOI (ISC, 0) and IOEOL (ISC, “ ”, 0), respectively. ISC contains the HP-IB select code, and the 0 and “ ” (NULL) values disables the carriage return (CR) and line feed (LF) to allow the AFG to receive a command string without a terminator. 2. Next, sent to the AFG the SCPI [SOURce:]LIST[1][:SEGment]:VOLTage:DAC command string using IOOUTPUTS (ADDR, commands, strlen(commands)). ADDR contains the AFG HP-IB address, commands contains the SCPI command string, and strlen(commands) contains the string length of commands. This enables the AFG to receive voltage data. Since CR or LF is disabled, the AFG holds execution until all the data is sent. Chapter 6 HP E1340A High Speed Operation Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com 116