-
print "  Interface Bus Interactive Control (IBIC)                            "
print "  Example Program using NI-488 board level functions                  "
print ""
print "======================================================================"
print "  This sample program is for reference only. It can only be expected  "
print "  to function with a Fluke 45 Digital Multimeter configured at primary" 
print "  address 1 in the configuration program IBCONF.                      "
print ""
print "  This program reads a measurement from the Fluke 45.                 "
print ""
print "  After each command executes, the numeric value and mnemonic         "
print "  representation of the status word IBSTA is displayed.  The byte     "
print "  count IBCNT and the mnemonic definition of IBERR are also shown     "
print "  when appropriate.                                                   "
print ""
print "  The NI-488 function IBONL is called with a parameter value of zero  "
print "  to disable the hardware and software.  Execution of this program is "
print "  terminated after the call to the function IBONL.                    "
print ""
print "  The EXIT command is used to terminate this program.                 "
print "======================================================================"
print ""
print "  Assign an unique identifier to board 0.  The name 'GPIB0' is the    "
print "  default name of board 0.                                            "
+
ibfind  GPIB0
-
print "  Send the Interface Clear (IFC) message.  This action                "
print "  initializes the GPIB interface board and makes the interface        "
print "  board Controller-In-Charge.                                         "
+
ibsic
-
print "  Turn on the Remote Enable (REN) signal.  The device does not        "
print "  actually enter remote mode until it receives its listen address.    "
+
ibsre  1
-
print "  Inhibit front panel control with the Local Lockout (LLO) command    "
print "  (hex 11).  Place the Fluke 45 in remote mode by addressing it to    "
print "  listen (hex 21 or ASCII '!').  Send the Device Clear (DCL) message  "
print "  to clear internal device functions (hex 14).  Address the GPIB      "
print "  interface board to talk (hex 20 or ASCII '@').  These commands can  "
print "  be found in Appendix A of the Software Reference Manual.            "
+
ibcmd  "\021!\024@"
-
print "  Reset the Fluke 45 by issuing the reset (*RST) command.  Instruct   "
print "  the Fluke 45 to measure the volts alternating current (VAC) using   "
print "  auto-ranging (AUTO), to wait for a trigger from the GPIB interface  "
print "  board (TRIGGER 2), and to assert the IEEE-488 Service Request line, "
print "  SRQ, when the measurement has been completed and the Fluke 45 is    "
print "  ready to send the result (*SRE 16).                                 "
+
ibwrt  "*RST; VAC; AUTO; TRIGGER 2; *SRE 16"
-
print "  Trigger the Fluke by sending the trigger (GET) command (hex 08)     "
print "  message.                                                            "
+
ibcmd  "\010"
-
print "  Request the triggered measurement by sending the instruction        "
print "  'VAL1?'.                                                            "
+
ibwrt  "VAL1?"
-
print "  Wait for the Fluke 45 to assert the Service Request (SRQ) line      "
print "  or wait for the Fluke 45 to timeout(TIMO).  The default timeout     "
print "  period is 10 seconds.  SRQ is detected by bit position 12           "
print "  (hex 1000, SRQI).  TIMO is detected by bit position 14 (hex 4000).  "
print "  These status bits are listed under the NI-488 function IBWAIT in    "
print "  the Software Reference Manual.                                      "
+
ibwait  (TIMO  SRQI)
-
print "  Serial poll the Fluke 45.  Unaddress bus devices by sending the     "
print "  untalk (UNT) command (hex 5F or ASCII '_') and the unlisten (UNL)   "
print "  command (hex 3F or ASCII '?').  Send the Serial Poll Enable (SPE)   "
print "  command (hex 18) and the Fluke 45 talk address (hex 41 or           "
print "  ASCII 'A').  Address the GPIB interface board to listen (hex 20     "
print "  or ASCII space).  These commands can be found in Appendix A of      "
print "  the Software Reference Manual.                                      "
+     
ibcmd  "?_\030A "
-
print "  Read the Fluke 45 serial poll status byte.                          "
print "  If the returned status byte is hex 50, the Fluke 45 has valid       "
print "  data to send; otherwise, it has a fault condition to report.        "
+
ibrd  1
-
print "  Complete the serial poll by sending the Serial Poll Disable (SPD)   "
print "  command, hex 19.  This command can be found in Appendix A of the    "
print "  Software Reference Manual.                                          "
+
ibcmd  "\031"
-
print "  Assume the status byte is hex 50 and read the Fluke 45 measurement. "
+
ibrd  10
-
print "  Call the ibonl function to disable the hardware and software.       "
+
ibonl  0
exit

