LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

s-domain transfer function

I am trying to recreate my partners Matlab filter in Labview whereby a sine wave goes through a low pass filter. I am using a sinewave array as the input and am trying to impose the s-domain low-pass transfer function s/(1+sT) on the wave as is done in Matlab. Can a formula node from matlab be pulled into Labview.
Thanks
kilyg
0 Kudos
Message 1 of 2
(2,910 Views)
Hello.

It is possible to execute Matlab code in LaVIEW, if you have both LabVIEW and MATLAB installed in the computer. You have to use a "Matlab Script" node found in Functions >> Analyze >> Mathematics >> Formula.

However, I recommend using LabVIEW native functions, unless it is absolutely necessary to use MATLAB, because whenever I have had to interface to MATLAB, I have found, that error reporting is very bad. For example, if you use an undeclared variable in MATLAB, it immediately tells you there is an error. But when you use the MATLAB script node it does not, so, debugging is a pain. You have to make sure your Matlab code is error-free.

To use that Matlab script node, you have to right-click on the edge of it, and create inputs and outputs, and give them the exact same name as the variables you will use inside in the Matlab code.

One possible solution for this particular application in which you want to apply a simple filter, is to use the "Filter" VI, found in Functions >> Analyze >> Waveform Conditioning. You can set it to low-pass filter, and set the cut-off frequency, and stuff like that. (I am using LabVIEW 7.1, so if you have an older version, I am not sure if you have that VI available, especially if it is older than 7.0).

I do recall seeing a VI in which you could directly specify a transfer function, like what you want to do, but I could not find it. Perhaps it is because I do not have the control design toolkit installed, and it was part of that, but I will keep looking and let you know if I find it.

Good luck.

Alejandro
0 Kudos
Message 2 of 2
(2,901 Views)