03-12-2013 04:04 PM
Most often this error is due to choosing the wrong calling convention in the configure call library dialog. Are you using WINAPI or C? Most likely you should be using C. Also try setting the error checking level to Maximum and see if you get a more helpful error message.
03-12-2013 06:39 PM
It looks like changing [calling convention] to stdcall (WINAPI), I no longer get error when I run the code. However, I am still not sure if I am getting back anything valid from the DLL. I used a "getvaluebypointer.xnode" as recommended in previous thread, I assume the DLL is suppose to give me a value that points to the memory location of the 3 bytes for (1, I2C freq, 2, 3.3V power output state, 3, 5V power output state). The return type is defined as int 32.
03-12-2013 06:44 PM
You were misled in the first reply. If the function calls works properly, your data is in the array output (directly across from the array input). The return value is something else entirely, probably a success/error indicator but you'd have to check the documentation.
Why are you initializing the array to 255 elements? From the documentation, it appears that you only need 3 elements (for the three values).
03-12-2013 07:45 PM
I have tried an array size of three, it doe not make difference. I get back a zero from the DLL.
03-13-2013 12:18 AM
Can you post your code?
Also, are you sure 0 is the wrong value? Try initializing the array to something else before you call the function and see if it still returns 0.
03-13-2013 02:52 AM
@ZhuoCao wrote:
I have tried an array size of three, it doe not make difference. I get back a zero from the DLL.
A zero return value? That may be an error code return and 0 may indicate success!
Create an Indicator on the right side of the array parameter on the Call Library Node and look at the first three values in that array.
03-13-2013 03:44 AM
Zhuo,
functions in C do not work in the manner, that everything in parameters is input, and the return is output.
Your functions takes 1 argument, that is pointer to data, and the function looks where the pointer points, and fills the data with some hw info.
After calling this function, you will see the HW info in the array or string you passed as an argument !
If your function returns integer, this usually means the error. If you get values like 0 or 1, it is usually success indication, if you get some negative nonsense number, that would be an error number.
03-13-2013 11:33 AM
Thank you guys very much for the reply, I now able to get the correct value back from the DLL.