- If the device is a traditional NI-DAQ (Legacy) device that shows up as "Device 2" - the resource string will be DAQ::2
- If the device however is a NI-DAQmx that shows up as "PXI1Slot6" the resource string will be DAQ::PXI1Slot6
Help request: using Instrument Control toolbox with Ni-Scope and PXI-5122
4 views (last 30 days)
Show older comments
Hi Everyone,
I'm trying to use Matlab (2011a) with the Instrument Control toolbox (2.12) to control a NI PXI-5122 Digitizer (which should be supported: http://www.mathworks.com/products/instrument/hardware/national-instruments.html).
The PXI-5122 and a NI-PXI 8106 embedded controller (with winXP and Matlab) are mounted in a PXI-1042Q chassis .
Now I'm trying to follow the demo "Using the NI-SCOPE driver with National Instruments Devices" ( http://www.mathworks.com/products/instrument/demos.html?file=/products/demos/shipping/instrument/demo_niscope.html )
First I had installed the NI-SCOPE driver version 3.7 and I got error after the " makemid('niscope') " command... then I noticed in the documentation that the Instrument Control toolbox supports NI-SCOPE 3.4 so I downgraded my NI-SCOPE drivers. (hey 3.4 is from 2007 !! the last version is 3.8 ...)
Now the
makemid('niscope')
command seems successful and the
niScopeObj = icdevice('niscope.mdd', 'DAQ::1')
also with:
Instrument Device Object Using Driver : niScope
Instrument Information
Type: IVIInstrument
Manufacturer: National Instruments Corp.
Model: NI Digitizers
Driver Information
DriverType: MATLAB IVI
DriverName: niScope
DriverVersion: 1.0
Communication State
Status: closed
but when I do
connect(niScopeObj);
I get the error:
??? Error using ==> icdevice.connect at 117
The VXIplug&play driver could not connect to the instrument using the
specified resource.
If this error is not an instrument error, use MIDEDIT to inspect the driver.
I think the resource name could be wrong but where I am supposed to find the correct resource name?
I tried with 'DAQ::1', with 'pxi5122' (which is the name that I see in NI Measurement & automation Explorer), 'PXI11::15::INSTR' (which should be the address of slot 2 in my chassis according to http://digital.ni.com/public.nsf/allkb/2D18F70FD412A28286256B66005414FE )
I've also tried with and without " 'optionstring','simulate=true' " but nothing...
I noticed also that in MIDEDIT under "Initialization and cleanup" the Create, Connect and Disconnect functions are empty apart a comment...is this correct?
Please help me! :-)
Thank you, Best Regards
D.
0 Comments
Answers (3)
Ankit Desai
on 15 Apr 2011
You can get the correct resource string from either the NISCOPE front panel application that comes with the NISCOPE driver or from NI Measurement & Automation Explorer.
Once you open the NISCOPE front panel, the application will bring a pop up dialog asking you to select a device. You can get the resource string from that dialog box.
Another way to get the resource string is to look at NI Measurement & Automation Explorer.
-Ankit
5 Comments
Ankit Desai
on 5 May 2011
I am not able to reproduce the issue with NI PXI-5102, NISCOPE version 3.4.
Make sure you have NI front panel closed before you try to connect from MATLAB command line.
Also you can try installed version 4.1 of the NI IVI Compliance Package (NICP) from http://joule.ni.com/nidu/cds/view/p/id/1420/lang/en.
If none of those work, it would be best to call MathWorks Technical Support - support@mathworks.com
Martijn
on 11 May 2011
To add to Ankit's instructions, there is also a third option:
3. The device can be NI-DAQmx and show up as "Dev1" or "Dev2", etc. in that case use 'Dev1' or 'Dev2', etc as resource string.
3 Comments
Martijn
on 12 May 2011
Based on your screenshots, I would say you need 'DAQ::PXI1Slot2' instead of 'PXI1Slot2'.
See Also
Categories
Find more on Instrument Connection and Communication in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!