LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Matlab script node for real time purpose

Hi!

We are trying to control in real time the frequency of a vibration motor with a voltage signal proportional to EMG activation.

Our EMG sends data to a LAN port and we read them in Labview using the UDP Read function.

We created a VI which reads data from UDP connection, parses the header and does the decoding (according to the data type of our EMG device, TMSi Porti).

Every sample read from UDP port is passed to the Matlab script node which implements a Bayesian filter which returns a value (MAP) used to control the vibration frequency.

The problem is that this operation is extremely slow...(about 15 seconds!!) and we need it to be real time!

We tried also a simple MA filter and the delay is reduced to around 2 sec, so we think that the major problem is in the Matlab script node.

We wonder if this delay is due to the call of an external code (Matlab) or to the complexity of the Matlab code itself.

Do you know how to improve the performance of this VI?

Thank you!

Serena

 

0 Kudos
Message 1 of 2
(2,648 Views)

Serena

 

I noticed that your code also have LabVIEW MathScript RT code. Have you tried to replace the Matlab scriptnode with it? The MathScript Node compiles the script natively into G function and avoid transfering information between programs.

 

If this does not speedup your application, please attach the subVIs and test data that allow us to reproduce the problem and performance. Also, what is the version of LabVIEW that you are using? If it is before LabVIEW 2009, then I would strong recommend update to that version.

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 2
(2,632 Views)