I want to make a biometric identification system of the ECG/EKG. Provided that Matlab does not perform Data Acquisition in Real Time (for monitoring), is there any way to make the monitoring and data acquisition in LabVIEW and then work simultaneously with Matlab for signal processing?
-
3Both, Matlab and Labview don't support real time data processing as both run on a non realtime OS. Why do you think data acquisition should be done in LabView? Good practice is to have some buffered input for data acquisition. This is not real time, but doing it right data will never get lost and the average processing delay is very low (<1/10s). I think a 100% matlab solution is probably right, but as your question lacks any details about your problem I vote to close it because there are to many possible answers. – Daniel Apr 02 '15 at 19:07
-
I don't feel this is too broad, since there is a way to do exactly what the OP asks for (see my answer below). – Ratbert Apr 02 '15 at 19:18
-
Why are you mentioning Real-Time here? Do you need to use LabVIEW realtime on a dedicated hardware? Why? Describe your setup. – mzu Apr 03 '15 at 18:55
-
@MikhailNZakharov Labview is dedicated to hardware and very fast to monitor the ECG/EKG Signal of the heart activity. – Zebbiche Badreddine Apr 06 '15 at 17:56
-
If I do it in Matlab, the plot (process of instantiating figure, plotting points of set of collected points and making everything in a big loop) will take very very long time. However, in the processing Matlab is so fast dealing with VEctors and Matrices. What I wanted is to make the data acquisition and monitoring on LabView and exporting everything to MAtlab do I can make my signal processing algorithms. Hope it's a bit clear now :) – Zebbiche Badreddine Apr 06 '15 at 17:58
-
"_instantiating figure and all the graphical objects_" should be done only one time, preferably _before_ you run the real-time loop. Then it's only update of the display, which can be quick enough in Matlab if done properly. Never measured it, but I would also fear that the overhead of passing data across the 2 platforms (`LabView<=>Matlab`) would defeat any small gain you would have made one one side or the other of your setup. – Hoki Sep 09 '15 at 12:52
-
1I've seen (compiled) LabVIEW run the same routine 1000x faster than (interpreted) MatLab. That kind of speed up is pretty good, and as long as data-passing is not horrible, something that can be realized in the overall application, not just one chunk of code. – EngrStudent Sep 29 '15 at 15:33
-
@Daniel LabVIEW Real Time does run on a real-time OS -- any of RT Linux, Pharlap, or VXWorks. – srm Nov 05 '18 at 00:25
4 Answers
You could just get a matlab compatible daq and run everything in matlab. http://www.mathworks.com/products/daq/

- 91
- 8
-
Oups, it's not for free.. What I wanted is to do it with the free LAbView and export the data to MatLab.. – Zebbiche Badreddine Apr 06 '15 at 17:55
-
2
You can indeed do some data acquisition with LabView and work simultaneously with Matlab for signal processing by calling the Matlab script node
, which executes some Matlab code during vi
execution.
You may have some performance issues, though, because both Labview and Matlab have to run on your machine simultaneously.

- 5,463
- 2
- 18
- 37
-
This will drive me to shift the signal processing to LabView while I was relying to do it on Matlab. Anything similar to bring the monitoring and data from LabView to Matlab? – Zebbiche Badreddine Apr 06 '15 at 17:55
-
I don't follow you. Have you looked at the link provided ? The `Matlab script node` exactly does what you want, _i.e_ transfering data from Labview to Matlab. What is wrong with this ? – Ratbert Apr 06 '15 at 18:36
-
Calls the MATLAB® software to execute scripts. Execution is on LabView. – Zebbiche Badreddine Apr 06 '15 at 18:48
-
I'm sorry but I still don't unerstand ... Can you be less laconic and answer with sentences ? – Ratbert Apr 06 '15 at 18:52
Question:
is there any way to make the monitoring and data acquisition on LabView and then work simultaneously with Matlab for signal processing
Answers:
- LabVIEW has "MathScript" node which is basic MatLab built into an add-on. It is not the MatLab toolboxes. It runs native MatLab code. It also runs slightly faster LabVIEW updates to the code. If your code runs there, then LabVIEW will pass data natively to your code. This box does not have direct MatLab toolbox access, so if you use any special calls then that can cause a problem.
- If you have MatLab on the box, then you can call the external MatLab function/code using mathscript (link), and the MatLab will run the function.
Clarification:
Real time just means "bounded time" (link), not "instant". If your idea of bounds are loose enough then many systems can work for them. You do not state it in your question - but what do you consider acceptable response time?

- 1,924
- 31
- 46
I've worked a lot with LabVIEW and Matlab. Personally, I would not use the Math Scripting node and would opt for using the Matlab Automation Server. You can call Matlab from LabVIEW using the ActiveX palette in LabVIEW (See Functions>>Connectivity>>ActiveX>>Automation Open) A couple reasons why I'd go for ActiveX and NOT the MathScript node:
The Math Script node does not allow you to change code dynamically. You must hardcode your data into the Math Script node and any future changes would require a change to LabVIEW's G code and therefore a recompile of your EXE
The Math Script node does not support all functions when compiled to an executable. Most notably graphing functions. See the help file here to read more on this.
Calling Matlab from ActiveX is going to give you a lot more flexibility in regards to how data is passed and processed.

- 371
- 2
- 4
- 16