Feedback on NI Community

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create dynamic link library

hello all,
        please help me to create the dynamic link library code linking with C using 2dimensional array...
#include "extcode.h"
#include "stdio.h"
#include "math.h"
#define PI 3.1415
_declspec(dllexport)float sum(short int x, short int y, float r, float l, float z1, float z2,
 float z3, float z4, float z5, float z6, float z7, float z8, float z9,
 float z10, float z11, float z12, float z13, float z14, float z15, float a1,
 float a2, float a3, float a4, float a5, float a6, float a7, float a8,
 float a9, float a10, float a11, float a12, float a13, float a14, float a15,
 float p, float w);
_declspec(dllexport)float sum(short int x, short int y, float r, float l, float z1, float z2,
 float z3, float z4, float z5, float z6, float z7, float z8, float z9,
 float z10, float z11, float z12, float z13, float z14, float z15, float a1,
 float a2, float a3, float a4, float a5, float a6, float a7, float a8,
 float a9, float a10, float a11, float a12, float a13, float a14, float a15,
 float p, float w)
 {

  int i[25][25]={x},j[25][25]={y};
  for(y=(12);y>=(-12);y--)
 {
  for(x=(-12);x<=12;x++)
  {
   r=((x*x)+(y*y));
      l=((sqrt(r)/25));
   
     if(l<=(0.5))
    {
     if(x<0 && y>0)
     p=(atan(y/x))+PI;
       else if(x<0 && y<0)
      p=(atan(y/x))+PI;
       else if(x>0 && y<0)
        p=(atan(y/x))+(2)*PI;
       else if(x>0 && y>0)
        p=((atan(y/x)));
       else if(x==0 && y>0)
        p=(PI/2);
       else if(x<0 && y==0)
        p=(PI);
       else if(x==0 && y<0)
         p=3*(PI)/2;
       else if(x>0 && y==0 || x==0 && y==0)
          p=(0);
      
     z2=2*(l)*cos(p);
     z3=2*(l)*sin(p);
     //printf("%f",z3);
     z4=(sqrt(3)*((2*l*l)-1));
     z5=(sqrt(6)*((l*l)*(sin(2*(p)))));
     z6=(sqrt(6)*((l*l)*(cos(2*(p)))));
     z7=(sqrt(8)*((3*l*l*l)-(2*l))*(sin)(p));
     z8=(sqrt(8)*((3*l*l*l)-(2*l))*(cos)(p));
     z9=(sqrt(8)*(l*l*l)*(sin(3*(p))));
     z10=(sqrt(8)*(l*l*l)*(cos(3*(p))));
     z11=(sqrt(5)*((6*l*l*l*l)-(6*l*l)+1));
     z12=(sqrt(10)*((4*l*l*l*l)-(3*l*l))*(cos(2*(p))));
     z13=((sqrt(10))*((4*l*l*l*l)-(3*l*l))*(sin(2*(p))));
     z14=(sqrt(10)*(l*l*l*l)*(sin(4*(p))));
     z15=(sqrt(10)*(l*l*l*l)*(cos(4*(p))));
     w=((a1*z1)+(a2*z2)+(a3*z3)+(a4*z4)+(a5*z5)+(a6*z6)+(a7*z7)+(a8*z8)+(a9*z9)+(a10*z10)+(a11*z11)+(a12*z12)+(a13*z13)+(a14*z14)+(a15*z15));
    
   printf("k[%d,%d]=w=%f\t",x,y,w);
    }
     else
printf("k[%d,%d]=w=%f\t",x,y,0);
  }
  }
 }
this is my example program so plz tell me how to creat DLL for this program/.. thank u
0 Kudos
Message 1 of 2
(5,839 Views)
you should re-post this in the CVI forums.
Regards
Ray Farmer
Message 2 of 2
(5,839 Views)