LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to continuously read from scope and pass data to Matlab script?

Hi all, 

 

I'm stuck at getting my code to continuously read data from Tektronix scope and pass the data to Matlab script so it can be processed. I like to read say 1 channel (V1) and pass this to Matlab for further processing. I have made a simpler code to show what I mean (screen shot below). 

0 Kudos
Message 1 of 5
(3,084 Views)

Try putting the Matlab script node inside the While Loop.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(3,072 Views)

Hi, 

I've tried that but I get an error to do with dimension mismatch. I can't exactly find which variable is causing it. I have attached my full code. As you can see, it can run once fine but once you put it in a loop or run continuously, you get the error. 

 

Thanks

0 Kudos
Message 3 of 5
(3,067 Views)

I don't have your DSO or the IV's that go with it, but I am guessing you need to lose the Express vi's and those variant data lines, that stuff never works...

 

Index and unbundle the traces and you should have X,Y, and Dt for each sweep, use those values in your script node.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(3,058 Views)

I tried removing the express VIs and unbundled the trace to get the variables and fed to matlab script. But the problem still exists. I can't figure out which variable doesn't get cleared up/updated and it goes out of dimension. 

0 Kudos
Message 5 of 5
(3,026 Views)