time-nuts@lists.febo.com

Discussion of precise time and frequency measurement

View all threads

HP5370B and GPIB

BK
Brian Kirby
Sun, Jul 1, 2007 4:24 PM

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

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
JM
John Miles
Sun, Jul 1, 2007 5:03 PM

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
sample
//
// 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
binary
// strings cannot be transmitted!
//

GPIB_write("SS1");
Sleep(100);

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);
  }

else
{
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
inclusive\n\n");
}

  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)) /

256);
sample_string[4] = (U8) (n_samples % 256);

  GPIB_write_BIN(sample_string, 5);
  }

-----end------

-----Original Message-----
From: time-nuts-bounces@febo.com [mailto:time-nuts-bounces@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@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

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 sample // // 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 binary // strings cannot be transmitted! // GPIB_write("SS1"); Sleep(100); 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); } else { 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 inclusive\n\n"); } 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)) / 256); sample_string[4] = (U8) (n_samples % 256); GPIB_write_BIN(sample_string, 5); } -----end------ > -----Original Message----- > From: time-nuts-bounces@febo.com [mailto:time-nuts-bounces@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@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 > >
P
Prologix
Sun, Jul 1, 2007 5:16 PM

The latest version of Prologix GPIB-USB controller firmware (v4.65)
available at http://prologix.biz/update.html allows binary data
transmission. CR (ASCII 13) and LF (ASCII 10) may be escaped by preceding
them with the ESC (ASCII 27) character.

-----Original Message-----
From: time-nuts-bounces@febo.com [mailto:time-nuts-bounces@febo.com] On
Behalf Of John Miles
Sent: Sunday, July 01, 2007 10:04 AM
To: Discussion of precise time and frequency measurement
Subject: Re: [time-nuts] HP5370B and GPIB

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
sample
//
// 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
binary
// strings cannot be transmitted!
//

GPIB_write("SS1");
Sleep(100);

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);
  }

else
{
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
inclusive\n\n");
}

  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)) /

256);
sample_string[4] = (U8) (n_samples % 256);

  GPIB_write_BIN(sample_string, 5);
  }

-----end------

-----Original Message-----
From: time-nuts-bounces@febo.com [mailto:time-nuts-bounces@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@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


time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to
https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

The latest version of Prologix GPIB-USB controller firmware (v4.65) available at http://prologix.biz/update.html allows binary data transmission. CR (ASCII 13) and LF (ASCII 10) may be escaped by preceding them with the ESC (ASCII 27) character. -----Original Message----- From: time-nuts-bounces@febo.com [mailto:time-nuts-bounces@febo.com] On Behalf Of John Miles Sent: Sunday, July 01, 2007 10:04 AM To: Discussion of precise time and frequency measurement Subject: Re: [time-nuts] HP5370B and GPIB 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 sample // // 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 binary // strings cannot be transmitted! // GPIB_write("SS1"); Sleep(100); 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); } else { 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 inclusive\n\n"); } 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)) / 256); sample_string[4] = (U8) (n_samples % 256); GPIB_write_BIN(sample_string, 5); } -----end------ > -----Original Message----- > From: time-nuts-bounces@febo.com [mailto:time-nuts-bounces@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@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 > > _______________________________________________ time-nuts mailing list -- time-nuts@febo.com To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts and follow the instructions there.
BJ
Bill Janssen
Sun, Jul 1, 2007 9:07 PM

Brian Kirby wrote:

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

Here is a short QBASIC program that I used to test my 5370A and a
National Instruments board.
the exact wording depends on the interface board you use. I hope I typed
it correctly as the machine
it is on is busy at the moment.

Good luck
Bill K7NOM


REM the address of the 5370 is 4
Include "qbdecl" :REM NI driver & language library
OPEN "GPIB0" FOR OUTPUT AS #1
OPEN "GPIB0" FOR INPUT AS #2
TIMER ON
PRINT #1, "ABORT": REM  this sets up the NI board as controller
PRINT #1, "CLEAR 4": REM this clears the 5370
Z=1 TO 100: NEXT Z:  REM let the 5370 settle
PRINT #1, "REMOTE 4"
PRINT #1, "OUTPUT 4 #3;FN1"
PRINT #1, "OUTPUT 4, #3;SS2"
ON TIMER (10)  GOSUB 200
100 REM stay here utill timer calls
150 GOTO 100
REM ***********************
200 PRINT #1, "ENTER 4 #24" :REM expect to get 24 characters
FOR X = 1 TO 1000: NEXT X
result$ = INPUT$(24,2):REM get 24 char. from port 2
FOR X = 1 TO 1000: NEXT X
a$=MID$(result$,5, 18):REM  discard the first 5 and the last 1 char.
a = VAL(a$)
PRINT a
RETURN
END


Brian Kirby wrote: > 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 > Here is a short QBASIC program that I used to test my 5370A and a National Instruments board. the exact wording depends on the interface board you use. I hope I typed it correctly as the machine it is on is busy at the moment. Good luck Bill K7NOM ********************************* REM the address of the 5370 is 4 Include "qbdecl" :REM NI driver & language library OPEN "GPIB0" FOR OUTPUT AS #1 OPEN "GPIB0" FOR INPUT AS #2 TIMER ON PRINT #1, "ABORT": REM this sets up the NI board as controller PRINT #1, "CLEAR 4": REM this clears the 5370 Z=1 TO 100: NEXT Z: REM let the 5370 settle PRINT #1, "REMOTE 4" PRINT #1, "OUTPUT 4 #3;FN1" PRINT #1, "OUTPUT 4, #3;SS2" ON TIMER (10) GOSUB 200 100 REM stay here utill timer calls 150 GOTO 100 REM *********************** 200 PRINT #1, "ENTER 4 #24" :REM expect to get 24 characters FOR X = 1 TO 1000: NEXT X result$ = INPUT$(24,2):REM get 24 char. from port 2 FOR X = 1 TO 1000: NEXT X a$=MID$(result$,5, 18):REM discard the first 5 and the last 1 char. a = VAL(a$) PRINT a RETURN END ***************