[time-nuts] GPIB on HP5382B counter

Jerome Peters jpeters at nvidia.com
Fri Oct 23 21:23:30 UTC 2009


I'm still trying to get the HP5328B counter to work with GPIB.  I don't have any problems talking, however I can't receive data.
I think the basic (HP/Agilent) hardware/software  are ok, with a similar type of program I am able to send/receive to a 34401 Digital Multimeter.
It "seems" like it should be pretty straight forward to implement but I can't figure out where  I'm going wrong.  There is a test oscillator driving the counter at ~5MHz, The Oscillator drifts a bit, so I can see every time it captures a new measurement. The counter is not in "talk only mode"

#include <visa.h>
#include <stdio.h>
#include <windows.h>
#include <string.h>

void main () {

  ViSession defaultRM, vi;
  char buf[25] = {0};
  char buf1[25] = {"Press Return to exit"};

  /* Open session to GPIB device */
  viOpenDefaultRM (&defaultRM);
       viOpen (defaultRM, "GPIB0::3::INSTR", VI_NULL,VI_NULL, &vi);   //This is for USB to GPIB adapter

                viPrintf(vi, "PF4G6S024R, \n");                  // Frequencey measurement, CH#A, 1Hz res, single measurement,
// Wait to output; Service request at end of meas.  Output at end of Measure.
        Sleep(2000);
        viPrintf(vi, "T, \n");                  // Trigger

        Sleep(2000);
        viScanf(vi, "%t", buf);                             // read results

              printf("DATA string 1: %s\n", buf);      // Print results

  viClose (vi);                                 // Close session
  viClose (defaultRM);

  printf(buf1);
  gets(buf1);                        //  Program exit after RETURN

}


Thanks to all those who responded last week.
Best regards,
Jerome KC6ENE


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


More information about the time-nuts mailing list