Author Topic: Microcontroller communication with USB Test Instruments  (Read 1992 times)

0 Members and 1 Guest are viewing this topic.

Offline alexm271175Topic starter

  • Newbie
  • Posts: 2
  • Country: de
Microcontroller communication with USB Test Instruments
« on: September 17, 2018, 02:12:01 pm »
Hi,

has anyone ever tried to USB control a Test & Measurement Instrument (like a digital multimeter) using a microcontroller? Like set the measurement range, start a measurement, read the result...

I think a FTDI VNC1L USB Host together with a microcontroller should do this (maybe also a STM32 microcontroller with built in USB), but I was lost about how to send a SCPI command to the instrument. I have some experience about how to write data using the VNC1L to a usb storage but can't find information about using the USB T&M class.

alex
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: Microcontroller communication with USB Test Instruments
« Reply #1 on: September 17, 2018, 07:52:19 pm »
Does it have to be a microcontroller? With a raspberry pi or similar, you can have linux and with that, the usbtmc kernel driver and/or all kinds of userspace tools that can speak SCPI.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3719
  • Country: us
Re: Microcontroller communication with USB Test Instruments
« Reply #2 on: September 18, 2018, 05:02:42 pm »
You can download and read the USBTMC standard, and eventually figure out what it means.  There are also a lot of open source USBTMC drivers that you can refer to, such as the linux kernel driver and the python-usbtmc userspace driver.  You used to be able to find the USBTMC definition on usb.org, but it seems to have been reorganized for maximum confusion since I last visited.  Here is a copy someone posted:
http://sdpha2.ucsd.edu/Lab_Equip_Manuals/USBTMC_1_00.pdf

When you say "set the measurement range, start a measurement, read the result" -- those are higher level concepts than USBTMC, and are about sending device specific SCPI commands.  USBTMC is concerned with sending messages, receiving responses, and executing control commands such as clearing the interface or aborting an in-progress transfer.  USB488.2 includes equivalent behavior to IEEE 488.2 such as serial poll and SRQ to notify you of events such as a measurement completion but that is still lower level than the application level commands you are talking about.

My suggestion is definitely to get things working on a PC first using libusb.  Most of the higher level code should stay the same if you want to move to a microcontroller, you will just have to replace the libusb calls with your appropriate platform USB calls.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf