Python Rs232

Discussion in 'Microcontrollers and Programming' started by Rajinder, Dec 19, 2016.

  1. Rajinder

    Rajinder

    Joined:
    Jan 30, 2016
    Messages:
    187
    Likes Received:
    2
    Hi all,
    I am using python to control a digital multimeter through rs232. I have mages to send the Meyer commands from real term, so I can read the I'd number, read the software version, measure current etc.
    This works fine.
    I want to expand this so I can read and measure from the Meyer nut use python.
    I want to save the results I.e. current measurements into a excel spreadsheet. I am using python v2.7
    My questions are
    1. I have to use pyserial is that correct
    2. How do I save results in excel
    3. Commands to the meter are for example *idn? (This returns the I'd value if the meter). How do I send this via python
    4. I want this to run from a gui, buttons to read I'd, button to measure current. I have no idea on this.
    I have a basic understanding of python but not an expert.
    I look forward to hearing from you.
    Best regards
    Raj
     
    Rajinder, Dec 19, 2016
    #1
    1. Advertisements

  2. Rajinder

    Harald Kapp Moderator Moderator

    Joined:
    Nov 17, 2011
    Messages:
    7,602
    Likes Received:
    1,336
    Location:
    Germany-Europe-Earth-Sol System-Milky Way-Laniakea
    1. That's one possibility, yes.
    2. Write data to a CSV file. This is a simple text format which can be imported into Excel rather easily.
    3. From pyserial use the write method.
    4. Get it running from the console first. Then find a framework you're comfortable with (e.g. tTinker) to write a GUI on top of the console program. A list of frameworks is here.

    This website shows how to use pyserial.
     
    Harald Kapp, Dec 20, 2016
    #2
    1. Advertisements

  3. Rajinder

    Rajinder

    Joined:
    Jan 30, 2016
    Messages:
    187
    Likes Received:
    2
    Thanks. I have also cone across PyVisa, this I believe are a set of libraries for instrument control such as RS232, GBIP etc.
    Not sure if they have libraries for my multimeter.
     
    Rajinder, Dec 20, 2016
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.