I want to create a DLL-File with Visual Studio 2008.
First I have modify the project “simpleFFT”. Then I have compiled the project. The DLL-File was created, but I cant import the DLL-File in Labview, because the import wizard cant find the function name.
Here is my code:
// includes, system
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
// includes, project
#include <cufft.h>
#include <cutil_inline.h>
#include “C:\Program Files\National Instruments\LabVIEW 8.6\cintools\extcode.h”
__declspec(dllexport) void Window_For_FFT(unsigned int Data_In, unsigned int Filter_Value);
static global void window(float *Data_In, float *Filter_Value , int, int);
void Window_For_FFT(float *Data_In, float *Filter_Value)
{
dim3 dimGrid;
dim3 dimBlock;
dimBlock.x = 512;
dimBlock.y = 1;
dimGrid.x = 2;
dimGrid.y = 1000;
window<<<dimGrid, dimBlock>>>(Data_In, Filter_Value, 1000, 1024);
}
// Fenster für FFT berechnen
global void window(float *waveform, float *coeff, int n_waveform, int number_of_coefficients)
{
int tidx = threadIdx.x + blockIdx.x*blockDim.x;
int tidy = threadIdx.y + blockIdx.y*blockDim.y;
if( tidx >= number_of_coefficients )
{
return;
}
if( tidy >= n_waveform )
{
return;
}
waveform[tidy * number_of_coefficients + tidx] = waveform[tidy * number_of_coefficients + tidx] * coeff[tidx];
}