LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop fourier transform if it needs too long

Solved!
Go to solution

How can i stop the fourier transform vi if the user accidentially throws in too much data and it needs too long to finish?

Guess i should use the async call vi's from the application control palette and block other calls with a semaphore until termination.

As far i can see, the FT vi is called in a separate thread by default. But i can't find any vi called "stop this thread instantaneously despite it has not yet finished" or something similar.

If possible i would not want to stop the whole vi on timeout (which would be easy with parallel while loops), but only the FT vi.

Even better i would like to give the user the choice if/when to stop the fourier transform.

 

Yours Labuser

0 Kudos
Message 1 of 4
(2,731 Views)

The problem is that almost all of the signal processing functions are just wrappers around a DLL. To my knowledge, there is no way to programmatically terminate that DLL from within LabVIEW.

 

I think your best bet would be to just check array size before calling the transform VI.

0 Kudos
Message 2 of 4
(2,714 Views)
Solution
Accepted by topic author Labuser16383

How big is the input array to the fft? (Note that if there is a single NaN in the data, it might take hundreds of times longer, so watch out for that.)

 

Is the FFT 1D or 2D? If this a 2D FFT, you could replace it with a series if 1D FFTs and look for termination conditions after each slice, for example.

 

 

0 Kudos
Message 3 of 4
(2,680 Views)

I fourier transform rgb images into 2D complex double arrays, make some modifications and then transform it back. if the image is too large (f.e. 2000x1200 pixels)

FT needs either some 10 seconds or just bombs the user with out of memory messages. With small images (f.e. 512x512) there is no problem.

If there's no way to programatically terminate a dll (maybe this should be proposed in begs and wishes) i think i will try to make separate 1D transformations and then

combine them later on again as you suggested.

 

0 Kudos
Message 4 of 4
(2,669 Views)