Giter VIP home page Giter VIP logo

gpib_fsa's Introduction

GPIB_FSA

Trace dump tool

A small python program to read/decode/plot/save the trace dump from the Rohde-Schwarz FSA Spectrum Analyzer that uses the GPIB bus to communicate with the PC. If you don't have an expensive GPIB interface like me, you might be interested in bulding a super easy one with just an Arduino Nano, a mutilated Centronics connector (yeah, you should have one in some closet from the days printers were connected by thick cables...) and a few interconnecting wires. The Arduino runs a slightly modified version of this code: https://github.com/JacekGreniger/gpib-conv-arduino-nano

In my home lab I have two R&S instruments: the FSAS spectrum analyzer and the SPMC signal generator. I have a GPIB cable connecting them and the Arduino interface piggybacks on one, then the USB cable goes to the PC via a 115kbps serial connection.

In the python source you may customize your equipment addresses, serial interface and commands to send for analysis. To use the program, just run on a terminal:

python fsas.py

it will then print instructions on how to use: direct capture from instrument or existing tracedump (re-)processing.

General processing tool (under heavy development)

The second tool I am currently developing (so it certainly has some small bug...) is gpib.py. With this you can create a different text file for each analysis operating over all your GPIB connected instruments. At the moment I implemented a very basic (but intuitive) scripting language that can help you modularize sequences of commands, create local variables, calling metafunctions defined in the Python source code for dealing with complex IN/OUT like the trace dump of the basic tool fsas.py. Be careful that GOTO commands only go forward for now, so no loops yet ;) I included an example script called commands.txt that should be processed in this way: python gpib.py -p commands.txt If you have more than one trace dump, I save them all to a multi page PDF file instead of filling your directory with JPGs. The PDF file will overwrite the output.pdf every time: be advised!

Instead of having to modify the python source code for every analysis you plan, I implemented a very basic (pun intended :) ) command interpreter to control any GPIB enabled instrument you have connected.

At the moment you can do the following operations:

  • write comments, disregarded by the interpreter;
  • define new user variables: they may be integers, floats or strings (the variables CANNOT be used inside GPIB commands yet!) but they can be given to user defined functions in the Python code. Variable values still cannot be dynamically modified like A=A+1, future development...;
  • use GOTO commands to skip certain parts of the analysis;
  • call user definable complex functions. At the moment I just defined three:
    • delay,
    • trace_dump (from my FSAS)
    • set_listener_talker
  • the output of the trace dumps will go to a multipage PDF file along with their TITLE;
  • the raw pickle output gets overwritten at the moment and only the last one is kept: be careful :)

Next I'll try to implement LOOPS in order to be able to perform optimization analyses actively varying some parameters such as tracking generator frequency and amplitude or sending GPIB commads to user ports etc.

Please study the commands.txt to understand the basic scripting rules.

THE CODE IS RELEASED UNDER THE GPL V3.0. Donations via PayPal TO cogoni AT gmail DOT com are welcome and will contribute to make me work on the project! Thanks.

Have fun!

marco / IS0KYB

Original FSAS image Image generated by the script The ugly adapter

gpib_fsa's People

Contributors

mcogoni avatar

Stargazers

 avatar  avatar Arild Velure avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.