PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect PXIe-5162 by Matlab?

Hi,

I try to control my NI PXIE-5162 using the Ni Scope and Matlab Instrument Control Toolbox. Ni Scope can connect it. But Matlab cannot connect it. After conducting the command 'connect(ictObj) ' , there is an error:
                        Yunzheng_0-1575257463125.png
The whole commands are:
                         Yunzheng_1-1575257463126.png
However, Matlab's Test & Measurement Tool can support PXIe-5162, as follows:
Yunzheng_2-1575259526440.png

But on Matlab website, there is no PXIe-5162 in Hardware Support, as follow.

Yunzheng_3-1575267239281.png
How can I connect the device? Are there any command sets that can be used to control PXIe-5162 by Matlab?
Thank you.
0 Kudos
Message 1 of 3
(2,197 Views)

Hi,

 

May you please try to follow below guide to connect to 5162 and follow the naming conventions.
https://www.mathworks.com/help/instrument/examples/fetch-waveforms-through-niscope-matlab-instrument...

Otherwise you may use python/LV code to interact with 5162 and call it from Matlab.
https://nimi-python.readthedocs.io/en/master/

0 Kudos
Message 2 of 3
(2,121 Views)

Hi Gevor, 

 

Thank you very much.

 

I tried many times and finally found the right way to connect PXIe-5162.

When creating a MATLAB Instrument object, you should use the same name in 'icdevice' function as shown in Ni MAX. For example, the name in the following picture is 'OSCILLOSCOPE'. Then, you should do like:

%Create a MATLAB Instrument object
ictObj = icdevice('niScope.mdd', 'OSCILLOSCOPE', 'optionstring', 'simulate=0');

 

If you don't use the same name, you will get errors every time.

 

0 Kudos
Message 3 of 3
(1,791 Views)