element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
BeagleBoard
  • Products
  • Dev Tools
  • Single-Board Computers
  • BeagleBoard
  • More
  • Cancel
BeagleBoard
Forum New Python project using a BeagleBone Black
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join BeagleBoard to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 10 replies
  • Answers 5 answers
  • Subscribers 103 subscribers
  • Views 2136 views
  • Users 0 members are here
  • pi-visa
  • python
  • beaglebone_black
  • test instrumentation
  • BeagleBone
  • vna
  • bb_black
  • instrument
Related

New Python project using a BeagleBone Black

angellxp
angellxp over 6 years ago

I'm looking for directions/guidance for the best direction to take with this new project.

 

I have a VNA that is controllable via Python/Pi-Visa and a network cable.  I also constructed a custom relay switching board so that I can test up to 32 connection points(using 16 relays) without reconnecting my VNA. The attached image is the 8Ch version I made.

My question is if anyone has had experience with instrument control via Python and/or the BB Black, what direction should I take?

 

Thanks

Attachments:
image
  • Sign in to reply
  • Cancel

Top Replies

  • jomoenginer
    jomoenginer over 6 years ago in reply to angellxp +3 suggested
    Derek Molloy has some good examples of how to interface the GPIOs of the BB Black. Some of the example may be dated but they should still point you in the right direction. His source code that can be downloaded…
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to shabaz +1 suggested
    My code i not hard to adapt to another relay board - even your home-grown - or a BBB. There's a limited piece of code that talks to the hardware. Where-ever you see a SPI call, replace it by the code to…
  • shabaz
    shabaz over 6 years ago in reply to angellxp +1 suggested
    Hi Jon, I think all of this can be achieved easily. First step would be to wire up the relay board to the BBB (using the GPIO API link earlier to see which pins are allowed - not all GPIO pins on the BBB…
Parents
  • shabaz
    0 shabaz over 6 years ago

    Hi Jon,

     

    Is your Python program (that uses pyvisa) also running on the BBB, or on a different machine?

     

    If your board has one logic level input per relay then some general-purpose I/O library can be used to control it.

    If you wish to use Python, there is a BBB GPIO library that may help, I've not tried it but hopefully it should work.

    There is a GPIO API example here.

     

    The above assumes that your pyvisa based code runs on the same BBB that has the relay board connected. If you want to make your code general-purpose so it can work remotely too, then some client-server code can be used.

    There is a project by Jan Cumps that you can use for that, called SCPI on a Linux Board. The code you write to control the I/O would be included at the instrument side of that project, and then it gets controlled in a similar way to your VNA.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • angellxp
    0 angellxp over 6 years ago in reply to shabaz

    I'd love to be able to run this ALL from the BB with the only interaction being user input to tell it when to start. (push button for example)

     

    At that point, the system could run in full auto stepping through each relay path one at a time. Switch, test, switch, test, and so-on until it finishes.

     

    At each switching instance, I'd need to change the relay path and load the VNA with a new data file to test against.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • angellxp
    0 angellxp over 6 years ago in reply to shabaz

    I'd love to be able to run this ALL from the BB with the only interaction being user input to tell it when to start. (push button for example)

     

    At that point, the system could run in full auto stepping through each relay path one at a time. Switch, test, switch, test, and so-on until it finishes.

     

    At each switching instance, I'd need to change the relay path and load the VNA with a new data file to test against.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • shabaz
    0 shabaz over 6 years ago in reply to angellxp

    Hi Jon,

     

    I think all of this can be achieved easily. First step would be to wire up the relay board to the BBB (using the GPIO API link earlier to see which pins are allowed - not all GPIO pins on the BBB are directly usable), and then use the examples there to prove that they can be switched on/off with the Python GPIO API. Next, take Jan's SCPI project, and include the GPIO API and swap in the GPIO commands in place of SPI that the code currently uses (or let us know if you need help with that, once you know the GPIO pin numbers mapping).

    Now your relay board will be controllable just like the VNA. Then is straightforward to write code to wait for an input or cycle through connections.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube