LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Formula Node

I have some old pascal code that I'm bringing into Labview and I'm having some trouble. Most of it is working just fine, but I have one subroutine I can't get to work. The subroutine is a modified FFT. Unfortunately not modified by me so i'm not sure where the differences are which keeps me from using the built in FFT.

I've attached the original version in pascal and my version in Labview as a formual node. The VI outputs a bunch of noise, not an FFT. I believe I've copied the code. I'm quite confused where the error is coming from. If anyone can find something in the formula node like declaring variables or .. something that would be great.
Download All
0 Kudos
Message 1 of 3
(2,680 Views)
I won't try to understand you FFT routine, but I still have a couple of comments.
One translation problem:
From Pascal
if j>i then begin
to LabView formula node
if (j>1)
i became 1.
You correctly recognized the difference between LabView and C basing the array index on 0 and Pascal basing the array index on 1. It can be confusing changing from one to the other. One way to do so with minimum impact on the code is to use LabView to insert a row at row 0, then go to the formula node treating everything as a 1 based array, then strip row 0 out with LabView after the formula node. In LabView's Array palette, look at the functions Insert Into Array to add row 0, and Array Subset to remove the row.
Have you tried using one of LabView's FFT VIs from the Analyze >> S
ignal Processing >> Frequency Domain palette to see if you get the same result as running through the original Pascal application?
0 Kudos
Message 2 of 3
(2,680 Views)
Why not build the pascal code into a dll that you call from LabVIEW? It is a nice and easy solution (provided you know how to build dlls in pascal).
0 Kudos
Message 3 of 3
(2,680 Views)