In message <[email protected]>, Magnus Danielson writes:

>Realize that I need to work on getting some GPIB programming done so I
>can get some scripts going.

I've mentioned it before, but I'll plug it again:

        https://github.com/bsdphk/pylt

The script I used for the plots I sent look like this:


        #!/usr/bin/env python

        from __future__ import print_function

        import time
        import socket
        import hp3336c

        # Use TCP/IP to Johns ARM board
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(("hp5370", 5370))

        s.send("ST9\r\n")
        s.send("MD2\r\n")
        s.send("SS3\r\n")

        # Purge whatever is buffered
        s.settimeout(1)
        while True:
                try:
                        x = s.recv(40)
                except socket.timeout:
                        break
                print(x)
        s.settimeout(None)

        g = hp3336c.hp3336c()
        print("ID", g.id)
        # Setup frequency and amplitude manually, this only reports...
        print("Freq: %.11e Hz %.1f dBm" % (g.read_freq(), g.read_dbm()))

        fo = open("/tmp/_q", "w")
        ph = 0
        for m in range(180):
                ph += 1
                g.wr("PH%.1fDE" % (.1*ph))
                time.sleep(.1)
                s.send("\n")
                data = s.recv(80).strip()
                data += " | " + s.recv(80).strip()
                print("%4d" % m, "%5.1f" % (.1 * ph), data)
                fo.write("%4d " % ph + "%5.3f " % (.1 * ph + j * .005) + data + 
"\n")


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[email protected]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
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