home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / SICL / data1.cab / sicl32 / c / samples / misc / vxiintr.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-02  |  887 b   |  34 lines

  1. /* vxiintr.c
  2.    The following example gets information about a specific
  3.    vxi device and prints it out. */
  4. #include <stdio.h>
  5. #include <sicl.h>
  6.  
  7. void main () {
  8.   int laddr;
  9.   struct vxiinfo info;
  10.   INST id;
  11.  
  12.   /* get instrument logical address */
  13.   printf ("Please enter the logical address of the register-based                          instrument, for example, 24 :  \n");
  14.   scanf ("%d", &laddr);
  15.  
  16.   /* install error handler */
  17.   ionerror (I_ERROR_EXIT);
  18.  
  19.   /* open a vxi interface session */
  20.   id  =  iopen ("vxi");
  21.   itimeout (id, 10000);
  22.  
  23.   /* read resource manager information for specified device */
  24.   ivxirminfo (id, laddr, &info);
  25.  
  26.   /* print results */
  27.   printf ("Instrument at address %d\n", laddr);
  28.   printf ("Manufacturer's Id = %s\n  Model = %s\n",
  29.                info.manuf_name, info.model_name);
  30.  
  31.   /* close session */
  32.   iclose (id);
  33. }
  34.