LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using MathScript Node or MATLAB Script Node in LabVIEW FPGA?

I am using MATLAB to generate a signal waveform that I would like to run through an FFT (Fast Fourier Transform) node in LabVIEW FPGA, but as far as I can see it does not allow me to use either the MathScript Node or the MATLAB Script Node in LabVIEW FPGA. I read about this LabVIEW MathScript RT Module that supposedly allows for MATLAB code implementation into a LabVIEW FPGA VI for deployment to a real-time target, but it looks like it's been discontinued or something. I have the PXIe-7846R set as my FPGA target in my VI. Does anyone know how I could use MATLAB code for this generated signal in LabVIEW FPGA?

0 Kudos
Message 1 of 5
(1,779 Views)

Hi Trekkie,

 

AFAIK you cannot use any MATLAB code inside of LabVIEW-FPGA…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,765 Views)

LabVIEW RT and LabVIEW FPGA code are two entirely different things, even though they typically run on the same device.

RT VIs are compiled to run on the CPU contained in a NI controller. This is done with a compiler similar to GCC that creates an executable file that can then be started. FPGA VIs are however converted into VHDL description language, which then is fed into one of the Xilinx compilers that finally creates a logic bitmap file. This file is then loaded into the FPGA fabric and determines directly how the hardware cells are connected together and their behavior.

 

If Matlab could generate VHDL code you MIGHT be able to integrate that into a LabVIEW FPGA VI through the Component Level IP node. Might is here.emphasized since VHDL isn’t a very strictly defined language description. There are limits what datatypes the CLIP node supports and many different ways to describe particular interface descriptions. 
Are you really calculating new Waveforms continuously? Otherwise you might precalculate them and import them in a LUT. Another approach might be to calculate them in your RT VI and send them through a DMA FIFO to the FPGA code.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 5
(1,734 Views)

I see, do you know how I could import them in a LUT?

0 Kudos
Message 4 of 5
(1,719 Views)

From Matlab save to tab or comma separated spreadsheet file. In LabVIEW FGA drop a LUT node and im the configuration dialog select “Import from file” or something similar.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 5
(1,714 Views)