[time-nuts] HP5370B and GPIB

John Miles jmiles at pop.net
Sun Jul 1 13:03:55 EDT 2007

I've got a basic data-logging example that works with NI and Prologix
adapters (see 5370b.cpp in www.ke5fx.com/gpib/setup.exe ).  There is one
caveat on the Prologix boards that might apply to the Softmark adapter as
well, though: you can't use the SB command to specify an arbitrary sample
size in binary, because the board might interpret any ASCII 10 or 13 (LF or
CR) characters as command terminators.

The sample-size logic in my case looks like this (below).  That's the only
hangup I can think of, offhand.  It doesn't sound like that's your problem,
but it's worth noting once you get the basic communication up and running.

Also, I don't remember if the 5370B asserts EOI at the end of each reading,
so you might make sure you've configured the Softmark board to terminate
incoming reads when ASCII 10 (LF) is received.

-- john, KE5FX

-----snip from 5370b.cpp-----

   // Tell counter how many samples to take for each returned reading, after
   // forcing it to wrap up any measurement in progress by taking a single
   // If sample size is not a power of 10, we must compose an SB
   // (Sample Binary) command string to specify the number of
   // samples we want the counter to take for each reading
   // Prologix users will not be able to use this feature, since arbitrary
   // strings cannot be transmitted!


   U8 sample_string[16];

   U32 n = (S32) (log10((DOUBLE) n_samples) + 0.5);

   if (n_samples == (U32) (pow(10.0, (S32) n) + 0.5))
      sprintf((C8 *) sample_string,"SS%d",n);

      GPIB_write((C8 *) sample_string);
      if (GPIB_serial_configuration() != NULL)
         printf("WARNING: Binary command transmission requires National
Instruments interface\n");
         printf("Measurement may not work -- use a power of 10 from 1-100000

      sample_string[0] = 'S';
      sample_string[1] = 'B';
      sample_string[2] = (U8) (n_samples / 65536);
      sample_string[3] = (U8) ((n_samples - ((n_samples / 65536) * 65536)) /
      sample_string[4] = (U8) (n_samples % 256);

      GPIB_write_BIN(sample_string, 5);


> -----Original Message-----
> From: time-nuts-bounces at febo.com [mailto:time-nuts-bounces at febo.com]On
> Behalf Of Brian Kirby
> Sent: Sunday, July 01, 2007 9:25 AM
> To: Time Nuts
> Subject: [time-nuts] HP5370B and GPIB
> ); SAEximRunCond expanded to false
> Errors-To: time-nuts-bounces+jmiles=pop.net+jmiles=pop.net at febo.com
> If you are using a HP5370B time interval counter and logging data from
> the HPIB bus, can I inquire to what you are using for an interface to
> the HPIB bus and what do you log the data with ?
> I am basically trying to capture 1 second data from the 5370B using a
> Softmark USB/GPIB card - and I am not having any luck at all.
> I see some effects of commanding, the display on the 5370 changes or I
> get and error message - but I cannot read any sort of data back thru the
> HPIB port.
> I would appreciate it if one could send an example of what commands I
> need to send to set the port up and retreive the data.
> Brian N4FMN

More information about the time-nuts mailing list