bulebell Posted February 14, 2012 Report Share 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.zip test_dll.vi Quote Link to comment
candidus Posted February 14, 2012 Report Share 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 Link to comment
bulebell Posted February 15, 2012 Author Report Share Posted February 15, 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); thanks very much! can you help me to offer me a sample? i am a freshman. Quote Link to comment
candidus Posted February 15, 2012 Report Share 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.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. Quote Link to comment
bulebell Posted February 23, 2012 Author Report Share Posted February 23, 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.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. Quote Link to comment
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.