home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / hp / 8595 < prev    next >
Encoding:
Text File  |  1992-07-27  |  2.8 KB  |  102 lines

  1. Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!hpscdc!cupnews0.cup.hp.com!hppad.waterloo.hp.com!hppad!hpfcso!stroyan
  2. From: stroyan@hpfcso.FC.HP.COM (Mike Stroyan)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: hp730 <- Digitizer: Communications Library Wanted
  5. Message-ID: <7371174@hpfcso.FC.HP.COM>
  6. Date: 27 Jul 92 23:02:38 GMT
  7. References: <Bs2B9q.JGF@news.cso.uiuc.edu>
  8. Organization: Hewlett-Packard, Fort Collins, CO, USA
  9. Lines: 91
  10.  
  11. >  I have an hp 730 and a hp 46087b Digitizing Tablet (that's a HP-HIL
  12. >  device, like a mouse or a keyboard).  
  13. >  I would like to find a library (c or fortran) that could facilitate
  14. >  command/control/data extraction from this device.  I am aware that 
  15. >  I could write my own c routines to do this, but there must be a faster
  16. >  way a better way than my c skills allow.
  17.  
  18. The Starbase library will perform input from the tablet.  It has calling
  19. conventions for both c and fortran.  The following examples do simple
  20. input from a tablet.  The program
  21. waits for ten button presses and reports the position of each one.
  22.  
  23. The examples assume a device file called "/dev/tablet" exists for the
  24. tablet.  The files /dev/hil1 through /dev/hil7 are created by default.
  25. The number corresponds to the position in the HP-HIL chain, starting
  26. from 1.  Nine-knob boxes count as three devices.  You could link one of
  27. the existing device files to "/dev/tablet", or change the programs to
  28. use one of the existing files.
  29.  
  30. The Starbase library also has a sample_locator call for reading the
  31. tablet position without waiting for a button press.
  32.  
  33. cc -o request request.c -lsb -ldld
  34.  
  35. f77 -o request request.f -lsb -ldld
  36.  
  37. # This is a shell archive.  Remove anything before this line,
  38. # then unpack it by saving it in a file and typing "sh file".
  39. #
  40. # Wrapped by stroyan at hpfcso on Mon Jul 27 16:53:20 1992
  41. #
  42. # This archive contains:
  43. #    request.c    request.f    
  44. #
  45.  
  46. LANG=""; export LANG
  47.  
  48. echo x - request.c
  49. cat >request.c <<'@EOF'
  50. #include <starbase.c.h>
  51. main()
  52. {
  53.     int tablet, valid, i;
  54.     float x=0.5, y=0.5, z=0.0;
  55.  
  56.     tablet = gopen("/dev/tablet", INDEV, "hp-hil", FALSE);
  57.     if (tablet == -1) exit();
  58.  
  59.     for (i=1; i<=10; i++) {
  60.     request_locator(tablet, 1, 200.0, &valid, &x, &y, &z);
  61.     printf("valid: %d, x: %f, y: %f, z: %f\n", valid, x, y, z);
  62.     }
  63.  
  64.     gclose(tablet);
  65. }
  66. @EOF
  67.  
  68. chmod 660 request.c
  69.  
  70. echo x - request.f
  71. cat >request.f <<'@EOF'
  72.         include '/usr/include/starbase.f1.h'
  73.         program main
  74.         include '/usr/include/starbase.f2.h'
  75.  
  76.         integer tablet, valid, i
  77.     real x, y, z
  78.  
  79.     x = 0.5
  80.     y = 0.5
  81.     z = 0.0
  82.  
  83.     tablet = gopen('/dev/tablet'//char(0), INDEV, 'hp-hil'//char(0), FALSE)
  84.     if (tablet .EQ. -1) stop
  85.  
  86.     do i=1, 10
  87.         call request_locator(tablet, 1, 200.0, valid, x, y, z)
  88.         write(6,*) 'valid: ', valid
  89.         write(6,*) 'x: ', x
  90.         write(6,*) 'y: ', y
  91.         write(6,*) 'z: ', z
  92.     end do
  93.  
  94.     call gclose(tablet)
  95.     end
  96. @EOF
  97.  
  98. chmod 660 request.f
  99.  
  100. exit 0
  101.