Jump to content

dll calling issue


Recommended Posts

The configuration of the Call Library Function Node is wrong. Take a look at the header file of your DLL. The required function prototype is:

void __stdcall NIDAQ_Wave_Get_070528(char DAQPort[], double rate,

long samplesPerChannel, long inputTerminalConfiguration, LVBoolean *Result,

double *Amplitude, double *Frequency, char ErrorMsg[], long *len);

Your Call Library Function Node is actually configured for:

int32_t __stdcall NIDAQ_Wave_Get_070528(void *input terminal configuration, int32_t Amplitude,

int32_t Frequency, CStr DAQ Port, int32_t samples per channel, int32_t rate);

Link to comment

The configuration of the Call Library Function Node is wrong. Take a look at the header file of your DLL. The required function prototype is:

void __stdcall NIDAQ_Wave_Get_070528(char DAQPort[], double rate,

long samplesPerChannel, long inputTerminalConfiguration, LVBoolean *Result,

double *Amplitude, double *Frequency, char ErrorMsg[], long *len);

Your Call Library Function Node is actually configured for:

int32_t __stdcall NIDAQ_Wave_Get_070528(void *input terminal configuration, int32_t Amplitude,

int32_t Frequency, CStr DAQ Port, int32_t samples per channel, int32_t rate);

thanks very much! can you help me to offer me a sample? i am a freshman.

Link to comment

You have to configure the Call Library Function Node according to the prototype of your C function, all argument types and positions have to match.

Here is a modified version of your VI with the (hopefully) correctly configured Call Library Function Node:

test_dll.vi

Note: A function argument that returns data must be a pointer. If an argument returns a string you have to allocate memory before: You can initialize an array of U8 and use that as string argument.

Link to comment

You have to configure the Call Library Function Node according to the prototype of your C function, all argument types and positions have to match.

Here is a modified version of your VI with the (hopefully) correctly configured Call Library Function Node:

test_dll.vi

Note: A function argument that returns data must be a pointer. If an argument returns a string you have to allocate memory before: You can initialize an array of U8 and use that as string argument.

thanks very much. for your information, i had wrriten a successful program.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.