Lab 5 – Serial Poll Bytes - Device Status – Function Generator

 I. Objective:

To give the student a lesson in the use of serial poll bytes/status bits and how to monitor and control the status bytes to monitor instrument events and status.

II. Procedure:

In this lab, you will monitor the status of the Function Generator and report the status to the User using a VI. The VI must

  1. Monitor the Status byte and display this information on the VI front panel as a series of LED lights and String indicators. You are REQUIRED to use the ARRAY data format for the status byte.
  2. In your implementation of the reading of the status, think about how often and where in the VI's logic sequence you should check the status of the instrument. Clearly, checking it too often slows down the VI execution while not checking it often enough may result in missing a critical instrument error. There is a discussion question below pertaining to this question.
  3. To test this VI, send the instrument various commands (change waveform type, amplitude, etc.) using the interactive GPIB windows program. Make sure that you send a BAD command or an OUT OF RANGE parameter. Eg. Send it the "WHATSHOULDIDO?" command, and the instrument should generate a command error. Send it a "VOLT 10000" command and you should generate a command error –222.
  4. Make sure that you appropriately clear the status byte so that NEW errors can be reported.

Additional information and a copy of this lab is located at:

http://www.njit.edu/Directory/Centers/OPSE

Submit the created VI or VIs by attaching them to an e-mail document that contains the answers to the discussion questions below. (Note that you can either attach the VI or zip the VIs by using WinZIP). E-mail the answers to the discussion questions and the VI or VIs to:

gnita@njit.edu

III. Discussion:

  1. In a more sophisticated version of this lab, if a DATA OUT OF RANGE status condition is detected by the VI, what action should the VI take? Eg. warn the user? Change the voltage settings? Halt the program?
  2. In this lab, you were required to use a ARRAY data structure for the status byte. Is there an advantage to using this data structure for the status byte rather than using 8 separate boolean structures?
  3. Error checking… when is enough, enough already? Error checking and idiot proofing takes a lot of computation time, programming time, execution time, etc. In considering Procedure II.b above, how did you decide when and how often to check the instrument status?