bulebell Posted February 14, 2012 Report Posted February 14, 2012 when i use the NIDAQ.dll,in the labview .it can run and show it data ,but if i call this dll,the result is null ,what's wrong? NIDAQ_070528.zipFetching info... test_dll.viFetching info... Quote
candidus Posted February 14, 2012 Report Posted February 14, 2012 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); Quote
bulebell Posted February 15, 2012 Author Report Posted February 15, 2012 On 2/14/2012 at 11:31 AM, candidus said: 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. Quote
candidus Posted February 15, 2012 Report Posted February 15, 2012 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.viFetching info... 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. Quote
bulebell Posted February 23, 2012 Author Report Posted February 23, 2012 On 2/15/2012 at 10:59 PM, candidus said: 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.viFetching info... 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.