Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use Mathematica 9 for to acquire data from a Measurement Computing (MC) USB-201 analog to digital (and other) device for classroom demonstration. I do not have a budget to buy LabView and link Mathematica with it to accomplish what I would like to.

Within Mathematica I have tried using Manipulate to see if I can detect a signal (anything) from this board (excited artificially with a variable 0-5V source). So far, I do not see any changes indicating I am communicating with this equipment.

Has anyone done something like this? Do I need a driver, and if so, where do I get it?

Clearly, I am not a DAQ expert. I need someone to speak slowly and distinctly so I can understand them.

Thank you.

share|improve this question
Use the C++ library Measurement Computing is distributing ? – Sektor Jan 18 '14 at 22:03
@Sektor Why the question mark... Anyway, the obvious follow-up is how? This is what the OP wants to know. – C. E. Jan 18 '14 at 23:00
Can you elaborate on what you used inside your Manipulate? – bobthechemist Jan 18 '14 at 23:10
Have you seen the device interface? And this guide? – carlosayam Jan 19 '14 at 0:13
@Pickett A suggestion. Well, he did not specify ... – Sektor Jan 19 '14 at 0:26

If this device support NI-VISA (as I understood from your reference to LabVIEW), then you can use following way:

  1. Install the VISA engine (available at National Instruments' web-site)
  2. Use the following code.

    lib = LoadCOMTypeLibrary[
    "C:\\Program Files (x86)\\IVI \Foundation\\VISA\\VisaCom\\GlobMgr.dll"]
    mgr = NETNew["Ivi.Visa.Interop.ResourceManagerClass"];
    OSA = NETNew["Ivi.Visa.Interop.FormattedIO488Class"];
    devs = mgr@FindRsrc["?*instr"];
    devdescr = {};
    OSA@IO = mgr@Open[devs[[i]]];
    OSA@WriteString ["*IDN?"];
    id = OSA@ReadList[];
    AppendTo[devdescr, id[[2]]],
    {i, 1, Length[devs]}];
    If[devs == $Failed, devs = {"empty"}; devdescr = {"NoDeviceDetected"}];

The first string enables NETLink and the next three strings load the VISA global manager and create an object named OSA.

The next block asks the VISA global manager for connected devices and gives you a list, devs, with their inner descriptions, devdescr.

You can connect to the needed device using the command:

OSA@IO = mgr@Open[devs[[x]]]

Where x is number in the list... After this, you can send any commands to a device using

OSA@WriteString ["<command>"]

And read answers using:




The list of supported commands should be in the user manual for your device.

share|improve this answer
Shouldn't "\\IVI \Foundation\\" be "\\IVI\\Foundation\\"? – Peter Mortensen Jun 3 '15 at 22:54
In "Needs["NETLink`"]", what does the ` do (after the "k")? – Peter Mortensen Jun 3 '15 at 22:55
@Peter, the backtick denotes the context of the functions about to be loaded by Needs[]; in this case, NETLink` . – J. M. Jun 3 '15 at 23:20
In the line "devs = mgr@FindRsrc["?*instr"];" I get this error: "A .NET exception occurred: \ System.Runtime.InteropServices.COMException (0x8002000B): HRESULT = \ 8002000b at Ivi.Visa.Interop.ResourceManagerClass.FindRsrc(String expr).". What may be wrong? – LeoRon7 Nov 30 '15 at 21:53
@LeoRon7, Did you check the mgr value? Try NETTypeInfo[mgr], do it has such method as FindRsrc? If it has then try mgr@FindRsrc["?*"] Will it show you any connected instruments? – Rom38 Dec 1 '15 at 15:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.