Download Agilent Technologies 8753ET User`s guide
Transcript
Programming Examples Report Generation Examples Example 7C: Printing with the Parallel Port This program will select the parallel port and program the analyzer to copy its display to a printer. There are a number of commands associated with the serial and parallel ports which allow you to configure output modes such as the baud rate and the handshake type used by the port and the printer. In this example, the parallel port is configured by the program. The interface may also be configured from the analyzer’s front-panel keys by pressing Local SET ADDRESSES PRINTER PORT . This menu allows manual selection of the parallel-interface parameters. Since the GPIB port is not being used for the copy operation, programming of the analyzer and measurement operations may continue once the copy operation has been initiated. An internal spooler in the analyzer’s memory provides buffering of the printer operation. In the example which follows, the status byte of the analyzer is checked to determine when the print operation is complete. • An I/O path is assigned to the analyzer. • The analyzer is initialized. • A single sweep is taken and the analyzer is placed in hold mode. • The status registers are cleared. • The copy-complete bit is set and enabled. • The printer operation and communication modes are set. • The print command is sent. • The analyzer is released from remote control and placed in continuous-sweep mode. • The analyzer is polled until the status bit representing copy complete is detected. • The analyzer is released from remote control and the program ends. Running the Program Run the program. The analyzer is initialized, set to single-sweep mode, and a sweep is taken. The program sets the system up to print the analyzer's display to a printer connected to the parallel port. At this time, the analyzer can continue making measurements as printer prints the display. When the analyzer display has finished printing, the controller displays the message: “DONE”, the analyzer is released from GPIB control, and the program ends. BASIC Program Listing 10 20 30 40 50 60 70 80 90 100 110 ! This program shows how to set up and print the display through the ! parallel printer port. ! ! EXAMP7C ! ASSIGN @Nwa TO 716 ! Assign an I/O path for the analyzer ! CLEAR SCREEN ! Initialize the analzyer without preset to preserve the data ABORT 7 ! Generate an IFC (Interface Clear) CLEAR @Nwa ! SDC (Selected Device Clear) Chapter 7 7-107
Related documents