Home

Programming Guide, E4428C/38C ESG Signal Generators

image

Contents

1. 4 Lowband Detector Fault Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Always Zero 0 Data QUEStionab POWer 15 14 13 12 31 100987 654 32 10 Condition Registe Data QUEStionab POWer Positive 15 14 13 12 1 10987 654 32 10 Transition Filter Data QUEStionab POWer Negative Transition Filter Data QUEStionab POWer Event Register Data QUEStionable POWer Event 15 14 13 12 111098765 4 3 Enable Register To Data Questionable Status Register Bit 3 ck704c Chapter 3 145 Programming the Status Register System Status Groups Data Ouestionable Power Condition Register The Data Ouestionable Power Condition Register continuously monitors the hardware and firmware status of the signal generator Condition registers are read only Table 3 8 Data Ouestionable Power Condition Register Bits Bit Description 08 Reverse Power Protection Tripped A 1 in this bit position indicates that the reverse power protection RPP circuit has been tripped There is no output in this state Any conditions that may have caused the problem should be corrected The RPP circuit can be reset by sending the remote SCPI command OUTput PROTection CLEar Resetting the RPP circuit bit will reset this bit to 0 1 Unleveled A 1 in this bit indicates that the output leveling loop is unable to set the output power ob IO Mod
2. Save and Recall SCPI Commands The following command seguence saves the current instrument state using the SAV command in seguence 1 register 01 A comment is then added to the instrument state SAV 01 1 MEM STAT COMM 01 1 Instrument state comment If there is a data file associated with the instrument state there will be a file name reference saved along with the instrument state However the data file must be stored in the signal generator s memory catalog as the SAV command does not save data files For more information on storing file data such as modulation formats arb setups and table entries refer to the Storing Files to the Memory Catalog section in the E4428C 38C ESG Signal Generators User s Guide NOTE File names are referenced when an instrument state is saved but a file will NOT be stored with the save function The recall function will recall the saved instrument state If there is a data file associated with the instrument state the file will be loaded along with the instrument state The following command recalls the instrument state saved in sequence 1 register 01 RCL 01 1 Chapter 4 211 Downloading and Using Files Saving and Recalling Instrument State Files Save and Recall Programming Example The following programming example uses VISA and Cf to save and recall signal generator instrument states Instruments states are saved to and recalled from your computer This console program prompt
3. Chapter 3 141 Programming the Status Register System Status Groups Data Ouestionable Condition Register The Data Ouestionable Condition Register continuously monitors the hardware and firmware status of the signal generator Condition registers are read only Table 3 7 Data Ouestionable Condition Register Bits Bit Description 0 1 2 Unused These bits are always set to 0 3 Power summary This is a summary bit taken from the QUEStionable POWer register A 1 in this bit position indicates that one of the following may have happened The ALC Automatic Leveling Control is unable to maintain a leveled RF output power i e ALC is UNLEVELED the reverse power protection circuit has been tripped See the Data Questionable Power Status Group on page 145 for more information 4 Temperature OVEN COLD A 1 in this bit position indicates that the internal reference oscillator reference oven is cold 5 Frequency summary This is a summary bit taken from the QUEStionable FREQuency register A 1 in this bit position indicates that one of the following may have happened synthesizer PLL unlocked 10 MHz reference VCO PLL unlocked 1 GHz reference unlocked sampler YO loop unlocked or baseband 1 unlocked For more information see the Data Questionable Frequency Status Group on page 148 6 Unused This bit is always set to 0 7 Modulation summary This is a summary bit taken from the QUEStionable M
4. Ouery STATus QUEStionable POWer EVENt Data Ouestionable Power Event Enable Register The Data Ouestionable Power Event Enable Register lets you choose which bits in the Data Ouestionable Power Event Register set the summary bit bit 3 of the Data Ouestionable Condition Register to 1 Command STATus OUEStionable POWer ENABle lt value gt command where lt value gt is the sum of the decimal values of the bits you want to enable Example Enable bit 9 and bit 3 so that whenever either of those bits is set to 1 the Data Ouestionable Power summary bit of the Data Ouestionable Condition Register is set to 1 Send the command STAT QUES POW ENAB 520 512 8 Query STATus QUEStionable POWer ENABle Response Decimal value of the sum of the bits previously enabled with the STATus QUEStionable POWer ENABle value command Chapter 3 147 Programming the Status Register System Status Groups Data Ouestionable Freguency Status Group NOTE A bit in this status group does not apply to the E4428C and will return a zero when gueried See Table 3 9 on page 149 for more information The Data Ouestionable Freguency Status Group is used to determine the specific event that set bit 5 in the Data Ouestionable Condition Register This group consists of the Data Ouestionable Freguency Condition Register the Data Ouestionable Freguency Transition Filters negative and positive the Data Ouestionable
5. command string appended after the null terminator bufBytes queryInstrument instSock charBuf charBuf strlen charBuf INPUT BUF SIZE strlen charBuf if guiet fwrite 2 1 stdout fwrite charBuf strlen charBuf 1 bufBytes 1 stdout fwrite n 1 1 stdout fflush stdout else commandInstrument instSock charBuf 102 Chapter 2 Programming Examples LAN Programming Examples if number numbert if show errs showErrors instSock ifdef WINSOCK closesocket instSock close winsock else close instSock endif WINSOCK return 0 End of lanio cpp ROR KKK kk k kk o IKK IK KCkCkC KK Ck Ck Kk o kok o oko k k Ck Kk oko Kk Ck Kk Ck Kk Ck ko kk ck ko k k k ko kk ke ke ke ke ke Function mainl Description Output a series of SCPI commands to the signal generator Send query results to stdout SReturn int non zero if an error occurs RRR KK KK kk o kok o ko IKK KK I Ck Ck Kk kok k oko Ck Ck Kk KC Kk oko k Ck Kk Ck ko kk koc k ke kok k kk ke ke ke ke k Rename this int mainl function to int main Re compile and the Ty execute the program Chapter 2 103 Programming Examples LAN Programming Examples BRR KK kok oko KKK IKK IKK KK I oko oko kok k oko k kok o ooo oko k kok k oko k kok k ke kk k kok oko int mainl SOCKET instSock long bufBytes char
6. prince n exit 0 viPrintf vi RST n Reset the signal generator viPrintf vi FREQ 500 kHz n Set the source CW frequency for 500 kHz viPrintf vi FREQ CW n Query the CW frequency viScanf vi t rdBuffer Read signal generator response printf Source CW frequency is s n rdBuffer Print the frequency viPrintf vi POW AMPL 2 3 dBm n Set the power level to 2 3 dBm viPrintf vi POW AMPL n Query the power level viScanf vi t rdBuffer Read the response into rdBuffer printf Source power dBm is s n rdBuffer Print the power level 54 Chapter 2 Programming Examples GPIB Programming Examples viPrintf vi OUTP STAT ON n Turn source RF state on WiPPintt vi OUTP T n Query the signal generator s RF state viScanf vi 1i amp num Read the response integer value Print the on off RF state if num gt 0 printf Source RF state is on n else printf Source RF state is off n printf n printf Verify RF state then press continue n print t mts getch viClear vi viPrintf vi OUTP STAT OFF n Turn source RF state off viPrintf vi OUTP n Query the signal generator s RF state viScanf vi 1i amp num Read the response Print the on off RF state if num gt 0 printf Source RF state is now on n else printf Source RF state is now off n Close
7. Perform the following steps to run the State_Files program 212 Chapter 4 Downloading and Using Files Saving and Recalling Instrument State Files Copy the State Files cs file from the CD ROM programming examples section to the directory where the NET Framework is installed Change the TCPIPO address in the program from TCPIPO 000 000 000 000 to your ESG s address Save the file using the cs file name extension Run the Command Prompt program Start gt Run gt cmd exe Change the directory for the command prompt to the location where the NET Framework was installed Type csc exe State_Files cs at the command prompt and then press the Enter key on the keyboard to run the program The following figure shows the command prompt interface Microsoft Window 1 Uer on s C Copyright 1985 2000 Microsoft Ca C2 WINNT Microsoft MET F ram The State_Files cs program is listed below You can copy this program from the examples directory on the ESG CD ROM E4400 90501 J RR RRR RK KR KKK IK KR IKK KKK KKK IKK I KK IK kok oko ko oko kok k oko k kok k ooo k k kok ok I oko k oko kok II I IH FileName State_Files cs This C example code saves and recalls signal generator instrument states The saved instrument state files are written to the local computer directory computer where the State_Files exe is located This is a console application that uses DLL importing to allow for calls t
8. Checks for operation complete while lngDone viScanf vi d amp lngDone Waits for setup to complete viPrintf vi SAV 1 n Saves sig gen state to register 41 Print user information printf The current signal generator operating state will be savedin printf to Register 1 Observe the state then press Enter n printf Nn Prints new line character getch Wait for user input IngDone 0 Resets the operation complete flag viPrintf vi RST n Resets the signal generator viPrintf vi OPC n Checks for operation complete Chapter 2 63 Programming Examples GPIB Programming Examples while lngDone viScanf vi d amp lngDone Waits for setup to complete Print user infromation printf The instrument is now in it s Reset operating state Press the n printf Enter key to return the signal generator to the Register 41 state n erince n Prints new line character getch Waits for user input lngDone 0 Reset the operation complete flag viPrintf vi ROL lXa Recalls stored register 1 state viPrintf vi V OPOC TYW n Checks for operation complete while lngDone viScanf vi d amp lngDone Waits for setup to complete Print user information printf The signal generator has been returned to it s Register 1 state n printf Press Enter to continue n printf Anty Prints new line character getch Waits f
9. 1024 bytes maximum read uint retCount if VisaInterop Read device buf uint buf Length 1 out retCount 0 retValue Encoding ASCII GetString buf 0 int retCount return retValue The following method reads a SCPI definite block from the signal generator and writes the contents to a file on your computer The trailing newline character is NOT consumed by the read static public void ReadFileBlock uint device string fileName Create the new empty data file FileStream fs new FileStream fileName FileMode Create Read the definite block header lengthDataLength dataLength uint retCount 0 byte buf new byte 10 VisaInterop Read device buf 2 out retCount VisaInterop Read device buf uint buf 1 0 out retCount uint fileSize UInt32 Parse Encoding ASCII GetString buf 0 int retCount Read the file block from the signal generator Chapter 4 219 Downloading and Using Files Saving and Recalling Instrument State Files byte readBuf new byte TRANSFER BLOCK SIZE uint bytesRemaining fileSize while bytesRemaining 0 uint bytesToRead bytesRemaining lt TRANSFER_BLOCK_SIZE bytesRemaining TRANSFER BLOCK SIZE VisaInterop Read device readBuf bytesToRead out retCount fs Write readBuf 0 int retCount bytesRemaining retCount Done with file fs Close The following method writes the contents of the specified file to th
10. ROR RRR kok kok kok o kok kok k oko kok kok k k kok k k kok k ke ke ke ke KK hostPtr gethostbyname hostname if hostPtr NULL 10 fprintf stderr unable to resolve hostname s n hostname return INVALID SOCKET BRR ke k ke e eee e ke ee e e create a socket Chapter 2 87 Programming Examples LAN Programming Examples Ok s socket AF_INET SOCK_STREAM 0 if s INVALID_SOCKET fprintf stderr unable to create socket to s hostname strerror errno return INVALID SOCKET memcpy amp peeraddr in sin addr s addr hostPtr gt h addr peeraddr in sin family AF INET s n hostPtr gt h length peeraddr in sin port htons unsigned short portNumber if connect s const struct sockaddr amp peeraddr in sizeof struct sockaddr in SOCKET ERROR fprintf stderr unable to create socket to s hostname strerror errno return INVALID SOCKET return s s n RRR KK KKK KKK IKK IKK IKK IKK IA I KR IKK IA I KR IRR IA IR IRR RR A I HH gt Function commandInstrument SDescription send a SCPI command to the instrument 88 Chapter 2 Programming Examples LAN Programming Examples Parameters FILE file pointer associated with TCP IP socket const char command SCPI command string SReturn char a pointer to the result string SErrors returns 0 if sen
11. after renaming to int main will output a sequence of commands to the signal generator You can use the format as a template and then add your own code This program is available on the ESG Documentation CD ROM as lanio c Sockets on UNIX In UNIX LAN communication via sockets is very similar to reading or writing a file The only difference is the openSocket routine which uses a few network library routines to create the TCP IP network connection Once this connection is created the standard fread and fwrite routines are used for network communication The following steps outline the process 1 Copy the lanio c and getopt c files to your home UNIX directory For example users mydir 2 Atthe UNIX prompt in your home directory type cc Aa O o lanio lanio c 3 Atthe UNIX prompt in your home directory type 1anio xxxxx IDN where xxxxx is the hostname for the signal generator Use this same format to output SCPI commands to the signal generator The int mainl function will output a sequence of commands in a program format If you want to run a Chapter 2 79 Programming Examples LAN Programming Examples program using a seguence of commands then perform the following 1 Rename the lanio c int mainl toint main andthe original int main to int mainl 2 Inthe main openSocket function change the your hostname here string to the hostname of the signal generator you want to control 3 Resa
12. 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 178 for program comments Chapter 4 185 Downloading and Using Files Understanding ARB Waveform File Composition and Encryption Understanding ARB Waveform File Composition and Encryption NOTE This feature is available only in E4438C ESG Vector Signal Generators with Option 001 601 or 002 602 When you generate a waveform from an ARB personality option including Signal Studio a waveform file is automatically created and stored in volatile memory along with providing you the option of renaming and or moving it to non volatile memory for safe storage The waveform file is comprised of header information waveform data and marker data The header information contains ESG ARB settings so that if the header is saved the waveform can be identically reproduced The ARB settings default to unspecified unless you save the header information In either case header information always accompanies the waveform data Refer to the User s Guide for more information on headers Additionally these waveform files can be extracted from the ESG in encrypted form for use
13. A GPIB interface card must be installed in your computer Two common GPIB interface cards are the National Instruments NI PCI GPIB and the Agilent GPIB interface cards Follow the GPIB interface card instructions for installing and configuring the card in your computer The following tables provide information on some of the interface cards available See the Agilent website www agilent com for details on GPIB interface cards that are available Table 1 1 Agilent GPIB Interface Card for PC Based Systems Interface Operating 0 Languages Backplane B Max 1 0 Buffering Card System Library US kB sec Agilent Windows VISA C C Visual ISA EISA 750 Built in 82341C for 95 98 NT SICL Basic Agilent 16 bit ISA bus 20009 VEE Agilent computers Basic for Windows Agilent Windows VISA C C Visual ISA EISA 750 Built in 82341D 95 SICL Basic Agilent 16 bit Plug amp Play VEE Agilent for PC Basic for Windows Agilent Windows VISA C C Visual PCI 32 bit 750 Built in 82350A for 95 98 NT SICL Basic Agilent PCI bus 2000 VEE Agilent computers Basic for Windows Windows 95 98 NT and 2000 are registered trademarks of M icrosoft Corporation Chapter 1 7 Getting Started Using GPIB Table 1 2 NI GPIB Interface Card for PC Based Systems Interface Operating I O Library Languages Backplane B Maxl 0 Card System US National Windows VIS
14. Download the E443xB type files to the signal generator exactly as if downloading files to a E443xB signal generator Downloaded E443xB waveform type files will automatically be converted to the new file format as described on page 162 and stored into the signal generator s memory The file conversion process takes more time than downloading files that are already in the new file format Store E443xB file downloads to waveform memory and then transfer them over to NVWFM memory to avoid the time required to convert these file types E443xB Data Format The following diagram describes the data format for the E443xB waveform files This file structure can be compared with the new style file format shown in Table 4 1 on page 163 If new waveform files are created for the signal generator use the new style format ARB Data Format E443xB ARB Data Format Marker Data Volatile Memory Path gt le 14 bits DAC Data File MSB Offset Binary LSB Q File 14 bits DAC Data inval Offset Binary arto data 180 Chapter 4 Downloading and Using Files ARB Waveform Data Downloads Storage Locations for ARB files Waveforms can be stored to either volatile waveform memory or the non volatile NVARB memory The signal generator supports the E443xB directory structure for waveform file storage e For the E443xB style 14 bit waveforms the following storage locations are used 1 For non volatile NVARB memory the directory locations are user nva
15. Freguency Event Register and the Data Ouestionable Freguency Event Enable Register Synthesizer Unlocked 10 MHz Reference Unlocked 1 GHz Reference Unlocked Baseband 1 Unlocked Unused Sampler Loop Unlocked YO Loop Unlocked Unused Unused Unused Unused Unused Unused Unused Unused Always Zero 0 Data n ondition Register Data QUEStionable EERENZZIIIIIZIE Transition Filter Data QUEStionable EENEREEEIIIIZIIE Vedan Transition Filter EEEENEEIIIZIIID FAEGueny 15 14 13 12 1 10987 65 43 2 1 0 1110987654321 Event Register i LL n mm m m S l ay OE EEEO a amp TI Ss mm S O ut KS mw 8 ososan tt tt ttt ttttt tt SS Enable Register i To Data Questionable Status Register Bit 5 ck7069 148 Chapter 3 Programming the Status Register System Status Groups Data Ouestionable Freguency Condition Register The Data Ouestionable Freguency Condition Register continuously monitors the hardware and firmware status of the signal generator Condition registers are read only Table 3 9 Data Ouestionable Freguency Condition Register Bits Bit Description 0 Synth Unlocked A 1 in this bit indicates that the synthesizer is unlocked 1 10 MHz Ref Unlocked A 1 in this bit indicates that the 10 MHz reference signal is unlocked 2 1 Ghz Ref Unlocked A 1 in this bit indicates that the 1 Ghz reference signal is unlocked 38 Baseband 1 Unlocked A 1 in this bit indicates
16. K Ndigits OUTPUT Esg USING K Nbytes WAIT OUTPUT Esgb Int_array OUTPUT Esg END ASSIGN Esg TO ASSIGN Esgb TO PRINT PRINT END END Chapter 4 Downloading and Using Files ARB Waveform Data Downloads Program Comments 10 Program file name 20 Sets the number of points in the waveform 30 Allocates integer data array for I and O waveform points 40 Sets HP BASIC to use degrees for cosine and sine functions 50 Sets up first loop for I waveform points 60 Calculate and interleave I waveform points 70 End of loop 80 Sets up second loop for Q waveform points 90 Calculate and interleave Q waveform points 100 End of loop 120 Calculates number of bytes in I Q waveform 130 Opens an I O path to the signal generator using GPIB 7 is the address of the GPIB card in the computer and 19 is the address of the signal generator This I O path is used to send ASCII data to the signal generator 140 Opens an I O 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 t
17. Refer to Table 1 4 for cable part numbers Table 1 4 Agilent GPIB Cables Model 10833A 10833B 10833C 10833D 10833F 10833G Length 1 meter 2 meters 4 meters 5 meter 6 meters 8 meters NI VISA is a registered trademark of National Instruments Corporation Chapter 1 Getting Started Using GPIB 4 Verifying GPIB Functionality Use the VISA Assistant available with the Agilent IO Library or the Getting Started Wizard available with the National Instrument I O Library to verify GPIB functionality These utility programs allow you to communicate with the signal generator and verify its operation over the GPIB Refer to the Help menu available in each utility for information and instructions on running these programs If You Have Problems 1 Verify the signal generator s address matches that declared in the program example programs in Chapter 2 use address 19 2 Remove all other instruments connected to the GPIB and re run the program 3 Verify that the GPIB card s name or id number matches the GPIB name or id number configured for your PC GPIB Interface Terms An instrument that is part of a GPIB network is categorized as a listener talker or controller depending on its current function in the network listener A listener is a device capable of receiving data or commands from other instruments Several instruments in the GPIB network can be listeners simultaneously talker A talker is
18. STATe ON 200 Chapter 4 Downloading and Using Files FIR Filter Coefficient Dow nloads FIR Filter Coefficient Downloads NOTE This feature is available only in E4438C ESG Vector Signal Generators with Option 001 601 or 002 602 The signal generator accepts finite impulse response FIR filter coefficient downloads After downloading the coefficients these user defined FIR filter coefficient values can be selected as the filtering mechanism for the active digital communications standard Data Reguirements There are two reguirements for user defined FIR filter coefficient files 1 Data must be in ASCII format The signal generator processes FIR filter coefficients as floating point numbers 2 Data must be in List format FIR filter coefficient data is processed as a list by the signal generator s firmware See Sample Command Line on page 207 Data Limitations Filter lengths of up to 1024 taps coefficients are allowed The oversample ratio OSR is the number of filter taps per symbol Oversample ratios from 1 through 32 are possible The maximum combination of OSR and symbols allowed is 32 symbols with an OSR of 32 The Real Time I Q Baseband FIR filter files are limited to 1024 taps 64 symbols and a 16 times oversample ratio FIR filter files with more than 64 symbols cannot be used The ARB Waveform Generator FIR filter files are limited to 512 taps and 512 symbols The sampling period At is equal to the inve
19. To erase the current hostname press Editing Keys gt Clear Text 4 Press Enter 5 Press LAN Config Manual DHCP to Manual 6 Press IP Address and enter a desired address Use the left and right arrow keys to move the cursor Use the up and down arrow keys front panel knob or numeric keypad to enter an IP address To erase the current IP address press the Clear Text softkey NOTE To remotely access the signal generator from a different LAN subnet you must also enter the subnet mask and default gateway See your system administrator to obtain the appropriate values 7 Press the Proceed With Reconfiguration softkey and then the Confirm Change Instrument will Reboot softkey This action assigns a hostname and IP address as well as a gateway and subnet mask if these have been configured to the signal generator The hostname IP address gateway and subnet mask are not affected by an instrument preset or by a power cycle DHCP Configuration 1 Press Utility gt GPIB RS 232 LAN gt LAN Setup NOTE If the DHCP server uses dynamic DNS to link the hostname with the assigned IP address the hostname may be used in place of the IP address Otherwise the hostname is not usable and you may skip steps 2 through 4 2 Press Hostname NOTE The Hostname softkey is only available when LAN Config Manual DHCP is set to Manual Chapter 1 17 Getting Started Using LAN 3 Use the labeled text softkeys or numeric keypad or both to
20. Unused Always Zero 0 Chapter 3 Event Register Event Enable Reg Baseband Operation Status Group Event Register Overview To Data Questionable Status Group 3 To Data Questionable Status Group 5 To Data Questionable Status Group 7 To Data Questionable Status Group 8 To Data Questionable Status Group 12 To Standard Operation Status Group 10 121 Programming the Status Register System Overview Figure 3 2 The Overall Status Byte Register System 2 of 2 Status Byte Register Unused 0 Unused Error Event Queue Summary Bit 2 Data Questionable Status Summary Bit From Data Quest Frequency Status Group Data Questionable Message Available MAV 4 Status Group Std Event Status Sum Bit 5 IM From Data Quest Modulation Status Group Unused Req Serv Sum Bit RQS 6 ti Unused Std Operation Status Sum Bit From Data Quest Calibration Status Group Unused T o From Data Questionable Power Status Group summary EMPerature VEN COLD From Data Ouest BERT Status Group OONO U KOV lt o0 o o summary isla E Unused H 2 o summary cjele le s From Baseband Operation Status Group summary E o sfc SELFtest S Lue summary Unused Oper Complete Req Bus Control Query Error Dev Dep Error Execution Error Command Error User Request Power On Wa CALibrating Settling Unused SWEeping DCFM DCIM Null in Progress Baseband is Bus
21. charBuf char malloc INPUT_BUF_SIZE RRR KK RK kok o oko ko oko kok k oko k kok k k ko ke ke ke ke ke ke ke KK open a socket connection to the instrument RRR KK KKK IKK I k k kok k k kok kk k kk kk k kk ee e e ifdef WINSOCK if init winsock 0 exit 1 endif WINSOCK instSock openSocket xxxxxx SCPI PORT Put your hostname here if instSock INVALID_SOCKET fprintf stderr Unable to open socket n return 1 fprintf stderr Socket opened n bufBytes queryInstrument instSock IDN n charBuf INPUT BUF SIZE printf ID s n charBuf commandInstrument instSock FREQ 2 5 GHz n printrzi i Xn bufBytes queryInstrument instSock FREQ CW n charBuf INPUT BUF SIZE 104 Chapter 2 Programming Examples LAN Programming Examples printf Freauency s n charBuf commandInstrument instSock POW AMPL 5 dBm n bufBytes queryInstrument instSock POW AMPL n charBuf INPUT BUF SIZE printf Power Level s n charBuf printf An ifdef WINSOCK closesocket instSock close winsock else close instSock endif WINSOCK return 0 RRR KR KKK IK KK IKK IK KK IKK IK KKK IKK IKK IKK IR k k k k k k k ok kok k kok k I HK getopt 3C getopt 3C PROGRAM FILE NAME getopt c getopt get option letter from argument vector SYNOPSIS int getopt int argc char const argv const char optst
22. optind if optind gt argc argv optind 0 argv optind 1 0 return EOF if strcmp argv optind 0 optind return EOF scan argv optind 1 optind c scantt posn strchr optstring c DDP if posn NULL c fprintf stderr s unknown option c n argv 0 c return posn tt if posn if scan O optarg scan scan NULL else optarg argv optind optind Chapter 2 107 Programming Examples LAN Programming Examples return c Sockets LAN Programming Using PERL This example uses PERL script to control the signal generator over the sockets LAN interface The signal generator frequency is set to 1 GHz queried for operation complete and then queried for it s identify string This example was developed using PERL version 5 6 0 and requires a PERL version with the IO Socket library 1 In the code below enter your signal generator s hostname in place of the xxxxx in the code line my SinstrumentName xxxxx 2 Save the code listed below using the filename lanperl 3 Run the program by typing perl lanperl at the UNIX term window prompt Setting the Power Level and Sending Queries Using PERL The following program example is available on the ESG Documentation CD ROM as perl txt usr bin perl PROGRAM NAME perl txt Example of talking to the signal generator via SCPI over soc
23. 19 PRAM downloads 224 RS 232 31 user file downloads 226 user FIR filter downloads 228 U UNIX 7 user file downloads 195 modulating and activating the carrier 200 selecting the user file as the data source 198 user files as data sources for frames transmissions 191 in framed mode 189 in pattern mode 189 multiple user files as data sources 194 user FIR file downloads 201 selecting a downloaded user FIR file 202 user flatness 211 using files 161 V viPrintf 14 VISA 9 16 28 include files 37 library 39 scanf 15 viClear 13 viPrintf 14 viTerminate 11 VISA Assistant 4 10 VISA COM IO Library 37 38 Visual Basic 6 IDE 37 38 references 37 38 viTerminate 11 VXI 11 20 74 programming 74 with SICL 74 with VISA 77 W waveform downloading using C 170 using HP BASIC for UNIX 176 184 using HP BASIC for Windows 173 182 waveform files composition 186 encryption 186 extracting 187 headers 186 use in other ESGs 187 Windows 2000 24 Windows NT 3 4 236 Index
24. 2 Programming Examples RS 232 Programming Examples Connect the computer to the signal generator using the RS 232 serial cable and enter the following code into the project cpp source file The program queries the signal generator ID string and sets and queries the power level Query results are printed to the screen The default attributes e g 9600 baud parity 8 data bits 1 stop bit are used These attributes can be changed using VISA functions IMPORTANT Set the signal generator BAUD rate to 9600 for this test J RR KK KKK I KK I o oko kok k oko k oko oko kok kok k k kok k k RR IR IRR IR IRR k k k k RA k k k AI kok IK k include lt visa h gt include lt stdio h gt include StdAfx h include lt stdlib h gt include lt conio h gt define MAX_COUNT 200 int main void ViStatusstatus Declares a type ViStatus variable ViSessiondefaultRM instr Declares type ViSession variables ViUInt32retCount Return count for string I O ViCharbuffer MAX COUNT Buffer for string I O status viOpenDefaultRM amp defaultRM Initializes the system Open communication with Serial Port 2 status viOpen defaultRM ASRL2 INSTR VI NULL VI NULL amp instr Chapter 2 117 Programming Examples RS 232 Programming Examples if status If problems then prompt user printf Could not open ViSession n printf Check instruments and connections M n prin
25. 70 80 220 230 240 250 330 340 350 370 Programming Examples GPIB Programming Examples data formats CLEAR and RESET the controller and RUN the following program Vo ck ck ck kk ko Ck kk Ck Ck ck kk Ck ke kk kk ke kk kk ke kk kk Sk kk kk ko kk ko Sk ko kk kk ke kk kk kc k Sk kk ko ko Sk ko Sk ko k Sk ko k Sk kv ko ko k ck ko ko ko DIM A 10 C 100 D 10 Declares variables to hold string response data INTEGER B Declares variable to hold integer response data Sig gen 719 Declares variable to hold signal generator address LOCAL Sig gen Puts signal generator in Local mode CLEAR Sig gen Resets parser and clears any pending output CLEAR SCREEN Clears the controller s display OUTPUT Sig gen RST Puts signal generator into a defined state OUTPUT Sig gen FREQ CW Querys the signal generator CW frequency setting ENTER Sig gen F Enter the CW frequency setting Print frequency setting to the controller display PRINT Present source CW frequency is F 1 E 6 MHz PRINT OUTPUT Sig gen POW AMPL Querys the signal generator power level ENTER Sig gen W Enter the power level Print power level to the controller display PRINT Current power setting is W dBM PRINT OUTPUT Sig gen FREQ MODE Querys the signal generator for frequency mode ENTER Sig gen A Enter in the mode CW Fixed or List Print frequency mode to the controller display PRINT Source s fr
26. Bits Bit Description 13 14 Unused These bits are set to 0 15 Always 0 a On the E4428C this bit applies only to the DCFM DC M calibration b On the E4428C this bit is set to 0 Query STATus QUEStionable CONDition Response The decimal sum of the bits set to 1 Example The decimal value 520 is returned The decimal sum 512 bit 9 8 bit 3 Data Questionable Transition Filters negative and positive The Data Questionable Transition Filters specify which type of bit state changes in the condition register set corresponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 Commands STATus QUEStionable NTRansition value negative transition or STATus QUEStionable PTRansition value positive transition where value is the sum of the decimal values of the bits you want to enable Queries STATus QUEStionable NTRansition STATus QUEStionable PTRansition Data Questionable Event Register The Data Questionable Event Register latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register Query STATus QUEStionable EVENt Chapter 3 143 Programming the Status Register System Status Groups Data Ouestionable Event Enable Register The Data Ouestionabl
27. Decimal Values 23 8 28 288s3 g8 9 7 7 Decimal c Me LEE I e Value 7 lt Bit Number 15 14 13 12 11 10 9 8 7 6 54 3 21 0 NOTE Bit 15 is not used and is always set to zero Chapter 3 123 Programming the Status Register System Accessing Status Register Information Accessing Status Register Information 1 Determine which register contains the bit that reports the condition Refer to Figure 3 1 on page 121 or Figure 3 2 on page 122 for register location and names 2 Send the unique SCPI query that reads that register 3 Examine the bit to see if the condition has changed Determining W hat to M onitor You can monitor the following conditions current signal generator hardware and firmware status e whether a particular condition bit has occurred Monitoring Current Signal Generator Hardware and Firmware Status To monitor the signal generator s operating status you can query the condition registers These registers represent the current state of the signal generator and are updated in real time When the condition monitored by a particular bit becomes true the bit sets to 1 When the condition becomes false the bit resets to 0 Monitoring Whether a Condition Bit has Changed The transition registers determine which bit transition condition change should be recorded as an event The transitions can be positive to negative negative to positive or b
28. Esg USING K Ndigitss Esg USING K Nbytes Esgb Qwfm_data Esg END Esg TO Esgb TO 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 175 for program comments Chapter 4 183 Downloading and Using Files ARB Waveform Data Downloads Waveform Dow nloading Using HP BASIC for UNIX The following program shows you how to download waveforms using HP BASIC for UNEX 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 Owfm 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 Iw m 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
29. KKK I ao aaa kok o oko ko oko kok k k oko oko I oko aaa I I I PROGRAM FILE NAME visaex4 cpp PROGRAM DESCRIPTION This example demonstrates query commands The signal generator frequency and power level The RF state of the signal generator is turn on and then the state is queried The response will indicate that the RF state is on The RF state is then turned off and queried The response should indicate that the RF state is off The query results are printed to the to the display window JKR KK RR KK IK KK I IK RIK IKK IR IR IRR IR AIR IRR IR AIR RRR IIR RR IR k k k k k k k k k k k k k He include StdAfx h Chapter 2 53 Programming Examples GPIB Programming Examples include lt visa h gt include lt iostream gt include lt stdlib h gt include lt conio h gt void main ViSession defaultRM vi Declares variables of type ViSession for instrument communication ViStatus viStatus 0 Declares a variable of type ViStatus for GPIB verifications char rdBuffer 256 Declare variable to hold string data int num Declare variable to hold integer data viStatus viOpenDefaultRM amp defaultRM Initialize VISA system Open session to GPIB device at address 19 viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus If problems then prompt user printf Could not open ViSession n printf Check instruments and connections M n
30. Otherwise the hostname is not usable and you must use the IP address to communicate with the signal generator over the LAN UNIX is a registered trademark of the Open Group MS DOS is a registered trademark of M icrosoft Corporation 18 Chapter 1 Table 1 12 Getting Started Using LAN Ping Responses Normal Response for UNIX A normal response to the ping command will be a total of 9 or 10 packets received with a minimal average round trip time The minimal average will be different from network to network LAN traffic will cause the round trip time to vary widely Normal Response for DOS or Windows A normal response to the ping command will be a total of 9 or 10 packets received if 10 echo requests were specified Error Messages If error messages appear then check the command syntax before continuing with troubleshooting If the syntax is correct resolve the error messages using your network documentation or by consulting your network administrator If an unknown host error message appears try using the IP address instead of the hostname Also verify that the host name and IP address for the signal generator have been registered by your IT administrator Check that the hostname and IP address are correctly entered in the node names database To do this enter the nslookup hostname command from the command prompt No Response If there is no response from a ping no packets were received Check tha
31. Programs gt Command Prompt 4 Compile the program At the command prompt type javac ScpiSockTest java The directory path for the Java compiler must be specified For example C gt jdk1 3 0_02 bin javac ScpiSockTest java 5 Run the program by typing java ScpiSockTest at the command prompt 6 Type exit at the command prompt to end the program Chapter 2 109 Programming Examples LAN Programming Examples Generating a CW Signal Using J ava The following program example is available on the ESG Documentation CD ROM as javaex txt J BR KK KKK IK KK I KK kk kk KK IKK IR IKK IRR IR AR IRR IR IR IR RA kok k k k k ke ke PROGRAM NAME javaex txt Sample java program to talk to the signal generator via SCPI over sockets This program requires Java version 1 1 or later Save this code as ScpiSockTest java Compile by typing javac ScpiSockTest java Run by typing java ScpiSockTest The signal generator is set for 1 GHz and queried for its id string J BRK KK KK IK KK I KK kk kk k kok kok oko oko kok kok k k kok k kok kok kok k k kok k k k k k k k k k k k kk k kok k k k k He import java io import java net class ScpiSockTest public static void main String args String instrumentName xxxxx Put instrument hostname here try Socket t new Socket instrumentName 5025 Connect to instrument Setup read write mechanism BufferedWriter out new BufferedWriter new OutputStreamWriter
32. Register set the summary bit bit 7 of the Status Byte Register to 1 Command STATus OPERation ENABle lt value gt where value is the sum of the decimal values of the bits you want to enable Example To enable bit 9 and bit 3 so that whenever either of those bits is set to 1 the Standard Operation Status summary bit of the Status Byte Register is set to 1 Send the command STAT OPER ENAB 520 512 8 Ouery STATus OPERation ENABle Response Decimal value of the sum of the bits previously enabled with the STATus OPERation ENABle lt value gt command Chapter 3 137 Programming the Status Register System Status Groups Baseband Operation Status Group NOTE This status group does not apply to the E4428C and if gueried will return a zero The Baseband Operation Status Group is used to determine the specific event that set bit 10 in the Standard Operation Status Group This group consists of the Baseband Operation Condition Register the Baseband Operation Transition Filters negative and positive the Baseband Operation Event Register and the Baseband Operation Event Enable Register Baseband 1 Busy Baseband 1 Communicating Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Always Zero 0 Condition Register 15 14 13 12 11109876543 2 1 5 EENENEZZIIIFIIIE aseband Operation Positive 15 14 13 12 11109 87 65 43 2 1
33. SRO and then sets the signal generator for a step mode sweep The program will enter a printing loop which prints Chapter 2 69 Programming Examples GPIB Programming Examples an character and ends when the sweep has completed and an SRO received J RR RRR RR KR KKK KKK KKK IKK I KK IKK IKK IKK IKK IA IRR IK IA IRR KK kok k I ke ke include visa h include lt stdio h gt include StdAfx h include windows h include lt conio h gt define MAX_CNT 1024 int sweep 1 End of sweeep flag Prototypes ViStatus _VI_FUNCH interupt ViSession vi ViEventType eventType ViEvent event addr int main ViSession defaultRM vi Declares variables of type ViSession for instrument communication ViStatus viStatus 0 Declares a variable of type ViStatus for GPIB verifications char rdBuffer MAX_CNT Declare a block of memory data viStatus viOpenDefaultRM amp defaultRM Initialize VISA session if viStatus lt VI SUCCESS If problems then prompt user printf ERROR initializing VISA exiting n prince na 70 ViAddr Chapter 2 Programming Examples GPIB Programming Examples return 1 Open session to gpib device at address 19 viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus If problems then prompt user printf ERROR Could not open communication with instrument Mn printf nt return 1 viC
34. The Data Questionable BERT Event Register latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register Query STATus QUEStionable BERT EVENt Data Questionable BERT Event Enable Register The Data Questionable BERT Event Enable Register lets you choose which bits in the Data Questionable BERT Event Register set the summary bit bit 3 of the Data Questionable Condition Register to 1 Command STATus QUEStionable BERT ENABle value command where value is the sum of the decimal values of the bits you want to enable Example Enable bit 9 and bit 3 so that whenever either of those bits is set to 1 the Data Questionable BERT summary bit of the Data Questionable Condition Register is set to 1 Send the command STAT QUES BERT ENAB 520 512 8 Query STATus QUEStionable BERT ENABle Response Decimal value of the sum of the bits previously enabled with the STATus QUEStionable BERT ENABle value command Chapter 3 159 Programming the Status Register System Status Groups 160 Chapter 3 4 Downloading and Using Files Computer generated data can be downloaded into the signal generator Depending on the options present the signal generator can accept ARB waveform data user file data FIR filte
35. Type SCPI MMEM DATA UNPRotected user waveform filename lt blockdata gt non volatile memory MMEM DATA UNPRotected NV WFM filename lt blockdata gt MMEM DATA UNPRotected filename NVWFM FTP volatile memory put filename user bbg 1 waveform newfilename FTP non volatile memory put filename user waveform newfilename Extracting waveform files from the ESG for use in other ESGs Waveform files can only be extracted from the SECUREWAVE directory The SECUREWAVE directory is not an actual directory but behaves more like a portal through which waveform data is packaged with header and marker data and encrypted during file extraction You can use either FTP or SCPI commands to extract the waveform file from the ESG to your computer Table 4 3 shows the command syntax options for both methods Table 4 3 Extraction M ethod Command Syntax Options M emory Type SCPI MMEM DATA user bbg1 securewave filename volatile memory MMEM DATA SWFMI filename MMEM DATA filename SWFM1 SCPI non volatile memory MMEM DATA user securewave filename MMEM DATA SNVWFM filename MMEM DATA filename SNVWEM FTP volatile memory get user bbg1 securewave filename FTP non volatile memory get user securewave filename Chapter 4 187 Downloading and Using Files Understanding ARB Waveform File Composition and Encryption Dow nloading encrypted waveform fil
36. X kc k X AA kck A ck A kck kck ck ckck kck ck k k ok 10 20 INTEGER Num 30 DIM Str 200 Str1 20 40 CONTROL 9 0 1 Resets the RS 232 interface 50 CONTROL 9 3 9600 Sets the baud rate to match signal generator rate 60 STATUS 9 4 Stat Reads the value of register 4 70 Num BINAND Stat 7 Gets the AND value 80 CONTROL 9 4 Num Sets the parity to NONE 90 OUTPUT 9 IDN Querys the sig gen ID 200 ENTER 9 Str Reads the ID 210 WAIT 2 Waits 2 seconds 220 PRINT ID Str Prints ID to the screen 230 OUTPUT 9 POW AMPL 5 dbm Sets the the power level to 5 dbm 240 OUTPUT 9 POW Querys the power level of the sig gen 250 ENTER 9 Str1 Reads the queried value 260 PRINT Power Stri Prints the power level to the screen 270 END End the program Queries Using VISA and C This example uses VISA library functions to communicate with the signal generator The program verifies that the RS 232 connections and interface are functional Launch Microsoft Visual C add the required files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as rs232ex2 cpp J RR RRR RK k KKK I KK Kk Ck KK I KK IKK KK I KK KK k A IK IKK KK k k Kk Ck Kk Ck Ck Kk k ke Kk ko kk k ke A k k k k k e PROGRAM NAME rs232ex2 cpp PROGRAM DESCRIPTION This code example uses the RS 232 serial interface to control the signal generator 116 Chapter
37. a device capable of transmitting data To avoid confusion a GPIB system allows only one device at a time to be an active talker controller A controller typically a computer can specify the talker and listeners including itself for an information transfer Only one device at a time can be an active controller GPIB Function Statements Function statements are the basis for GPIB programming and instrument control These function statements combined with SCPI provide management and data communication for the GPIB interface and the signal generator This section describes functions used by different I O libraries Refer to the NI 488 2 Function Reference Manual for Windows Agilent Standard Instrument Control Library reference manual and Microsoft Visual C 6 0 documentation for more information Microsoft is a registered trademark of Microsoft Corporation 10 Chapter 1 Getting Started Using GPIB Abort Function The Agilent BASIC function ABORT and the other listed I O library functions terminate listener talker activity on the GPIB and prepare the signal generator to receive a new command from the computer Typically this is an initialization command used to place the GPIB in a known starting condition Table 1 5 Agilent BASIC VISA NI 488 2 Agilent SICL 10 ABORT 7 viTerminate parameter ibstop int ud iabort id list Agilent BASIC The ABORT function stops all GPIB activity VISA Library
38. a total length of 20 meters LAN LAN based communication is supported by the signal generator Data transfer is fast as the LAN handles packets of data The distance between a computer and the signal generator is limited to 100 meters 10Base T The following protocols can be used to communicate with the signal generator over the LAN e VMEbus Extensions for Instrumentation VXT as defined in VXI 11 Sockets LAN Telephone Network TELNET File Transfer Protocol FTP RS 232 RS 232 is acommon method used to communicate with a single instrument its primary use is to control printers and external disk drives and connect to a modem Communication over RS 232 is much slower than with GPIB or LAN because data is sent and received one bit at a time It also requires that certain parameters such as baud rate be matched on both the computer and signal generator I O Libraries An VO library is a collection of functions used by a programming language to send instrument commands and receive instrument data Before you can communicate and control the signal generator you must have an IO library installed on your computer The Agilent IO libraries are included with your signal generator or Agilent GPIB interface board or they can be downloaded from the Agilent website http www agilent com NOTE Agilent I O libraries support the V XI 11 standard Agilent IO Libraries Suite The Agilent IO Libraries Suite replaces earlier versions of
39. above The string variable file name is the name of the waveform data file The signal generator will associate a marker file with the data file Downloads to Non Volatile M emory MMEM DATA NVARBI file name I waveform data MMEM DATA NVARBQ file name gt Q waveform data These commands download E443xB I Q waveform data into the signal generator s non volatile memory The string variable ile name is the name of the data file The signal generator will associate a marker file with the data file when the file is moved to waveform memory prior to playing Chapter 4 181 Downloading and Using Files ARB Waveform Data Downloads Example Programs Waveform Downloading Using HP BASIC for Windows 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 80 with 80 OUTPUT ESG USING K MMEM DATA NVARBl testfile and replace line 130 with 130 OUTPUT ESG USING K MMEM DATA NVARBO 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 Owfm
40. and 64 MB for Option 602 Preliminary Setup It is important to set up the digital communications format before downloading data This allows the signal generator to define the modulation format filter and data clock Activating the digital communications format after the data has been downloaded to PRAM may corrupt the downloaded data Via the front panel To set up the TDMA format press Mode desired format and toggle the format on To set up the custom modulation format press Mode gt Custom and toggle the format on To adjust symbol rate filtering or other parameters press the appropriate softkey and adjust the value 206 Chapter 4 Downloading and Using Files Downloads Directly into Pattern RAM PRAM Via the remote interface For TDMA formats send the following SCPI commands SOURce RADio lt desired format gt STATe ON SOURce RADio lt desired format gt BURSt STATe ON SOURce BURSt SOURce INT For custom modulation send SOURce RADio CUSTOm STATe ON To adjust symbol rate filtering or other parameters send the appropriate SCPI command SCPI Command to Download Data in List Format MEMory DATA PRAM LIST lt uint8 gt lt uint8 gt lt gt This command downloads the list formatted data directly into PRAM The variable lt uint8 gt is any of the valid 8 bit unsigned integer values between 0 and 255 as specified by Table 4 1 Note that each value corresponds to a unique byte add
41. control information associated with the data field bit See Table 4 1 for the required data and control bits Total data bits plus control bits download size limitations are 8 megabytes 32 MB for Option 002 and 64 MB for Option 602 Because a waveform containing 16 megabits of data for subsequent modulation must also contain another 112 megabits of control information a file this size requires a signal generator with Option 002 32 MB or 602 64 MB The largest amount of modulation data for a waveform in an Option 001 601 signal generator is approximately 8 megabits which leaves enough room for the required 56 megabits of control bits Preliminary Setup Before downloading data set up the digital communications format to enable the signal generator to define the modulation format filter and data clock Activating the digital communications format after data downloads to PRAM can corrupt the data Via the front panel To set up the TDMA format press Mode gt desired format and toggle the format on To set up a custom modulation format press Mode gt Custom and toggle the format on To adjust symbol rate filtering or other parameters press the appropriate softkey and adjust the value Via the remote interface For TDMA formats send the following SCPI command SOURce RADio lt desired format gt STATe ON For custom modulation send SOURce RADio CUSTom STATe ON To adjust symbol rate filtering or other param
42. 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 IO 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 00 Nbytes 2 Num_points 10 ASSIGN Esg TO 719 20 ASSIGN Esgb TO 719 FORMAT MSB FIRST 30 Nbytes VALS Nbytes 40 Ndigits LEN Nbytes 50 Ndigits VAL Ndigits 182 Chapter 4 170 OUTPUT 180 OUTPUT 190 OUTPUT 210 OUTPUT 220 OUTPUT 230 OUTPUT 240 OUTPUT 250 OUTPUT 260 ASSIGN 270 ASSIGN 280 PRINT Downloading and Using Files ARB Waveform Data Downloads T Esg USING K MMEM DATA ARBI file name 1 Esg USING K Ndigitss Esg USING K Nbytes Esgb Iwfm_data r Esg END Esg USING K MMEM DATA ARBO file name 1
43. enter the desired hostname To erase the current hostname press Editing Keys gt Clear Text 4 Press Enter 5 Press LAN Config Manual DHCP to DHCP 6 Press the Proceed With Reconfiguration softkey and then the Confirm Change Instrument will Reboot softkey This action configures the signal generator as a DHCP client In DHCP mode the signal generator will reguest a new IP address from the DHCP server upon rebooting You can return to the LAN Setup menu after rebooting to determine the assigned IP address 3 Verifying LAN Functionality Verify the communications link between the computer and the signal generator remote file server using the ping utility Compare your ping response to those described in Table 1 12 From a UNIX workstation type ping lt hostname or IP address gt 64 10 where lt hostname or IP address gt is your instrument s name or IP address 64 is the packet size and 10 is the number of packets transmitted Type man ping at the UNIX prompt for details on the ping command From the MS DOS Command Prompt or Windows environment type ping n 10 lt hostname or IP address gt where hostname or IP address gt is your instruments name or IP address and 10 is the number of echo reguests Type ping at the command prompt for details on the ping command NOTE In DHCP mode if the DHCP server uses dynamic DNS to link the hostname with the assigned IP address the hostname may be used in place of the IP address
44. file name gt ABC for the markers file MMEM DATA USER HEADER file name gt ABC for the header file Downloads Using FTP To download files to NVWFM memory non volatile memory using the file transfer protocol FTP over the LAN interface perform the following steps 1 From the PC Command Prompt or Unix command line change the directory to the directory where the file to be downloaded is located 2 From the PC Command Prompt or Unix command line type ftp instrument name Where instrument name is the hostname for the signal generator or the signal generator s IP address 3 Atthe User prompt in the ftp window press the Enter key no entry is required 4 Atthe Password prompt in the ftp window press the Enter key no entry is required Chapter 4 167 Downloading and Using Files ARB Waveform Data Downloads 5 Atthe ftp prompt type put lt file_name gt USER WAVEFORM lt file_name_1 gt where lt file_name gt is the name of the file to download and lt file_name_1 gt the name designator for the signal generator s USER WAVEFORM directory If you have a marker file associated with the data file use the following command to download it to the signal generator put lt marker file_name gt USER MARKERS lt file_name_1 gt where marker file name is the name of the file to download and lt file name 1 the name designator for the file in the signal gene
45. following 1 A K qe Determine which bit monitors the condition Send commands to enable the bit that monitors the condition transition registers Send commands to enable the summary bits that report the condition event enable registers Send commands to enable the status byte register to monitor the condition Enable the controller to respond to service reguests Chapter 3 125 Programming the Status Register System Accessing Status Register Information The controller responds to the SRO as soon as it occurs As a result the time the controller would otherwise have used to monitor the condition as in a loop method can be used to perform other tasks The application determines how the controller responds to the SRO When a condition changes and that condition has been enabled the ROS bit in the status byte register is set In order for the controller to respond to the change the Service Reguest Enable Register needs to be enabled for the bit s that will trigger the SRO Generating a Service Reguest The Service Reguest Enable Register lets you choose the bits in the Status Byte Register that will trigger a service request Send the SRE num command where num is the sum of the decimal values of the bits you want to enable For example to enable bit 7 on the Status Byte Register so that whenever the Standard Operation Status register summary bit is set to 1 a service request is generated send the command SRE 12
46. following minor changes LAN Replace the GPIB assignment for the instOpenString object with lan lt hostname or IP address gt for the signal generator Non volatile Memory Remove BBGI from the file path assigned to the instDestFile object The program also includes some error checking to alert you when problems arise while trying to download files This includes checking to see if the file exists Description Send a file in blocks of data to an ESG include lt sicl h gt include lt stdlib h gt include lt stdio h gt include lt string h gt ATTENTION Configure these three lines appropriately for your instrument sf and use before compiling and running char instOpenString gpib7 19 for LAN replace with lan lt hostname or IP address gt 170 Chapter 4 Downloading and Using Files ARB Waveform Data Downloads const char localSrcFile D home TEST_WAVE enter file location on PC workstation const char instDestFile USER BBG1 WAVEFORM TEST WAVE for non volatile memory remove BBG1 from file path Size of the copy buffer const int BUFFER SIZE 100 1024 int main INST id iopen instOpenString if tid fprintf stderr iopen failed s n instOpenString return 1 FILE file fopen localSrcFile rb if file fprintf stderr Could not open file s n localSrcFile return 0 if fseek file 0 SEEK END lt 0
47. following sections e Each O waveform must contain an even number of samples to play in the waveform sequencer An error message File format invalid is displayed if this requirement is not met The file format is discussed in greater detail in the following sections e A marker file is always associated with an I Q waveform file An empty all zeros default marker file will be created if a marker file is not provided by the user The user defined marker file and I Q waveform data file must have the same name in the signal generator 164 Chapter 4 Downloading and Using Files ARB Waveform Data Downloads File Structure and Memory For volatile waveform memory WFM1 there are approximately 8 megasamples 32 Msa with Option 002 and 64 Msa with Option 602 of memory allocated in 1024 byte segments For non volatile memory NVWEM Option 005 provides approximately one gigasample of storage Signal generators without Option 005 provide 3 megasamples of NVWFM storage A waveform file must have a minimum of 60 samples of data Each sample eguals one I O pair of values represented by four bytes of data along with markers represented by a single byte of data A 60 sample waveform file will occupy 1024 bytes of waveform memory If a waveform file is too large to fit into a 1024 byte memory segment additional memory space is allocated in multiples of 1024 bytes For example a waveform represented by 500 samples is allocated to a 307
48. fprintf stderr Cannot seek to the end of file n return 0 long lenToSend ftell file printf File size d n lenToSend Chapter 4 171 Downloading and Using Files ARB Waveform Data Downloads 172 if char fseek file 0 SEEK_SET lt 0 fprintf stderr Cannot seek to the start of file n return 0 buf new char BUFFER SIZE if buf amp amp lenToSend else Prepare and send the SCPI command header char s 20 sprintf s Sd lenToSend int lenLen strlen s char s2 256 sprintf s2 mmem data Ss d d instDestFile lenLen lenToSend iwrite id s2 strlen s2 0 0 Send file in BUFFER_SIZE chunks long numRead do numRead fread buf sizeof char BUFFER_SIZE file iwrite id buf numRead 0 0 while numRead BUFFER SIZE Send the terminating newline and EOM iwrite id n 1 1 0 delete buf Chapter 4 Downloading and Using Files ARB Waveform Data Downloads fprintf stderr Could not allocate memory for copy buffer n fclose file iclose id return 0 Waveform Downloading Using HP BASIC for Windows The following program will download a waveform using HP BASIC for Windows into volatile ARB memory The waveform generated by this program is the same as the default SINE TEST WFM waveform file available in the signal generator s waveform memory This code is similar to the code shown for
49. init winsock 0 exit 1 endif WINSOCK 100 instSock openSocket destination SCPI PORT if instSock INVALID SOCKET fprintf stderr Unable to open socket Mn return 1 fprintf stderr Socket opened n if strlen command gt 0 RRR KK kkk k k kk k k k k k k k k KK kk k k k k kk k kkk k kk k kk k kkk k kkk kk k k if the command has a in it use queryInstrument otherwise simply send the command RRR KR KK KKK IK KR KK IKK I oko k kok k k kok k oko oko k ke ke ke ke ke e e Chapter 2 if isQuery command long bufBytes bufBytes gueryInstrument instSock command charBuf INPUT BUF SIZE if guiet fwrite charBuf bufBytes 1 stdout fwrite n 1 1 stdout fflush stdout else commandInstrument instSock command else read a line from lt stdin gt while gets charBuf NULL if strlen charBuf continue if charBuf 4 charBuf continue strcat charBuf n if guiet Chapter 2 Programming Examples LAN Programming Examples 101 Programming Examples LAN Programming Examples if number char num 10 sprintf num d number fwrite num strlen num 1 stdout fwrite charBuf strlen charBuf 1 stdout fflush stdout if isQuery charBuf long bufBytes Put the guery response into the same buffer as the
50. instrument state setting includes any instrument state that does not survive a signal generator preset or power cycle such as freguency amplitude attenuation and other user defined parameters The instrument state settings are saved in memory and organized into seguences and registers There are 10 seguences with 100 registers per seguence available for instrument state settings These instrument state files are stored in the USER STATE directory The save function does not store data such as arb formats table entries list sweep data and so forth Use the store commands or store softkey functions to store these data file types to the signal generator s memory catalog The save function will save a reference to the data file name associated with the instrument state Before saving an instrument state that has a data file associated with it store the data file For example if you are editing a multitone arb format store the multitone data to a file in the signal generator s memory catalog multitone files are stored in the USER MTONE directory Then save the instrument state associated with that data file The settings for the signal generator such as freguency and amplitude and a reference to the multitone file name will be saved in the selected seguence and register number Refer to the E4428C 38C ESG Signal Generators User s Guide and E4428C 38C ESG Signal Generators Key Reference for more information on the save and recall functions
51. internally generated framing The the data fields absolutely must be continuous data streams and the size of the data exceeds the available PRAM real time data and synchronization can be supplied by an external data source to the front panel DATA DATA CLOCK and SYMBOL SYNC connectors This data can be continuously transmitted or can be framed by supplying a data synchronous burst pulse to the EXT1 INPUT connector on the front panel Additionally the external data can be multiplexed into the internally generated framing Chapter 4 227 Downloading and Using Files Data Transfer Troubleshooting User FIR Filter Coefficient File Download Problems Table 4 7 User FIR File Download Trouble Symptoms and Causes Symptom Possible Cause There is not enough memory available for the FIR coefficient file being downloaded ERROR 321 Out of memory To solve the problem either reduce the file size of the FIR file or delete unnecessary files from memory User FIR filter has too many symbols ERROR 223 Too much data Real Time cannot use a filter that has more than 64 symbols 512 symbols maximum for ARB You may have specified an incorrect oversample ratio in the filter table editor Data Reguirement Reminders To avoid user FIR filter coefficient data download problems the following conditions must be met 1 Data must be in ASCII format 2 Downloads must be in list format 3 Filters containing more symbols than
52. non volatile memory NVWFM Data stored in volatile waveform memory cannot be recovered if it is overwritten or if Chapter 4 205 Downloading and Using Files Downloads Directly into Pattern RAM PRAM the power is cycled Data stored in non volatile memory however remains until you delete the file The Option 005 signal generator s hard disk provides one gigasample of non volatile storage Signal generators without Option 005 provide 3 megasamples of non volatile storage NOTE References to pattern RAM PRAM are for descriptive purposes only relating to the manner in which the memory is being used PRAM and volatile waveform memory WFM1 actually utilize the same storage media Downloading in List Format NOTE Because of parsing list data format downloads are significantly slower than block format downloads Data Requirements and Limitations Summary 1 Data must be 8 bit unsigned integers from 0 to 255 This requirement is necessary as list format downloads are parsed prior to being loaded into PRAM 2 Forevery bit of modulation data bit 0 you must provide 7 bits of control information bits 1 7 The signal generator processes data in 8 bit bytes Each byte contains 1 bit of data field information and 7 bits of control information associated with the data field bit See Table 4 1 for the required data and control bits Total data bits plus control bits download size limitations are 8 megabytes 32 MB for Option 002
53. of the enable register and the result is logically ORed to produce a status summary bit in the Status Byte Register 132 Chapter 3 Programming the Status Register System Status Groups Standard Event Status Group The Standard Event Status Group is used to determine the specific event that set bit 5 in the Status Byte Register This group consists of the Standard Event Status Register an event register and the Standard Event Status Enable Register Chapter 3 Operation Complete Reguest Bus Control Query Error Device Dependent Error Execution Error Command Error User Request Power On O1 Event Register 7 6 4 3 2 b3 TAE o 4 L l l L A S amp ELLE E Enable Register 5 4 3 2 1 0 i j To Status Byte Register Bit 5 ck728a 133 Programming the Status Register System Status Groups Standard Event Status Register Table 3 4 Standard Event Status Register Bits Bit Description 0 Operation Complete A 1 in this bit position indicates that all pending signal generator operations were completed following execution of the OPC command 1 Request Control This bit is always set to 0 The signal generator does not request control 2 Query Error A 1 in this bit position indicates that a query error has occurred Query errors have SCPI error numbers from 499 to 400 3 Device Dependent Error A 1 in this bit position indicates that a device dependen
54. requests it should instruct the controller to perform a serial poll when SRQ is true Each device on the bus returns the contents of its status byte register in response to this poll The device whose request service summary bit RQS bit is set to 1 is the device that requested service 126 Chapter 3 Programming the Status Register System Accessing Status Register Information NOTE When you read the signal generator s Status Byte Register with a serial poll the ROS bit is reset to 0 Other bits in the register are not affected If the status register is configured to SRO on end of sweep or measurement and the mode set to continuous restarting the measurement INIT command can cause the measuring bit to pulse low This causes an SRO when you have not actually reached the end of sweep or measurement condition To avoid this do the following 1 Send the command INITiate CONTinuous OFF 2 Set enable the status registers 3 Restart the measurement send INIT Status Register SCPI Commands Most monitoring of signal generator conditions is done at the highest level using the IEEE 488 2 common commands listed below You can set and query individual status registers using the commands in the STATus subsystem CLS clear status clears the Status Byte Register by emptying the error queue and clearing all the event registers ESE ESE event status enable sets and queries the bits in the Standard Event Enable Register which
55. set the signal generator into remote mode front panel keys except the Local key are disabled Press the Local key to revert to manual operation NOTE To update the signal generator s front panel display so that it reflects remote command setups enable the remote display press Utility gt Display gt Update in Remote Off On softkey until On is highlighted or send the SCPI command DISPlay REMote ON For faster test execution disable front panel updates Programming Examples Development Environment The C C examples in this guide were written using an IBM compatible personal computer PC with the following configuration e Pentium processor Pentium is a U S registered trademark of Intel Corporation 36 Chapter 2 Programming Examples Using the Programming Examples Windows NT 4 0 operating system e C C programming language with the Microsoft Visual C 6 0 IDE e National Instruments PCI GPIB interface card or Agilent GPIB interface card e National Instruments VISA Library or Agilent VISA library e COMI or COM serial port available LAN interface card The Agilent BASIC examples were run on a UNIX 700 Series workstation Running C C Programming Examples To run the example programs written in C C you must include the required files in the Microsoft Visual C 6 0 project If you are using the VISA library do the following e add the visa32 lib file to the Resource Files e add the visa h file to the
56. sig rdVal 100 Reads in the response into rdVal rdVal ibcntl 0 Null character indicating end of array cout lt lt Source CW frequency is lt lt rdVal Print frequency of signal generator cout lt lt Press any key to continue lt lt endl cin ignore 10000 Xn ibwrt ibrd s rdVal Chapter 2 sig POW AMPL 10 Querys the signal generator ig rdVal 100 Reads the signal generator power level ibentl NOT Null character indicating end of array 49 Programming Examples GPIB Programming Examples 50 Prints signal generator power level cout lt lt Source power dBm is lt lt rdVal cout lt lt Press any key to continue lt lt endl cin ignore 10000 n ibwrt sig FREQ MODE 11 Querys source frequency mode ibrd sig rdVal 100 Enters in the source frequency mode rdVal ibcntl 0 Null character indicating end of array cout lt lt Source frequency mode is lt lt rdVal Print source frequency mode cout lt lt Press any key to continue lt lt endl cin ignore 10000 Xn ibwrt sig OUTP OFF 12 Turns off RF source ibwrt sig OUTP 5 Querys the on off state of the instrument ibrd sig rdVal 2 Enter in the source state rdVal ibcntl 0 num int rdval 0 0 if num gt 0 cout lt lt Source RF state is On lt lt endl jelsei cout Source RF state is Off endl cout lt lt endl ibwrt s
57. signal generator s AXILLARY INTERFACE connector Refer to Table 1 13 for RS 232 cable information Table 1 13 RS 232 Serial Interface Cable Quantity Description Agilent Part Number 1 Serial RS 232 cable 9 pin male to 9 pin 8120 6188 female NOTE Any 9 pin male to 9 pin female straight through cable that directly wires pins 2 3 5 7 and 8 may be used Chapter 1 29 Getting Started Using RS 232 3 Verifying RS 232 Functionality You can use the HyperTerminal program available on your computer to verify the RS 232 interface functionality To run the HyperTerminal program connect the RS 232 cable between the computer and the signal generator and perform the following steps 1 On the PC click Start gt Programs gt Accessories gt HyperTerminal Select HyperTerminal Enter a name for the session in the text box and select an icon Select COMI COM2 can be used if COMI is unavailable UN me BW In the COMI or COMO if selected properties set the following parameters Bits per second 9600 must match signal generator s baud rate On the signal generator Select Utility gt GPIB RS 232 LAN gt RS 232 Setup gt RS 232 Baud Rate gt 9600 e Data bits 8 e Parity None e Stop bits 1 Flow Control None NOTE Flow control via the RTS line is driven by the signal generator For the purposes of this verification the controller PC can ignore this if flow control is set to None However
58. t getOutputStream BufferedReader in new BufferedReader new InputStreamReader t getInputStream System out println Setting frequency to 1 GHz out write freq 1GHz Nn Sets frequency out flush 110 Chapter 2 Programming Examples LAN Programming Examples System out println Waiting for source to settle out write opc WMn Waits for completion out flush String opcResponse in readLine if lopcResponse equals 1 System err println Invalid response to OPC System exit 1 System out println Retrieving instrument ID out write idn n Querys the id string out flush String idnResponse in readLine Reads the id string Prints the id string System out println Instrument ID idnResponse catch IOException e System out println Error e Chapter 2 111 Programming Examples RS 232 Programming Examples RS 232 Programming Examples e Interface Check Using Agilent BASIC on page 112 e Interface Check Using VISA and C on page 113 e Queries Using Agilent BASIC on page 115 e Queries Using VISA and C on page 116 Before Using the Examples On the signal generator select the following settings e Baud Rate 9600 must match computer s baud rate e RS232 Echo Off Interface Check Using Agilent BASIC This example program causes the signal generator to perform an instrument reset The SCPI command RST
59. that the baseband 1 generator is unlocked 4 Unused This bit is set to 0 5 Sampler Loop Unlocked A 1 in this bit indicates that the sampler loop is unlocked 6 YO Loop Unlocked A 1 in this bit indicates that the YO loop is unlocked 7 14 Unused These bits are always set to 0 15 Always 0 a On the E4428C this bit is set to 0 Query STATus QUEStionable FREQuency CONDition Response The decimal sum of the bits set to 1 Data Questionable Frequency Transition Filters negative and positive Specifies which types of bit state changes in the condition register set corresponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 Commands STATus QUEStionable FREQuency NTRansition value negative transition or STATus QUEStionable FREQuency PTRansition value positive transition where value is the sum of the decimal values of the bits you want to enable Queries STATus QUEStionable FREQuency NTRansition STATus QUEStionable FREQuency PTRansition Chapter 3 149 Programming the Status Register System Status Groups Data Ouestionable Freguency Event Register Latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register Ouery STATus QUEStionable FREQuen
60. the signal generator Condition registers are read only Table 3 5 Standard Operation Condition Register Bits Bit Description 04 VO Calibrating A 1 in this position indicates an O calibration is in process 1 Settling A 1 in this bit position indicates that the signal generator is settling 2 Unused This bit position is set to 0 3 Sweeping A 1 in this bit position indicates that a sweep is in progress 4a Measuring A1 in this bit position indicates that a bit error rate test is in progress 5 Waiting for Trigger A 1 in this bit position indicates that the source is in a wait for trigger state When option 300 is enabled a 1 in this bit position indicates that TCH PDCH synchronization is established and waiting for a trigger to start measurements 6 7 8 Unused These bits are always set to 0 9 DCFM DCoM Null in Progress A 1 in this bit position indicates that the signal generator is currently performing a DCFM DC M zero calibration 102 Baseband is Busy A 1 in this bit position indicates that the baseband generator is communicating or processing This is a summary bit See the Baseband Operation Status Group on page 138 for more information 11 Sweep Calculating A 1 in this bit position indicates that the signal generator is currently doing the necessary pre sweep calculations 128 BERT Synchronizing A 1 in this bit position is set while the BERT is synchronizing to BCH then TC
61. the file structure The signal generator uses this two file format when generating waveform data More details are given in the following sections of this chapter Table 4 1 I Q Data File Structure Sample 1 Sample 2 I 16 bits Q 16 bits I 16 bits Q 16 bits 2 bytes 2 bytes 2 bytes 2 bytes Marker File Structure 4 bits unused Mo 4 bits LSB 4 bits unused M 4 bits LSB MSB MSB 1 byte 1 byte Bit value and Output Power Bit value and output power e 0 0 volts e 32768 gives negative full scale output e 32767 gives positive full scale output Types of Arbitrary Waveform Generator Memory Waveform data can be saved to volatile memory called waveform memory or WFM1 and non volatile memory called NVWFM memory The data in waveform memory is lost whenever the signal generator s line power is cycled If Option 005 is not installed then the signal generator provides approximately 3 megasamples of non volatile memory With Option 005 there is approximately 1 gigasample of NVWFM memory available Waveforms stored in NVWFM memory must be moved to volatile memory in order to be sequenced and played Moving either a waveform file or a maker file between the two memory types volatile and non volatile automatically moves the companion waveform or marker file too Chapter 4 163 Downloading and Using Files ARB Waveform Data Downloads Waveform Data Storage Path e Volatile memory waveform m
62. the sessions printer n 4 viClear vi viClose vi viClose defaultRM Chapter 2 55 Programming Examples GPIB Programming Examples Generating an Externally Applied AC Coupled FM Signal Using VISA and C In this example the VISA library is used to generate an ac coupled FM signal at a carrier freguency of 700 MHz a power level of 2 5 dBm and a deviation of 20 kHz Before running the program Connect the output of a modulating signal source to the signal generator s EXT 2 input connector e Set the modulation signal source for the desired FM characteristics Launch Microsoft Visual C 6 0 add the required files and enter the code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex5 cpp JKR RK KK KK ok kok o kok kok k oko kok k kok ko oko kok k kok k k kok k kok kok kok k k oko kok kok kok kok kok kok IR AIA I k kok He PROGRAM FILE NAME visaex5 cpp PROGRAM DESCRIPTION This example sets the signal generator FM source to External 2 coupling to AC deviation to 20 kHZ carrier freguency to 700 MHz and the power level to 2 5 dBm The RF state is set to on J KR KK KR KK IK KK IK RIK I KR IK IR IRR IR ARR IRR IR IIR IRR IR IIR RR kok kok kok k kok kok k k k k Ae include lt visa h gt include StdAfx h include lt iostream gt include lt stdlib h gt include lt conio h gt void main ViSession defaultRM
63. to control the signal generator programmatically or download files to the signal generator you must enable RTS CTS hardware flow control on the controller Note that only the RTS line is currently used Go to the HyperTerminal window and select File gt Properties Go to Settings gt Emulation and select VT100 Leave the Backscroll buffer lines set to the default value O PO n A Go to Settings gt ASCII Setup 10 Check the first two boxes and leave the other boxes as default values Once the connection is established enter the SCPI command IDN followed by lt Ctrl j gt inthe HyperTerminal window The Ctrl j gt is the new line character on the keyboard press the Cntrl key and the j key simultaneously The signal generator should return a string similar to the following depending on model Agilent Technologies instrument model name and number US40000001 C 02 00 30 Chapter 1 Getting Started Using RS 232 Character Format Parameters The signal generator uses the following character format parameters when communicating via RS 232 e Character Length Eight data bits are used for each character excluding start stop and parity bits e Parity Enable Parity is disabled absent for each character e Stop Bits One stop bit is included with each character If You Have Problems 1 Verify that the baud rate parity and stop bits are the same for the computer and signal generator 2 Verify that the RS 232 ca
64. toggle to on Via the remote interface SOURce RADio CUSTom FILTer lt file_name gt This command selects the user FIR filter specified by the file name as the active filter for the custom modulation format After selecting the file activate the TDMA format with the following command SOURce RADio CUSTom STATe On FIR Filter Data for CDMA and W CDMA Modulation The following front panel key presses or remote commands will select user FIR filter data as the active filter for a CDMA modulation format The process is very similar for W CDMA Via the front panel 1 Press Mode gt CDMA gt Arb IS 95A gt CDMA Define gt Filter gt Select gt User FIR 2 Highlight the desired file in the catalog of FIR files 3 Press Select File To activate the CDMA modulation press Mode gt CDMA gt Arb IS 95A gt CDMA Off On to On Chapter 4 203 Downloading and Using Files FIR Filter Coefficient Downloads Via the remote interface SOURCe RADio desired format gt ARB FILTer lt file_name gt This command selects the User FIR filter specified by the file name as the active filter for the CDMA or W CDMA modulation format After selecting the file activate the CDMA or W CDMA format with the following command SOURce RADio lt desired format gt ARB STATe On Modulating and Activating the Carrier The following front panel key presses or remote commands will set the carrier frequency power turn on the mod
65. vi Declares variables of type ViSession for instrument communication ViStatus viStatus 0 Declares a variable of type ViStatus for GPIB verifications Initialize VISA session viStatus viOpenDefaultRM amp defaultRM open session to gpib device at address 19 56 Chapter 2 viStatus viOpen defaultRM GPIB 19 INSTR Programming Examples GPIB Programming Examples VI NULL VI NULL amp vi if viStatus If problems then prompt user printf Could not open ViSession Nn printf Check instruments and connections Mn printf f Xan s exit 0 printf Example program to set up the signal generator n printf for an AC coupled FM signal n printf Press any key to continue n printf nt getch printf Na viPrintf vi RST n Resets the signal generator viPrintf vi FM SOUR EXT2 n Sets EXT 2 source for FM viPrintf vi FM EXT2 COUP AC n Sets FM path 2 coupling to AC viPrintf vi FM DEV 20 kHz Nn Sets FM path 2 deviation to 20 kHz viPrintf vi FREQ 700 MHz n Sets carrier frequency to 700 MHz viPrintf vi POW AMPL 2 5 dBm n Sets the power level to 2 5 dBm viPrintf vi FM STAT ON n Turns viPrintf vi OUTP STAT ON n Turns Print printf Power level 2 5 dBm n printf FM state onn printf RF output onin printf Carrier Frequency 700 MHZ n printf Deviation 20 kHZ n pri
66. will place the signal generator into a pre defined state The serial interface address for the signal generator in this example is 9 The serial port used is COMI Serial A on some computers Refer to Using RS 232 on page 28 for more information Watch for the signal generator s Listen annunciator L and the remote preset message on the front panel display If there is no indication check that the RS 232 cable is properly connected to the computer serial port and that the manual setup listed above is correct If the compiler displays an error message or the program hangs it is possible that the program was typed incorrectly Press the signal generator s Reset RS 232 softkey and re run the program Refer to If You Have Problems on page 31 for more help The following program example is available on the ESG Documentation CD ROM as rs232ex1 txt 10 VK CK CK Ck CK kk Ck A A Z Ck KA KA Ck SK A KA KA Ck SK A KA KA kk kk kk kk Kk A KA ck ck kk A kA AKA ck kckck kck ck ckck kck k ck ck ckck kck ck k ck ck ok 20 30 PROGRAM NAME rs232exl txt 40 50 PROGRAM DESCRIPTION This program verifies that the RS 232 connections and 60 interface are functional 70 112 Chapter 2 Programming Examples RS 232 Programming Examples 80 Connect the UNIX workstation to the signal generator using an RS 232 cable 90 00 10 Run Agilent BASIC type in the following commands and then RUN the program 20 30 40 1 KK
67. 2 byte memory segment 1 sample 5 bytes 500 samples x 5 bytes 2500 bytes 3 x 1024 3072 bytes of memory allocation Total memory usage may be much more than the sum of the samples that make up waveform files Many small waveform files can use large amounts of memory Dow nloading Waveforms Two files a waveform data file and the associated marker file are downloaded into waveform memory before being sequenced and played The waveform data file can be loaded into the signal generator s waveform or NVWFM memory using the following methods e SCPI using VXI 11 VMEbus Extensions for Instrumentation as defined in VXI 11 e SCPI over the GPIB or RS 232 e SCPI with sockets LAN using port 5025 File Transfer Protocol FTP Refer to Downloads Using FTP on page 167 for information on FTP Sample Command Line A sample command line using SCPI SCPI command Arbitrary Block Data The Arbitrary Block Data is defined in the IEEE std 488 2 1992 section 7 7 6 The following is an example or the format as used to download waveform data to the signal generator MMEM DATA WFM1 lt file name gt ABC file name the name of the waveform file stored in the signal generator Chapter 4 165 Downloading and Using Files ARB Waveform Data Downloads A the number of decimal digits to follow in B B a decimal number specifying the number of data bytes in C C the binary waveform data NO
68. 7 bytes on HP UX 9 05 do 93 Programming Examples LAN Programming Examples int recount rcount recv sock result int numBytes 0 resultBytes rcount result recount Advance pointer while resultBytes lt numBytes KKK kok kok kok kok kok kok kok kk kkk kkk kk kkk kk kkk kkk kkk kk kkk kok k ck k ck kok ck A K For LAN dumps there is always an extra trailing newline Since there is no EOI line For ASCII dumps this is great but for binary dumps it is not needed oko kok k kok o kok ko oko kok o kok ko kok kok k kok k k kok k oko oko kk kok ke ke ke ke ke e e e if resultBytes numBytes char junk count recv sock amp junk 1 0 else indefinite block dump til we can an extra line feed do if recv_line sock result maxLength NULL break if strlen result 1 amp amp result n break resultBytes strlen result result strlen result while 1 else ASCII response not a binary block 94 Chapter 2 Programming Examples LAN Programming Examples result char ch if recv line sock result 1 maxLength 1 NULL return 0 REMOVE trailing newline if present And terminate string resultBytes strlen result if result resultBytes 1 n resultBytes 1 result resultBytes 0 while 0 return resultBytes RRR KK KKK IKK I KK IKK IKK I KK IKK IK I ko oko k k kok
69. 74 languages 36 libraries 2 3 9 10 16 28 list error messages 32 listener 10 local echo telnet 25 local function 13 local lockout function 12 M manual operation 11 MS DOS Command Prompt 18 MS DOS command prompt 22 National Instruments NI 488 2 39 NI 488 2 include files 37 VISA 39 National Instruments VISA 9 16 28 negative transition filter description 132 net framework 211 NI 488 2 9 16 28 EnableRemote 12 iblcr 13 ibloc 13 ibrd 15 ibstop 11 ibwrt 14 SetRWLS 12 NVARB memory vs ARB memory 163 0 OPC commands 127 output command 14 output function 14 P pattern RAM 205 PCI GPIB 39 PERL example 108 Index 233 Index personal computer PC 7 ping program 18 polling method status registers 125 ports 79 positive transition filter description 132 PRAM 205 PRAM downloads in block format 208 preliminary setup 208 sample commands line 209 SCPI commands 209 in list format 206 207 data query SCPI command 207 preliminary setup 206 SCPI commands 207 modulating and activating the carrier 210 problems ARB waveform downloads 229 PRAM downloads 224 user file downloads 226 user FIR filter downloads 228 programming examples C 211 using GPIB 39 using LAN 74 using RS 232 112 waveform downloading using C 170 waveform downloading using HP BASIC for UNIX 176 waveform downloading using HP BASIC for Windows 173 waveform ge
70. 8 Refer to Figure 3 1 on page 121 or Figure 3 2 on page 122 for bit positions and values The query command SRE returns the decimal value of the sum of the bits previously enabled with the SRE num command To query the Status Byte Register send the command STB The response will be the decimal sum of the bits which are set to 1 For example if bit 7 and bit 3 are set the decimal sum will be 136 bit 72128 and bit 3 8 NOTE Multiple Status Byte Register bits can assert an SRQ however only one bit at a time can set the RQS bit AII bits that are asserting an SRQ will be read as part of the status byte when it is queried or serial polled The SRQ process asserts SRQ as true and sets the status byte s RQS bit to 1 Both actions are necessary to inform the controller that the signal generator requires service Asserting SRQ informs the controller that some device on the bus requires service Setting the ROS bit allows the controller to determine which signal generator requires service This process is initiated if both of the following conditions are true e The corresponding bit of the Service Request Enable Register is also set to 1 e The signal generator does not have a service request pending A service request is considered to be pending between the time the signal generator s SRQ process is initiated and the time the controller reads the status byte register If a program enables the controller to detect and respond to service
71. 9 FORMAT ON 40 ASSIGN Esgb TO 719 FORMAT OFF 50 Nbytes VALS Nbytes 60 Ndigits LEN Nbytes 70 Ndigits VAL Ndigits 80 WAIT 90 OUTPUT Esg USING K MMEM DATA WFM1 data file 200 OUTPUT Esg USING K Ndigits 210 OUTPUT Esg USING K Nbytes 220 WAIT 230 OUTPUT Esgb Int_array 240 WAIT 2 176 Chapter 4 Downloading and Using Files ARB Waveform Data Downloads 241 OUTPUT GEsg END 250 ASSIGN Esg TO 260 ASSIGN Esgb TO 270 PRINT 280 PRINT END 290 END Chapter 4 177 Downloading and Using Files ARB Waveform Data Downloads Program Comments 10 Program file name 20 Sets the number of points in the waveform 30 Allocates integer data array for I and O waveform points 40 Sets HP BASIC to use degrees for cosine and sine functions 50 Sets up first loop for I waveform points 60 Calculate and interleave I waveform points 70 End of loop 80 Sets up second loop for O waveform points 90 Calculate and interleave O waveform points 100 End of loop 120 Calculates number of bytes in I Q waveform 130 Opens an I O path to the signal generator using GPIB 7 is the address of the GPIB card in the computer and 19 is the address of the signal generator This I O path is used to send ASCII data to the signal generator 140 Opens an I O path for sending binary data to the signal generator 150 Creates an ASCII string rep
72. A C C PCI 32 bit 15 Instruments 95 98 2000 NI 488 2 Visual BASIC Mbytes s PCI GPIB ME NT LabView National Windows VISA C C PCI 32 bit 1 5 Instrument s NT NI 488 2 Visual BASIC Mbytes s PCI GPIB LabView NI 488 2 is a trademark of National Instruments Corporation Table 1 3 Agilent GPIB Interface Card for HP UX Workstations Interface Operating I O Library Languages Backplane B Max 1 0 Buffering Card System US kB sec Agilent HP UX 9 x VISA SICL ANSIC EISA 750 Built in E2071C HP UX Agilent VEE 10 01 Agilent BASIC HP UX Agilent HP UX VISA SICL ANSIC EISA 750 Built in E2071D 10 20 Agilent VEE Agilent BASIC HP UX Agilent HP UX VISA SICL ANSIC PCI 750 Built in E2078A 10 20 Agilent VEE Agilent BASIC HP UX 8 Chapter 1 Getting Started Using GPIB 2 Selecting I O Libraries for GPIB The I O libraries are included with your GPIB interface card These libraries can also be downloaded from the National Instruments website or the Agilent website Refer to I O Libraries on page 3 for information on I O libraries The following is a discussion on these libraries VISA SICL NI 488 2 VISA is an I O library used to develop I O applications and instrument drivers that comply with industry standards It is recommended that the VISA library be used for programming the signal generator The NI VISA and Agilent VISA libraries are similar implementations of VISA and have the same commands syntax and functions
73. A k k k k k K Simpler UNIX version using file I O recv version works too This demonstrates how to use file I O on sockets in UNIX kok kok k k kok kok k kok ko kok k oko ko oko kok k oko ko oko kok k oko k kok k kok kok kk kok k kk FILE instFile instFile fdopen sock r if instFile NULL fprintf stderr Unable to create FILE structure s n strerror errno exit 2 return fgets result maxLength instFile endif RRR KK KKK E kok o A IK kok A k A o oko o kok o oko k oko kok k oko ko oko A k k k k k k k kok k k K k k k k k k k k gt Function queryInstrument SDescription send a SCPI command to the instrument return a response Parameters K FILE file pointer associated with TCP IP socket const char command SCPI command string char result where to put the result size_t maxLength maximum size of result array in bytes Chapter 2 91 Programming Examples LAN Programming Examples Return long The number of bytes in result buffer SErrors returns 0 if anything goes wrong kkkkkkkkkkkkkkkkkkkkkkkkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ko ko kk ke ke kk k kk ke ke ke long gueryInstrument SOCKET sock const char command char result size t maxLength long ch char tmp buf 8 long resultBytes 0 int command err int count RRR KK kk o KKK I KK IK IK I ko kok
74. ASIC VISA NI 488 2 Agilent SICL 10 CLEAR 719 viClear ViSession ibclr int ud iclear id vi Agilent BASIC VISA Library NI 488 2 Library Chapter 1 The CLEAR 719 function causes all pending output parameter operations to be halted the parser interpreter of programming codes to reset and prepare for a new programming code stops any sweep in progress and continuous sweep to be turned off The VISA library uses the viClear function This function performs an IEEE 488 1 clear of the signal generator The NI 488 2 library function sends the GPIB Selected Device Clear SDC message to the device described by ua 13 Getting Started Using GPIB SICL The Agilent SICL function clears a device or interface The function also discards data in both the read and write formatted I O buffers The id parameter identifies the session Output Function The Agilent BASIC I O function OUTPUT and the other listed I O library functions put the signal generator into a listen mode and prepare it to receive ASCII data typically SCPI commands Table 1 10 Agilent BASIC VISA NI 488 2 Agilent SICL 10 OUTPUT 719 viPrintf parameter ibwrt parameter iprintf parameter list list list Agilent BASIC The function OUTPUT 719 puts the signal generator into remote mode makes it a listener and prepares it to receive data VISA Library The VISA library uses the above function and associated parame
75. BASIC for UNIX but there is a formatting difference in line 130 and line 140 To download into non volatile memory replace line 80 with 210 OUTPUT ESG USING K MMEM DATA NVWFM testfile As discussed at the beginning of this section I and Q waveform data is interleaved into one file in 2 s compliment form and a marker file is associated with this I Q waveform file 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 BASIC Win file 20 Num points 200 30 ALLOCATE INTEGER Int array 1 Num points 2 40 DEG 50 FOR I 1 TO Num points 2 STEP 2 60 Int array 1 INT 32767 SIN I 360 Num points 70 NEXT I 80 FOR I 2 TO Num points 2 STEP 2 90 Int array I INT 32767 COS I 360 Num points 100 NEXT I 110 PRINT Data Generated 120 Nbytes 4 Num points 130 ASSIGN Esg TO 719 Chapter 4 173 Downloading and Using Files ARB Waveform Data Downloads 40 50 60 70 80 90 200 210 220 230 240 250 260 270 280 290 174 ASSIGN Esgb TO 719 FORMAT MSB FIRST Nbytes VALS Nbytes Ndigits LEN Nbytes Ndigits VAL Ndigits WAIT OUTPUT Esg USING K MMEM DATA WFM1 data_file OUTPUT Esg USING
76. Ce kk kk ce kk kk ce kk kk X X kk X X kk X AX KKK KKK ko ko ko ko kc k kokck ck ko k kk Sig gen 719 Declares a variable to hold the signal generator s address LOCAL Sig gen Places the signal generator into Local mode CLEAR Sig gen Clears any pending data I O and resets the parser REMOTE 719 Puts the signal generator into remote mode CLEAR SCREEN Clears the controllers display REMOTE 719 OUTPUT Sig gen RST Places the signal generator into a defined state PRINT The signal generator should now be in REMOTE PRINT PRINT Verify that the remote R annunciator is on Press the Local key PRINT on the front panel to return the signal generator to local control PRINT Chapter 2 Programming Examples GPIB Programming Examples 280 PRINT Press RUN to start again 290 END Program ends Interface Check Using NI 488 2 and C This example uses the NI 488 2 library to verify that the GPIB connections and interface are functional Launch Microsoft Visual C 6 0 add the required files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as niex1 cpp ck ck ck kk kk kk e A A A A A A ck X ce X A ck ck ck ck A A ck ck ck ck ck ck ck ck ck ck ck A ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck AZ ck ck ck ck AZ ck ck ck ck ck AZ ck ck ck ck ckckckckckckckckckck PROGRAM NAME niexl cpp if PROGRAM
77. DESCRIPTION This program verifies that the GPIB connections and interface are functional V Connect a GPIB cable from the PC GPIB card to the signal generator Enter the following code into the source cpp file and execute the program kk ck kk kk kk eee A AZ AZ ce ce AX X ce ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck Ck ck ck ck ck kk ck ckckckckckckck include stdafx h include lt iostream gt include windows h include Decl 32 h using namespace std int GPIBO 0 Board handle Addr4882_t Address 31 Declares an array of type Addr4882_t int main void Chapter 2 41 Programming Examples GPIB Programming Examples int sig Declares a device descriptor variable sig ibdev 0 19 0 13 1 0 Aquires a device descriptor ibclr sig Sends device clear message to signal generator ibwrt sig RST 4 Places the signal generator into a defined state Print data to the output window cout lt lt The signal generator should now be in REMOTE The remote indicator lt lt endl cout lt lt annunciator R should appear on the signal generator display lt lt endl return 0 Interface Check using VISA and C This program uses VISA library functions and the C language to communicate with the signal generator The program verifies that the GPIB connections and interface
78. Dition Response The decimal sum of the bits set to 1 Data Questionable Calibration Transition Filters negative and positive The Data Questionable Calibration Transition Filters specify which type of bit state changes in the condition register set corresponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 Commands STATus QUEStionable CALibration NTRansition value negative transition or STATus QUEStionable CALibration PTRansition value positive transition where value is the sum of the decimal values of the bits you want to enable Queries STATus QUEStionable CALibration NTRansition STATus QUEStionable CALibration PTRansition Data Questionable Calibration Event Register The Data Questionable Calibration Event Register latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register Query STATus QUEStionable CALibration EVENt Chapter 3 155 Programming the Status Register System Status Groups Data Ouestionable Calibration Event Enable Register The Data Ouestionable Calibration Event Enable Register lets you choose which bits in the Data Ouestionable Calibration Event Register set the summary bit bit 8 of the Data Ouestionable Condition register to 1 Command STATus OUESti
79. ESARERSCFORAERRESARGOERS CERES RESAAFTESZSci dS 165 Downloading L iunc Lp eb EE RR RT ER O RR EE QE NET RE RUE 165 Playing a Downloaded Wavefort soia ect eet ESI ee HEH odd kA EAR SHIRE R EER Yl 179 Downloading E443xB Signal Generator Files lt 4 4000 180 Understanding ARB Waveform File Composition and Encryption 4 4 186 Downloading waveform data to the ESG for extraction as an encrypted waveform file 186 Extracting waveform files from the ESG for use in other ESGs esses 187 Downloading encrypted waveform files to the ESG eee eee 188 User Bi Binary Pile Data Downloads dde ROC ror bod o odd 189 Pramed and Untramed Data Types z a nie een ieas ee bs eee GANG E GUCRRO SUR Re bok Cte Aw 189 Data Bec He Meri bg occa eck Seg eiumiehoainladessea PEE Yo EEbe qubd dE serai 190 Data LAOS aec oe ee ep EP E Epp eb ead K bre eR ERAT d bee b bqe i iq dina 191 Data Vola y 5 oeste kk Bo RPS AR DURER EB PRG PEU UE b EI dek 191 User Files as Data Source for Framed Transmission 4444444444440 191 Multiple User Files Selected as Data Sources for Different Timeslots 194 Downloadi User Pille Dali 2425 ade im tt du peso od na odvedl f a 195 Selecting Downloaded User Files as the Transmitted Data 4 4444 198 Modulating and Activating the Carteras coser easi rert Sn ceded een EAE kE NA 200 FUR Filter Coehtcient Downlod eeu bob
80. Event vi VI EVENT IO COMPLETION VI OUEUE VI NULL viClear vi Sends device clear command Set attributes for the session viSetAttribute vi VI_ATTR_ASRL_BAUD baud viSetAttribute vi VI ATTR ASRL DATA BITS 8 viPrintf vi RST n Resets the signal generator printf The signal generator has been reset n printf Power level should be 135 dBm n printf n Prints new line character to the display viClose vi Closes session viClose defaultRM Closes default session Queries Using Agilent BASIC This example program demonstrates signal generator query commands over RS 232 Query commands are of the type IDN and are identified by the question mark that follows the mnemonic Start Agilent BASIC type in the following commands and then RUN the program The following program example is available on the ESG Documentation CD ROM as rs232ex2 txt T KK KK KK kA K A AK Z A KA kA AXA A KA KA Ck CK A KA KA kk A KA KA AXA A KA kk AXA AXA ck kck kck ck AX kck ck AKA A kA ck ck ckck ck ck ck k k ok 20 30 PROGRAM NAME rs232ex2 txt 40 50 PROGRAM DESCRIPTION In this example query commands are used to read 60 data from the signal generator 70 Chapter 2 115 Programming Examples RS 232 Programming Examples 80 Start Agilent BASIC type in the following code and then RUN the program 90 i 00 LK KK KK RK RK K A Sk K A KA KA KA A KA KA AXA A KA KA AKA A kk kk kk kc ck kA A
81. H and then to PRBS 12 13 14 Unused These bits are always set to 0 15 Always 0 a On the E4428C this bit is set to 0 Ouery STATus OPERation CONDition Response The decimal sum of the bits set to 1 Example The decimal value 520 is returned The decimal sum 512 bit 9 8 bit 3 136 Chapter 3 Programming the Status Register System Status Groups Standard Operation Transition Filters negative and positive The Standard Operation Transition Filters specify which types of bit state changes in the condition register set corresponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 Commands STATus OPERation NTRansition lt value gt negative transition or STATus OPERation PTRansition value positive transition where value is the sum of the decimal values of the bits you want to enable Queries STATus OPERation NTRansition STATus OPERation PTRansition Standard Operation Event Register The Standard Operation Event Register latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register Query STATus OPERation EVENt Standard Operation Event Enable Register The Standard Operation Event Enable Register lets you choose which bits in the Standard Operation Event
82. Header Files If you are using the NI 488 2 library do the following add the GPIB 32 OBJ file to the Resource Files e add the windows h file to the Header Files e add the Deci 32 h file to the Header Files Refer to the National Instrument website for information on the NI 488 2 library and file requirements For information on the VISA library see the Agilent website or National Instrument s website IMPORTANT The VXI 11 SCPI service must be enabled before you can communicate with the signal generator over the LAN interface Go to the Utility gt GPIB RS 232 LAN gt LAN Services Setup menu and enable the VXI 11 SCPI service Running Visual Basic 6 0 Programming Examples To run the example programs written in Visual Basic 6 0 you must include references to the IO Libraries For more information on VISA and IO libraries refer to the Agilent VISA User s Manual available on Agilent s website http www agilent com In the Visual Basic IDE Integrated Development Environment go to Project References and place a check mark on the following references e Agilent VISA COM Resource Manager 1 0 Chapter 2 37 Programming Examples Using the Programming Examples VISA COM 1 0 Type Library NOTE If you want to use VISA functions such as viWrite then you must add the visa32 bas module to your Visual Basic project The signal generator s VXI 11 SCPI service must be on before you can run the Download Visual Basic 6 0 programming exa
83. In VISA the viTerminate command requests a VISA session to terminate normal execution of an asynchronous operation The parameter list describes the session and job id NI 488 2 Library The NI 488 2 library function aborts any asynchronous read write or command operation that is in progress The parameter ud is the interface or device descriptor SICL The Agilent SICL function aborts any command currently executing with the session id This function is supported with C C on Windows 3 1 and Series 700 HP UX Remote Function The Agilent BASIC function REMOTE and the other listed I O library functions cause the signal generator to change from local operation to remote operation In remote operation the front panel keys are disabled except for the Local key and the line power switch Pressing the Local key on the signal generator front panel restores manual operation Table 1 6 Agilent BASIC VISA NI 488 2 Agilent SICL 10 REMOTE 719 N A EnableRemote parameter iremote id list Agilent BASIC The REMOTE 719 function disables the front panel operation of all keys with the exception of the Local key VISA Library The VISA library at this time does not have a similar command Chapter 1 11 Getting Started Using GPIB NI 488 2 Library SICL This NI 488 2 library function asserts the Remote Enable REN GPIB line All devices listed in the parameter list are put into a
84. K KK KK KK I IKK IKK I kok oko k AR IRR IR AR IRR IR AIR IR RR IIR AR IRA k k k k k k k k k k k k k He include lt visa h gt include StdAfx h include lt iostream gt include lt conio h gt void main ViSession defaultRM vi Declares variables of type ViSession for instrument communication ViStatus viStatus 0 Declares a variable of type ViStatus for GPIB verifications long lngDone 0 Operation complete flag 62 Chapter 2 Programming Examples GPIB Programming Examples viStatus viOpenDefaultRM amp defaultRM Initialize VISA session Open session to gpib device at address 19 viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus If problems then prompt user printf Could not open ViSession Nn printf Check instruments and connections M n printfi Xm exit 0 OrintE Xn viClear vi Clears the signal generator viPrintf vi OLSXn Resets the status byte register Print user information printf Programming example using the SAV RCL SCPI commands Nn printf used to save and recall an instrument s state n printf Nn viPrintf vi RSTXn Resets the signal generator viPrintf vi FREQ 5 MHz Mn Sets sig gen frequency viPrintf vi POW ALC OFF n Turns ALC Off viPrintf vi POW AMPL 3 2 dBm n Sets power for 3 2 dBm viPrintf vi OUTP STAT ON n Turns RF output On viPrintf vi OPC VXn
85. KK K KA K K AA K KA X K AKA K kk Se kk K AKA K kk Se kk AA K KK KK RR KR KK ck ckck ck ckckck KK KKK 50 60 INTEGER Num 70 CONTROL 9 0 1 Resets the RS 232 interface 80 CONTROL 9 3 9600 Sets the baud rate to match the sig gen 90 STATUS 9 4 Stat Reads the value of register 4 200 Num BINAND Stat 7 Gets the AND value 210 CONTROL 9 4 Num Sets parity to NONE 220 OUTPUT 9 RSI Outputs reset to the sig gen 230 END End the program Interface Check Using VISA and C This program uses VISA library functions to communicate with the signal generator The program verifies that the RS 232 connections and interface are functional In this example the COM2 port is used The serial port is referred to in the VISA library as ASRL1 or ASRL2 depending on the computer serial port you are using Launch Microsoft Visual C add the required files and enter the following code into the cpp source file The following program example is available on the ESG Documentation CD ROM as rs232ex1 cpp J RR RRR kok k KR KKK IK oko KKK KK KK Kk o I o Ck IKK IKK IKK Kk kok o kok ok I Ck KC CK k kok k Ck kk Ck ke kk Ck ko kk ke ko ke ke kk HE PROGRAM NAME rs232exl cpp JJ PROGRAM DESCRIPTION This code example uses the RS 232 serial interface to control the signal generator Connect the computer to the signal generator using an RS 232 serial cable The user is asked to set the signal generator for a 0 dBm power level A
86. M as niex2 cpp ck ck ck kk kk kk e ee A A AZ ce ce X AZ AX A ce AZ AZ ck ce ce ce ce cce cce ce ccce ck cec ccce cc ck ck ck ck ck ck ck ck ck ck ck ck ck ck AZ ck AZ ck AZ ck ck ck ck ck ck ck ck kk ckckckckckckckck PROGRAM NAME niex2 cpp PROGRAM DESCRIPTION This program will place the signal generator into LOCAL LOCKOUT mode All front panel keys except the Contrast key will be disabled The local command ibloc sig executed via program code is the only way to return the signal generator to front panel Local control Ck ck ck kk kk kk e A A ee A X AX X AX ce ce cce ce ce cce ce ce X A cc ck ck ck X ck X ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck kk ck ck ck ck ck ck ck ck ck Ck ck ck ck kk kk kckckckok include stdafx h include lt iostream gt include windows h include Decl 32 h using namespace std int GPIBO 0 Board handle Addr4882 t Address 31 Declares a variable of type Addr4882 t int main int sig Declares variable to hold interface descriptor sig ibdev 0 19 0 13 1 0 Opens and initialize a device descriptor Chapter 2 45 Programming Examples GPIB Programming Examples ibclr sig Sends GPIB Selected Device Clear SDC message ibwrt sig RST 4 Places signal generator in a defined state cout lt lt The signal generator should now be in REMOTE The remote mode R lt lt endl cout lt lt annunciator should appear on the s
87. MEASuring o Waiting for TRIGer 5 s 9 in T Zlo Unused gt 5 Unused c Unused Els zls gt m stat reg_2of2 Always Zero 0 122 Service Request Enable Register Chapter 3 Programming the Status Register System Status Register Bit Values Status Register Bit Values Each bit in a register is represented by a decimal value based on its location in the register see Table 3 1 e To enable a particular bit in a register send its value with the SCPI command Refer to the signal generator s SCPI command listing for more information e To enable more than one bit send the sum of all the bits that you want to enable e To verify the bits set in a register query the register Example Enable a Register To enable bit 0 and bit 6 of the Standard Event Status Group s Event Register 1 Add the decimal value of bit 0 1 and the decimal value of bit 6 64 to give a decimal value of 65 2 Send the sum with the command ESE 65 Example Query a Register To query a register for a condition send a SCPI query command For example if you want to query the Standard Operation Status Group s Condition Register send the command STATus OPERation CONDition If bit 7 bit 3 and bit 2 in this register are set bits 1 then the query will return the decimal value 140 The value represents the decimal values of bit 7 bit 3 and bit 2 128 8 4 140 Table 3 1 Status Register Bit
88. MEM DATA file name The output format is the same as the input format Selecting Dow nloaded User Files as the Transmitted Data Unframed Data The following front panel key presses or remote commands will select the desired user file from the catalog of user files as a continuous stream of unframed data for the active TDMA format or for a custom modulation Via the front panel 1 Fora TDMA format press Mode gt Real Time TDMA gt desired format gt Data gt User File For custom modulation press Mode gt Custom gt Real Time I O Baseband gt Data gt User File 2 Highlight the desired file in the catalog of user files 3 Press Select File gt desired format Off On or Custom Off On to On Via the remote interface The following commands activate the desired TDMA format SOURce RADio lt desired format gt DATA BIT lt file_name gt SOURce RADio lt desired format gt STATe On 198 Chapter 4 Downloading and Using Files User Bit Binary File Data Dow nloads The following commands activate the custom modulation format SOURce RADio CUSTom DATA BIT lt file name gt SOURce RADio CUSTom STATe On NOTE To select a user file from binary memory send the same commands shown in the above examples without BIT preceding the file name For example SOURce RADio lt desired format gt DATA lt file_name gt Framed Data The following front panel key presses or remote commands w
89. ODulation register A 1 in this bit position indicates that one of the following may have happened modulation source 1 underrange modulation source 1 overrange modulation source 2 underrange modulation source 2 overrange modulation uncalibrated See the Data Questionable Modulation Status Group on page 151 for more information g Calibration summary This is a summary bit taken from the QUEStionable CA Libration register A 1 in this bit position indicates that one of the following may have happened an error has occurred in the DCFM DC M zero calibration an error has occurred in the I Q calibration See the Data Questionable Calibration Status Group on page 154 for more information 9 Self Test A 1 in this bit position indicates that a self test has failed during power up This bit can only be cleared by cycling the signal generator s line power CLS will not clear this bit 10 11 Unused These bits are always set to 0 12 gt BERT summary This is a summary bit taken from the QUEStionable BERT register A 1 in this bit position indicates that one of the following occurred no BCH TCH synchronization no data change no clock input PRBS not synchronized demod DSP unlocked or demod unleveled See the Data Questionable BERT Status Group on page 157 for more information 142 Chapter 3 Programming the Status Register System Status Groups Table 3 7 Data Ouestionable Condition Register
90. Overdrive A 1 in this bit indicates that the signal level into the IO modulator is too large 3 Lowband Detector Fault A 1 in this bit indicates that the lowband detector heater circuit has failed 2 14 Unused These bits are always set to 0 15 Always 0 a On the E4428C 38C with Option 506 this bit is set to 0 b On the E4428C this bit is set to 0 Ouery STATus QUEStionable POWer CONDition Response The decimal sum of the bits set to 1 Data Questionable Power Transition Filters negative and positive The Data Questionable Power Transition Filters specify which type of bit state changes in the condition register set corresponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 146 Commands STATus OUEStionable POWer NTRansition lt value gt negative transition or STATus QUEStionable POWer PTRansition value positive transition where value is the sum of the decimal values of the bits you want to enable Queries STATus QUEStionable POWer NTRansition STATus QUEStionable POWer PTRansition Chapter 3 Programming the Status Register System Status Groups Data Ouestionable Power Event Register The Data Ouestionable Power Event Register latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register
91. P address and hostname to match the IP address and hostname of your signal generator VXI 11 Programing The signal generator supports the VXI 11 standard for instrument communication over the LAN interface Agilent IO Libraries support the VXI 11 standard and must be installed on your computer before using the VXI 11 protocol Refer to Using VXI 11 on page 20 of this Programming Guide for information on configuring and using the VXI 11 protocol The VXI 11 examples use TCPIPO as the board address VXI 11 Programming Using SICL and C The following program uses the VXI 11 protocol and SICL to control the signal generator The signal generator is set to a 1 GHz CW frequency and then queried for its ID string Before running this code you must set up the interface using the Agilent IO Libraries IO Config utility The following program example is available on the ESG Documentation CD ROM as vxisicl cpp J RR KK KK KK o oko k kk kk oko Kk kk Ck kk kk kok Kk kok k kok Kk kok k k kok k kok Kk kok k kok Ck ko kk k kok k kk k k k k ke kk k k ke ke k k ke ke ke PROGRAM NAME vxisicl cpp PROGRAM DESCRIPTION Sample test program using SICL and the VXI 11 protocol 74 Chapter 2 Programming Examples LAN Programming Examples Z NOTE You must have the Agilent IO Libraries installed to run this program This example uses the VXI 11 protocol to set the signal generator for a 1 gHz CW frequency The signal generator
92. Programming Examples printf Signal Generator Modulation Uncalibratedn printfi Xm break default printf No Problems with Modulation n printf nny Close the sessions viClose vi viClose defaultRM Reading the Service Request Interrupt SRQ Using VISA and C This example demonstrates use of the Service Request SRQ interrupt By using the SRQ the computer can attend to other tasks while the signal generator is busy performing a function or operation When the signal generator finishes it s operation or detects a failure then a Service Request can be generated The computer will respond to the SRQ and depending on the code can perform some other operation or notify the user of failures or other conditions This program sets up a step sweep function for the signal generator and while the operation is in progress prints out a series of asterisks When the step sweep operation is complete an SRQ is generated and the printing ceases Launch Microsoft Visual C 6 0 add the required files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex10 cpp VA RR RRR RRR KR KKK KKK IKK aoaaa oaaao IK aooaa aa aooaa KK IK I RR KO I I HK PROGRAM FILE NAME visaexl0 cpp PROGRAM DESCRIPTION This example demonstrates the use of a Service Request SRQ interrupt The program sets up conditions to enable the
93. Programming Guide Agilent Technologies E4428C 38C ESG Signal Generators This guide applies to the following signal generator models E4428C ESG Analog Signal Generator E4438C ESG Vector Signal Generator Due to our continuing efforts to improve our products through firmware and hardware revisions signal generator design and operation may vary from descriptions in this guide We recommend that you use the latest revision of this guide to ensure you have up to date product information Compare the print date of this guide see bottom of page with the latest revision which can be downloaded from the following website http www agilent com find esg GE Agilent Technologies Manufacturing Part Number E4400 90505 Printed in USA March 2005 Copyright 2001 2005 Agilent Technologies Inc Notice The material contained in this document is provided as is and is subject to being changed without notice in future editions Further to the maximum extent permitted by applicable law Agilent disclaims all warranties either express or implied with regard to this manual and to any of the Agilent products to which it pertains including but not limited to the implied warranties of merchantability and fitness for a particular purpose Agilent shall not be liable for errors or for incidental or consequential damages in connection with the furnishing use or performance of this document or any of the Agilent products to which it pertains
94. RF output off printf Press the front panel Local key to return the n printf signal generoator to manual operation n Closes the sessions printf nT viClose vi viClose defaultRM Chapter 2 61 Programming Examples GPIB Programming Examples Saving and Recalling States Using VISA and C In this example instrument settings are saved in the signal generator s save register These settings can then be recalled separately either from the keyboard or from the signal generator s front panel Launch Microsoft Visual C 6 0 add the reguired files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex8 cpp J RR RRR RK KK KK IK oko IKK KKK IKK IK I IKK II KK IKK IKK I A KK IRR IR AIR I I II I I A PROGRAM FILE NAME visaex8 cpp PROGRAM DESCRIPTION In this example instrument settings are saved in the signal generator s registers and then recalled Instrument settings can be recalled from the keyboard or when the signal generator is put into Local control from the front panel This program will initialize the signal generator for an instrument state store the state to register 1 An RST command will reset the signal generator and a RCL command will return it to the stored state Following this remote operation the user will be instructed to place the signal generator in Local mode J BR R
95. Reads the response into rdBuffer Prints the source power level printf Source power dBm is s n rdBuffer printf Press any key to continue n erince n y Prints new line character to the display getch viPrintf vi FREQ MODE n Querys the frequency mode viScanf vi t rdBuffer Reads the response into rdBuffer Prints the source freq mode printf Source frequency mode is s n rdBuffer printf Press any key to continue n printfi Xu s Prints new line character to the display getch 52 Chapter 2 Programming Examples GPIB Programming Examples viPrintf vi OUTP OFF n Turns source RF state off vViPrintfi vi NOUTE n s Querys the signal generator s RF state viScanf vi Sli amp num Reads the response integer value Prints the on off RF state if num gt 0 printf Source RF state is on n else printf Source RF state is off n Close the sessions viClose vi viClose defaultRM Generating a CW Signal Using VISA and C This example uses VISA library functions to control the signal generator The signal generator is set for a CW frequency of 500 kHz and a power level of 2 3 dBm Launch Microsoft Visual C 6 0 add the required files and enter the code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex4 cpp J RR RRR RK KR KKK IKK IKK aoa oa aaa aaa KK IK
96. SC PT Con ike soe sre he opo dor Ri baies d Here eda keds 127 SUC Bye TOP E DET 129 Contents SLR Ke ROCIO 6 cordes bok aka oe RA dob PE bb eo eei dd uid du ea d no dz 130 Service Request Enable NEM isc eta ceeiegseleerchhoepeesacewededaaeqhadaxwes 134 SENS GOUS Mr C rer 132 Standard Event Status GIIOUD ia 600g eect ee ete eee Cewek PERE ERR RO d EO dro d 133 Standard Operation Status Group visa e546 dk dd heb SA Ir REPE iki o RR ol P oka 135 Baseband person Status GROUP lt ss kebab eba iei er a 138 Data Questionable State ftps esere ts ERPRSEEEFRqRRbEIrADUR IUDEX ppb EDEN eked 141 Dita Questionable Power Statne GIOUD xosurdahes dk d EC RR EP CE e dH ERE Rd ed 145 Data Questionable Frequency Status Group 2 s400scsvse euet et RR Ya ERR EUR Raw 148 Data Questionable Modulation Status Group c sise 8 neuen R dod ee esas RR RADAR awn 151 Data Questionable Calibration Status Group 0 eee eee 154 Data Questionable BERT Status CO cs xeeg hbiuing barca here cel seeadewe teed eae 157 4 Downloading and Using Files iiid akadanduvakaxenedaxaszanexexexe naci a BT ARB Waveform Data Downloads 124224 ERROR Ro ERE CEP EP RR ok o vl 162 Bit value and Output POWT rsi ses see e do ERES EH RAPERE ECOIURF SER Ede desi du 163 Types of Arbitrary Waveform Generator Memory i i ioasu es e ER RRGURERRREXG oan 163 Date PRO EOS quedes ed bu Roboran kc od n E galee ice a orb EE d e do e p dice 164 Fale Stracture and MEIIDUI Lostrer sr rR
97. SISE IE Unused Els Unused ECP S Unused Tere Unused Unused Unused Unused Always Zero 0 Synth Unlocked 10 MHz Ref Unlocked 1 GHz Ref Unlocked Baseband 1 Unlocked Unused Unused Unused Unused 2 p Sampler Loop Unlocked 2l2 je YO Loop Unlocked ic fit fole vlule s Unused 2 2 v s Unused E e zu Unused e mE tjs m Data Quest BERT Status Group en m Option UN7 8 300 only acre No Data Chanos Data Quest Modulation Status Group PRBS Sync Loss U d Mod 1 Undermod pn Unused Sync to BCH TCH PDCH 2 3 4 Mod 1 Overmod Md 5 sis Mod 2 Undermod U 6 Ss Mod 2 Overmod ls misma uu Modulation Uncalibrated s s s r cle Unused zs Unused 4 8 sic als Unused 4 9 Ele ee s ex s Unused 410 HG Slo jw Unused SIME Downconv Demod Out of Lock I 11 Unused D D fr 9 Demod DSP Ampl Out of Range 112 w 3 4 5 bmd md ad ah d ipee Waiting for TCHIPDCH Unused Always Zero 0 Unused Always Zero 0 Data Quest Calibration Status Group DCFM DCfM Zero Failure Option 001 601 and 002 602 Baseband 1 Busy Baseband 1 Communicating Unused Unused Unused l QCalibration Failure Unused o Unused Unused 2 slo Unused E Unused SEE Unused ajaj Unused fa fu Unused i lo Unused S s s Unused osla Unused j E Unused SIEIS Unused a OH Unused tIS w Unused 8 d i SHE Unused Bas Unused Unused Unused Unused Unused Unused Always Zero 0
98. SS S 5sS S 5 SsS S Sssss 5 S S s n printf Nn printf Manually set up the sig gen for an unleveled output condition n printfi Xn s printf Select AM modulation Nn printf Select AM Source Ext 1 and Ext Coupling AC n printf Turn On the modulation Nn printf Do not connect any source to the input in printf Check signal generator s display for the EXT1 LO annunciator n Chapter 2 67 Programming Examples GPIB Programming Examples printf nT printf Press Enter when ready n printf nt y getch viPrintf vi STAT QUES MOD ENAB 16 n Ae bits T0 5 T1T1 1T27 3 and viPrintf vi STAT QUES MOD COND n set bits viScanf vi s rdBuffer set bits Waits for keyboard user input Enables the Data Questionable Modulation Condition Register ia Querys the register for any Reads the decimal sum of the num int rdBuffer 1 0 Converts string data to numeric switch num case 1 printf Signal Generator Modulation printf nt break case 2 printf Signal Generator Modulation printfi Xmu s break case 4 printf Signal Generator Modulation printf Anty break case 8 printf Signal Generator Modulation printf nt y break case 16 68 Based on the decimal value 1 Undermod n 1 Overmod n 2 Undermod n 2 Overmod n Chapter 2 Programming Examples GPIB
99. Should Agilent have a written contract with the User and should any of the contract terms conflict with these terms the contract terms shall control Questions or Comments about our Documentation We welcome any questions or comments you may have about our documentation Please send us an E mail at sources manuals am exch agilent com Contents 1 Betting Started ssssas sunanasdndd s ha a sad d n Ka ernesenessacewnase esens D Introduction To Renne Opr uuo s R88 80 OB EIE E ESIE EESE bb gp ud 2 lo ED 3 POLDAN S auc 3 od dd dd od rd do RR e Rd dd 3 Ardent IO Libraunes SIE sok io e dbi Qa EE osobou ovl dod Cow EI HR E Res dok 3 Wile A E akon Rod E dp dri B ptos quib pk eds eed o ET ETT 4 Programming Langues vse zb oe b iu k 4 ese deshedegse een chdageoo she eand sees dk 6 EE OMV eee ee ee eee eee eee ee ee he er er re ere eee ee 7 1 Installing the GPIB Interface Caid ocs pak eine d d dan k he tortti bitki TEREE 7 2 pelecime VO Libraries for GPIB 2 ivccuiesad 2a oe ib eed as ede PRRATORPR EAE RAP RIP 9 S Dota Up the GPE IMENE a nacida deos d HERO ib iR ds k ebd urb qc dd desde 9 S en GPIB Panctousality epes cerr eree EEE ESEE OPER OOPPRRICRTERE SISSE ENA 10 GFE Interfaces VEB d odekebb dar eekan pad e bane kb bebe dE eb E bita bita 10 GPIB Pohon SUUOIIente 3 z dures ewceo ase ex e S e Re bob kB bl eo ORE RE TE qs 10 Were EAN MP 16 1 Selec ng VO Libraries
100. TE If sockets is used to send data to the signal generator you must provide an end of file indicator Use the following command to download waveform data MEM DATA lt WFM1 file_name gt 0 lt data gt NL END Example 1 MMEM DATA WFM1 FILENAME 3 240 240 bytes of data LJL I j A B C FILENAME the waveform file name as it will appear in the signal generator s waveform memory catalog 3 defines the number of decimal digits to follow in B This variable is represented by A in the sample command line 240 denotes how many bytes of data are to follow This variable is represented by B in the sample command line 240 bytes of data the binary waveform data order for each 2 byte sample is defined as MSB most significant byte first and LSB least significant byte last The waveform must have at least 60 samples of data Each sample I Q data is represented by 4 bytes 2 bytes for the I sample and 2 bytes for the Q sample In the example above the data 240 bytes represents 60 samples of data Example 2 MMEM DATA WEM1 file_name 1912S407897 file_name the waveform file name as it will appear in the signal generator s waveform memory catalog 1 defines the number of decimal digits to follow in B 9 denotes how many bytes of data are to follow 128407897 the ASCII representation of the data that is downloaded to the signal generator This variable is represented by C in the sample command line 166 Chapter 4 Downloading an
101. The differences are in the lower level I O libraries NI 488 2 and SICL respectively It is best to use the Agilent VISA library with the Agilent GPIB interface card or NI VISA with the NI PCI GPIB interface card Agilent SICL can be used without the VISA overlay The SICL functions can be called from a program However if this method is used executable programs will not be portable to other hardware platforms For example a program using SICL functions will not run on a computer with NI libraries PCI GPIB interface card NI 488 2 can be used without the VISA overlay The NI 488 2 functions can be called from a program However if this method is used executable programs will not be portable to other hardware platforms For example a program using NI 488 2 functions will not run on a computer with Agilent SICL Agilent GPIB interface card 3 Setting Up the GPIB Interface 1 Press Utility gt GPIB RS 232 LAN gt GPIB Address 2 Use the numeric keypad the arrow keys or rotate the front panel knob to set the desired address The signal generator s GPIB address is set to 19 at the factory The acceptable range of addresses is 0 through 30 Once initialized the state of the GPIB address is not affected by a signal generator preset or by a power cycle Other instruments on the GPIB cannot use the same address as the signal generator 3 Press Enter 4 Connect a GPIB interface cable between the signal generator and the computer
102. Tor LAN 6 00 06 escccebebe tO CREE R Dae ee e p ee 16 2 nas Lipthe LAN METI S LLostRhEdoU EROR RO sd buk ed d k bla k EB BE RS SESS dE 16 3 Verovineg LAN PEatichoud by 216 os qb pd ebe dE EU P pid deed nd deb bp Rep PUR e EP bqi 18 Ling NAE TT SR S P UR E E CU EN CRREEERSSdRES EE Eb b Rd br ets epuuq 20 Using Sockets LAN uoeuibesereperbee4cRee4 RERO Db RR Ep AP RR EE RR ob deque 21 Usine lene LAN c dn Ree REX ARE ER OX dj dose deo E ERE E TER eR UPPER du 23 rd Wr rrr 26 Eus E o ln bino ned ko ey heath teenage ah ani qu bre obe er des 28 lselecnng VO Libraries Tor RS 232 cote dit VIERU AERE EEES OLENS a EE QR RR ES CER Ed 28 2 Deti Upthe R3232 MENA essri op EU sb rnu oe dro di qood 29 3 Verifying RS 232 PuICHODATIL sak duce e ded V ORO IOS E rere PERRO A eR d d 30 Character Format Parameters cs eoos ERE REXRERSREXREASQRRSIERRAAE Rd EROR ERR oko ked 31 U You Have Problor b a eeaacreteoe REV ed ER Sd on RES ERR ho Ped Ap dk ques al Dri l R RR O REG be O ub yg obe ue ERE Pa don 32 Emo Menee PiE NEUTER 32 Eror Message TUBES ps whee ee Eric EE eE EEEREN RAEE TENE REEDA Er ddd kk db b ds 33 2 Programing Exemples 5 sc s n n ok eases K E ANO EG Ea aud ad Using the Programming Examples icine ar bios koda k Eb RR ODE dele EROR diod kc RR RSA 36 Programming Examples Development Environment 6406 6 64 4 66b Web e ee etre d 36 Running CC Progamming Exemples ciris 808 886 B BPA v bob dob buds 37 Running Visual Basic 6 0 Programmi
103. Transition Filter ZFEEFSZETIISZIIIT RegaesOre is 14 13 12 1110987654321 0 ransition Filter Er bdbrgrirrtrii o Baseband Operationl45 14 13 12 11 009 87 65 4 3 2 1 0 15 14 13 1221 10098765432 1 0 14 13 12 11109 87 6 5 4 3 2 1 Event Register T amp amp 9 4 Ze C Za ow unl Baseband Operation EENE Event 15 14 13 12 131 109 87 65 4 32 1 O Enable Register To Operation Status Register Bit 10 ck712c lt 138 Chapter 3 Programming the Status Register System Status Groups Baseband Operation Condition Register The Baseband Operation Condition Register continuously monitors the hardware and firmware status of the signal generator Condition registers are read only Table 3 6 Baseband Operation Condition Register Bits Bit Description 0 Baseband 1 Busy A 1 in this position indicates the signal generator baseband is active 1 Baseband 1 Communicating A 1 in this bit position indicates that the signal generator baseband generator is handling data I O 2 14 Unused This bit position is set to 0 15 Always 0 Query STATus OPERat ion BASeband CONDition Response The decimal sum of the bits set to 1 Example The decimal value 2 is returned The decimal sum 2 bit 1 Baseband Operation Transition Filters negative and positive The Baseband Operation Transition Filters specify which types of bit state changes in the condition register set corr
104. _ gt For this protocol configuration the signal generator s firmware loads PRAM with the bits defined in the following table Frame Timeslot PRAM Word Data Bits Burst Bits Pattern Offset Reset Bit 1 0 0 155 0 1 don t care 0 off 0 off 1 1 on 156 311 set by GSM standard 42 bits amp 1 on 0 first 114 bits of user file 1 2 312 467 0 1 don t care 0 0 1 3 468 624 0 1 don t care 0 0 1 4 625 780 0 1 don t care 0 0 1 5 781 936 0 1 don t care 0 0 1 6 937 1092 0 1 don t care 0 0 1 7 1093 1249 0 1 don t care 0 0 2 0 1250 1405 0 1 don t care 0 0 2 1 on 1406 1561 set by GSM standard 42 bits amp 1 on 0 remaining bits of user file 2 2 through 6 1562 2342 0 1 don t care 0 0 off Chapter 4 193 Downloading and Using Files User Bit Binary File Data Dow nloads Frame Timeslot PRAM Word Data Bits Burst Bits Pattern Offset Reset Bit 2 7 2343 2499 0 1 don t care 0 0 1 in offset 2499 only Event 1 output is set to 0 or 1 depending on the sync out selection which enables the Event 1 output at either the beginning of the frame beginning of a specific timeslot or at all timeslots Because timeslots are configured and enabled within the signal generator a user file can be individually assigned to one or more timeslots A timeslot cannot have more than one data source PN sequenc
105. al Generator ID Print header for ID printf buffer Print the ID string printf ntj Print carriage return Flush the read buffer Set sig gen power to 5dbm status viWrite instr ViBuf POW AMPL 5dbm n 15 amp retCount Query the power level status viWrite instr ViBuf POW n 5 amp retCount 78 Chapter 2 Programming Examples LAN Programming Examples Read the power level status viRead instr ViBuf buffer MAX COUNT amp retCount buffer retCount 0 Indicate the end of the string printf Power level Print header to the screen printf buffer Print the queried power level printf n y status viClose instr Close down the system status viClose defaultRM return 0 Sockets LAN Programming using C The program listing shown in Setting Parameters and Sending Queries Using Sockets and C on page 82 consists of two files lanio c and getopt c The lanio c file has two main functions int main andan int mainl The int main function allows communication with the signal generator interactively from the command line The program reads the signal generator s hostname from the command line followed by the SCPI command It then opens a socket to the signal generator using port 5025 and sends the command If the command appears to be a query the program queries the signal generator for a response and prints the response The int main1
106. ameter list describes the interface or device descriptor SICL The Agilent SICL igpibllo function prevents user access to front panel keys operation The function puts an instrument identified by the id parameter into remote mode with local lockout The parameter idis the session identifier and instrument address list 12 Chapter 1 Local Function Getting Started Using GPIB The Agilent BASIC function LOCAL and the other listed functions cause the signal generator to return to local control with a fully enabled front panel Table 1 8 Agilent BASIC VISA NI 488 2 Agilent SICL 10 LOCAL 719 N A ibloc int ud iloc id Agilent BASIC VISA Library NI 488 2 Library SICL Clear Function The LOCAL 719 function returns the signal generator to manual operation allowing access to the signal generator s front panel keys The VISA library at this time does not have a similar command The NI 488 2 library function places the interface in local mode and allows operation of the signal generator s front panel keys The ud parameter in the parameter list is the interface or device descriptor The Agilent SICL function puts the signal generator into Local operation enabling front panel key operation The id parameter identifies the session The Agilent BASIC function CLEAR and the other listed T O library functions cause the signal generator to assume a cleared condition Table 1 9 Agilent B
107. an event viStatus vilnstallHandler vi VI EVENT SERVICE REO interupt rdBuffer The next line of code enables the detection of an event viStatus viEnableEvent vi VI EVENT SERVICE REO VI HNDLR VI NULLI viPrintf vi viPrintf vi viPrintf vi viPrintf vi viPrintf vi viPrintf vi viPrintf vi viPrintf vi viPrintf vi viPrintf vi viPrintf vi printf n FREQ MODE LIST n Sets frequency mode to list LIST TYPE STEP n Sets sweep to step LIST TRIG SOUR IMM n Immediately trigger the sweep LIST MODE AUTO n Sets mode for the list sweep FREO STAR 40 MHZ n Start frequency set to 40 MHz FREQ STOP 900 MHZ n Stop frequency set to 900 MHz SWE POIN 25 n Set number of points for the step sweep SWE DWEL 5 S n Allow 5 sec dwell at each point INIT CONT OFF n Set up for single sweep TRIG SOUR IMM n Triggers the sweep INIT n Takes a single sweep While the instrument is sweeping have the program busy with printing to the display The Sleep function defined in the header file windows h will pause the program operation for 5 seconds while sweep 1 printf Sleep 500 printf nny The following lines of code will stop the events and close down the session viStatus viDisableEvent vi VI ALL ENABLED EVENTS VI ALL MECH 72 Chapter 2 Programming Examples GPIB Programmi
108. are functional Launch Microsoft Visual C 6 0 add the required files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex1 cpp JKR RK KR KK KKK IK kok k kok kok oko k IR IRR IIR AR IRR IR AIR IR RIAA IRR IRA ko k kok kok k k k k ke ke PROGRAM NAME visaexl cpp ff PROGRAM DESCRIPTION This example program verifies that the GPIB connections and and interface are functional Turn signal generator power off then on and then run the program bf J RR RRR KR KK KKK IK KR IKK KKK IK A IKK I KR IK A IKK I oko oko IK IRR IA IIR oko I oko kok oko I A include lt visa h gt include lt stdio h gt include StdAfx h include lt stdlib h gt 42 Chapter 2 Programming Examples GPIB Programming Examples void main ViSession defaultRM vi Declares a variable of type ViSession for instrument communication ViStatus viStatus 0 Opens a session to the GPIB device at address 19 viStatus viOpenDefaultRM amp defaultRM viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus printf Could not open ViSession n printf Check instruments and connections M n printf Nn exit 0 viPrintf vi RST n initializes signal generator prints to the output window printf The signal generator should now be in REMOTE The remote indicator n printf annunci
109. ata and restart the user file after the third timeslot The last 0 5 timeslot worth of data will never be modulated Data Requirement Reminders To avoid user file data download problems the following conditions must be met 1 The user file selected must entirely fill the data field of each timeslot 2 For binary memory downloads the user file must be a multiple of 8 bits so that it can be represented in ASCII characters 3 Available PRAM must be large enough to support both the data field bits and the framing bits Requirement for Continuous User File Data Transmission Full Data Field Requirements If a user file does not completely fill a single timeslot the firmware does not load any data into that timeslot For example if a timeslot s data field should contain 114 bits and only 100 bits are provided in the user file no data is loaded into the timeslot data field and no data is transmitted at the RF output To solve this problem add bits to the user file until it completely fills the data field of the active protocol 226 Chapter 4 Downloading and Using Files Data Transfer Troubleshooting Integer Number of Timeslots Requirement for M ultiple Timeslots If a user file fills the data fields of more than one timeslot in a continuously repeating framed transmission the user file is restarted after the last timeslot containing completely filled data fields For example if the user file contains enough d
110. ata to fill the data fields of 3 5 timeslots firmware loads 3 timeslots with data and restart the user file after the third timeslot The last 0 5 timeslot worth of data is never modulated To solve this problem add or subtract bits from the user file until it completely fills an integer number of timeslots M ultiple of 8 Bits Requirement For downloads to binary memory user file data must be downloaded in multiples of 8 bits since SCPI specifies data in 8 bit bytes Therefore if the original data pattern s length is not a multiple of 8 you may need to e Add additional bits to complete the ASCII character replicate the data pattern to generate a continuously repeating pattern with no discontinuity e truncate the remaining bits NOTE The multiple of 8 bits data length requirement for binary memory downloads is in addition to the requirement of completely filling the data field of an integer number of timeslots Using Externally Generated Real Time Data for Large Files The data fields absolutely must be continuous data streams and the size of the data exceeds the available PRAM real time data and synchronization can be supplied by an external data source to the front panel DATA DATA CLOCK and SYMBOL SYNC connectors This data can be continuously transmitted or can be framed by supplying a data synchronous burst pulse to the EXT1 INPUT connector on the front panel Additionally the external data can be multiplexed into
111. ation B ASeband PTRransition 327767 STATus QUEStionable CALibration ENABle 32767 STATus QUEStionable CALibration NTRansition 32767 STATus QUEStionable CALibration PTRansition 32767 STATus QUEStionable ENABle 0 STATus QUEStionable NTRansition 0 STATus QUEStionable PTRansition 32767 STATus QUEStionable FREQuency ENABle 32767 STATus QUEStionable FREQuency NTRansition 32767 STATus QUEStionable FREQuency PTRansition 32767 STATus QUEStionable MODulation ENABle 32767 STATus QUEStionable MODulation NTRansition 32767 STATus QUEStionable MODulation PTRansition 32767 STATus QUEStionable POWer ENABle 32767 STATus QUEStionable POWer NTRansition 32767 STATus QUEStionable POWer PTRansition 32767 STATus QUEStionable BERT ENABle 32767 STATus QUEStionable BERT NTRansition 32767 STATus QUEStionable BERT PTRansition 32767 128 Chapter 3 Programming the Status Register System Status Byte Group Status Byte Group The Status Byte Group includes the Status Byte Register and the Service Reguest Enable Register Status Byte Register T 8 Tele fas Te Service Request Enable Register ck721a Chapter 3 129 Programming the Status Register System Status Byte Group Status Byte Register Table 3 3 Status Byte Register Bits Bit Description 0 1 Unused These bits are always set to 0 2 Error Event Queue Summary Bit A 1 in this bit position indicates that the SCPI error queue is not empty T
112. ator R should appear on the signal generator display n printf Nn viClose vi closes session viClose defaultRM closes default session Local Lockout Using Agilent BASIC This example demonstrates the Local Lockout function Local Lockout disables the front panel signal generator keys The following program example is available on the ESG Documentation CD ROM as basicex2 txt 10 VK CK CK Ck kk Kk kk Ck Kk KA Ck Ck CK kk Ck Ck Sk CK kk kk kk kk kk kk Kk kk kc kk ck kk Ck kk kk kk ck kck kck ck ckck kck ck k ck kk 20 30 PROGRAM NAME basicex2 txt Chapter 2 43 Programming Examples GPIB Programming Examples 40 50 60 70 80 90 00 10 20 30 40 50 60 70 80 90 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 44 PROGRAM DESCRIPTION In REMOTE mode access to the signal generators l functional front panel keys are disabled except for the Local and Contrast keys The LOCAL LOCKOUT command will disable the Local key The LOCAL command executed from the controller is then the only way to return the signal generator to front panel Local control V ok ck ck ck kk kk Ck Ck kk Ck A kk ek kk ck ke kk kk kk Sk kk kk Sk kk kk Sk kk Sk kk kk kk AXA kk Sk ko ko ko k ko ko KKK kk ck k ko ko ko Sig gen 719 Declares a variable to hold signal generator address CLEAR Sig gen Resets signal generator parser and clears any outp
113. ble is identical to the cable specified in Table 1 13 3 Verify that the application is using the correct computer COM port and that the RS 232 cable is properly connected to that port 4 Verify that the controller s flow control is set to RTS CTS Chapter 1 31 Getting Started Error Messages Error Messages If an error condition occurs in the signal generator it is reported to both the SCPI remote interface error gueue and the front panel display error gueue These two gueues are viewed and managed separately for information on the front panel display error gueue refer to the User s Guide When accessing error messages using the SCPI remote interface error gueue the error numbers and the error description portions of the error query response are displayed on the host terminal Characteristic SCPI Remote Interface Error Oueue Capacity errors 30 Linear first in first out rflow Handli Overflow Handling Replaces newest error with 350 Queue overflow Viewing Entries Use SCPI query SYSTem ERRor NEXT Power up Clearing the Queue Send a CLS command Read last item in the queue Unresolved Errors Re reported after queue is cleared When the queue is empty every error in the queue has been read or the queue is cleared No Errors the following message appears in the queue 0 No error Errors that must be resolved For example unlock Error M essage Fi
114. byte are taken as data and used e In bit format the number of bits in the file is known and the non data bits in the last byte are discarded After downloading the files they can be selected as the transmitting data source This section contains information on transferring user file data from a PC to the signal generator It explains how to download user files into the signal generator s memory and modulate the carrier signal with those files Framed and Unframed Data Types There are two modes that can be used framed mode and pattern mode n framed mode user file data is inserted into the data fields of an existing or user defined custom framed digital modulation format such as DECT PHS or TETRA The signal generator s firmware generates the required framing structure and inserts user file data into the data field s of the selected format For more information see User Files as Data Source for Framed Transmission on page 191 NOTE Unlike pattern RAM PRAM downloads to memory user files contain data field information only The control data bits required for files downloaded directly into PRAM are not required for user file data e In pattern mode the file is modulated as a continuous unframed stream of data according to the modulation type symbol rate and filtering associated with the selected format When a user file is selected as the data source the signal generator s firmware loads each data bit into wa
115. c error bit bit 3 in the event status register IEEE 488 2 section 11 5 1 The lt error_message gt string for a positive error is not defined by SCPI A positive error indicates that the instrument detected an error within the GPIB system within the instrument s firmware or hardware during the transfer of block data or during calibration Execution Errors 299 to 200 indicate that an error has been detected by the instrument s execution control block Errors in this class set the execution error bit bit 4 in the event status register IEEE 488 2 section 11 5 1 In this case Either a PROGRAM DATA element following a header was evaluated by the device as outside of its legal input range or is otherwise inconsistent with the device s capabilities or e a valid program message could not be properly executed due to some device condition Execution errors are reported after rounding and expression evaluation operations are completed Rounding a numeric data element for example is not reported as an execution error Command Errors 199 to 100 indicate that the instrument s parser detected an IEEE 488 2 syntax error Errors in this class set the command error bit bit 5 in the event status register IEEE 488 2 section 11 5 1 In this case Either an IEEE 488 2 syntax error has been detected by the parser a control to device message was received that is in violation of the IEEE 488 2 standard Possible violat
116. cy EVENt Data Questionable Frequency Event Enable Register Lets you choose which bits in the Data Questionable Frequency Event Register set the summary bit bit 5 of the Data Questionable Condition Register to 1 Command STATus QUEStionable FREQuency ENABle value where value is the sum of the decimal values of the bits you want to enable Example Enable bit 9 and bit 3 so that whenever either of those bits is set to 1 the Data Questionable Frequency summary bit of the Data Questionable Condition Register is set to 1 Send the command STAT QUES FREQ ENAB 520 512 8 Query STATus QUEStionable FREQuency ENABle Response Decimal value of the sum of the bits previously enabled with the STATus QUEStionable FREQuency ENABle value command 150 Chapter 3 Programming the Status Register System Status Groups Data Questionable M odulation Status Group The Data Ouestionable Modulation Status Group is used to determine the specific event that set bit 7 in the Data Ouestionable Condition Register This group consists of the Data Ouestionable Modulation Condition Register the Data Ouestionable Modulation Transition Filters negative and positive the Data Ouestionable Modulation Event Register and the Data Ouestionable Modulation Event Enable Register Modulation 1 Undermod Modulation 1 Overmod Modulation 2 Undermod Modulation 2 Overmod Modulation Uncalibrated Unuse
117. d uint session byte buf uint count out uint retCount DllImport agvisa32 dll EntryPoint viSetAttribute public static extern int SetAttribute uint vi VisaAttribute attribute uint attrState DllImport agvisa32 dll EntryPoint viStatusDesc public static extern int StatusDesc uint vi int status byte desc DllImport agvisa32 dll EntryPoint viWrite public static extern int Write uint session byte buf uint count out uint retCount Chapter 4 223 Downloading and Using Files Data Transfer Troubleshooting Data Transfer Troubleshooting NOTE This feature is available only in E4438C ESG Vector Signal Generators with Option 001 601 or 002 602 This section is divided by the following data transfer method Direct PRAM Download Problems on page 224 User File Download Problems on page 226 User FIR Filter Coefficient File Download Problems on page 228 ARB Waveform Data Download Problems on page 229 Each section contains the following troubleshooting information alist of symptoms and possible causes of typical problems encountered while downloading data to the signal generator reminders regarding special considerations file requirements and data limitations tips on creating data transferring data data application and memory usage Direct PRAM Download Problems Table 4 5 Direct to PRAM Download Trouble Symptoms and Causes Symptom Po
118. d Unused Unused Unused Unused Unused Unused Unused Unused Unused Always Zero 0 Data OUEStionable CM Data OUEStonabl Y vy v vvvvvtvyvvvvi Kouan Data QUEStionable Y VY VY VVYYYVYVYY Negative Transition Filter Foy t Y t V i iiv tit v t i MODulation 15 14 13 12 1110987654321 0 15 14 13 12 1110987654321 0 Event Register Hn ON dul T S p Q Data QUEStionable ITI LEPIT Event 15 14 13 12 131 1009 87 654 3 21 0 Enable Register To Data Questionable Status Register Bit 7 ck708c Chapter 3 151 Programming the Status Register System Status Groups Data Questionable Modulation Condition Register The Data Ouestionable Modulation Condition Register continuously monitors the hardware and firmware status of the signal generator Condition registers are read only Table 3 10 Data Questionable Modulation Condition Register Bits Bit Description 0 Modulation 1 Undermod A 1 in this bit indicates that the External 1 input ac coupling on is less than 0 97 volts 1 Modulation 1 Overmod A 1 in this bit indicates that the External 1 input ac coupling on is more than 1 03 volts 2 Modulation 2 Undermod A in this bit indicates that the External 2 input ac coupling on is less than 0 97 volts 3 Modulation 2 Overmod A 1 in this bit indicates that the External 2 input ac coupling on is more than 1 03 volts 4 Modulation Uncalibrated A 1 in this bit indicat
119. d Using Files ARB Waveform Data Downloads Downloads to Waveform Memory NOTE Before downloading files into waveform memory turn off the ARB by pressing Mode gt Dual ARB gt ARB Off On until Off is highlighted or send the SCPI command SOURce RADio ARB STATe OFF MMEM DATA WFM1 lt file_name gt ABC for the waveform data file MMEM DATA MKR1 file name gt ABC for the markers file MMEM DATA HDR1 file name gt ABC for the header file The full directory path name can be specified in the command line The following SCPI commands are equivalent to the previous commands MMEM DATA USER BBG1 WAVEFORM file name 4ABC for the waveform data file MMEM DATA USER BBG1 MARKERS file name 4ABC for the markers file MMEM DATA USER BBG1 HEADER file name gt ABC for the header file Downloads to NVWFM M emory To download files to NVWFM non volatile memory using the GPIB or the LAN interface use the following SCPI commands MMEM DATA NVWFM lt file name fABC for the waveform file MMEM DATA NVMKR lt file name gt ABC for the markers file MMEM DATA NVHDR lt file name gt ABC for the header file The full directory path name can be specified in the command line The following SCPI commands are eguivalent to the previous commands MMEM DATA USER WAVEFORM lt file name gt ABC for the waveform file MMEM DATA USER MARKERS
120. d fails kok KR KK IR o oko o Ck Kk kok o kkk o Ck Kk oko k oko k k Ck Kk oko k kok k k kok k k kkk k kok kk kok k kk ke ke k int commandInstrument SOCKET sock const char command int count fprintf stderr Sending W sW Xn command if strchr command n NULL fprintf stderr Warning missing newline on command s n command count send sock command strlen command 0 if count SOCKET_ERROR return COMMAND_ERROR return NO_CMD_ERROR RRR KK KKK IKK I ko oko kok k kok ko oko oko k kok k k kok k k IR IRR IRR IR k k k k k kkk k kk k k k k k recv line similar to fgets but uses recv EOKCKCKCKCkCKCKCkCkCkCkCkCkCkCKCKCkCk IKK IK IKK II IK IK IKK I IKK I IR ck ke ke ke ke ke char recv_line SOCKET sock char result int maxLength Chapter 2 89 Programming Examples LAN Programming Examples ifdef WINSOCK int cur length 0 int count char ptr result int err 1 while cur length lt maxLength Get a byte into ptr count recv sock ptr 1 0 If no chars to read stop if count lt 1 break cur_length count If we hit a newline stop if ptr n ptrt t err 0 break ptrt t ptr 0 if err return NULL else return result 90 Chapter 2 Programming Examples LAN Programming Examples else RRR KK KK KK KK I KK IKK I KK IK IK I KR IK IR IKK IK IA k k k k k
121. e if out_stream fail cout lt lt Input file opening failed lt lt endl exit 1 generate the sample data for I and Q The I channel will have a sine wave and the Q channel will a cosine wave for int i 0 i lt SAMPLES i igData 2 i AMPLITUDE sin two_pi i float SAMPLES igData 2 i 1 AMPLITUDE cos two_pi i float SAMPLES make sure bytes are in the order MSB most significant byte first PC only char cptr char iaData cast the integer values to characters for int i 0 i lt 4 SAMPLES i 2 4 SAMPLES char temp cptr i swap LSB and MSB bytes Chapter 4 169 Downloading and Using Files ARB Waveform Data Downloads cptr i l cptr i 1 cptr i 1 temp now write the buffer to a file out stream write char iqData 4 SAMPLES return 0 Waveform Downloading Using C The following program uses the GPIB to download a file directly to the baseband generator volatile memory for play back in the Dual ARB player The program allocates a memory buffer on the PC or workstation of 102400 bytes 100 1024 bytes The actual size of the buffer is limited by the memory on your PC or workstation so the buffer size can be increased or decreased to meet your system limitations While this program is directed at using the GPIB to download a waveform file into volatile memory it can be modified to store files in non volatile memory or for use over the LAN with the
122. e specified file in the form of a SCPI definite block A newline is NOT appended to the block and END is not sent at the conclusion of the write static public void WriteFileBlock uint device string fileName Make sure that the file exists otherwise sends a null block if File Exists fileName FileStream fs new FileStream fileName FileMode Open Send the definite block header lengthDataLength dataLength string fileSize fs Length ToString string fileSizeLength fileSize Length ToString WriteDevice device fileSizeLength fileSize false Don t set END at the end of writes VisaInterop SetAttribute device VisaAttribute SendEndEnable 0 220 Downloading and Using Files Saving and Recalling Instrument State Files Write the file block to the signal generator byte readBuf new byte TRANSFER BLOCK SIZE int numRead 0 uint retCount 0 while numRead fs Read readBuf 0 TRANSFER BLOCK SIZE 0 VisaInterop Write device readBuf uint numRead out retCount Go ahead and set END on writes VisaInterop SetAttribute device VisaAttribute SendEndEnable 1 Done with file fs Close else Send an empty definite block WriteDevice device 10 false Declaration of VISA device access constants public enum VisaAccessMode NoLock 0 ExclusiveLock 1 SharedLock 2 LoadConfig 4 Declaration of VISA attrib
123. e Event Enable Register lets you choose which bits in the Data Ouestionable Event Register set the summary bit bit 3 of the Status Byte Register to 1 Command STATus QUEStionable ENABle value command where value is the sum of the decimal values of the bits you want to enable Example Enable bit 9 and bit 3 so that whenever either of those bits is set to 1 the Data Ouestionable Status summary bit of the Status Byte Register is set to 1 Send the command STAT QUES ENAB 520 512 8 Query STATus QUEStionable ENABle Response Decimal value of the sum of the bits previously enabled with the STATus QUEStionable ENABle value command 144 Chapter 3 Programming the Status Register System Status Groups Data Ouestionable Power Status Group NOTE There are two conditions when a bit from this status group does not apply and returns a zero when gueried For more information see Table 3 8 on page 146 The Data Ouestionable Power Status Group is used to determine the specific event that set bit 3 in the Data Ouestionable Condition Register This group consists of the Data Ouestionable Power Condition Register the Data Ouestionable Power Transition Filters negative and positive the Data Ouestionable Power Event Register and the Data Ouestionable Power Event Enable Register Reverse Power Protection Tripped Unleveled IQ Mod Overdrive
124. e RR 229 vi 1 Getting Started This chapter provides the following major sections Introduction to Remote Operation on page 2 e Using GPIB on page 7 e Using LAN on page 16 Using RS 232 on page 28 Getting Started Introduction to Remote Operation Introduction to Remote Operation ESG signal generators support the following interfaces e General Purpose Interface Bus GPIB Local Area Network LAN e ANSI EIA232 RS 232 serial connection Each of these interfaces in combination with an I O library and programming language can be used to remotely control your signal generator Figure 1 1 uses the GPIB as an example of the relationships between the interface I O libraries programming language and signal generator Figure 1 1 Software Hardware Layers Programming Language C C Visual BASIC LabView etc National Instruments National Instruments Agilent SICL NI 488 2 Library Agilent GPIB NI PCI GPIB Interface Card Interface Card ce910a 2 Chapter 1 Getting Started Introduction to Remote Operation Interfaces GPIB GPIB is used extensively when a dedicated computer is available for remote control of each instrument or system Data transfer is fast because the GPIB handles information in 8 bit bytes GPIB is physically restricted by the location and distance between the instrument system and the computer cables are limited to an average length of two meters per device with
125. e or user file specified for it The amount of user file data that can be mapped into hardware memory depends on both the amount of PRAM available on the baseband generator and the number and size of each frame The amount of PRAM required for a framed transmission is calculated as follows PRAM storage required measured in 32 bit words size of normal GSM timeslot x timeslots per frame x speech multiframe TCH x superframe size of normal GSM timeslot 156 25 bits timeslots per frame 8 timeslots speech multiframe TCH 26 frames superframe 51 speech multiframes For example to calculate the number of bytes to generate a superframe for GSM 156 25 x 8 x 26x 51 1 657 5000 32 bit words 6 630 000 bytes Multiple User Files Selected as Data Sources for Different Timeslots If two or more user files are selected for a framed transmission the amount of PRAM reguired is determined by the user file that generates the largest number of frames In order to generate continuously repeating data patterns each user file must be long enough to completely fill an integer number of timeslots In addition all user files must meet the multiple of 8 bits and enough PRAM memory reguirements to be correctly modulated For example user file 1 contains 114 bits and fills the data fields of a normal GSM timeslot and user file 2 contains 148 bits for a custom GSM timeslot In order to correctly transmit these data patterns as continuou
126. e914a Chapter 2 81 Programming Examples LAN Programming Examples Setting Parameters and Sending Oueries Using Sockets and C The following programming examples are available on the ESG Documentation CD ROM as lanio c and getopt c RK RK kok k k oko oko o oko oko kok kok kok oko kok kok kok k k kok k k A k kok k k kok A k k kok k k kok k kok k k k k k k k Header lanio c 04 24 01 Revision 1 1 Date 10 24 01 PROGRAM NAME lanio c Description Functions to talk to an Agilent signal generator via TCP IP Uses command line arguments A TCP IP connection to port 5025 is established and the resultant file descriptor is used to talk to the instrument using regular socket I O mechanisms Examples Query the signal generator frequency d lanio xx xxx xx x FREQ Query the signal generator power level d lanio xx xxx xx x POW Check for errors gets one error lanio xx xxx xx x syst err Send a list of commands from a file and number them m cat scpi cmds lanio n XX XXX XX X 82 Chapter 2 Programming Examples LAN Programming Examples ck ck kk kk AAA A A A A A A A X A X A ck A AX AX X AX X A ck A AX ck AZ ck ck ck AX ck AX X ck ck ck AX ck AX X A KKK KKK ck ck A X A X AX X AX AX AZ AZ AZ ck ck ck kk ck ko This program compiles and runs under s HP UX 10 20 UNIX using HP cc or gcc cc Aa 0 o lanio lanio c gcc Wall O o lani
127. ed condition The signal generator is then set up for an unleveled condition and the data questionable status register read The results are then displayed to the user The status questionable register is then setup to monitor a modulation error condition The signal generator is set up for a modulation error condition and the data questionable status register is read The results are displayed to the active window J BR KK KR KK IK KK I KK IK I kok oko k kok k kok kok kok k k k k k k k k k k IR k k k k k k k k oko k k k kok k k k kk k kk k kk k k kk k k k k k include lt visa h gt include StdAfx h include lt iostream gt include lt conio h gt void main ViSession defaultRM vi Declares a variables of type ViSession for instrument communication ViStatus viStatus 0 Declares a variable of type ViStatus for GPIB verifications Chapter 2 65 Programming Examples GPIB Programming Examples int num 0 Declares a variable for switch statements char rdBuffer 256 0 Declare a variable for response data viStatus viOpenDefaultRM amp defaultRM Initialize VISA session Open session to GPIB device at address 19 viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus If problems then prompt user printf Could not open ViSession Nn printf Check instruments and connections n printf nyy exit 0 printf An
128. ed eS ebd ooo d beoha edd deed d dew 201 Data Koquiuemenis ge eau c tbt RRRRRIE I CER Enisch ie dre ARR RC ddd kk dde dock d dac ba 201 Contents Dua EARS zkouska eode b dile RR ADR HEC EUR RU RRA REEL EE 201 Downloading FIR Filter Coethctent Data oi s05206e orte RRRERRRRRERRERUERRAR E A AREA 201 Selecting a Downloaded User FIR Filter as the Active Filter lt 202 Downloads Directly into Pattern RAM PRAM 0 0 2 cece cee eh 205 BA AB E bee PI O P PO O O R IF RIDERA Ub d ORE ER bu 205 Dus VA ead otro p eee bas k ak ada kb ekk kika 205 Downloading im List Formmail ose bes rentar EEEE EEREN EFIE E ERS BA B 206 Dosatoamng m BOE POHBE od keidbosdc d dee ERE UR RPEAY ERRORS Book baba 208 Modulating and Activating the L AI cosacev haod E er Rec edk VC ide dobu 210 Aaeuwing the PRAM WAVelotti oc icc acne ebay UC RE RICE ERE HERI RE dd REP d RR i d RUE 210 Saving and Recalling Instrument State Piles 05 cc0ns suse e hr nm Res 211 Save and Recall Programming Example t 6 c05027ee0 2 eeden Saved edcae Gavia vaches de 212 Data Transter Doosbles oen 444664044 p o Rd lod oie eie kab b ko ol edd deoa 224 Direct PRAM Downlosd PIGDIGINS saeua prex X ec pb RO EGRE e eb ave bed 224 User File Download Probleme zs oz 6444r4 50604 e RP ERR RR be RR ER eR OER ERED 226 User FIR Filter Coefficient File Download Problems lt 228 ARB Wavetorm Data Download Problems xs cic eds exer REP EE RR a gee RR Rob
129. efaultRM visaOpenString VisaAccessMode NoLock DEFAULT TIMEOUT out device 0 if no errors proceed bool quit false while quit Get user input Console Write 1 Backup state files n 2 Restore state files n 3 Quit nEnter 1 2 or 3 Your choice string choice Console ReadLine switch choice case 1 BackupInstrumentState device Write instrument state break files to the computer case 2 RestoreInstrumentState device Read instrument state break files to the ESG case 3 quit true break default Chapter 4 215 Downloading and Using Files Saving and Recalling Instrument State Files break VisaInterop Close device Close the device else Console WriteLine Unable to open visaOpenString VisaInterop Close defaultRM Close the default resource manager else Console WriteLine Unable to open the VISA resource manager This method restores all the sequence register state files located in the local directory identified by a STA file name extension to the signal generator static public void RestoreInstrumentState uint device DirectoryInfo di new DirectoryInfo Instantiate object class FileInfo rgFiles di GetFiles STA Get the state files foreach FileInfo fi in rgFiles Match m Regex Match fi Name d _ d d if m Success string seq
130. emory VO waveform data is stored in the signal generator s user bbg1 waveform directory The associated marker and header data files if provided are stored in the user bbgl markers and user bbg1 header directories This is volatile memory and the contents will be lost when the signal generator is turned off e Non volatile memory NVWFM memory If the Option 005 is installed then I Q data is stored in the signal generator s user waveform directory The associated marker data file if provided is stored in the user markers directory and the header data file is stored in the user header directory This is non volatile memory and the contents will not be lost when the signal generator is turned off Data Requirements VO waveform data downloads have the following requirements Data must be in signed 2 s complement format e Data must be in 2 byte integers Two bytes are needed to express 16 bit waveforms The signal generator accepts the most significant byte MSB first e Input data must be between 32768 and 32767 This range is based on the input specifications of the 16 bit DAC used to create the analog voltages for the I Q modulator e Each I Q waveform must contain at least 60 samples to play in the waveform sequencer one sample equals one pair of I Q values and markers An error message File format invalid is displayed if this requirement is not met The file format is discussed in greater detail in the
131. equency mode is A PRINT OUTPUT Sig gen OUTP OFF Turns signal generator RF state off OUTPUT Sig gen OUTP Querys the operating state of the signal generator ENTER Sig gen B Enter in the state 0 for off Print the on off state of the signal generator to the controller display Chapter 2 47 Programming Examples GPIB Programming Examples 380 IF B gt 0 THEN 390 PRINT Signal Generator output is on 400 ELSE 410 PRINT Signal Generator output is off 420 END IF 430 OUTPUT Sig gen IDN Querys for signal generator ID 440 ENTER Sig gen C Enter in the signal generator ID 450 Print the signal generator ID to the controller display 460 PRINT 470 PRINT This signal generator is a C 480 PRINT 490 The next command is a query for the signal generator s GPIB address 500 OUTPUT Sig gen SYST COMM GPIB ADDR 510 ENTER Sig gen D Enter in the signal generator s address 520 Print the signal generator s GPIB address to the controllers display 530 PRINT The GPIB address is D 540 PRINT 550 Print user prompts to the controller s display 560 PRINT The signal generator is now under local control 570 PRINT or Press RUN to start again 580 END Queries Using NI 488 2 and C This example uses the NI 488 2 library to query different instrument states and conditions Launch Microsoft Visual C 6 0 add the required files and enter the following code into your cpp source file The foll
132. er function 14 errors 19 32 ESE commands 127 event enable register description 132 event registers description 132 examples save and recall 212 Telnet 26 extracting waveforms 186 187 F file encryption 186 file headers 186 file transfer 26 files 37 error messages 32 filters See also transition filters negative transition description 132 positive transition description 132 firmware status monitoring 124 FTP 26 G Getting Started Wizard 10 GPIB 3 address 9 cables 9 card installation 7 configuration 9 controller 10 interface 7 IO libraries 9 listener 10 on UNIX 8 overview 7 program examples 39 SCPI commands 10 talker 10 verifying operation 10 232 Index H hardware status monitoring 124 headers 186 hostname 16 HyperTerminal 30 iabort 11 ibloc 13 ibstop 11 ibwrt 14 iclear 14 IEEE standard 7 igpibllo 12 instrument communication 4 instrument state files 211 instrument status monitoring 120 interactive io 3 interface 3 interface cards 7 IO Config 5 10 config 3 4 IO interface 4 IO libraries 2 3 7 9 10 28 IP address 16 iremote 12 J Java example 109 L LabView 6 LAN 3 DHCP configuration 17 hostname 16 interface 3 IO libraries 16 manual configuration 17 overview 16 program examples 74 sockets 74 sockets LAN 16 Telnet 22 Index LAN 3 continued verifying operation 18 VXI 11 16
133. ermType then click Connect Host Name IP address or hostname Port 5023 Term Type vt100 At the SCPI prompt enter SCPI commands Refer to Figure 1 4 on page 24 To signal device clear press Ct r1 C on your keyboard Select Exit from the Connect menu and type exit at the command prompt to end the Telnet session Using Telnet On a PC With a Host Port Setting Menu GUI Iu dy de On your PC click Start gt Run Type telnet then click the OK button The Telnet connection screen will be displayed Click on the Connect menu then select Remote System A connection form is displayed See Figure 1 3 Enter the hostname port number and TermType then click Connect Host Name signal generator s IP address or hostname e Port 5023 Term Type vt100 At the SCPI prompt enter SCPI commands Refer to Figure 1 4 on page 24 To signal device clear press Ct r1 C Select Exit from the Connect menu to end the Telnet session Chapter 1 23 Getting Started Using LAN Figure 1 4 Telnet Window J Telnet tpvipt Connect Edt lemma Hep Agilent Technologies E8254 SN USOOOBOUDh 218 1p1 IP 888 000 00 008 SCPI gt IDN Agilent Technologies E8254A USO0009005 C 01 00 ST 1 00000000E AM SCPI gt B Using Telnet On Windows 2000 1 On your PC click Start gt Run BBE 2 Type telnet in the run text box then click the OK button The Telnet connection screen will be displayed See Figure 1 5 on pa
134. erview NOTE Some of the status bits and register groups do not appy to the E4428C Standard Operation Condition Register bits see Table 3 5 on page 136 e Baseband Operation Status Group Data Questionable Condition Register bits see Table 3 7 on page 142 e Data Questionable Power Condition Register bit see Table 3 8 on page 146 Data Questionable Frequency Condition Register bit see Table 3 9 on page 149 e Data Questionable Calibration Condition Register bit see Table 3 11 on page 155 e Data Questionable Bert Status Group During remote operation you may need to monitor the status of the signal generator for error conditions or status changes For more information on using the ESG s SCPI commands to query the signal generator s error queue refer to the ESG SCPI command reference guide to see if any errors have occurred An alternative method uses the signal generator s status register system to monitor error conditions or condition changes or both The signal generator s status register system provides two major advantages e You can monitor the settling of the signal generator using the settling bit of the Standard Operation Status Group s condition register e You can use the service request SRO interrupt technique to avoid status polling therefore giving a speed advantage The signal generator s instrument status system provides complete SCPI Standard data structures for reporting instrument status usin
135. es Chapter 4 229 Downloading and Using Files Data Transfer Troubleshooting 230 Chapter 4 Symbols NET framework 211 A abort function 11 add device 5 address GPIB address 9 IP address 16 Agilent BASIC 40 SICL 39 VISA 39 Agilent BASIC 6 Agilent IO Libraries 3 4 Agilent IO Libraries Suite 3 Agilent VISA 9 16 28 Agilent VISA COM Resource Manager 1 0 37 38 ARB memory vs NVARB memory 163 ARB waveform file downloads 165 180 186 188 example programs 168 182 playing a downloaded waveform 179 SCPI commands 167 181 ARB waveform files composition 186 encryption 186 extracting 187 headers 186 use in other ESGs 187 arbitrary block data 165 ascii 14 BASIC ABORT 11 CLEAR 13 ENTER 14 LOCAL 13 LOCAL LOCKOUT 12 OUTPUT 14 REMOTE 11 binary memory and bit memory 190 binary memory catalog user file downloads 197 binary memory vs bit memory 190 Index bit memory and binary memory 190 bit memory catalog user file downloads 196 bit status how and what to monitor 124 bit values 123 bit value and output power ARB waveforms 163 block data arbitrary 165 C C 211 212 C C 6 include files 37 clear command 13 clear function 13 CLS command 127 command prompt 18 109 commands 11 12 13 14 computer interface 3 condition registers description 132 connection expert 3 connection wizard 3 controller 10 csc exe 211 D data block inf
136. es that modulation is uncalibrated 5 14 Unused This bit is always set to 0 15 Always 0 Query STATus QUEStionable MODulation CONDition Response The decimal sum of the bits set to 1 Data Questionable M odulation Transition Filters negative and positive The Data Questionable Modulation Transition Filters specify which type of bit state changes in the condition register set corresponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 152 Commands STA or STATus QUI transition whe Queries STATus QUES STATus QUES re lt value gt is the sum of the tionable MODulation N tionable MODulation P1 us QUEStionable MODulation NTRansition value negative transition EStionable MODulation PTRansition lt value gt positive decimal values of the bits you want to enable Ransition Ransition Chapter 3 Programming the Status Register System Status Groups Data Questionable Modulation Event Register The Data Questionable Modulation Event Register latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register Query STATus QUEStionable MODulation EVENt Data Questionable Modulation Event Enable Register The Data Questionable Modulation Event Enable Register lets you choose wh
137. es to the ESG To download an encrypted file to the ESG you must ensure that the file is loaded into the ESG s SECUREWAVE directory where the file is decrypted and unpackaged into its header information waveform data and marker data You can use either FTP or SCPI commands to download encrypted waveform files to the ESG Table 4 4 shows the command syntax options for both methods Table 4 4 Download Method Command Syntax Options Memory Type SCPI MMEM DATA user bbg1 securewave filename lt blockdata gt volatile memory MMEM DATA SWFM1 filename lt blockdata gt MMEM DATA filename SWFM1 SCPI non volatile memory MMEM DATA user securewave filename lt blockdata gt MMEM DATA SNVWFM filename lt blockdata gt MMEM DATA filename SNV WFM FTP volatile memory put filename user bbg 1 securewave newfilename FTP non volatile memory put filename user securewave newfilename 188 Chapter 4 Downloading and Using Files User Bit Binary File Data Dow nloads User Bit Binary File Data Downloads NOTE This feature is available only in E4438C ESG Vector Signal Generators with Option 001 601 or 002 602 The signal generator accepts user file data downloads The files can be in either binary or bit format each consisting of 8 bit bytes Both file types are stored in the signal generator s non volatile memory e In binary format the data is in multiples of 8 bits all 8 bits of a
138. esponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 Commands STATus OPERation BASeband NTRansition value negative transition or STATus OPERation BASeband PTRansition value positive transition where value is the sum of the decimal values of the bits you want to enable Queries STATus OPERation BASeband NTRansition STATus OPERation BASeband PTRansition Chapter 3 139 Programming the Status Register System Status Groups Baseband Operation Event Register The Baseband Operation Event Register latches transition events from the condition register as specified by the transition filters Event registers are destructive read only Reading data from an event register clears the content of that register Ouery STATus OPERation BASeband EVENt Baseband Operation Event Enable Register The Baseband Operation Event Enable Register lets you choose which bits in the Baseband Operation Event Register can set the summary bit bit 7 of the Status Byte Register Command STATus OPERation BASeband ENABle lt value gt where value is the sum of the decimal values of the bits you want to enable Example To enable bit 0 and bit 1 so that whenever either of those bits is set to 1 the Baseband Operation Status summary bit of the Status Byte Register is set to 1 Send the command STAT OPER ENAB 520 512 8 Query STATu
139. esponse to OPC n iclose id exit 1 iprintf id FREQ n Query the frequency iscanf id t amp buf Read the signal generator frequency printf n Print the frequency to the display printf Frequency of signal generator is s n buf ipromptf id IDN Xn St buf i Query for id string printf Instrument ID s n buf Print id string to display iclose id Close the session return 0 76 Chapter 2 Programming Examples LAN Programming Examples VXI 11 Programming Using VISA and C The following program uses the VXI 11 protocol and the VISA library to control the signal generator The signal generator is set to a 1 GHz CW frequency and queried for its ID string Before running this code you must set up the interface using the Agilent IO Libraries IO Config utility The following program example is available on the ESG Documentation CD ROM as vxivisa cpp J RR RRR KR KK KKK IKK IKK I KK IK IKK I KK IKK IKK IRR IA A RR IRR IA IIR oko k I oko kok oko I ke ke 4 PROGRAM FILE NAME vxivisa cpp Sample test program using the VISA libraries and the VXI 11 protocol NOTE You must have the Agilent Libraries installed on your computer to run this program PROGRAM DESCRIPTION This example uses the VXI 11 protocol and VISA to query the signal generator for its ID string The ID string is then printed to the screen Next the signal generator
140. et command NOTE If your Telnet connection is in line by line mode there is no local echo This means you cannot see the characters you are typing until you press the Enter key To remedy this change your Telnet connection to character by character mode Escape out of Telnet and at the telnet gt prompt type mode char If this does not work consult your Telnet program s documentation Chapter 1 25 Getting Started Using LAN Unix Telnet Example To connect to the instrument with host name my Instrument and port number 7778 enter the following command on the command line telnet myInstrument 5023 When you connect to the signal generator the UNIX window will display a welcome message and a SCPI command prompt The instrument is now ready to accept your SCPI commands As you type SCPI commands guery results appear on the next line When you are done break the Telnet connection using an escape character For example Ct r1 where the control key and the are pressed at the same time The following example shows Telnet commands telnet myinstrument 5023 Trying s Connected to signal generator Escape character is Agilent Technologies E8254A SN US00000001 Firmware Hostname your instrument IP XXX XX XXX XXX SCPI Using FTP FTP allows users to transfer files between the signal generator and any computer connected to the LAN For example you can use FTP to download instrument screen images to a computer W
141. eters send the appropriate SCPI command 208 Chapter 4 Downloading and Using Files Downloads Directly into Pattern RAM PRAM SCPI Command to Download Data in Block Format MEMory DATA PRAM BLOCk lt datablock gt This command downloads the block formatted data directly into pattern RAM Sample Command Line A sample command line MEMory DATA PRAM BLOCk ABC A the number of decimal digits to follow in B B a decimal number specifying the number of data bytes in C C the binary user file data Example 1 MEMory DATA PRAM BLOCk 419128407897 1 defines the number of decimal digits to follow in B 9 denotes how many bytes of data are to follow 128407897 is the ASCII representation of the data downloaded to the signal generator This variable is represented by C in the sample command line NOTE Not all binary values can be printed as ASCII characters In fact only ASCII characters corresponding to decimal values 32 to 126 are printable keyboard characters The above example was chosen for simplicity Typically the binary value corresponding to your 8 bit pattern is not printable Therefore the program written to download and upload user files must correctly convert between binary and the visible representation of the data sequence Chapter 4 209 Downloading and Using Files Downloads Directly into Pattern RAM PRAM M odulating and Activating the Carrier The following section explains h
142. faultRM amp defaultRM open 58 Declares variables of type ViSession for instrument communication Declares a variable of type ViStatus for GPIB verifications Initialize VISA session session to gpib device at address 19 Chapter 2 Programming Examples GPIB Programming Examples viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus If problems then prompt user printf Could not open ViSession Nn printf Check instruments and connections Mn printf nt exit 0 printf Example program to set up the signal generator n printf for an AC coupled FM signal n printfi Xn s printf Press any key to continue n getch viClear vi Clears the signal generator viPrintf vi RSTXn Resets the signal generator viPrintf vi FM2 INT FREQ 5 kHz Mn Sets EXT 2 source for FM viPrintf vi FM2 DEV 100 kHz Wn Sets FM path 2 coupling to AC viPrintf vi FREQ 900 MHz n Sets carrier frequency to 700 MHz viPrintf vi POW 15 dBm n Sets the power level to 2 3 dBm viPrintf vi FM2 STAT ON n Turns on frequency modulation viPrintf vi OUTP STAT ON n Turns on RF output printf t my Prints a carriage return Print user information printf Power level 15 dBm n printf FM state onn printf RF output on n printf Carrier Frequency 900 MHZ n printf Deviation 100 kHZ n printf Internal modulatio
143. g d_ d d while m Success Grab the matched filename from the regular expresssion string nextFile m Groups 1 ToString Retrieve the file and store with a STA extension in the current directory Console WriteLine Retrieving state file nextFile WriteDevice device MEM DATA USER STATE nextFile n true ReadFileBlock device nextFile STA Clear newline ReadDevice device Advance to next match in catalog string m m NextMatch This method writes an ASCII text string SCPI command to the signal generator If the bool sendEnd is true the END line character will be sent at the conclusion of the write If sendEnd is false the END line will not be sent static public void WriteDevice uint device string scpiCmd bool sendEnd byte buf Encoding ASCII GetBytes scpiCmd if sendEnd Do not send the END line character VisaInterop SetAttribute device VisaAttribute SendEndEnable 0 uint retCount VisaInterop Write device buf uint buf Length out retCount if sendEnd Set the bool sendEnd true 218 Chapter 4 Downloading and Using Files Saving and Recalling Instrument State Files VisaInterop SetAttribute device VisaAttribute SendEndEnable 1 This method reads an ASCII string from the specified device static public string ReadDevice uint device string retValue byte buf new byte MAX_READ_DEVICE_STRING
144. g the register model The SCPI register model of the status system has multiple registers that are arranged in a hierarchical order The lower priority status registers propagate their data to the higher priority registers using summary bits The Status Byte Register is at the top of the hierarchy and contains the status information for lower level registers The lower level registers monitor specific events or conditions The lower level status registers are grouped according to their functionality For example the Data Quest Frequency Status Group consists of five registers This chapter may refer to a group as a register so that the cumbersome correct description is avoided For example the Standard Operation Status Group s Condition Register can be referred to as the Standard Operation Status register Refer to Status Groups on page 132 for more information Figure 3 1 and Figure 3 2 show the signal generator s status byte register system and hierarchy The status register system uses IEEE 488 2 commands those beginning with to access the higher level summary registers Lower level registers can be accessed using STATus commands 120 Chapter 3 Programming the Status Register System Figure 3 1 The Overall Status Byte Register System 1 of 2 Data Questionable Power Status Group R PP Tripped Unleveled 18 Mod Overdrive Lowband Detector Fault Unused o s s Unused F fo Unused alal Unused
145. ge 25 3 Type open at the prompt and then press the Enter key The prompt will change to to 4 At the to prompt enter the signal generator s IP address followed by a space and 5023 which is the Telnet port associated with the signal generator 5 Atthe SCPI gt prompt enter SCPI commands Refer to commands shown in Figure 1 4 on page 24 6 To escape from the SCPI gt session type Ct r1 7 Type quit at the prompt to end the Telnet session 24 Chapter 1 Getting Started Using LAN Figure 1 5 Telnet 2000 Window Microsoft XR Windows 2888 TM Version 5 88 Build 21955 Melcome to Microsoft Telnet Client Telnet Client Build 5 800 99206 1 Escape Character is CTRL 1 Microsoft Telnet The Standard UNIX Telnet Command Synopsis telnet host port Description This command is used to communicate with another host using the Telnet protocol When the command telnet is invoked with host or port arguments a connection is opened to the host and input is sent from the user to the host Options and Parameters The command telnet operates in character at a time or line by line mode In line by line mode typed text is echoed to the screen When the line is completed by pressing the Enter key the text line is sent to host In character at a time mode text is echoed to the screen and sent to host as it is typed At the UNIX prompt type man telnet to view the options and parameters available with the teln
146. ged only when the controller asks the right question This is accomplished by a program loop that continually sends a query The polling method works well if you do not need to know about changes the moment they occur Use polling in the following situations when you use a programming language development environment or I O interface that does not support SRQ interrupts when you want to write a simple single purpose program and don t want the added complexity of setting up an SRQ handler The service request SRQ method In the SRQ method described in the following section the signal generator takes a more active role It tells the controller when there has been a condition change without the controller asking Use the SRQ method if you must know immediately when a condition changes To detect a change using the polling method the program must repeatedly read the registers Use the SRQ method in the following situations when you need time critical notification of changes when you are monitoring more than one device that supports SRQs when you need to have the controller do something else while waiting when you can t afford the performance penalty inherent to polling Using the Service Request SRQ M ethod The programming language I O interface and programming environment must support SRQ interrupts for example BASIC or VISA used with GPIB and VXI 11 over the LAN Using this method you must do the
147. gister 137 140 standard operation status group 135 138 standard operation transition filters 137 139 state files 211 status byte overall register system 121 122 status byte group 129 status byte register 130 status groups data questionable 141 data questionable BERT 157 data questionable calibration 154 data questionable frequency 148 data questionable modulation 151 data questionable power 145 registers 132 standard event 133 standard operation 135 138 status byte 129 status registers See also registers accessing information 124 bit values 123 hierarchy 120 how and what to monitor 124 in status groups 132 overall system 121 122 sockets programming 119 example 79 82 SCPI commands 127 Java 109 SCPI model 120 Index 235 Index status registers continued setting and guerying 127 standard event 134 standard event status enable 134 system overview 120 using 123 STB command 127 system reguirements 36 T talker 10 TCP IP 21 TCPIP 4 Telnet DOS command prompt 22 example 26 PC 23 UNIX 25 26 using 22 Windows 2000 24 transition filters See also filters data questionable 143 data questionable BERT 159 data questionable calibration 155 data questionable frequency 149 data questionable modulation 152 data questionable power 146 description 132 standard operation 137 139 troubleshooting ARB waveform downloads 229 ping response errors
148. has restarted or to create a data synchronous pulse train by toggling this bit in alternate addresses 7 Pattern Reset 0 1 Set to 0 continue to next sequential memory address Set to 1 end of memory and restart memory playback This bit is set to O for all bytes except the last address of PRAM For the last address byte of PRAM it is set to 1 to restart the pattern Chapter 4 225 Downloading and Using Files Data Transfer Troubleshooting User File Download Problems Table 4 6 User FIR File Download Trouble Symptoms and Causes Symptom Possible Cause Not enough data to fill a single timeslot If a user file does not completely fill a single timeslot the firmware No data modulated will not load any data into the timeslot For example if a timeslot s data field should contain 114 bits and only 100 bits are provided in the user file no data will be loaded into the data field of the timeslot Therefore no data will be detected at the RF output Data does not completely fill an integer number of timeslots If a user file fills the data fields of more than one timeslot in a At RF output continuously repeating framed transmission the user file will be some data modulated restarted after the last timeslot containing completely filled data some data missing fields For example if the user file contains enough data to fill the data fields of 3 5 timeslots firmware will load 3 timeslots with d
149. he SCPI error queue contains at least one error message Data Questionable Status Summary Bit A 1 in this bit position indicates that the Data Questionable summary bit has been set The Data Questionable Event Register can then be read to determine the specific condition that caused this bit to be set Message Available A 1 in this bit position indicates that the signal generator has data ready in the output queue There are no lower status groups that provide input to this bit Standard Event Status Summary Bit A 1 in this bit position indicates that the Standard Event summary bit has been set The Standard Event Status Register can then be read to determine the specific event that caused this bit to be set Request Service RQS Summary Bit A 1 in this bit position indicates that the signal generator has at least one reason to require service This bit is also called the Master Summary Status bit MSS The individual bits in the Status Byte are individually ANDed with their corresponding service request enable register then each individual bit value is ORed and input to this bit Standard Operation Status Summary Bit A 1 in this bit position indicates that the Standard Operation Status Group s summary bit has been set The Standard Operation Event Register can then be read to determine the specific condition that caused this bit to be set 130 Query STB Response The decimal sum of the bits set to 1 includ
150. hen logged onto the signal generator with the FTP command the signal generator s file structure can be accessed Figure 1 6 shows the FTP interface and lists the directories in the signal generator s user level directory NOTE File access is limited to the signal generator s user directory 26 Chapter 1 Getting Started Using LAN Figure 1 6 FTP Screen pen Command Prompt ftp 000 000 00 000 lt C gt Copyrights 1985 1996 Microsoft Corp C gt ftp 000 000 00 000 connected to 000 000 000 000 220 Agilent Technologies E8254A SN US00000004 220 Firmware Mar 28 2001 11 23 18 220 Hostname 000lp1 220 IP 000 000 00 000 220 FTP server lt Version 1 0 gt ready User lt 000 000 00 000 lt none gt gt 331 Password required Password 230 Successful login ftp gt Is 200 Port command successful 150 Opening data connection BACKUP BIN CAL HTML SYS USER 226 Transfer complete 35 bytes received in 0 00 seconds lt 35000 00 Kbytes sec gt ftp gt _ ce917a The following steps outline a sample FTP session from the MS DOS Command Prompt 1 2 On the PC click Start gt Programs gt Command Prompt At the command prompt enter ftp IP address gt or lt hostname gt At the user name prompt press enter At the password prompt press enter You are now in the signal generator s user directory Typing help at the command prompt will show you the FTP commands that are available on your
151. iPrintf button Manual Configuration Perform the following steps to manually configure an interface l 2 pa O O Nn A MH P Run the IO Config Program Click on GPIB in the Available Interface Types text box Click the Configure button Set the Default Protocol to AUTO and then Click OK to use the default settings Click on GPIBO in the Configured Interfaces text box Click Edit Click the Edit VISA Config button Click the Add device button Enter the GPIB address of the signal generator Click the OK button in this form and all other forms to exit the IO Config program Chapter 1 5 Getting Started Introduction to Remote Operation Programming Language The programming language is used along with Standard Commands for Programming Instructions SCPI and I O library functions to remotely control the signal generator Common programming languages include C C Agilent BASIC LabView Java Visual Basic C J ava is a U S trademark of Sun Microsystems Inc Visual Basic is a registered trademark of Microsoft Corporation Chapter 1 Getting Started Using GPIB Using GPIB The GPIB allows instruments to be connected together and controlled by a computer The GPIB and its associated interface operations are defined in the ANSI IEEE Standard 488 1 1987 and ANSI IEEE Standard 488 2 1992 See the IEEE website www ieee org for details on these standards 1 Installing the GPIB Interface Card
152. ich bits in the Data Questionable Modulation Event Register set the summary bit bit 7 of the Data Questionable Condition Register to 1 Command STATus QUEStionable MODulation ENABle value command where value is the sum of the decimal values of the bits you want to enable Example Enable bit 9 and bit 3 so that whenever either of those bits is set to 1 the Data Questionable Modulation summary bit of the Data Questionable Condition Register is set to 1 Send the command STAT QUES MOD ENAB 520 512 8 Query STATus QUEStionable MODulation ENABle Response Decimal value of the sum of the bits previously enabled with the STATus QUEStionable MODulation ENABle value command Chapter 3 153 Programming the Status Register System Status Groups Data Ouestionable Calibration Status Group NOTE A bit in this status group does not apply to the E4428C and will return a zero when gueried See Table 3 11 on page 155 for more information The Data Ouestionable Calibration Status Group is used to determine the specific event that set bit 8 in the Data Ouestionable Condition Register This group consists of the Data Ouestionable Calibration Condition Register the Data Ouestionable Calibration Transition Filters negative and positive the Data Ouestionable Calibration Event Register and the Data Ouestionable Calibration Event Enable Register 154 DCFM DCOM Zero Failure 1 A Calib
153. ig IDN 5 Querys the instrument ID ibrd sig rdVal 100 Reads the source ID rdVal ibentl 0 Null character indicating end of array cout lt lt Source ID is rdVal Prints the source ID cout lt lt Press any key to continue lt lt endl cin ignore 10000 n ibwrt sig SYST COMM GPIB ADDR 20 Querys source address ibrd sig rdVal 100 Reads the source address rdVal ibcntl 0 Null character indicates end of array Prints the signal generator address cout lt lt Source GPIB address is lt lt rdVal cout lt lt endl Chapter 2 Programming Examples GPIB Programming Examples cout Press the Local key to return the signal generator to LOCAL control lt lt endl cout lt lt endl return 0 Queries Using VISA and C This example uses VISA library functions to query different instrument states and conditions Launch Microsoft Visual C 6 0 add the required files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex3 cpp J BR KK KK KK KK IKK IKK I kok oko k RR IRR IR AR IRR IA AIR IRR IR IIR RR IR AIR kok kok k k k k ke ke PROGRAM FILE NAME visaex3 cpp ff PROGRAM DESCRIPTION This example demonstrates the use of query commands The signal generator can be queried for conditions and instrument states These commands are of the type IDN the question mar
154. ignal generator display lt lt endl cout lt lt Press Enter to continue lt lt endl cin ignore 10000 n SendIFC GPIBO Resets the GPIB interface Address 0 19 Signal generator s address Address 1 NOADDR Signifies end element in array Defined in DECL 32 H SetRWLS GPIBO Address Places device in Remote with Lockout State cout The signal generator should now be in LOCAL LOCKOUT Verify that all keys lt lt endl cout lt lt including the Local key are disabled Contrast keys are not affected lt lt endl cout lt lt Press Enter to continue lt lt endl cin ignore 10000 n ibloc sig Returns signal generator to local control cout lt lt endl cout lt lt The signal generator should now be in local mode n return 0 Queries Using Agilent BASIC This example demonstrates signal generator query commands The signal generator can be queried for conditions and setup parameters Query commands are identified by the question mark as in the identify command IDN The following program example is available on the ESG Documentation CD ROM as basicex3 txt 10 VOKCKCK KK KK Ck kk K A A Z A KA KK A KA KA KK KK KK KK KK KK KK KKK KK RK kck k ck ck kck kck ck KK ckck ok 20 30 PROGRAM NAME basicex3 txt 40 50 PROGRAM DESCRIPTION In this example query commands are used with response 46 Chapter 2 60 70 80 90 00 10 20 30 40 50 60
155. ill select the desired user file from the catalog of user files as a continuous stream of framed data for the active TDMA format Via the front panel 1 Press Mode gt Real Time TDMA gt desired format gt Data Format Pattern Framed gt Configure Timeslots gt Configure current active timeslot gt Data gt User File 2 Highlight the desired file in the catalog of user files 3 Press Select File 4 To activate the TDMA format press Mode gt Real Time TDMA gt desired format gt toggle the format on Via the remote interface The following SCPI commands select and activate the user file as framed data for an NADC uplink traffic channel in timeslot 1 The same command syntax is used for other data transmission formats SOURce RADio NADC SLOT1 UTCHannel DATA BIT lt file_name gt SOURce RADio NADC STATe On Chapter 4 199 Downloading and Using Files User Bit Binary File Data Dow nloads M odulating and Activating the Carrier The following settings can be performed from the front panel or by using remote commands to modulate the carrier and turn on the RF output Via the front panel 1 Set the carrier freguency to 2 5 GHz 2 Set the carrier amplitude to 10 0 dBm 3 Modulate the carrier 4 Activate the RF output Via the remote interface SOURce FREOuency FIXed 2 5GHZ SOURce POWer LEVel IMMediate AMPLitude 10 0DBM OUTPut MODulation STATe ON OUTPut
156. in binary format SCPI specifies the data in 8 bit bytes NOTE Not all binary values are ASCII characters that can be printed In fact only ASCII characters corresponding to decimal values 32 through 126 are printable keyboard characters Typically the ASCII character corresponding to an 8 bit pattern is not printable Because of this the program written to download and upload user files must correctly convert the binary data into 8 bit ASCII characters 2 Bit length must be a multiple of the data field length of the active format Also the bit length of a user file must be a multiple of the data field length of the active format in order to completely fill the frame s data field without leaving a remainder Remaining data is truncated by the signal generator s firmware and is therefore not present in the resulting waveform at the RF output 3 Bit length must be a multiple of 8 binary downloads only SCPI specifies data in 8 bit bytes and the binary memory stores data in 8 bit bytes If the length in bits of the original data pattern is not a multiple of 8 you may need to e add additional bits to complete the ASCII character replicate the data pattern without discontinuity until the total length is a multiple of 8 bits e truncate and discard bits until you reach a string length that is a multiple of 8 or e use a bit file and download to bit memory instead 190 Chapter 4 Downloading and Using Files User Bit Bina
157. in other ESGs having the same option You can also extract encrypted files created with applications such as MATLAB providing the data was downloaded to the ESG using the method described in the section below Files cannot be extracted from the ESG in unencrypted form Furthermore files created with prior ESG firmware revisions cannot be extracted in any form Downloading waveform data to the ESG for extraction as an encrypted waveform file If you are using waveform data created in MATLAB or another similar application and are using SCPI to download the data to the ESG you must use the MMEM DATA UNPRotected command Downloading data with this command allows it to be extracted from the ESG s SECUREWAVE directory as an encrypted file refer to Extracting waveform files from the ESG for use in other ESGs on page 187 If you use FTP no special command syntax is necessary Table 4 2 shows the command syntax options for both methods Table 4 2 Download M ethod Command Syntax Options Memory Type SCPI MMEM DATA UNPRotected user bbg1 waveform filename lt blockdata gt volatile memory MMEM DATA UNPRotected WFMI filename blockdata MMEM DATA UNPRotected filename WFMI M ATLAB is a U S registered trademark of The Math Works Inc 186 Chapter 4 Downloading and Using Files Understanding ARB Waveform File Composition and Encryption Table 4 2 Download Method Command Syntax Options Memory
158. ine SOCKET_ERROR 1 define INVALID_SOCKET typedef int SOCKET endif WINSOCK ifdef WINSOCK Declared in getopt c 84 x y P 1 for fprintf and NULL for memcpy and memset for malloc atol for strerror BSD style socket functions UNIX with BSD sockets for connect and socket for sockaddr in for gethostbyname ha See example programs disk Chapter 2 Programming Examples LAN Programming Examples extern char optarg extern int optind extern int getopt int argc char const argv const char optstring else include lt unistd h gt for getopt 3c endif define COMMAND_ERROR 1 define NO CMD ERROR 0 define SCPI PORT 5025 define INPUT BUF SIZE 64 1024 P e RK o kok k oko o oko ko oko kok k oko k oko kok k kok k k oko k kok k kok k k kok k k oko k k k kok kok k kok k k k k k Display usage kok kok k k kok k kok o kok k oko kok k oko k oko oko k kok k k oko kok k kk k kk k kk IR kk ke ke ke static void usage char basename fprintf stderr Usage s nqu hostname lt command gt n basename fprintf stderr s nqu hostname lt stdin n basename n number output lines n fprintf stderr fprintf stderr q quiet do NOT echo lines n fprintf stderr e show messages in error queue when done n ifdef WINSOCK int init winsock void Chapter 2 85 Pr
159. ing and allows applications to communicate using standard mechanisms built into network hardware and operating systems The method accesses a port on the signal generator from which bidirectional communication with a network computer can be established Sockets LAN can be described as an internet address that combines Internet Protocol IP with a device port number and represents a single connection between two pieces of software The socket can be accessed using code libraries packaged with the computer operating system Two common versions of socket libraries are the Berkeley Sockets Library for UNIX systems and Winsock for Microsoft operating systems Your signal generator implements a sockets Applications Programming Interface API that is compatible with Berkeley sockets for UNIX systems and Winsock for Microsoft systems The signal generator is also compatible with other standard sockets APIs The signal generator can be controlled using SCPI commands that are output to a socket connection established in your program Chapter 1 21 Getting Started Using LAN Before you can use sockets LAN you must select the signal generator s sockets port number to use Standard mode Available on port 5025 Use this port for simple programming e TELNET mode The telnet SCPI service is available on port 5023 NOTE The signal generator will accept references to telnet SCPI service at port 7777 and sockets SCPI service at port 7778 An example usi
160. ing the master summary status bit MSS bit 6 Example The decimal value 136 is returned when the MSS bit is set low 0 Decimal sum 128 bit 7 8 bit 3 The decimal value 200 is returned when the MSS bit is set high 1 Decimal sum 128 bit 7 8 bit 3 64 MSS bit Chapter 3 Programming the Status Register System Status Byte Group Service Reguest Enable Register The Service Reguest Enable Register lets you choose which bits in the Status Byte Register trigger a service reguest SRE lt data gt lt data gt is the sum of the decimal values of the bits you want to enable except bit 6 Bit 6 cannot be enabled on this register Refer to Figure 3 1 on page 121 or Figure 3 2 on page 122 Example To enable bits 7 and 5 to trigger a service reguest when either corresponding status group register summary bit sets to 1 Send the command SRE 160 128 32 Ouery SRE Response The decimal value of the sum of the bits previously enabled with the SRE lt data gt command Chapter 3 131 Programming the Status Register System Status Groups Status Groups The Standard Operation Status Group and the Data Ouestionable Status Group consist of the registers listed below The Standard Event Status Group is similar but does not have negative or positive transition filters or a condition register Condition Register Negative Transition Filter Positive Transition Filter Event Register Event E
161. ions include a data element that violates device listening formats or whose type is unacceptable to the device or anunrecognized header was received These include incorrect device specific headers and incorrect or unimplemented IEEE 488 2 common commands Chapter 1 33 Getting Started Error Messages 34 Chapter 1 2 Programming Examples This chapter provides the following major sections Using the Programming Examples on page 36 e GPIB Programming Examples on page 39 LAN Programming Examples on page 74 e RS 232 Programming Examples on page 112 35 Programming Examples Using the Programming Examples Using the Programming Examples The programming examples for remote control of the signal generator use the GPIB LAN and RS 232 interfaces and demonstrate instrument control using different I O libraries and programming languages Many of the example programs in this chapter are interactive the user will be prompted to perform certain actions or verify signal generator operation or functionality Example programs are written in the following languages e Agilent BASIC e C C Java PERL e Microsoft Visual Basic 6 0 CH See Chapter 1 of this programming guide for information on interfaces I O libraries and programming languages The example programs are also available on the ESG Documentation CD ROM allowing you to cut and paste the examples into a text editor NOTE The example programs
162. is part of the Standard Event Status Group ESR event status register queries and clears the Standard Event Status Register which is part of the Standard Event Status Group OPC OPC operation complete sets bit 0 in the Standard Event Status Register to 1 when all commands have completed The query stops any new commands from being processed until the current processing is complete then returns a 1 PSC PSC power on state clear sets the power on state so that it clears the Service Request Enable Register the Standard Event Status Enable Register and device specific event enable registers at power on The query returns the flag setting from the PSC command SRE SRE service request enable sets and queries the value of the Service Request Enable Register STB status byte queries the value of the status byte register without erasing its contents STATus PRESet presets all transition filters non IEEE 488 2 enable registers and error event queue enable registers Refer to Table 3 2 Chapter 3 127 Programming the Status Register System Accessing Status Register Information Table 3 2 Effects of STATus PRESet Register Value after STATus PRESet STATus OPERation ENABle 0 STATus OPERation NTRansition 0 STATus OPERation PTRransition 32767 STATus OPERation B ASeband ENABle 0 STATus OPERation B ASeband NTRansition 0 STATus OPER
163. is queried for operation complete and then queried for its ID string The frequency and ID string are then printed to the display IMPORTANT Enter in your signal generators hostname in the instrumentName declaration where the xxxxx appears J BR KK kok KK IK KK IK KKK I IKK IR kok k kok k k kok k oko k kok k k kok RIK IRR IA IIR k k k k IRA k k k kok kok OR k k include stdafx h include lt sicl h gt include lt stdlib h gt include lt stdio h gt int main int argc char argv INST id Device session id int opcResponse Variable for response flag char instrumentName xxxxx Put your instrument s hostname here char instNameBuf 256 Variable to hold instrument name char buf 256 Variable for id string ionerror I ERROR EXIT Register SICL error handler Open SICL instrument handle using VXI 11 protocol sprintf instNameBuf lan s inst0 instrumentName id iopen instNameBuf Open instrument session Chapter 2 75 Programming Examples LAN Programming Examples itimeout id 1000 Set 1 second timeout for operations printf Setting frequency to 1 Ghz n iprintf id freq 1 GHz n Set frequency to 1 GHz printf Waiting for source to settle n iprintf id opc n Query for operation complete iscanf id d amp opcResponse Operation complete flag if opcResponse 1 If operation fails prompt user printf Bad r
164. is set for a 5 dBm power level and then queried for the power level The power level is printed to the screen IMPORTANT Set up the LAN Client using the IO Config utility J RR KK KK RIK KK IKK IKK I k oko k kok k kok k k kok k oko kok k k kok k oko kok k kok RII RR kok k kok k k k k kok k k k k ke k k include lt visa h gt include lt stdio h gt include StdAfx h include lt stdlib h gt include lt conio h gt define MAX COUNT 200 int main void Chapter 2 TI Programming Examples LAN Programming Examples ViStatus status Declares a type ViStatus variable ViSession defaultRM instr Declares a type ViSession variable ViUInt32 retCount Return count for string I O ViChar buffer MAX COUNT Buffer for string I O status viOpenDefaultRM amp defaultRM Initialize the system Open communication with Serial Port 2 status viOpen defaultRM TPCIP0 19 INSTR VI NULL VI NULL amp instr if status If problems then prompt user printf Could not open ViSession Mn printf Check instruments and connections Mn printf Xn r exit 0 Set timeout for 5 seconds viSetAttribute instr VI ATTR TMO VALUE 5000 Ask for sig gen ID string status viWrite instr ViBuf IDN n 6 amp retCount Read the sig gen response status viRead instr ViBuf buffer MAX COUNT amp retCount buffer retCount 0 Indicate the end of the string printf Sign
165. its previously enabled with the ESE lt data gt command Chapter 3 Programming the Status Register System Status Groups Standard Operation Status Group NOTE Some of the bits in this status group do not apply to the E4428C and will return a zero when gueried See Table 3 5 on page 136 for more information The Operation Status Group is used to determine the specific event that set bit 7 in the Status Byte Register This group consists of the Standard Operation Condition Register the Standard Operation Transition Filters negative and positive the Standard Operation Event Register and the Standard Operation Event Enable Register Va CALibrating Settling Unused SWEeping MEASuring Waiting for TRIGger Unused Unused Unused DCFM DC M Null in Progress Baseband is busy SWEep Calculating BERT SYNChronizing Unused Unused Always Zero 0 Standard qp Standard Operation Y Y Y Y v Y Y Y Y Y Y Y Y v RENE eno Y Y v vt ivive YY Standard Operation Negative 15 14 13 12 31 10 987 654 32 1 0 Transition Filter p Y v Y v v vvvvvivv vi oe 15 14 F 12 11 109876543210 4444 CER ll amp Standard Operation FELIU F nable Register To Status Byte Register Bit 7 x Chapter 3 135 Programming the Status Register System Status Groups Standard Operation Condition Register The Standard Operation Condition Register continuously monitors the hardware and firmware status of
166. k indicates a query J RR RRR KK KKK IKK IKK I KK IK KIRK I KK IKK KK I KR IA IRR IRR IA IIR oko III II I IK include lt visa h gt include StdAfx h include lt iostream gt include lt conio h gt include lt stdlib h gt using namespace std void main ViSession defaultRM vi Declares variables of type ViSession for instrument communication ViStatus viStatus 0 Declares a variable of type ViStatus for GPIB verifications char rdBuffer 256 Declares variable to hold string data Chapter 2 51 Programming Examples GPIB Programming Examples int num Declares variable to hold integer data Initialize the VISA system viStatus viOpenDefaultRM amp defaultRM Open session to GPIB device at address 19 viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus If problems then prompt user printf Could not open ViSession Mn printf Check instruments and connections Mn pDrint fi XnU s exit 0 viPrintf vi RST n Resets signal generator viPrintf vi FREQ CW Nn Querys the CW frequency viScanf vi t rdBuffer Reads response into rdBuffer Prints the source frequency printf Source CW frequency is s n rdBuffer printf Press any key to continue n printf Ant Prints new line character to the display getch viPrintf vi POW AMPL n Querys the power level viScanf vi t rdBuffer
167. k k k k k kok k k k k k k k k k k k IR k k k kk k gt Function showErrors SDescription Query the SCPI error queue until empty Print results SReturn void FR RR IRR IK IRR IR RR IRR IRR AIR kk k kk k kk k kk kk kk I k k ke ke A void showErrors SOCKET sock const char command SYST ERR n char result_str 256 do queryInstrument sock command result str sizeof result str 1 Chapter 2 95 Programming Examples LAN Programming Examples RK RK kok k oko k oko k kok k kok kok oko k kok k kok k k kok k kok kok k kok k k k kk kok kok IO k k Typical result str 221 Settings conflict Frequency span reduced 0 No error Don t bother decoding kk kok k kok Ck Ck Kk Ck kk k kok kk k KC Ck k kok k kk Ck kk k kk k kA ke kk k kkk ke ke kk ke ke ke ke if strnemp result str 0 3 0 Matched 0 No error break puts result str while 1 BORK KK KKK KKK I Kk Ck IKK IKK IKK IK Kk Ck KK Ck Ck Kk KC Kk oko Kk Ck Kk Ck KC Kk oko k k kok k kok k I HK gt Function isQuery Description Test current SCPI command to see if it a query Return unsigned char non zero if command is a query 0 if not kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Kk kok k k kok k kok IK kok k k kkk ke unsigned char isQuery char cmd unsigned char g 0 char query RRR KK KK kok k kok o kok k o kok k kok ko k oko oko k kok kok
168. kets use I0O Socket Change to your instrument s hostname my SinstrumentName xxxxx Get socket Ssock new IO Socket INET PeerAddr gt instrumentName PeerPort gt 5025 Proto gt tcp i die Socket Could not be created Reason n unless sock Set freq print Setting frequency n print sock freq 1 GHz n 108 Chapter 2 Programming Examples LAN Programming Examples Wait for completion print Waiting for source to settle n print sock opc n my response lt sock gt chomp response Removes newline from response if Sresponse ne 1 die Bad response to OPC from instrument n Send identification query print Ssock IDN n Sresponse lt Ssock gt chomp response print Instrument ID response n Sockets LAN Programming Using J ava In this example the Java program connects to the signal generator via sockets LAN This program requires Java version 1 1 or later be installed on your PC To run the program perform the following steps 1 In the code example below type in the hostname or IP address of your signal generator For example String instrumentName your signal generator s hostname 2 Copy the program as ScpiSockTest java and save it in a convenient directory on your computer For example save the file to the C jdk1 3 0_2 bin javac directory 3 Launch the Command Prompt program on your computer Click Start gt
169. kok k k I Kk oko k KC kk k kok k KC k k kk k ke Send command to signal generator kok k kok ok k oko kok o kok k k kok k kok k kc kCk oko k kok ck k ck k ck kck ck k kok kckck ck kk command err commandInstrument sock command if command err return COMMAND ERROR RRR KK KK kok k oko kok oko k kok k kok kok kok k k kok k oko kok k k kok k k k I I Read response from signal generator oko k kok ok k oko kok o kok k kok k kok k oko kok k kok kok kok k kok kok oko k kok oko count recv sock tmp buf 1 0 read 1 char ch tmp_buf 0 if count lt 1 ch EOF ch Mn result N0 null terminate result for ascii return 0 92 Chapter 2 use Chapter 2 Programming Examples LAN Programming Examples a do while so we can break out binary data encountered figure out what it is long numDigits long numBytes 0 char length 10 count recv sock tmp buf 1 0 read 1 char ch tmp buf 0 if count lt 1 ch EOF break End of file if ch lt 0 ch gt 9 break unexpected char numDigits ch 0 if numDigits read numDigits bytes into result string count recv sock result int numDigits 0 result count 0 null terminate numBytes atol result if numBytes resultBytes 0 Loop until we get all the bytes we requested Each call seems to return up to 145
170. kok k k kok k KK KK 96 Chapter 2 Programming Examples LAN Programming Examples if the command has a in it use queryInstrument otherwise simply send the command s Actually we must be a more specific so that marker value guerys are treated as commands KA Example SENS FREQ CENT CALC1 MARK1 X f BRR KK RR KK KK I Ck Ck Kk Ck Kk Ck I Ck Ck Kk kk Kk oko k Ck ko kk kok kok ke kk ke ke if query strchr cmd NULL Make sure we don t have a marker value query or any command with a followed by a character This kind of command is not a auery from our point of view The signal generator does the guery internally and uses the result Ai queryt bump past while query if query attempt to ignore white spc gueryt else break return q RRR KK kk k kk KK kok o KR oko o kok o kok Ck Ck Kk k k Kk CK KK Ck Ck Kk o kok k k k k o oko k k Kk k Kk ok kok k oko ke ke k k ke ke ke gt Function main Chapter 2 97 Programming Examples LAN Programming Examples SDescription Read command line arguments and talk to signal generator Send query results to stdout Return int non zero if an error occurs FR RR IIR A KK k kok k k oko oko Kk kok Kk k Kk k k Kk Ck k Kk Ck Ck kk Kk k k k kok k kk k ke kk ke kok k kk ke k ke ke int main int argc char argv SOCKET instSock char charBuf char
171. ld length of the active TDMA format User file size is limited by the available memory Po When designing user files you must consider the signal generator s PRAM storage size Option 001 601 8 megawords Option 002 32 megawords or Option 602 64 megawords framing overhead and available memory Chapter 4 195 Downloading and Using Files User Bit Binary File Data Dow nloads 5 For downloads to binary memory bit length must be a multiple of 8 SCPI specifies the data in 8 bit bytes NOTE Not all binary values are ASCII characters that can be printed Only ASCII characters corresponding to decimal values 32 through 126 are printable keyboard characters Typically the ASCII character corresponding to an 8 bit pattern is not printable Because of this the program written to download and upload user files must correctly convert the binary data into 8 bit characters Preliminary Setup No preliminary setup is reguired for user file downloads Bit Memory Downloads Bit memory accepts data in any integer number of bits up to the maximum available memory The data length in bytes for files downloaded to bit memory is egual to the number of significant bits plus 7 divided by 8 then rounded down to the nearest integer plus 8 bytes for the file header Each file has a 16 byte header associated with it You must have enough bytes to contain the bits you specify If the number of bits is not a multiple of 8 the least significa
172. le A complete list of error messages is provided in the file errormesages pdf on the CD ROM supplied with your instrument In the error message list an explanation is generally included with each error to further clarify its meaning The error messages are listed numerically In cases where there are multiple listings for the same error number the messages are in alphabetical order 32 Chapter 1 Getting Started Error Messages Error M essage Types Events do not generate more than one type of error For example an event that generates a guery error will not generate a device specific execution or command error Query Errors 499 to 400 indicate that the instrument s output queue control has detected a problem with the message exchange protocol described in IEEE 488 2 Chapter 6 Errors in this class set the guery error bit bit 2 in the event status register IEEE 488 2 section 11 5 1 These errors correspond to message exchange protocol errors described in IEEE 488 2 6 5 In this case e Either an attempt is being made to read data from the output queue when no output is either present or pending or e data in the output queue has been lost Device Specific Errors 399 to 300 201 to 703 and 800 to 810 indicate that a device operation did not properly complete possibly due to an abnormal hardware or firmware condition These codes are also used for self test response errors Errors in this class set the device specifi
173. lear vi Clears the signal generator viPrinti wi RSTAn Resets signal generator Print program header and information printf End of Sweep Service Request n orintE na printf The signal generator will be set up for a step sweep mode operation n printf An will be printed while the instrument is sweeping The end of in printf sweep will be indicated by an SRO on the GPIB and the program will end Nn printf nnyy printf Press Enter to continue n printf Mn getch viPrintf vi CLS n Clears signal generator status byte viPrintf vi STAT OPER NTR 8 n Sets the Operation Status Group Negative Transition Filter to indicate a negative transition in Bit 3 Sweeping which will set a corresponding event in the Operation Event Register This occurs at the end of a sweep viPrintf vi STAT OPER PTR 0 n Sets the Operation Status Group Positive Transition Filter so that no positive transition on Bit 3 affects the Operation Event Register The positive transition occurs at the start of a sweep viPrintf vi STAT OPER ENAB 8 n Enables Operation Status Event Bit 3 to report Chapter 2 71 Programming Examples GPIB Programming Examples the event to Status Byte Register Summary Bit 7 viPrintf vi SRE 128 n Enables Status Byte Register Summary Bit 7 The next line of code indicates the function to call on
174. listen active state although no indication is generated by the signal generator The parameter list describes the interface or device descriptor The Agilent SICL function puts an instrument identified by the id parameter into remote mode and disables the front panel keys Pressing the Local key on the signal generator front panel restores manual operation The parameter id is the session identifier Local Lockout Function The Agilent BASIC function LOCAL LOCKOUT and the other listed I O library functions can be used to disable the front panel keys including the Local key With the Local key disabled only the controller or a hard reset of the line power switch can restore local control Table 1 7 Agilent BASIC VISA NI 488 2 Agilent SICL 10 LOCAL LOCKOUT 719 N A SetRWLS parameter igpibllo id list Agilent BASIC The LOCAL LOCKOUT function disables all front panel signal generator keys Return to local control can occur only with a hard on off when the LOCAL command is sent or if the Preset key is pressed VISA Library The VISA library at this time does not have a similar command NI 488 2 Library The NI 488 2 library function places the instrument described in the parameter list in remote mode by asserting the Remote Enable REN GPIB line The lockout state is then set using the Local Lockout LLO GPIB message Local control can be restored only with the EnableLocal NI 488 2 routine or hard reset The par
175. lways Zero 0 el QUEStionable BER Condition Register 15 14 18 12 11 10 987 6543210 osa oueotonade P V 3 3 V VY YT VY VVT V3 Transtion Fi 15 14 13 12 31 109 87 65 4 32 1 0 ransition Filter ky MMEEEREEEZZIZZZZZEE Nocati 15 14 13 12 11 10 087 654 32 1 0 egative Transition Filter n Een W LU LA amp Data OUEStionable mEREREEEZRRRER Event i 15 14 13 12 11 109876543210 Enable Register ck710c 157 Programming the Status Register System Status Groups Data Ouestionable BERT Condition Register The Data Ouestionable BERT Condition Register continuously monitors the hardware and firmware status of the signal generator Condition registers are read only Table 3 12 Data Ouestionable BERT Condition Register Bits Bit Description 0 No Clock A 1 in this bit indicates no clock input for more than 3 seconds 1 No Data Change A 1 in this bit indicates no data change occurred during the last 200 clock signals 2 PRBS Sync Loss A 1 is set while PRBS synchronization is not established RST sets the bit to zero 3 10 Unused These bits are always set to 0 11 Down conv Demod Unlocked A 1 in this bit indicates that either the demodulator or the down converter is out of lock 12 Demod DSP Ampl out of range A 1 in this bit indicates the demodulator amplitude is out of range The RST command will set this bit to zero 0 13 Sync to BCH TCH PDCH If the synchronizatio
176. malloc INPUT BUF SIZE char basename int chr char command 1024 char destination unsigned char quiet 0 unsigned char show_errs 0 int number 0 basename strrchr argv 0 if basename NULL basenamet else basename argv 0 while chr getopt argc argv qune EOF switch chr case q quiet 1 break case n number 1 break 98 Chapter 2 Programming Examples LAN Programming Examples case e show errs 1 break case u case usage basename exit 1 now look for hostname and optional lt command gt if optind argc destination argv optind strcpy command if optind argc while optind lt argc lt hostname gt lt command gt provided only one command string strcat command argv optind if optind lt argc strcat command else strcat command n else Only lt hostname gt provided input on lt stdin gt strcpy command if optind gt argc usage basename exit 1 Chapter 2 99 Programming Examples LAN Programming Examples else no hostname usage basename exit 1 RRR KK kk kk kk oko k kok k oko Kk kok k k Ck kk ke k Kk kok k k ke kk ko ke kk ke ke ke ke ke k k k open a socket connection to the instrument ROR KKK KKK kk k oko k o oko kok Kk Ck Kk kk Kk kok kk Ck kk kok k ke ke ke ke ke ke ek ifdef WINSOCK if
177. mple IMPORTANT The VXI 11 SCPI service must be enabled before you can communicate with the signal generator over the LAN interface Go to the Utility gt GPIB RS 232 LAN gt LAN Services Setup menu and enable turn On the VXI 11 SCPI service You can start a new Standard EXE project and add the required references Once the required references are include you can copy the example programs into your project and add a command button to Form1 that will call the program The example Visual Basic 6 0 programs are available on the ESG Documentation CD ROM enabling you to cut and paste the examples into your project Running C Programming Examples To run the example program written in C you must have the NET framework installed on your computer You must also have the Agilent IO Libraries installed on your computer The NET framework can be downloaded from the Microsoft website IMPORTANT The VXI 11 SCPI service must be enabled before you can communicate with the signal generator over the LAN interface Go to the Utility gt GPIB RS 232 LAN gt LAN Services Setup menu and enable turn On the VXI 11 SCPI service 1 Copy the State File cs file in the examples directory to the NET installation directory where the csc exe file is located The example C program is available on the ESG Documentation CD ROM 2 Run the MS DOS Command Prompt program Change the directory so that the command prompt program is in the same directory as the c
178. n 5 kHz Mn printf Tnt Print a carrage return Close the sessions viClose vi viClose defaultRM Chapter 2 59 Programming Examples GPIB Programming Examples Generating a Step Swept Signal Using VISA and C In this example the VISA library is used to set the signal generator for a continuous step sweep on a defined set of points from 500 MHz to 800 MHz The number of steps is set for 10 and the dwell time at each step is set to 500 ms The signal generator will then be set to local mode which allows the user to make adjustments from the front panel Launch Microsoft Visual C 6 0 add the reguired files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex7 cpp J RR RRR kok k KR KKK KKK KK KKK HK IKK I KK IK KKK IKK IK IKK IK I IIR I I IO KR K k k k k k IE PROGRAM FILE NAME visaex7 cpp PROGRAM DESCRIPTION This example will program the signal generator to perform a step sweep from 500 800 MHz with a 5 sec dwell at each frequency step TBR RRR KR KK KKK IKK IKK I IKK IKK IKK I KR IA AR IRR IA ARR IRR A AIR k oko I oko kok II I Ie include lt visa h gt include StdAfx h include lt iostream gt void main ViSession defaultRM vi Declares variables of type ViSession vi establishes instrument communication ViStatus viStatus 0 Declares a variable of type ViStatus for GPIB verificati
179. n source is BCH a 1 in this bit indicates BCH synchronization is not established it does not indicate the TCH PDCH synchronization status If the sync source is TCH or PDCH a 1 in this bit indicates that TCH or PDCH synchronization is not established RST sets the bit to zero 14 Waiting for TCH PDCH A 1 in this bit indicates that a TCH or PDCH midamble has not been received This bit is set when bit 13 is set The bit is also set when the TCH or PDCH synchronization was once locked and then lost in this case the front panel displays WAITING FOR TCH or PDCH RST set the bit to Zero 15 Always 0 Query STATus QUEStionable BERT CONDition Response The decimal sum of the bits set to 1 158 Chapter 3 Programming the Status Register System Status Groups Data Ouestionable BERT Transition Filters negative and positive The Data Ouestionable BERT Transition Filters specify which type of bit state changes in the condition register set corresponding bits in the event register Changes can be positive 0 to 1 or negative 1 to 0 Commands STATus OUEStionable BERT NTRansition lt value gt negative transition or STATus QUEStionable BERT PTRansition value positive transition where lt value gt is the sum of the decimal values of the bits you want to enable Queries STATus QUEStionable BERT NTRansition STATus QUEStionable BERT PTRansition Data Questionable BERT Event Register
180. nable Register A condition register continuously monitors the hardware and firmware status of the signal generator There is no latching or buffering for a condition register it is updated in real time A negative transition filter specifies the bits in the condition register that will set corresponding bits in the event register when the condition bit changes from to 0 A positive transition filter specifies the bits in the condition register that will set corresponding bits in the event register when the condition bit changes from 0 to 1 An event register latches transition events from the condition register as specified by the positive and negative transition filters Once the bits in the event register are set they remain set until cleared by either querying the register contents or sending the CLS command An enable register specifies the bits in the event register that generate the summary bit The signal generator logically ANDs corresponding bits in the event and enable registers and ORs all the resulting bits to produce a summary bit Summary bits are in turn used by the Status Byte Register A status group is a set of related registers whose contents are programmed to produce status summary bits In each status group corresponding bits in the condition register are filtered by the negative and positive transition filters and stored in the event register The contents of the event register are logically ANDed with the contents
181. nded that the VISA library be used for programming the signal generator The NI VISA and Agilent VISA libraries are similar implementations of VISA and have the same commands syntax and functions The differences are in the lower level I O libraries used to communicate over the RS 232 NI 488 2 and SICL respectively NI 488 2 NI 488 2 I O libraries can be used to develop applications for the RS 232 interface See National Instrument s website for information on NI 488 2 SICL Agilent SICL can be used to develop applications for the RS 232 interface See Agilent s website for information on SICL 28 Chapter 1 Getting Started Using RS 232 2 Setting Up the RS 232 Interface 1 Press Utility gt GPIB RS 232 LAN gt RS 232 Setup gt RS 232 Baud Rate gt 9600 Use baud rates 57600 or lower only Select the signal generator s baud rate to match the baud rate of your computer or UNIX workstation or adjust the baud rate settings on your computer to match the baud rate setting of the signal generator NOTE The default baud rate for VISA is 9600 This baud rate can be changed with the VI ATTR ASRL BAUD VISA attribute 2 Press Utility gt GPIB RS 232 LAN gt RS 232 Setup gt RS 232 Echo Off On until Off is highlighted Set the signal generator s RS 232 echo Selecting On echoes or returns characters sent to the signal generator and prints them to the display 3 Connect an RS 232 cable from the computer s serial connector to the
182. neration using C 168 programming languages 36 Q queue error 32 R recall states 211 register system overview 120 registers See also status registers condition description 132 data questionable BERT condition 158 registers continued data questionable BERT event 159 data questionable BERT event enable 159 data questionable calibration condition 155 data questionable calibration event 155 data questionable calibration event enable 156 data questionable condition 142 data questionable event 143 data questionable event enable 144 data questionable frequency condition 149 data questionable frequency event 150 data questionable frequency event enable 150 data questionable modulation condition 152 data questionable modulation event 153 data questionable modulation event enable 153 data questionable power condition 146 data questionable power event 147 data questionable power event enable 147 in status groups descriptions 132 overall system 121 122 standard event status 134 standard event status enable 134 standard operation condition 136 139 standard operation event 137 140 standard operation event enable 137 140 status byte 130 remote annunciator 112 remote function 11 remote interface 2 GPIB 8 RS 232 28 RS 232 3 address 112 baud rate 29 cable 29 configuration 29 echo 29 format parameters 31 interface 29 IO libraries 28 overview 28 program examples 112 setti
183. nformation and details on the specification Configuring for VXI 11 The Agilent I O library has a program I O Config that is used to setup the computer signal generator interface for the VXI 11 protocol Download the latest version of the Agilent I O library from the Agilent website Refer to the Agilent I O library user manual documentation and Help menu for information on running the I O Config program and configuring the VXI 11 interface Use the I O Config program to configure the LAN client Once the computer is configured for a LAN client you can use the VXI 11 protocol and the VISA library to send SCPI commands to the signal generator over the LAN interface Example programs for this protocol are included in LAN Programming Examples on page 74 of this programming guide NOTE For Agilent I O library version J 01 0100 the Identify devices at run time check box must be unchecked Refer to Figure 1 2 20 Chapter 1 Getting Started Using LAN Figure 1 2 Show Devices Form Show Devices OK Identify devices at run time Cancel Devices present on interface GPIB1 Add device Remove device Auto Add devices Ea a s Adve _Eiemove device Ao bt devices Using Sockets LAN Sockets LAN is a method used to communicate with the signal generator over the LAN interface using the Transmission Control Protocol Internet Protocol TCP IP A socket is a fundamental technology used for computer network
184. ng Examples cece eee eee eee ee 37 Running CF Programming Examples 0 0 4iio0ndesdsdeoh prd tA EEIE ER rra 38 Contents GPIB Brozr mome ExaMpotuob assskb z nak u Spa bee bei bee eX be p d RR ds 39 Perne Using the Examples cess ob sce pao hae He ho RPO Oe Sos eR KUKA dd koda pda 39 Interface Check usine Agilent BASIC za book eco idee hee ee EERE ERRE d REC RA 40 Interface Check Using NE488 2 and CFF i ccc cera tte ace RR RR ERR YO ARR VESTE S 41 Interface Check Using VIS AGNI C LL pok pb yd ddd by Bb kdo ike ob od 42 Local Lockout Usine Agilent BASIC aq deb pie dese bebe dn shoud deda r sd 43 Local Lockout Using INL4938 2 and C 4eb opis t E ageene eee eee EREDE R Ad kod DP edn 45 Queries Using Agvet BASIC kg aic a bios sdb bab MELAS LRSM daba Sea ps 46 Quenes Using NI 458 2 and CE zed eee thao ddd a ashe kk bt Rene Rus 48 Queues Usine VISA ANd Ceci cle tiene eicckiakee IRI RUD RR ade ade E RARE SCR Raney 51 Generating a CW Signal Using VISA and C zo ok eee ee eee d cko ok e me 33 Generating an Externally Applied AC Coupled FM Signal Using VISA andC 56 Generating an Internal AC Coupled FM Signal Using VISA andC 58 Generating a Step Swept Signal Using VISA and C lt a edu cins dorpi RR k RR Red 60 Saving and Recalling States Using VISA and C eee eee eens 62 Reading the Data Questionable Status Register Using VISA and C 65 Reading the Service Req
185. ng Examples viStatus viUninstallHandler vi VI EVENT SERVICE REO interupt rdBuffer viStatus viClose vi viStatus viClose defaultRM return 0 The following function is called when an SRO event occurs Code specific to your reguirements would be entered in the body of the function ViStatus VI FUNCH interupt ViSession vi ViEventType eventType ViEvent event ViAddr addr ViStatus status ViUInt16 stb status viReadSTB vi amp stb Reads the Status Byte sweep 0 Sets the flag to stop the printing printf Xn Print user information printf An SRO indicating end of sweep has occurred n viClose event Closes the event return VI SUCCESS Chapter 2 73 Programming Examples LAN Programming Examples LAN Programming Examples e VXI 11 Programming Using SICL and C on page 74 e VXI 11 Programming Using VISA and C on page 77 e Setting Parameters and Sending Queries Using Sockets and C on page 82 e Setting the Power Level and Sending Queries Using PERL on page 108 e Generating a CW Signal Using Java on page 110 The LAN programming examples in this section demonstrate the use of VXI 11 and Sockets LAN to control the signal generator For details on using FTP and TELNET refer to Using FTP on page 26 and Using Telnet LAN on page 22 of this guide Before Using the Examples To use these programming examples you must change references to the I
186. ng sockets LAN is given in Chapter 2 of this programming guide Using Telnet LAN Telnet provides a means of communicating with the signal generator over the LAN The Telnet client run on a LAN connected computer will create a login session on the signal generator A connection established between computer and signal generator generates a user interface display screen with SCP I gt prompts on the command line Using the Telnet protocol to send commands to the signal generator is similar to communicating with the signal generator over GPIB You establish a connection with the signal generator and then send or receive information using SCPI commands Communication is interactive one command at a time NOTE The Windows 2000 operating system uses a command prompt style interface for the Telnet client Refer to the Figure 1 5 on page 25 for an example of this interface Using Telnet and MS DOS Command Prompt 1 On your PC click Start gt Programs gt Command Prompt At the command prompt type in telnet Press the Enter key The Telnet display screen will be displayed Aor Click on the Connect menu then select Remote System A connection form Figure 1 3 is displayed Connect Form Windows 2000 is a registered trademark of M icrosoft Corporation 22 Chapter 1 Getting Started Using LAN Figure 1 3 Host Name instrument name Port 5023 TermType S000 Cancel Enter the hostname port number and T
187. ngs baud rate 112 verifying operation 30 234 Index S sample command line 207 save and recall 211 SCPI 6 7 SCPI commands 10 ARB waveform file downloads 167 181 example programs C 170 HP BASIC for UNIX 176 184 HP BASIC for Windows 168 182 HP BASIC for windows 173 playing a downloaded waveform 179 for status registers IEEE 488 2 common commands 127 PRAM downloads in block format 209 preliminary setup 208 sample command line 209 in list format 207 preliminary setup 206 querying the PRAM data 207 sample command line 207 modulating and activating the carrier 210 user file downloads 196 197 querying the PRAM data 197 198 sample command line 197 user FIR file downloads sample command line 202 SCPI error queue 32 SCPI register model 120 service request method status registers 125 service request method using 125 SetRWLS 12 SICL 9 16 28 39 iabort 11 iclear 14 igpibllo 12 iprintf 14 iremote 12 iscanf 15 signal generator monitoring status 120 Index sockets continued LAN 74 79 PERL 108 UNIX 79 Windows 80 sockets LAN 21 software libraries IO 3 SRE commands 127 SRQ command 125 SRQ method status registers 125 standard event status enable register 134 standard event status group 133 standard event status register 134 standard operation condition register 136 139 standard operation event enable register 137 140 standard operation event re
188. not require I O libraries to be installed on your computer However to write programs to control your signal generator an I O library must be installed on your computer and the computer configured for instrument control using the LAN interface The Agilent IO libraries Suite is available on the Automation Ready CD which was shipped with your signal generator The libraries can also be downloaded from the Agilent website The following is a discussion on these libraries Agilent VISA VISA is an I O library used to develop I O applications and instrument drivers that comply with industry standards Use the Agilent VISA library for programming the signal generator over the LAN interface SICL Agilent SICL is a lower level library that is installed along with Agilent VISA 2 Setting Up the LAN Interface For LAN operation the signal generator must be connected to the LAN and an IP address must be assigned to the signal generator either manually or by using DHCP client service Your system administrator can tell you which method to use NOTE Verify that the signal generator is connected to the LAN using a 10Base T LAN cable 16 Chapter 1 Getting Started Using LAN Manual Configuration 1 Press Utility gt GPIB RS 232 LAN gt LAN Setup 2 Press Hostname NOTE The Hostname softkey is only available when LAN Config M anual DHCP is set to Manual 3 Use the labeled text softkeys or numeric keypad or both to enter the desired hostname
189. nt IO Libraries version M or earlier you can configure the interfaces available on your computer by using the IO Config program This program can setup the interfaces that you want to use to control the signal generator The following steps set up the interfaces NOTE Install GPIB interface boards before running IO Config 1 Run the IO Config program The program automatically identifies available interfaces Click on the interface type you want to configure such GPIB in the Available Interface Types text box Click the Configure button Set the Default Protocol to AUTO Click OK to use the default settings cod BB Click OK to exit the IO Config program VISA Assistant Use can use the VISA Assistant available with the Agilent IO Libraries versions M and earlier to send commands to the signal generator If the interface you want to use does not appear in the VISA Assistant then you must manually configure the interface See the Manual Configuration section below Refer to the 4 Chapter 1 Getting Started Introduction to Remote Operation VISA Assistant Help menu and the Agilent VISA User s Manual available on Agilent s website for more information 1 2 3 4 Run the VISA Assistant program Click on the interface you want to use for sending commands to the signal generator Click the Formatted I O tab Select SCPI in the Instr Lang section You can enter SCPI commands in the text box and send the command using the v
190. nt bits of the last byte will be ignored For example specifying 14 bits of a 16 bit string using the command MEMory DATA BIT file name 14 120z results in the last 2 bits being ignored See the following figure 1010 0001 0111 1010 original user defined data contains 2 bytes 16 bits total SCPI command sets bit count to 14 the last 2 bits are ignored 1010 0001 0111 10 0 lt Bit memory provides more versatility and is preferred for user file downloads SCPI Commands Send the following command to download the user file data into the signal generators bit memory MEMory DATA BIT file name gt bit count lt datablock gt 196 Chapter 4 Downloading and Using Files User Bit Binary File Data Dow nloads Example MEMory DATA BIT file name 16 120z file name provides the user file name as it will appear in the signal generator s binary memory catalog 1 defines the number of decimal digits to follow in B 2 denotes how many bytes of data are to follow Qz the ASCII representation of the 16 bits of data that are downloaded to the signal generator This variable is represented by C in the sample command line Querying the Waveform Data Use the following SCPI command to query user file data from binary memory MEMory DATA BIT lt file name gt The output format is the same as the input format Binary Memory Downloads Binary memory requires data formatted in 8 bit bytes Files
191. nt format The I and Q data values are interleaved creating a single I Q waveform data file The 2 byte I integer and 2 byte Q integer values along with a marker byte make up one sample one waveform point There are five bytes of data for every sample as shown in Table 4 1 The signal generator uses a marker file that is always associated with an I Q waveform file If you do not create a marker file for the I Q waveform file then the signal generator will automatically create one This automatically generated default marker file consists of all zeros The marker data drives the signal generator s EVENT output connectors e Marker bit 1 drives EVENT 1 rear panel BNC e Marker bit 2 drives EVENT 2 rear panel BNC e Marker bit 3 drives EVENT 3 rear panel auxiliary D connector pin 19 e Marker bit 4 drives EVENT 4 rear panel auxiliary D connector pin 18 NOTE The default marker file is automatically created when no user defined marker file is provided The creation is done when the I Q waveform file is loaded into volatile WFM1 waveform memory prior to playing If the default marker file is used toggle the Pulse RF Blank None softkey to None 162 Chapter 4 Downloading and Using Files ARB Waveform Data Downloads The marker file consists of 8 bit samples with each sample having four marker bits and four unused bits The result is that the I O file will have four times as many bytes as the marker file See Table 4 1 for more detail on
192. ntf EXT2 and AC coupling are selected Wn on frequency modulation on RF output user information print tX mts Prints a carrage return Close viClose vi Chapter 2 the sessions 57 Programming Examples GPIB Programming Examples viClose defaultRM Generating an Internal AC Coupled FM Signal Using VISA and C In this example the VISA library is used to generate an ac coupled internal FM signal at a carrier frequency of 900 MHz and a power level of 15 dBm The FM rate will be 5 kHz and the peak deviation will be 100 kHz Launch Microsoft Visual C 6 0 add the required files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex6 cpp J RRR RK RRR KR KKK HK KR IKK KKK IKK IK I KK IK I IKK I KR IA I RR IRR k kok k k kok k oko oko oko kok oko I I PROGRAM FILE NAME visaex6 cpp PROGRAM DESCRIPION This example generates an AC coupled internal FM signal at a 900 MHz carrier frequency and a power level of 15 dBm The FM rate is 5 kHz and the peak deviation 100 kHz J RR RRR RRR KKK IK KR IKK KKK IK IKK I KK IK KKK IKK IR IR IRR IA oko k k kok k I III ooo I I include lt visa h gt include StdAfx h include lt iostream gt include lt stdlib h gt include lt conio h gt void main ViSession defaultRM vi ViStatus viStatus 0 viStatus viOpenDe
193. o 210 Sends the rest of the ASCII header 230 Sends the binary data Note that ESGb is the binary I O 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 Chapter 4 175 Downloading and Using Files ARB Waveform Data Downloads Waveform Dow nloading Using HP BASIC for UNIX The following program shows you how to download waveforms using HP BASIC for UNIX The code is similar to that shown for HP BASIC for Windows but there is a formatting difference in line 45 and line 50 As discussed at the beginning of this section I and O waveform data is interleaved into one file in 2 s compliment form and a marker file is associated with this I O waveform file 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 UNIX file 20 Num points 200 30 ALLOCATE INTEGER Int array 1 Num points 2 40 DEG 50 FOR I 1 TO Num points 2 STEP 2 60 Int array 1 INT 32767 SIN I 360 Num points 70 NEXT I 80 FOR I 2 TO Num points 2 STEP 2 90 Int array I INT 32767 COS I 360 Num points 00 NEXT I 10 PRINT Data generated 20 Nbytes 4 Num points 30 ASSIGN Esg TO 71
194. o lanio c Windows 95 using Microsoft Visual C 4 0 Standard Edition Windows NT 3 51 using Microsoft Visual C 4 0 Be sure to add WSOCK32 LIB to your list of libraries Compile both lanio c and getopt c Consider re naming the files to lanio cpp and getopt cpp Considerations On UNIX systems file I O can be used on network sockets B This makes programming very convenient since routines like getc fgets fscanf and fprintf can be used These routines typically use the lower level read and write calls In the Windows environment file operations such as read write and close cannot be assumed to work correctly when applied to sockets Instead the functions send and recv MUST be used OKCKCKCKCkCkCKCkCkCk KK IK IK I KK AIK IK IKK IIR IK IRR I I IR IR AR OR I ke ke Support both Win32 and HP UX UNIX environment ifdef _WIN32 Visual C 6 0 will define this define WINSOCK dendif ifndef WINSOCK ifndef HPUX SOURCE Chapter 2 83 Programming Examples LAN Programming Examples define HPUX SOURCE endif dendif include lt stdio h gt include lt string h gt include lt stdlib h gt include lt errno h gt ifdef WINSOCK include lt windows h gt ifndef WINSOCKAPI include lt winsock h gt endif else include lt sys socket h gt include lt netinet in h gt include lt netdb h gt def
195. o the unmanaged Agilent IO Library VISA DLL The Agilent VISA library must be installed on your computer for this example to run Important Replace the visaOpenString with the IP address for your signal generator Chapter 4 213 Downloading and Using Files Saving and Recalling Instrument State Files J ROR RK KKK IKK IKK IK I k oko k kok k ooo oko kok k oko k kok k oko kok kok k k oko ooo RR IR kok ko AR A kk ke ke A e using System using System 10 using System Text using System Runtime InteropServices using System Collections using System Text RegularExpressions namespace State_Files class MainApp Replace the visaOpenString variable with your instrument s address static public string visaOpenString TCPIP0 000 000 000 000 GPIBO 19 TCPIPO esg3 INSTR public const uint DEFAULT_TIMEOUT 30 1000 Instrument timeout 30 seconds public const int MAX_READ_DEVICE_STRING 1024 Buffer for string data reads public const int TRANSFER_BLOCK_SIZE 4096 Buffer for byte data The main entry point for the application STAThread static void Main string args uint defaultRM Open the default VISA resource manager 214 Chapter 4 Downloading and Using Files Saving and Recalling Instrument State Files if VisaInterop OpenDefaultRM out defaultRM 0 If no errors proceed uint device Open the specified VISA device the signal generator if VisaInterop Open d
196. oads to PRAM allow you complete control over bursting which is especially helpful for designing experimental or proprietary framing schemes This section contains information that will help you transfer user generated data from a system controller to the signal generator s PRAM It explains how to download data directly into PRAM and modulate the carrier signal with the data The signal generator s baseband generator assembly builds modulation schemes by reading data stored in PRAM and constructing framing protocols according to the data patterns present PRAM data can be manipulated types of protocols changed standard protocols modified or customized etc by the front panel interface or by remote command interface NOTE Because there is no parsing involved block data format downloads are significantly faster than list format downloads Data Limitations Total data bits plus control bits download size limitations are 8 megabytes with Option 001 601 32 megabytes with Option 002 and 64 megabytes with Option 602 Each sample for PRAM uses 4 bytes of storage A data pattern file containing 8 megabits of modulation data must contain another 56 megabits of control information A file of this size requires 8 megasamples of memory the largest amount of modulation data for a waveform in the signal generator without Option 002 or 602 Data Volatility The signal generator provides two data storage areas volatile waveform memory WFM1 and
197. ogramming Examples LAN Programming Examples int WORD wVersionRequested WSADATA wsaData int err wVersionRequested MAKEWORD 1 1 wVersionRequested MAKEWORD 2 0 err WSAStartup wVersionReguested amp wsaData if err 0 Tell the user that we couldn t find a useable winsock dll tif fprintf stderr Cannot initialize Winsock 1 1 n return 1 return 0 close winsock void WSACleanup return 0 endif WINSOCK RRR KK KKK KKK I IKK IK IKK IKK IAA KR IRR IA I KR IRR IA IR IRR A A I koe gt Function openSocket SDescription 86 open a TCP IP socket connection to the instrument Chapter 2 Programming Examples LAN Programming Examples Parameters x const char hostname Network name of instrument This can be in dotted decimal notation int portNumber The TCP IP port to talk to SReturn SErrors int Use 5025 for the SCPI port A file descriptor similar to open 1 returns 1 if anything goes wrong kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Kk Ck kk Ck kkk kkk kkk kkk ke ke ke ke ke x x SOCKET openSocket const char hostname int portNumber struct hostent hostPtr struct sockaddr_in peeraddr_in SOCKET s memset amp peeraddr_in 0 sizeof struct sockaddr in RRR KK RK oko koho oko kok k kok k k kok k k KK KK OK KK map the desired host name to internal form
198. onable CALibration ENABle lt value gt where lt value gt is the sum of the decimal values of the bits you want to enable Example Enable bit 9 and bit 3 so that whenever either of those bits is set to 1 the Data Ouestionable Calibration summary bit of the Data Ouestionable Condition Register is set to 1 Send the command STAT QUES CAL ENAB 520 512 8 Ouery STATus QUEStionable CALibration ENABle Response Decimal value of the sum of the bits previously enabled with the STATus QUEStionable CALibration ENABle value command 156 Chapter 3 Programming the Status Register System Data Ouestionable BERT Status Group NOTE This status group does not apply to the E4428C and if gueried will return a zero Status Groups The Data Ouestionable BERT Status Group is used to determine the specific event that set bit 12 in the Data Ouestionable Condition Register The Data Ouestionable Status group consists of the Data Ouestionable BERT Condition Register the Data Ouestionable BERT Transition Filters negative and positive the Data Ouestionable BERT Event Register and the Data Ouestionable BERT Event Enable Register Chapter 3 To Data Questionable Status Register Bit 12 No Clock No Data Change PRBS Sync Loss Unused Unused Unused Unused Unused Unused Unused Unused Downconv Demod Unlocked Demod DSP Ampl Out of Range Sync to BCH TCH PDCH Waiting for TCH PDCH A
199. one of the following SCPI commands MEMory COPY NAME NVWEM file name gt lt WFM1 file name MEMory COPY NAME NVMKR file name MKRl1 file name MEMory COPY NAME NVHDR file name gt lt HDR1 file name E NOTE When copying a waveform marker or header file from volatile and non volatile memory the waveform and the associated marker and header files are copied Conversely when a waveform file is deleted the associated marker and header files are deleted It is not necessary to send a separate command to copy or delete the marker and header files 2 Select the downloaded waveform file in volatile waveform memory for playback Via the front panel a Press Retum Select Waveform b Highlight selection c Press Select Waveform To select a segment via the remote interface send the following SCPI command SOURce RADio ARB WAVeform WFM1 lt file name gt Chapter 4 179 Downloading and Using Files ARB Waveform Data Downloads 3 Play the waveform and use it to modulate the RF carrier Via the front panel a Press ARB Off On until On is highlighted b Press Mod On Off until the MOD ON annunciator appears on the display c Press RF On Off until the RF On annunciator appears on the display Via the remote interface send the following SCPI commands SOURce RADio ARB STATe ON 0UTPut MODulation STATe ON OUTPut STATe ON Downloading E443xB Signal Generator Files
200. ons viStatus viOpenDefaultRM amp defaultRM Initialize VISA session Open session to GPIB device at address 19 viStatus viOpen defaultRM GPIB 19 INSTR VI NULL VI NULL amp vi if viStatus If problems then prompt user printf Could not open ViSession n 60 Chapter 2 Programming Examples GPIB Programming Examples printf Check instruments and connections n printf Nn exit 0 viClear vi Clears the signal generator viPrintf vi RST n Resets the signal generator viPrintf vi OLSXn Clears the status byte register viPrintf vi FREQ MODE LIST n Sets the sig gen freq mode to list viPrintf vi LIST TYPE STEP n Sets sig gen LIST type to step viPrintf vi FREQ STAR 500 MHz n Sets start frequency viPrintf vi FREQ STOP 800 MHz n Sets stop frequency viPrintf vi SWE POIN 10 n Sets number of steps 30 mHz step viPrintf vi SWEIDWEL 5 Sin Sets dwell time to 500 ms step viPrintf vi POW AMPL 5 dBm Win Sets the power level for 5 dBm viPrintf vi OUTP STAT ON n Turns RF output on viPrintf vi INIT CONT ON n Begins the step sweep operation Print user information printf The signal generator is in step sweep mode The frequency range is n printf 500 to 800 mHz There is a 5 sec dwell time at each 30 mHz step n erintE in Prints a carriage return line feed viPrintf vi OUTP STAT OFF n Turns the
201. or user input lngDone 0 Reset the operation complete flag viPrintf vi RST n Resets the signal generator viPrintfi vi OrPCc n Checks for operation complete while lngDone viScanf vi d amp lngDone Waits for setup to complete Print user information printf Press Local on instrument front panel to return to manual mode n printf Anty Prints new line character Close the sessions viClose vi viClose defaultRM 64 Chapter 2 Programming Examples GPIB Programming Examples Reading the Data Ouestionable Status Register Using VISA and C In this example the signal generator s data questionable status register is read You will be asked to set up the signal generator for error generating conditions The data guestionable status register will be read and the program will notify the user of the error condition that the setup caused Follow the user prompts presented when the program runs Launch Microsoft Visual C 6 0 add the reguired files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD ROM as visaex9 cpp J RR RRR RK KR KKK IKK IKK I KK IKK IKK I KK IKK IR I KR A k k k RA IRR k k k AIR IR I k k k ooo oko k k kk k k PROGRAM NAME visaex9 cpp PROGRAM DESCRIPTION In this example the data questionable status register is read The data questionable status register is enabled to read an unlevel
202. ormation 165 data limitations ARB waveform downloads 165 FIR filter downloads 201 PRAM downloads 205 user file downloads 191 data questionable filters BERT transition 159 calibration transition 155 frequency transition 149 modulation transition 152 power transition 146 transition 143 data questionable groups BERT status 157 calibration status 154 frequency status 148 modulation status 151 power status 145 Index 231 Index data guestionable groups continued status 141 data guestionable registers BERT condition 158 BERT event 159 BERT event enable 159 calibration condition 155 calibration event 155 calibration event enable 156 condition 142 event 143 event enable 144 freguency condition 149 freguency event 150 freguency event enable 150 modulation condition 152 modulation event 153 modulation event enable 153 power condition 146 power event 147 power event enable 147 data reguirements ARB waveform downloads 164 FIR filter downloads 201 user file downloads 190 data transfer 3 data volatility PRAM downloads 205 user file downloads 191 developing programs 36 37 DHCP 17 DNS 18 DOS command prompt 22 download libraries 9 16 download user flatness 211 downloading ARB waveform data 162 186 encrypted ARB waveform files 188 FIR filter coefficient data 201 user files 189 downloading files 161 edit visa config 5 EnableRemote 12 encryption 186 ent
203. oth To monitor a certain condition enable the bit associated with the condition in the associated positive and negative registers Once you have enabled a bit via the transition registers the signal generator monitors it for a change in its condition If this change in condition occurs the corresponding bit in the event register will be set to 1 When a bit becomes true set to 1 in the event register it stays set until the event register is read or is cleared You can thus query the event register for a condition even if that condition no longer exists The event register can be cleared only by querying its contents or sending the CLS command which clears all event registers Monitoring When a Condition Bit Changes Once you enable a bit the signal generator monitors it for a change in its condition The transition registers are preset to register positive transitions a change going from 0 to 1 This can be changed so the selected bit is detected if it goes from true to false negative transition or if either transition occurs 124 Chapter 3 Programming the Status Register System Accessing Status Register Information Deciding How to Monitor You can use either of two methods described below to access the information in status registers both methods allow you to monitor one or more conditions The polling method In the polling method the signal generator has a passive role It tells the controller that conditions have chan
204. ow to modulate the carrier with the data downloaded to PRAM first from the front panel interface and then via remote SCPI commands Via the Front Panel 1 Set the carrier frequency to 2 5 Ghz Frequency gt 2 5 gt GHz Set the carrier amplitude 10 0 dBm Amplitude gt 10 gt dBm Turn modulation on press Mod On Off until the display annunciator reads MOD ON Rope qe Activate the RF output press RF On Off until the display annunciator reads RF ON Via the Remote Interface Send the following SCPI commands to modulate and activate the carrier 1 Set the carrier frequency to 2 5 Ghz SOURCe FREQuency FIXed 2 5GHZ 2 Set the carrier power to 10 0 dBm SOURce POWer LEVel IMMediate AMPLitude 10 0DBM 3 Activate the modulation OUTPut MODulation STATe ON 4 Activate the RF output OUTPut STATe ON Viewing the PRAM Waveform After the waveform data is written to PRAM the data pattern can be viewed using an oscilloscope There is approximately a 12 symbol delay between a state change in the burst bit and the corresponding effect at the RF out This delay varies with symbol rate and filter settings and requires compensation to advance the burst bit in the downloaded PRAM file 210 Chapter 4 Downloading and Using Files Saving and Recalling Instrument State Files Saving and Recalling Instrument State Files The signal generator can save instrument state settings to memory An
205. owing program example is available on the ESG Documentation CD ROM as niex3 cpp J BR KK KKK IKK kk Ck kk Ck kk Kk Ck CK Ck kk oko Kk oko k kok k k k Kk kok k Ck k kk k k Kk k k k Ck k ke kk k kok k ke kk k kk ke kk ko ke k k He PROGRAM NAME niex3 cpp PROGRAM DESCRIPTION This example demonstrates the use of query commands The signal generator can be queried for conditions and instrument states 48 Chapter 2 These a que kkx include include include include Programming Examples GPIB Programming Examples commands are of the type IDN where the question mark indicates ry ck ck ck ck ck ke ck ccce ce ce KKK KKK KKK KKK KKK KKK KKK KKK KKK ck ck ck KKK ck ck ck ck ck ck ck ck ck KKK KKK ck ck ck Ck Ck ck KKK KKK KKK KKK stdafx h lt iostream gt windows h Decl 32 h using namespace std int GPIB Addr4882 int main 0 0 Board handle _t Address 31 Declare a variable of type Addr4882 t int sig Declares variable to hold interface descriptor int num char rdVal 100 Declares variable to read instrument responses sig ibdev 0 19 0 13 1 0 Open and initialize a device descriptor ibloc sig Places the signal generator in local mode ibclr sig Sends Selected Device Clear SDC message ibwrt sig RST 4 Places signal generator in a defined state ibwrt sig FREQuency CW 14 Querys the CW frequency ibrd
206. 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 IO 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 Owfm data I INT 8191 COS I 360 Num points 8192 80 NEXT I 90 PRINT Data Generated 00 Nbytes 2 Num points 10 ASSIGN Esg TO 719 FORMAT ON 20 ASSIGN Esgb TO 719 FORMAT OFF 30 Nbytes VALS Nbytes 40 Ndigits LEN Nbytes 50 Ndigits VAL Ndigits 60 OUTPUT Esg USING K MMEM DATA ARBI file name 1 70 OUTPUT Esg USING K Ndigits 80 OUTPUT Esg USING K Nbytes 90 OUTPUT Esgb Iwfm_data 200 OUTPUT Esg END 210 OUTPUT Esg USING K MMEM DATA ARBO file name 1 220 OUTPUT Esg USING K Ndigits 184 Chapter 4 230 240 250 260 270 280 290 300 OUTPUT OUTPUT OUTPUT ASSIGN ASSIGN PRINT PRINT END Downloading and Using Files ARB Waveform Data Downloads Esg USING K Nbytes Esgb Qwfm_data Esg END Esg TO Esgb TO XEND Program Comments 10 Program file name 20 Sets the number of points in the waveform
207. r coefficient data and data downloads directly to waveform memory This chapter explains signal generator memory and the different waveform download methods ARB Waveform Data Downloads on page 162 Understanding ARB Waveform File Composition and Encryption on page 186 User Bit Binary File Data Downloads on page 189 FIR Filter Coefficient Downloads on page 201 Downloads Directly into Pattern RAM PRAM on page 205 Saving and Recalling Instrument State Files on page 211 Data Transfer Troubleshooting on page 224 161 Downloading and Using Files ARB Waveform Data Downloads ARB Waveform Data Dow nloads NOTE This feature is available only in E4438C ESG Vector Signal Generators with Option 001 601 or 002 602 The signal generator accepts I Q waveform data downloads After downloading the data file into non volatile memory the file can be loaded into volatile memory and then played These user defined I Q waveforms can also be sequenced together with other waveforms and played as part of a waveform sequence NOTE The signal generator can use waveform files developed for the E443xB model signal generators Refer to Downloading E443xB Signal Generator Files on page 180 for information on how to download these file types The I Q waveform data is used to drive the I and Q ports of the I Q modulator The waveform data is described using 16 bit I and 16 bit Q integer values in 2 s compleme
208. ration Failure Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Unused Always Zero 0 Data OUEStionable y CALibration Condition Register 15 14 1 Data QUES tionable CALibration Positive 15 14 13 Transition Filter Data QUES tionable CALibration 15 14 13 Negative Transition Filter Data QUEStionable CALibration 15 14 13 Event Register Data QUEStionable CALibration Event 15 14 18 2110987654321 Enable Register To Data Questionable Status Register Bit 8 ck720a Chapter 3 Programming the Status Register System Status Groups Data Ouestionable Calibration Condition Register The Data Ouestionable Calibration Condition Register continuously monitors the calibration status of the signal generator Condition registers are read only Table 3 11 Data Ouestionable Calibration Condition Register Bits Bit Description 0 DCFM DC M Zero Failure A 1 in this bit indicates that the DCFM DC M zero calibration routine has failed This is a critical error The output of the source has no validity until the condition of this bit is 0 12 VO Calibration Failure A 1 in this bit indicates that the I Q modulation calibration experienced a failure 2 14 Unused These bits are always set to 0 15 Always 0 a On the E4428C this bit is set to 0 Query STATus QUEStionable CALibration CON
209. rator s USER MARKERS directory Marker files and the associated I Q waveform file have the same name NOTE If no marker file is provided the signal generator automatically creates a default marker file consisting of all zeros 6 Atthe ftp prompt type bye 7 Atthe Command Prompt type exit Example Programs Waveform Generation Using C The following program Metrowerks CodeWarrior 3 0 creates an I Q waveform and writes the data to a file on your PC Once the file is created you can use the file transfer protocol FTP or one of the waveform download programs to download the waveform data to the signal generator Refer to Downloads Using FTP on page 167 or Waveform Downloading Using C on page 170 for more information include lt iostream gt include lt fstream gt include lt math h gt include lt stdlib h gt using namespace std int main void ofstream out_stream write the I Q data to a file const unsigned int SAMPLES 200 number of sample pairs in the waveform 168 Chapter 4 Downloading and Using Files ARB Waveform Data Downloads const short AMPLITUDE 32000 amplitude between 0 and full scale dac value const double two pi 6 2831853 allocate buffer for waveform short iqData new short 2 SAMPLES need two bytes for each integer if iqData cout lt lt Could not allocate data buffer lt lt endl return 1 out_stream open IQ_data create a data fil
210. rbi and user nvarba 2 For volatile waveform memory the directory locations are user arbi and user arbg Loading files into the above directories does not actually store them in those directories Instead these directories function as pipes to the format translator The E443xB files are translated into 16 bit versions by appending 0 s to the least significant bit LSB and interleaving the data and stored in the regular waveform directories along with other new style waveform files Although the you can see the E443xB file names in the arbi arbq and nvarbi nvarbq directories these names are really pointers Refer to Types of Arbitrary Waveform Generator Memory on page 163 for more information on the new style directory structure SCPI Commands The signal generator automatically generates a marker file for downloaded E443xB waveform files The following commands will download E443xB waveform files into the signal generator Downloads to Waveform M emory Before downloading into volatile memory turn off the ARB by pressing Mode gt Dual ARB gt ARB Off On until Off is highlighted or send the SCPI command SOURce RADio ARB STATe OFF MMEM DATA ARBI file name I waveform data MMEM DATA ARBQ file name Q waveform data These commands download E443xB I Q waveform data into the signal generator s waveform memory The I waveform data and Q waveform data is the file format as described
211. resentation 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 ESGb is the binary I O 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 178 Chapter 4 Downloading and Using Files ARB Waveform Data Downloads Playing a Downloaded Waveform The following procedure shows you how to load and play a downloaded waveform file using front panel key presses and remote commands 1 Select the downloaded waveform file in non volatile waveform memory NVWFM and load it into volatile waveform memory WFM1 The file consists of both I O and marker file data and requires a SCPI command to load remotely Via the front panel a Press Mode gt Dual ARB gt Select Waveform gt Waveform Segments gt Load Store until Load is highlighted b Highlight the waveform file in the NVWFM catalog using the arrow keys or front panel knob c Press Load Segment From NVWFM Memory If the waveform is not highlighted use the cursor to highlight the waveform Via the remote interface send any
212. reset command RST is sent to the signal generator via the RS 232 Chapter 2 113 Programming Examples RS 232 Programming Examples interface and the power level will reset to the 135 dBm level The default attributes e g 9600 baud no parity 8 data bits 1 stop bit are used These attributes can be changed using VISA functions ff IMPORTANT Set the signal generator BAUD rate to 9600 for this test J RR RRR RR KK KKK IKK IKK I KK IKK IKK I KR IK kok o oko o oko kok o oko o oko oko k k oko kok k k kok k oko kok II I I include lt visa h gt include lt stdio h gt include StdAfx h include lt stdlib h gt include lt conio h gt void main int baud 9600 Set baud rate to 9600 printf Manually set the signal generator power level to 0 dBm n Serine n gt printf Press any key to continue n getch printf kn ViSession defaultRM vi Declares a variable of type ViSession for instrument communication on COM 2 port ViStatus viStatus 0 Opens session to RS 232 device at serial port 2 viStatus viOpenDefaultRM amp defaultRM viStatus viOpen defaultRM ASRL2 INSTR VI NULL VI NULL amp vi if viStatus If operation fails prompt user 114 Chapter 2 Programming Examples RS 232 Programming Examples printf Could not open ViSession n printf Check instruments and connections n printf n exit 0 initialize device viStatus viEnable
213. ress in PRAM Sample Command Line For example to burst a FIX4 data pattern of 1100 five times then turn the burst off for 32 data periods assuming a 1 bit symbol modulation format the command is MEMory DATA PRAM LIST 85 21 20 20 21 21 20 20 21 21 20 20 21 21 20 20 21 21 20 20 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 144 21 signifies data 1 burst on 1 20 signifies data 0 burst on 1 16 signifies data unspecified burst off 0 85 enables event trigger signifying the beginning of the data pattern 144 signifies data unspecified burst off 0 pattern repeat on 1 Querying the Waveform Data Use the following SCPI command line to determine whether there is a user defined pattern in the PRAM MEMory DATA PRAM Chapter 4 207 Downloading and Using Files Downloads Directly into Pattern RAM PRAM Dow nloading in Block Format NOTE Because there is no parsing block data format downloads are faster than list format downloads Data Reguirements and Limitations Summary 1 Data must be in binary form This reguirement is necessary as the baseband generator reads binary data from the data generator 2 For every bit of modulation data bit 0 you must provide 7 bits of control information bits 1 7 The signal generator processes data in 8 bit bytes Each byte contains 1 bit of data field information and 7 bits of
214. ring extern char optarg extern int optind opterr optopt PRORGAM DESCRIPTION getopt returns the next option letter in argv starting from argv 1 that matches a letter in optstring optstring is a string of recognized option letters if a letter is followed by a colon the Chapter 2 105 Programming Examples LAN Programming Examples option is expected to have an argument that may or may not be separated from it by white space optarg is set to point to the start of the option argument on return from getopt getopt places in optind the argv index of the next argument to be processed The external variable optind is initialized to 1 before the first call to the function getopt When all options have been processed i e up to the first non option argument getopt returns EOF The special option can be used to delimit the end of the options EOF is returned and is skipped FR RR IRR KR IRR IA AR IRR IA IIR IRR IR IIR k k k k IR kok kk k k kok k kkk k kk k finclude lt stdio h gt For NULL EOF include lt string h gt For strohr char optarg Global argument pointer int optind 0 Global argv index static char scan NULL Private scan pointer int getopt int argc char const argv const char optstring char c char posn optarg NULL if scan NULL scan 0O if optind 0 106 Programming Examples LAN Programming Examples
215. rmats it using the format string and stores the data in the argument list The parameter list includes the session id and string argument The NI 488 2 library function addresses the GPIB reads data bytes from the signal generator and stores the data into a specified buffer The parameter list includes the instrument address and session id The Agilent SICL function reads formatted data converts it and stores the results into the argument list The conversion is done using conversion rules for the format string The parameter list includes the instrument address formatted data to read and so forth 15 Getting Started Using LAN Using LAN The signal generator can be remotely programmed via a 10Base T LAN interface and LAN connected computer using one of several LAN interface protocols The LAN allows instruments to be connected together and controlled by a LAN based computer LAN and its associated interface operations are defined in the IEEE 802 2 standard See the IEEE website www ieee org for details on these standards The signal generator supports the following LAN interface protocols e VXLII Sockets LAN Telephone Network TELNET e File Transfer Protocol FTP VXI 11 and sockets LAN are used for general programming using the LAN interface TELNET is used for interactive one command at a time instrument control and FTP is for file transfer 1 Selecting I O Libraries for LAN The TELNET and FTP protocols do
216. rse of the sampling rate FS The sampling rate is equal to the symbol rate multiplied by the oversample ratio For example the GSM symbol rate is 270 83 ksps With an oversample ratio of 4 the sampling rate is 1083 32 kHz and At inverse of FS is 923 088 nsec Downloading FIR Filter Coefficient Data The ESG stores the FIR files in the FIR USER FIR directory which utilizes non volatile memory Use the following SCPI command line to download FIR filter coefficients from the PC to the signal generator s FIR memory Chapter 4 201 Downloading and Using Files FIR Filter Coefficient Downloads MEMory DATA FIR lt file_name gt osr coefficient coefficient Use the following SCPI command line to query list data from FIR memory MEMory DATA FIR lt file name gt Sample Command Line The following SCPI command will download a typical set of FIR filter coefficient values and name the file FIR1 MEMory DATA FIR FIR1 4 0 0 0 0 0 0 000001 0 000012 0 000132 0 001101 0 006743 0 030588 0 103676 0 265790 0 523849 0 809508 1 1 0 809508 0 523849 0 265790 0 103676 0 030588 0 006743 0 001101 0 000132 0 000012 0 000001 0 0 0 0 0 FIR1 assigns the name FIRI to the associated OSR over sample ratio and coefficient values The file is then represented with this name in the FIR File catalog 4 specifies the oversample ratio 0 0 0 0 0 0 000 0 0 00001 represent FIR filter coefficients Selecting a Do
217. ry File Data Dow nloads Data Limitations Maximum selectable file sizes are directly proportional to the available memory space and the signal generator s pattern RAM size For example Option 001 601 can accommodate up to 1 megabyte of source data Option 002 4 MB Option 602 8 MB To determine the maximum user file size you must consider the following framing overhead e pattern RAM storage size Option 001 601 8 megawords Option 002 32 megawords or Option 602 64 megawords available memory You may have to delete files from memory before downloading larger files Data Volatility The signal generator provides two data storage areas volatile waveform memory WFM1 and non volatile memory NVWFM Data stored in volatile waveform memory cannot be recovered if it is overwritten or if the power is cycled Data stored in non volatile memory however remains until you delete the file The Option 005 signal generator s hard disk provides one gigasample of non volatile storage Signal generators without Option 005 provide 3 megasamples of non volatile storage NOTE References to pattern RAM PRAM are for descriptive purposes only relating to the manner in which the memory is being used PRAM and volatile waveform memory WFM1 actually utilize the same storage media User Files as Data Source for Framed Transmission Specifying a user file as the data source for a framed transmission provides you with an easy method
218. s OPERat ion BASeband ENABle Response Decimal value of the sum of the bits previously enabled with the STATus OPERation BASeband ENABle lt value gt command 140 Chapter 3 Programming the Status Register System Status Groups Data Ouestionable Status Group NOTE Some of the bits in this status group do not apply to the E4428C and will return a zero when gueried See Table 3 7 on page 142 for more information The Data Ouestionable Status Group is used to determine the specific event that set bit 3 in the Status Byte Register This group consists of the Data Ouestionable Condition Register the Data Ouestionable Transition Filters negative and positive the Data Ouestionable Event Register and the Data Ouestionable Event Enable Register Unused Unused Unused POWer summary TEMPerature OVEN COLD FREQuency summary Unused MODulation summary CALibration summary SELFtest Unused Unused BERT summary Unused Unused Always Zero 0 Rata auEstonable 15 14 13 12 11109876543 210 E l j y V VY Y vvv vv v v v Yi ata QUEStionable Positive 15 14 13 12 4 1009 87654 32 10 Transition Filter Y Y VY Yvvettvev vi Data QUEStionable Negative 15 14 13 12 11109 87 654 3 21 0 Transition Filter Y Y d ivit vt viii pate ego De 15 44 13 12 11009876543 2 1 0 Data QUEStionable Event Enable Register 15 14 13 12 11 109 87 654 3 21 0 To Status Byte Register Bit 3 ck722k
219. s the user for an action Backup State Files Restore State Files or Ouit The Backup State Files choice reads the signal generator s state files and stores it on your computer in the same directory where the State Files exe program is located The Restore State Files selection downloads instrument state files stored on your computer to the signal generator s State directory The Ouit selection exists the program The figure below shows the console interface and the results obtained after selecting the Restore State Files operation The program uses VISA library functions Refer to the Agilent VISA User s Manual available on Agilent s website http www agilent com for more information on VISA functions The program listing for the State_Files cs program is shown below It is available on the CD ROM in the programming examples section under the same name C WINNT Microsoft NET Pramework v1 1 4922 State Pilesl exe C and Microsoft NET Framework The Microsoft NET Framework is a platform for creating Web Services and applications There are three components of the NET Framework the common language runtime class libraries and Active Server Pages called ASP NET Refer to the Microsoft website for more information on the NET Framework The NET Framework must be installed on your computer before you can run the State_Files program The framework can be downloaded from the Microsoft website and then installed on your computer
220. sc exe and State File programs 3 Onthe command line enter csc State File cs 4 Follow the prompts in the program to save and recall signal generator instrument states Visual Basic is a registered trademark of M icrosoft corporation 38 Chapter 2 Programming Examples GPIB Programming Examples GPIB Programming Examples Interface Check using Agilent BASIC on page 40 Interface Check Using NI 488 2 and C on page 41 Interface Check using VISA and C on page 42 Local Lockout Using Agilent BASIC on page 43 Local Lockout Using NI 488 2 and C on page 45 Oueries Using Agilent BASIC on page 46 Oueries Using NI 488 2 and C on page 48 Oueries Using VISA and C on page 51 Generating a CW Signal Using VISA and C on page 53 Generating an Externally Applied AC Coupled FM Signal Using VISA and C on page 56 Generating an Internal AC Coupled FM Signal Using VISA and C on page 58 Generating a Step Swept Signal Using VISA and C on page 60 Saving and Recalling States Using VISA and C on page 62 Reading the Data Questionable Status Register Using VISA and C on page 65 Reading the Service Request Interrupt SRQ Using VISA and C on page 69 Before Using the Examples If the Agilent GPIB interface card is used then the Agilent VISA library should be installed along with Agilent SICL If the National Instruments PCI GPIB interface card is used the NI VISA library along with
221. sly repeating user files without discontinuities both data patterns must be repeated four times Therefore user file 1 contains 456 bits and user file 2 contains 592 bits Each user file will then create exactly four frames in pattern RAM 194 Chapter 4 Downloading and Using Files User Bit Binary File Data Dow nloads When two or more user files generate different numbers of complete frames the user files will repeat on different cycles All user files will restart when the user file that generates the largest number of frames repeats For example user file 1 needs four frames to completely transmit its data and user file 2 needs only three User file 2 will repeat after the third frame and again when user file 1 repeats See Figure 4 3 If these were integer multiples of each other both user files would be continuous and user file 2 would repeat after two frames Figure 4 3 Repeating Different Length User Files User File 1 User File 1 Re starts Re starts User File 2 User File 2 Re starts Re starts User File 2 User File 2 Re starts Re starts Downloading User File Data This section includes information that explains how to download user file data It includes data requirements and limitations preliminary setup SCPI commands and sample command lines for both downloads to bit memory and binary memory Data Requirements and Limitations Summary 1 Data must be binary Bit length must be a multiple of the data fie
222. ssible Cause Pattern reset bit not set The transmitted pattern is interspersed with random Insure that the pattern reset bit bit 7 value 128 is set on the last byte unwanted data of your downloaded data PRAM download exceeds the size of PRAM memory ERROR 223 Too much data Either use a smaller pattern or get more memory by ordering the appropriate hardware option 224 Chapter 4 Downloading and Using Files Data Transfer Troubleshooting Data Reguirement Reminders To avoid direct download to PRAM problems the following conditions must be met 1 The data must be in binary form 2 For every bit of modulation data bit 0 you must provide 7 bits of control information bits 1 7 Bit Function Value Comments 0 Data 0 1 This bit is the data to be modulated This bit is unspecified when burst bit 2 is set to 0 1 Reserved 0 Always 0 2 Burst 0 1 Set to 1 RF on Set to 0 RF off For non bursted non TDMA systems this bit is set to 1 for all memory locations leaving the RF output on continuously For framed data this bit is set to 1 for on timeslots and 0 for off timeslots 3 Reserved 0 Always 0 4 Reserved 1 Always I 3 Reserved 0 Always 0 6 Event 1 Output 0 1 Setting this bit to 1 causes a level transition at the EVENT 1 BNC connector This can be used for many functions For example as a marker output to trigger external hardware when the data pattern
223. stored or downloaded to binary memory are converted to bit files prior to editing in the Bit File Editor Afterward these modified files from binary memory are stored in bit memory as bit files Bit memory is the preferred for user file downloads SCPI Commands MMEM DATA lt file name gt lt datablock gt Send this command to download the user file data into the signal generator s binary memory The variable lt file_name gt denotes the name that will be associated with the downloaded user file stored in the signal generator Sample Command Line MMEM DATA file_name ABC file_name the name of the user file stored in the signal generator s memory A the number of decimal digits to follow in B B a decimal number specifying the number of data bytes in C the binary user file data Chapter 4 197 Downloading and Using Files User Bit Binary File Data Dow nloads Example MMEM DATA file_name 1912S407897 file_name provides the user file name as it will appear in the signal generator s binary memory catalog 1 defines the number of decimal digits to follow in B 9 denotes how many bytes of data are to follow 12S407897 the ASCII representation of the data that is downloaded to the signal generator This variable is represented by C in the sample command line Querying the Waveform Data Use the following SCPI command line to query user file data from binary memory M
224. system Type quit or bye to end your FTP session Type exit to end the command prompt session Chapter 1 27 Getting Started Using RS 232 Using RS 232 The RS 232 serial interface can be used to communicate with the signal generator The RS 232 connection is standard on most PCs and can be connected to the signal generator s rear panel connector using the cable described in Table 1 13 on page 29 Many functions provided by GPIB with the exception of indefinite blocks serial polling GET non SCPI remote languages and remote mode are available using the RS 232 interface The serial port sends and receives data one bit at a time therefore RS 232 communication is slow The data transmitted and received is usually in ASCII format with SCPI commands being sent to the signal generator and ASCII data returned 1 Selecting I O Libraries for RS 232 The I O libraries can be downloaded from the National Instrument website www ni com or Agilent s website www agilent com The following is a discussion on these libraries Agilent BASIC The Agilent BASIC language has an extensive I O library that can be used to control the signal generator over the RS 232 interface This library has many low level functions that can be used in BASIC applications to control the signal generator over the RS 232 interface VISA VISA is an I O library used to develop I O applications and instrument drivers that comply with industry standards It is recomme
225. t according to the configuration selected For inactive off timeslots burst control bits are set to 0 and data is unspecified Pattern reset is set to 1 for the last byte in PRAM causing the pattern to repeat after the last byte is read NOTE The data in PRAM is static Firmware writes to PRAM once for the configuration selected and the hardware reads this data repeatedly Firmware overwrites the volatile PRAM memory to reflect the desired configuration only when the data source or mode digital communications format is changed Take for example transmitting a 228 bit user file for timeslot 1 TS1 in a normal GSM transmission Per the standard a GSM normal channel is 156 25 bits long with two 57 bit data fields 114 bits total per timeslot and 42 bits for control or signalling purposes NOTE Compliant with the GSM standard which specifies 156 25 bit timeslots the signal generator uses 156 bit timeslots and adds an extra guard bit every fourth timeslot 192 Chapter 4 Downloading and Using Files User Bit Binary File Data Dow nloads The 7 remaining timeslots in the GSM frame are off The user file will completely fill timeslot 1 in two consecutive frames and will then repeat See Figure 4 2 Figure 4 2 Mapping User File Data to a Single Timeslot 228 bit User File 114bits 114bits Amplitude TSO TS1 TS2 TS3 TS4 TS5 TS6 TS7 TS0 TS1 TS2 TS3 TS4 TS5 TS6 TS7 j TSO TS1 TS2 Frame 1 Frame 2 Frame 1 Time
226. t error has occurred Device dependent errors have SCPI error numbers from 399 to 300 and 1 to 32767 4 Execution Error A 1 in this bit position indicates that an execution error has occurred Execution errors have SCPI error numbers from 299 to 200 5 Command Error A 1 in this bit position indicates that a command error has occurred Command errors have SCPI error numbers from 199 to 100 6 User Reguest Key Local A 1 in this bit position indicates that the Local key has been pressed This is true even if the signal generator is in local lockout mode 7 Power On A 1 in this bit position indicates that the signal generator has been turned off and then on Ouery ESR Response The decimal sum of the bits set to 1 Example The decimal value 136 is returned The decimal sum 128 bit 7 8 bit 3 Standard Event Status Enable Register The Standard Event Status Enable Register lets you choose which bits in the Standard Event Status Register set the summary bit bit 5 of the Status Byte Register to 1 134 ESE lt data gt lt data gt is the sum of the decimal values of the bits you want to enable Example To enable bit 7 and bit 6 so that whenever either of those bits is set to 1 the Standard Event Status summary bit of the Status Byte Register is set to 1 Send the command ESE 192 128 64 Query ESE Response Decimal value of the sum of the b
227. t the typed address or hostname matches the IP address or hostname assigned to the signal generator in the System Utility gt GPIB RS 232 LAN gt LAN Setup menu Ping each node along the route between your workstation and the signal generator starting with your workstation If a node doesn t respond contact your IT administrator If the signal generator still does not respond to ping you should suspect a hardware problem Intermittent Response If you received 1 to 8 packets back there maybe a problem with the network In networks with switches and bridges the first few pings may be lost until the these devices learn the location of hosts Also because the number of packets received depends on your network traffic and integrity the number might be different for your network Problems of this nature are best resolved by your IT department Chapter 1 19 Getting Started Using LAN Using VXI 11 The signal generator supports the LAN interface protocol described in the VXI 11 standard VXI 11 is an instrument control protocol based on Open Network Computing Remote Procedure Call ONC RPC interfaces running over TCP IP It is intended to provide GBIB capabilities such as SRO Service Request status byte reading and DCAS Device Clear State over a LAN interface This protocol is a good choice for migrating from GPIB to LAN as it has full Agilent VISA SICL support See the VXI website www vsi org for more i
228. ter list to output data This function formats according to the format string and sends data to the device The parameter list describes the session id and data to send NI 488 2 Library The NI 488 2 library function addresses the GPIB and writes data to the signal generator The parameter list includes the instrument address session id and the data to send SICL The Agilent SICL function converts data using the format string The format string specifies how the argument is converted before it is output The function sends the characters in the format string directly to the instrument The parameter list includes the instrument address data buffer to write and so forth Enter Function The Agilent BASIC function ENTER reads formatted data from the signal generator Other I O libraries use similar functions to read data from the signal generator Table 1 11 Agilent BASIC VISA NI 488 2 Agilent SICL 10 ENTER 719 viScanf parameter list ibrd parameter list iscanf parameter list Agilent BASIC The function ENTER 719 puts the signal generator into remote mode makes it a talker and assigns data or status information to a designated variable 14 Chapter 1 VISA Library NI 488 2 Library SICL Chapter 1 Getting Started Using GPIB The VISA library uses the viScanf function and an associated parameter list to receive data This function receives data from the instrument fo
229. tfi Xm s exit 0 Set timeout for 5 seconds viSetAttribute instr VI ATTR TMO VALUE 5000 Asks for sig gen ID string status viWrite instr ViBuf IDN n 6 amp retCount Reads the sig gen response status viRead instr ViBuf buffer MAX COUNT amp retCount buffer retCount 0 Indicates the end of the string printf Signal Generator ID Prints header for ID printf buffer Prints the ID string to the screen printf n Prints carriage return Flush the read buffer Sets sig gen power to 5dbm status viWrite instr ViBuf POW AMPL 5dbm n 15 amp retCount Querys the sig gen for power level status viWrite instr ViBuf POW n 5 amp retCount Read the power level status viRead instr ViBuf buffer MAX COUNT amp retCount buffer retCount 0 Indicates the end of the string printf Power level Prints header to the screen printf buffer Prints the queried power level printf Xn s status viClose instr Close down the system status viClose defaultRM return 0 118 Chapter 2 3 Programming the Status Register System This chapter provides the following major sections Overview on page 120 Status Register Bit Values on page 123 Accessing Status Register Information on page 124 Status Byte Group on page 129 Status Groups on page 132 119 Programming the Status Register System Overview Ov
230. the Agilent IO Libraries version M and earlier and is supported on all platforms except Windows NT If you are using the Windows NT platform refer to the section on Windows NT on page 4 The Agilent IO Libraries Suite is available on the Automation Ready CD that is shipped with your signal generator The libraries can also be downloaded from the Agilent website hitp www agilent com Once the Chapter 1 3 Getting Started Introduction to Remote Operation libraries are loaded you can use the Agilent Connection Expert Interactive IO or VISA Assistant to configure and communicate with the signal generator over a variety of I O interfaces Follow instructions in the setup wizard to install the libraries on your computer IMPORTANT The VXI 11 SCPI service must be enabled before you can communicate with the signal generator over the LAN interface Go to the Utility gt GPIB RS 232 LAN gt LAN Services Setup menu and enable turn On the VXI 11 SCPI service Refer to the Agilent IO Libraries Suite Help documentation for details on the features available with this software Windows NT You must use Agilent IO Libraries version M or earlier if you have the Windows NT platform The libraries can be downloaded from the Agilent website http www agilent com NOTE The following sections are specific to Agilent IO Libraries versions M and earlier and apply only to the Windows NT platform 10 Config Program After installing the Agile
231. the NI 488 2 library should be installed Refer to 2 Selecting I O Libraries for GPIB on page 9 and the documentation for your GPIB interface card for details NOTE Agilent BASIC addresses the signal generator at 719 The GPIB card is addressed at 7 and the signal generator at 19 The GPIB address designator for other libraries is typically GPIBO or GPIBI Chapter 2 39 Programming Examples GPIB Programming Examples Interface Check using Agilent BASIC This simple program causes the signal generator to perform an instrument reset The SCPI command RST places the signal generator into a pre defined state and the remote annunciator R appears on the front panel display The following program example is available on the ESG Documentation CD ROM as basicex 1 txt 10 20 30 40 50 60 70 80 90 00 10 20 30 40 50 60 70 80 90 200 210 220 230 240 250 260 270 40 V ok ck ck ck kk kk Ck kk Ck kk Ck X A X XX AX X A X A X AX X A X AX X A X AXA X A X A X AX ko ko Sk ko ko k ko k Sk ko k k ko ko k ck ko ko ko PROGRAM NAME basicexl txt PROGRAM DESCRIPTION This program verifies that the GPIB connections and interface are functional Connect a controller to the signal generator using a GPIB cable CLEAR and RESET the controller and type in the following commands and then RUN the program o oko ok kk kk Ck Ck XZ A Ck Ck kk Ce kk kk Ce kk kk
232. the hardware allows 64 for Real Time and 512 for ARB will not be selectable for that configuration 228 Chapter 4 Downloading and Using Files Data Transfer Troubleshooting ARB Waveform Data Dow nload Problems Table 4 8 1 Q Waveform Data Download Trouble Symptoms and Causes Symptom Possible Cause ERROR 224 Text file busy Attempting to download a waveform that has the same name as the waveform currently being played by the signal generator To solve the problem either change the name of the waveform being downloaded or turn off the ARB ERROR 321 Out of memory There is not enough space in the ARB memory for the waveform file being downloaded To solve the problem either reduce the file size of the waveform file or delete unnecessary files from ARB memory No RF Output If no user marker file is provided then a default marker file containing all Zeros is created If the signal generator s Mrk 2 to RF Blank softkey is set to on the RF will be blanked Go to MODE Dual ARB ARB Setup and toggle Mrk 2 to RF to off Data Requirement Reminders To avoid I Q waveform data download problems the following six conditions must be met Data must be in signed 2 s complement binary format Data must ordered MSB first to LSB last Each I Q sample has 4 bytes of data 2 3 Input integers must be between 32768 and 32767 4 Each I and Q waveform file must have at least 60 sampl
233. to multiplex real data into internally generated TDMA framing The user file will fill the data fields of the active timeslot in the first frame and continue to fill the same timeslot of successive frames as long as there is more data in the file This functionality allows a communications system designer to download and modulate proprietary data sequences specific PN sequences or simulate multiframe transmission such as those specified by some mobile communications protocols As the example in the following figure shows a GSM multiframe transmission requires 26 frames for speech Chapter 4 191 Downloading and Using Files User Bit Binary File Data Dow nloads Figure 4 1 GSM Multiframe Transmission SuperFrame 51 MultiFrames 1 657 500 bits 6 12 s Speech MultiFrame TCH 26 Frames 32 500 bits 120 ms l Frame 8 Timeslots 1250 bits 4 615 ms T50 ret bia TT TS4 TS5 rss s 156 25 bits 576 92 us Tail Data Control Control Data Tail Guard Bits Field 1 Bit Bit Field 2 Bits Period Midamble When a user file is selected as the data source for a framed transmission the signal generator s firmware loads PRAM with the framing protocol of the active TDMA format For all addresses corresponding to active on timeslots burst bits are set to 1 and data bits are set with the contents of the user file for the data fields of the timeslot Other bits are se
234. tthe command prompt cd to the directory containing the lanio exe file and then to the Debug folder For example C SocketIO Lanio Debug 80 Chapter 2 Programming Examples LAN Programming Examples 5 After you cd to the directory where the lanio exe file is located type in the following command at the command prompt lanio xxxxx IDN For example C NSocketlONLanioNDebug lanio xxxxx IDN where the xxxxx is the hostname of your signal generator Use this format to output SCPI commands to the signal generator in a line by line format from the command prompt 6 Type exit at the command prompt to quit the program Programming Using main1 Function The int mainl function will output a sequence of commands in a program format If you want to run a program using a sequence of commands then perform the following 1 Enter the hostname of your signal generator in the openSocket function of the main1 function of the lanio cpp program 2 Rename the lanio cpp int main1 function to int main and the original int main function toint mainl 3 Select Rebuild All from Build menu Then select Execute Lanio exe The program will run and display the results as shown in Figure 2 1 Figure 2 1 Program Output Screen _ C GPIB Test lanio Debug Lanio exe ID Agilent Technologies E8254A US00000001 C 01 00 Frequency 2 5000000000000E 09 Power Level 5 00000000E 000 Press any key to continue c
235. ty viClear vi Clears the signal generator Prints user information printf Programming example to demonstrate reading the signal generator s Status Byte n printf nT printf Manually set up the sig gen for an unleveled output condition n printf Set signal generator output amplitude to 20 dBm n printf Set frequency to maximum value n printf Turn On signal generator s RF Output n printf Check signal generator s display for the UNLEVEL annuniator n printf n printf Press Enter when ready n printfi Xn getch Waits for keyboard user input viPrintf vi STAT QUES POW ENAB 2n Enables the Data Questionable Power Condition Register Bits Bits 0 and 1 viPrintf vi STAT QUES POW COND Mn Querys the register for any 66 Chapter 2 Programming Examples GPIB Programming Examples set bits viScanf vi s rdBuffer Reads the decimal sum of the set bits num int rdBuffer 1 0 Converts string data to numeric switch num Based on the decimal value case 1 printf Signal Generator Reverse Power Protection Tripped Win printfi m s break case 2 printf Signal Generator Power is Unleveled n printf TnT break default printf No Power Unleveled condition detected n printcE n viClear vi Clears the signal generator Prints user information printf 5 S 5 S S 5 S
236. uence m Groups 1 ToString 216 Chapter 4 Downloading and Using Files Saving and Recalling Instrument State Files string register m Groups 2 ToString Console WriteLine Restoring sequence sequence register register Save the target instrument s current state to the specified sequence register pair This ensures the index file has an entry for the specified sequence register pair This workaround will not be necessary in future revisions of firmware WriteDevice device SAV register sequence An true lt lt on SAME line Overwrite the newly created state file with the state file that is being restored WriteDevice device MEM DATA USER STATE m ToString false lt lt on SAME line WriteFileBlock device fi Name WriteDevice device n true This method reads out all the sequence register state files from the signal generator and stores them in your computer s local directory with a STA extension static public void BackupInstrumentState uint device Get the memory catalog for the state directory WriteDevice device MEM CAT STAT n false string catalog ReadDevice device Match the catalog listing for state files which are named seguencef registerf e g 0 01 1 01 2 05 Chapter 4 217 Downloading and Using Files Saving and Recalling Instrument State Files Match m Regex Match catalo
237. uest Interrupt SRO Using VISA and C nn 69 LAN Programming Examples ii edidi edcsekqicicie dabei dtto bob k brk er RRA EEN banco dr 74 Betore Using the Examples 82s ae kk ecko eee Oe deka dd desi d da 74 NKE TOS de pen ko ke band bd ed lind e bp be ei dde ho dees 74 Sockets LAN Programming Bang C zim ur kA cr IRR eects eda t ewes Bo d 29 sockets LAN Programming Using PERL 2 0 cs401 08 4254440544069 o 8 o k eR dle 108 Sockets LAN Programming Using JAVA 25 20scseac ve sec er eons ER ERE RR 109 B5232 Prosta BxatnplEs 5x56 868 kA cress daddy bbe Sade SRE SELES EEN 112 Betore Using he PEXSImples sre osobne qiurd Rd ESR ERER e REEE EEES 112 internace Check Using Agent BASIC Lisssetusek Rr am REA DREESIERAERE RAE SCARE AREE de 112 Interface Check Using VISA and Uii sss eger bbs RR RE RIPE SER e di HR OR Rb E N 113 Queries Using Amlent BASIC z cinch tht dek d d sn dd qe TAREE RED CE RES 115 Queries Using VISA amd 4 obvo bd ERR ELEPRA Beko ii Re RR BOR ok k Ed ERR dd ok Bb 116 3 Programming the Status Register System isse n n n n nn n n nn nns LLY alc ca rrr 120 status Register Bit Vales 3 454 hore reed Xa C REA AER VR ORE E CE E Pa e ede 123 Accessing Stejn Register Hotinatloll uoo ri itrenn NAREN EEE bob BOR de EE ARR EURO 124 Determining Whatta Monitor ues eese tem 4s OA ORO GER OR odb d SEM led rA OH 124 Deciding How To Monk cioe se n eeu edche donee Adk Eda REA CESARE RE ws 125 Sites Resister
238. ulation and turn on the RF output Via the front panel 1 Press Frequency gt 2 5 gt GHz Sets the signal generator frequency to 2 5 Ghz 2 Press Amplitude gt 10 gt dBm Sets the signal generator power to 10 dBm 3 Press Mod On Off until the display annunciator reads MOD ON 4 Press RF On Off until the display annunciator reads RF ON Via the remote interface Send the following SCPI commands to modulate and activate the carrier 1 Set the carrier frequency to 2 5 Ghz SOURCe FREQuency FIXed 2 5GHZ 2 Set the carrier power to 10 0 dBm SOURce POWer LEVel IMMediate AMPLitude 10 0DBM 3 Activate the modulation OUTPut MODulation STATe ON 4 Activate the RF output OUTPut STATe ON 204 Chapter 4 Downloading and Using Files Downloads Directly into Pattern RAM PRAM Downloads Directly into Pattern RAM PRAM NOTE This feature is available only in E4438C ESG Vector Signal Generators with Option 001 601 or 002 602 Typically the signal generator s firmware generates the required data and framing structure and loads this data into Pattern RAM PRAM The data is read by the baseband generator which in turn is input to the I Q modulator The signal generator can also accept data downloads directly into PRAM from a computer Programs such as MATLAB or MathCad can generate data which can be downloaded directly into PRAM in either a list format or a block format Direct downl
239. ut LOCAL Sig gen Places the signal generator in local mode REMOTE Sig gen Places the signal generator in remote mode CLEAR SCREEN Clears the controllers display OUTPUT Sig gen RST Places the signal generator in a defined state The following print statements are user prompts PRINT The signal generator should now be in remote PRINT Verify that the R and L annunciators are visable PRINT nun Press Continue PAUSE LOCAL LOCKOUT 7 Puts the signal generator in LOCAL LOCKOUT mode PRINT Prints user prompt messages PRINT Signal generator should now be in LOCAL LOCKOUT mode PRINT Verify that all keys including Local except Contrast keys have no effect PRINT PRINT 9 ne Press Continue PAUSE PRINT LOCAL 7 Returns signal generator to Local control The following print statements are user prompts PRINT Signal generator should now be in Local mode Chapter 2 Programming Examples GPIB Programming Examples 360 PRINT 370 PRINT Verify that the signal generator s front panel keyboard is functional 380 PRINT 390 PRINT To re start this program press RUN 400 END Local Lockout Using NI 488 2 and C This example uses the NI 488 2 library to set the signal generator local lockout mode Launch Microsoft Visual C 6 0 add the reguired files and enter the following code into your cpp source file The following program example is available on the ESG Documentation CD RO
240. ute constants public enum VisaAttribute Chapter 4 221 Downloading and Using Files Saving and Recalling Instrument State Files SendEndEnable Ox3FFF0016 TimeoutValue Ox3FFF001A This class provides a way to call the unmanaged Agilent IO Library VISA C functions from the C application public class VisaInterop DllImport agvisa32 dll EntryPoint viClear public static extern int Clear uint session DllImport agvisa32 dll EntryPoint viClose public static extern int Close uint session DllImport agvisa32 dll EntryPoint viFindNext public static extern int FindNext uint findList byte desc DllImport agvisa32 dll EntryPoint viFindRsrc public static extern int FindRsrc uint session string expr out uint findList out uint retCnt byte desc DllImport agvisa32 dll EntryPoint viGetAttribute public static extern int GetAttribute uint vi VisaAttribute attribute out uint attrState DllImport agvisa32 dll EntryPoint viOpen 222 Chapter 4 Downloading and Using Files Saving and Recalling Instrument State Files public static extern int Open uint session string rsrcName VisaAccessMode accessMode uint timeout out uint vi DllImport agvisa32 dll EntryPoint viOpenDefaultRM public static extern int OpenDefaultRM out uint session DllImport agvisa32 dll EntryPoint viRead public static extern int Rea
241. ve the lanio c program 4 At the UNIX prompt type cc Aa O o lanio lanio c 5 At the UNIX prompt type lanio The program will run and output a sequence of SCPI commands to the signal generator The UNIX display will show a display similar to the following unix machine users mydir lanio ID Agilent Technologies E4438C US70000001 C 02 00 Frequency 2 5000000000000E 09 Power Level 5 00000000E 000 Sockets on Windows In Windows the routines send and recv must be used since fread and fwrite may not work on sockets The following steps outline the process for running the interactive program in the Microsoft Visual C 6 0 environment 1 Rename the lanio c to lanio cpp and getopt c to getopt cpp and add them to the Source folder of the Visual C project NOTE The int main function in the lanio cpp file will allow commands to be sent to the signal generator in a line by line format the user types in SCPI commands The int main1 0 function can be used to output a seguence of commands in a program format See Programming Using main1 Function below 2 Click Rebuild All from Build menu Then Click Execute Lanio exe The Debug window will appear with a prompt Press any key to continue This indicates that the program has compiled and can be used to send commands to the signal generator 3 Click Start click Programs then click Command Prompt The command prompt window will appear 4 A
242. veform memory and sets 31 additional control bits depending upon the operating mode regardless of whether framed or unframed transmission is selected In this manner user files are mapped into waveform memory bit by bit where each bit is represented by a 32 bit word If the bit rate exceeds 50 Mbps the user data is written to memory one symbol per 32 bit word rather than one bit per 32 bit word This is generally referred to as parallel mode Chapter 4 189 Downloading and Using Files User Bit Binary File Data Dow nloads Bit Memory and Binary Memory User files can be downloaded to the bit memory or binary memory Bit memory accepts data in integer number of bits up to the maximum available memory The data length in bytes for files downloaded into bit memory is egual to the number of significant bits plus 7 divided by 8 then rounded down to the nearest integer plus 8 bytes for the file header You must have enough bytes to contain the bits you specify If the number of bits is not a multiple of 8 the least significant bits of the last byte will be ignored Bit memory provides more versatility and is the preferred memory for user file downloads Binary memory reguires data formatted in 8 bit bytes Files stored or downloaded to binary memory are converted to bit files prior to editing in the bit file editor Afterward these modified files from binary memory are stored in bit memory as bit files Data Reguirements 1 Data must be
243. wnloaded User FIR Filter as the Active Filter FIR Filter Data for TDMA Format The following front panel key presses or remote commands will select user FIR filter data as the active filter for a TDMA modulation format Via the front panel 1 Press Mode gt Real Time TDMA gt desired format gt M odify Standard gt Filter gt Select gt User FIR 2 Highlight the desired file in the catalog of FIR files 3 Press Select File To activate the TDMA format press Mode gt Real Time TDMA gt desired format and toggle the format on 202 Chapter 4 Downloading and Using Files FIR Filter Coefficient Dow nloads Via the remote interface SOURce RADio lt desired format gt FILTer lt file name gt This command selects the user FIR filter specified by the file name as the active filter for the TDMA modulation format After selecting the file activate the TDMA format with the following command SOURce RADio lt desired format gt STATe On FIR Filter Data for Custom M odulation The following front panel key presses or remote commands will select user FIR filter data as the active filter for a custom modulation format Via the front panel 1 Press Mode gt Custom gt Real Time IQ Baseband gt Filter gt Select gt User FIR 2 Highlight the desired file in the catalog of FIR files 3 Press Select File To activate the custom modulation press Mode gt Custom gt Real Time IQ Baseband gt Custom Off On and

Download Pdf Manuals

image

Related Search

Related Contents

LM80WD Cover.qxp  Troubleshooting guide · TC models  Operating Instructions Operating Instructions Operating Instructions  Massive Ceiling light 30192/31/10    Repetidores serie X cat+ílogo  Sunbeam Bedding HE2300 User's Manual  TOR PICO 取扱説明書 TOR  Epson ActionDesk 4000 User's Manual    

Copyright © All rights reserved.
Failed to retrieve file