07-22-2020 12:59 AM
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?
07-22-2020 01:15 AM
07-22-2020 04:46 AM - edited 07-22-2020 04:49 AM
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.
07-22-2020 10:12 AM
I see, do you know how I could import them in a LUT?
07-22-2020 10:28 AM - edited 07-22-2020 10:41 AM
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.