Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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 at 22:03
    
@Sektor Why the question mark... Anyway, the obvious follow-up is how? This is what the OP wants to know. –  Pickett Jan 18 at 23:00
    
Can you elaborate on what you used inside your Manipulate? –  bobthechemist Jan 18 at 23:10
    
Have you seen the device interface? And this guide? –  caya Jan 19 at 0:13
    
@Pickett A suggestion. Well, he did not specify ... –  Sektor Jan 19 at 0:26

1 Answer 1

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 NI web-site)
  2. Use following code.

    Needs["NETLink`"]
    
    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 = {};
    Do[
    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"}];
    

First string enables NetLink and next three strings load the VISA global manager and create object named OSA.

Next block ask VISA global manager for connected devices and gives you a list devs with their inner descriptions devdescr

you can connect to needed device using command:

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

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

OSA@WriteString ["<command>"]

and read answers using

OSA@ReadList[]

or

OSA@ReadString[]

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

share|improve this answer

Your Answer

 
discard

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.