element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Pico SCPI Lab Switch project: automate your test setup with a standards compliant multi-channel switch
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 9 replies
  • Subscribers 659 subscribers
  • Views 2956 views
  • Users 0 members are here
  • raspberry
  • pico_usbtmc_scpi
  • pico
  • scpi
Related

Pico SCPI Lab Switch project: automate your test setup with a standards compliant multi-channel switch

Jan Cumps
Jan Cumps over 2 years ago

SCPI programmable LAB switch with USBTMC interface

Automated test setups often need switches:

  • to turn signals on and off
  • to enable or disable supplies
  • to add or remove output loads
  • to connect a measurement instrument to several circuit nodes and collect data
  • that integrate seamlessly with LabVIEW and pyvisa test setups
  • ...

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

LabVIEW compatible. This video shows the WIP VI Virtual Instrument driver

In this blog series, I develop a lab switch that can do that. Programmable via SCPI. Plug-and-play compatible with the VISA test & measurement device standards. It supports the USBTMC standard and is IEEE 488.2 compliant. It can control any 3.3V compatible relay/switch circuit.


image

The core is a Raspberry Pico. Firmware is 97% based on SCPI and USBTMC cross-platform libraries. 3% (less than 30 lines of source code) is Pico specific.

image

The number of switches you can control is only limited by the amount of available GPIOs on the PICO.

image
image: WIP VI Virtual Instrument driver example

Command supported:

  • all standard SCPI commands (*IDN?, *RST, SYST:ERR...)
  • control a switch: DIGI:OUTP# 0|1
  • poll a switch state: DIGI:OUTP#?

The firmware is SCPI and IEEE488.2 compliant.
Free to use - also for commercial applications (except the LabVIEW driver). No restrictions and no promises. Please respect the licenses of the 3rd party libraries that are used in the project.
Check the last post for source code, PyVISA and LabVIEW test beds, and the Pico ready-to-load firmware binary.

link to all posts

  • Sign in to reply
  • Cancel
Parents
  • neuromodulator
    neuromodulator over 2 years ago

    I've been playing  a bit with TinyUSB to make an USBTMC device, and I was wondering if you have tried to make a composite device that uses USBTMC and CDC. Since CDC uses IAD, I needed to define class/sub-class/protocol to 0xEF, 0x02, 0x01. But when I tried it, NI-max did not detect the USBTMC device. Then I set the class/subclass/protocol to 0x00, 0x00, 0x00, and everything worked just fine. But as this appears to be non-standard, I'm not sure if it would work well on machines that are not Windows 10. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to neuromodulator

    I have never tried to make composite tinyUSB firmware. 

    The commercial devices I have at home with composite, are usually debuggers. I have USBTMC scopes, psu and dmm.  But they don't enumerate with additional (CDC or other) interfaces. I don't know if TMC and CDC can live together on the same USB...

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Jan Cumps
    Jan Cumps over 2 years ago in reply to neuromodulator

    I have never tried to make composite tinyUSB firmware. 

    The commercial devices I have at home with composite, are usually debuggers. I have USBTMC scopes, psu and dmm.  But they don't enumerate with additional (CDC or other) interfaces. I don't know if TMC and CDC can live together on the same USB...

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
Children
  • neuromodulator
    neuromodulator over 2 years ago in reply to Jan Cumps

    I suppose in the worse case, if its not supported, one could expose them as connected to a virtual hub. I haven't tried that yet though, not sure how much work that may require. In the meantime I'll just use the 0x00, 0x00, 0x00 class/subclass/protocol, as its working well to make a composite device with 3 different interfaces (USBTMC, CDC, MSC)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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