PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquisition from Scope 5105 to matlab

I need an interface between the Scope 5105 and matlab. I want to transfer the plots received by the scope to a matlab programm for further processing.
There is no interface available at mathworks due to the fact that the 5105 doesn`t work with DAQ but with a special scope interface.
I think it would be an alternative to adapt an existing example of Labview to create datas from the scope plot in the HWS format and then transfering this to matlab where it is processed further. Could that work?
Did somebody here worked on this or a similar problem an could give me some advises?
 
 
0 Kudos
Message 1 of 10
(6,438 Views)
I cannot recognize whether you are looking for a online or offline processing in Matlab®.

For online processing you have generally two options:
  • High level implementation with TCP/IP or UDP communication between LabVIEW and Matlab®
  • Low level implementation with the "Matlab® Node" (located in Functionspalette - Mathematics - Scripts & Formula - Script Nodes - Matlab® Node)
    • The Matlab® node is the easiest way to establish an online communication. The variables of the Matlab® node (input and outputs) are directly accessible in the Matlab® workspace. This means you can read the variables declared as inputs and write variables which are declared as output.


For offline processing might use the easiest way: File Input/Output
    Use the following link for further information on this topic: http://digital.ni.com/public.nsf/allkb/562D29142BF79B4E862570D10074E3CC?OpenDocument


More information on the Matlab® node can be found here:
http://digital.ni.com/public.nsf/allkb/93DDF49DA2EFED528625670B005B48E9?OpenDocument

Thanks,
ThSa

Message Edited by ThSa on 10-16-2007 12:39 PM

0 Kudos
Message 2 of 10
(6,416 Views)
I designed such a data acquisition with the PXI-5105. Pretty like the same style shown in the figure above. Its all working well while using the auto setup (which is put in the while loop). But when i replace this by manual trigger vi's, i get an error message saying that vectors with same length are used to run the Matlab script. But the fact is i just transfer one value (Y5105) to Matlab which has to be plotted. Nothing else should be proceed by Matlab. Whats the reason for the error?
I would be gratefule for some help.
0 Kudos
Message 3 of 10
(6,354 Views)
Please post an example and the detailed error description.
Probably something isn't well configured.

Thanks,
ThSa
0 Kudos
Message 4 of 10
(6,349 Views)
The first figure shows the block diagram. All trigger values are the default values.

0 Kudos
Message 5 of 10
(6,346 Views)
This one shows the error message. Sorry...its in german.
0 Kudos
Message 6 of 10
(6,343 Views)
The loaded m-file comprises just:

plot(Y5105)
NumSamples=10000;
Stop=0;


Translation of the error message:
Error 1050 LabView: During execution of the matlab script an error has occurred.
Error message from server:???
Error using--> plot
Vectors must be the same lengths.
......

Possible causes:
LabView: Error during procession of the script.
0 Kudos
Message 7 of 10
(6,338 Views)
I guess I've seen the mistake.
The error is not related to the Matlab Script Server and/or the ActiveX interconnection, this is simply an aftereffect.

The niScope configuration/code you did requires the niScope Initiate Acquisition.vi to run as expected.
If you don't know how to use it have a look on this example:
C:\Program Files\National Instruments\LabVIEW 8.5\examples\instr\niScope\niScope EX Configured Acquisition.vi

To get an appropriate information on the current status use the error cluster.



0 Kudos
Message 8 of 10
(6,330 Views)
Thanks ThSa. I could solve this problem. But there is another one 🙂 .
I want to implement the ability to plot multiple graphs at the same time in Matlab. To realize this on the wavegraph in LabView is an easy one, but to transfer the required informations to the Matlab script node I need to use the Multi Waveform/1D Waveform Data Type or the /Cluster-Array at the 'ni Scope Read WDT' (shown in the block diagram figure above). Then to seperate the needed informations from the array of clusters to plot the multiple graphs in MatLab I need an appropriate 'splitter', but I can`t find one. Which one will do?
Thanks again for your help.
0 Kudos
Message 9 of 10
(6,315 Views)
The simplest way would be to use a For Loop and the "Get Waveform Components" function.
The dt is for all channels the same...



Message Edited by ThSa on 10-30-2007 10:49 PM

0 Kudos
Message 10 of 10
(6,309 Views)