Here is a plot from the latest GPIB hack which reads frequency and phase about once per second. Only the phase is shown here. Small tweeks to the fine freq standard adjustment take several minutes to take effect. Is the fine adjustment tweeking some parameter related to the oven??? On 12/11/2011 07:34 AM, Larry McDavid wrote: > Chuck, what is the time scale in your plot? That is, why does "1400" = > 430 seconds? > > Larry > > > On 12/10/2011 10:35 PM, Chuck Forsberg WA7KGX N2469R wrote: >> The 1992's A input goes to the Thunderbolt. >> The 1992's B input goes to its time base output. >> The counter is set to "A rel B" >> >> Here's a blow-up of the phase plot. In this case it takes some 430 >> seconds for the >> phase offset to cycle 360 degrees. In other words, there is 1/430 Hz >> frequency difference. > ... > -- Chuck Forsberg WA7KGX N2469R [email protected] www.omen.com Developer of Industrial ZMODEM(Tm) for Embedded Applications Omen Technology Inc "The High Reliability Software" 10255 NW Old Cornelius Pass Portland OR 97231 503-614-0430

<<attachment: phase3.gif>>

/***************************************************************************
                                 rdxp.c
                Read phase and freq from Racal-Dana 1992
                             -------------------

 ***************************************************************************/

#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <getopt.h>
#include <sys/time.h>
#include "gpib/ib.h"

#define LL 132
char line[LL];
long double  phase, freq;
struct timeval tv;
long long tt;
FILE *fout;

int ud, minor=0, pad = 15;
const int sad = 0;
const int send_eoi = 1;
const int eos_mode = 0;
const int timeout = T1s;

int once = 1;           // discard garbage readings forst time around


main(argc, argv)
{
        long long l;

        fout = fopen("/o/tmp/rdxp", "w");
        if (fout  == NULL)
                fprintf(stderr, "Can't open output file.\n");

        fprintf(stderr, "trying to open pad = %i on /dev/gpib%i ... ", pad, 
minor);
        ud = ibdev(minor, pad, sad, timeout, send_eoi, eos_mode);
        if(ud < 0)
        {
                fprintf(stderr, "ibdev error\n");
                return (-1);
        }
        fprintf(stderr, "ud = %d\n", ud);

        ibrsc(ud, 1);
        ibsic(ud);
        ibclr(ud);
        ibsre(ud, 1);

        ibwrt(ud, "SRS9\n", 5);         // set high res
        once = 1;
        while (1) {
                
                ibwrt(ud, "PH\n", 3);   // measure phase
                line[0] = 0;
                Receive (0, 15, line, LL, 012);
                if (strncmp(line, "PH", 2)) {
                        fprintf(stderr, "PH Timeout\n"); continue;
                }
//              fputs (line, stdout);
                sscanf (line+2, "%Le", &phase);
        
                
                ibwrt(ud, "FA\n", 3);   // Measure freq input A
                line[0] = 0;
                Receive (0, 15, line, LL, 012);
                if (strncmp(line, "FA", 2)) {
                        fprintf(stderr, "FA Timeout\n"); continue;
                }
//              fputs (line, stdout);
                gettimeofday(&tv, NULL); tt = tv.tv_sec;
                sscanf (line+2, "%Le", &freq);
/*
 * Display freq as deviation from the nearest MHz
 */
                l = freq + 50000.;
                l /= 100000;
                l *= 100000;
                freq -= l;
                if (once) {once = 0; continue;}
                fprintf(stdout, "%lld %12.2Lf %3.0Lf\n", tt, freq, phase );
                fflush(stdout);
                if (fout != NULL) {
                        fprintf(fout,"%lld %12.2Lf %3.0Lf\n", tt, freq, phase );
                        fflush(fout);
                }
        }
}

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

Reply via email to