USBTMC device class support

01 Aug 2014

Hi all, I think it would be a great idea to add some kind of USB TMC (http://digital.ni.com/public.nsf/allkb/044FA220F32774ED86256DB3005850CA) support to the current mbed USB stack.

Although on first glance it appears to be just a NI / Agilent thing, this is actually used by a huge amount of common USB test gear (tektronix, agilent, keithley etc), and programs like NI LabView and matlab are all well versed in talking over this protocol.

This would really ease the development of serious test and measurement instruments on mbed!

On linux, there is a reasonably well working kernel driver implementing support. On Windows, NI VISA and other libraries are available.

I'm not 100% sure exactly how much this differs from the HID support already in place.

Thanks Dan W

01 Aug 2014

Nice idea. Actually surprised they aren't running it just on USBCDC, since in the end GPIB are just ASCII commands, but I guess that would make too much sense. I would expect it should be fairly doable to add.

Question 1: Are you thinking about host or device side? (In other words, playing a measurement instrument or controlling one).

Question 2: What would the output of such a class be? Partly ASCII code, and some commands automatically responded to? Or make the class also handle the commands.

01 Aug 2014

Perhaps this link can be of any help http://www.microchip.com/forums/m389220.aspx

Last message in the list - user nuess0r created open source C code, allbeit for another processor, perhaps worth porting to mbed?

04 Aug 2014

Hi Frank, Erik many thanks for your replies. I would be thinking of the mbed as the device - it actually seems a lot of what people are doing with these kinds of boards is creating sensors / measurement equipment. In the field of professional lab work (which is what I do day to day), the lingua franca of such things would be GPIB/TMC type equipment - and mbed can be incredibly useful in these fields if we can easily integrate it into existing measurement rigs. The best way to do that would be by having it compatible with GPIB type interfaces, of which USBTMC is the appropriate one for USB transport.

It surprises me also that it isn't just CDC!

I was thinking of some kind of subclass of the USBDevice support stuff (which I haven't looked at for a while, so may be out of date), which is similar to the USB HID class, except implementing the TMC device. I would envisage that the user has to provide quite a lot of "scaffolding" (i.e. I think it's probably a bit much to implement a load of SCPI commands into the class), but I'm not sure on this point yet.

I'd be willing to write it, but my spare time is very minimal at the moment!