wolfgang Posted February 16, 2006 Report Share Posted February 16, 2006 Hello, I'm trying to write a dll for use in LabVIEW. So I make this simple little dll source: #include "lvdll.h"__declspec(dllexport) int AddInts(int x, int y) { int z; z = x+y; return(z);} It compiles fine (using OpenWatcom compiler) and I write a little test C app and it works correctly when called from there. However, in LabVIEW, I use the call library function node, using C calling convention and wire up i32s to the parameters, I always get 1244517 as the result. If anyone has any idea what could be going on, I would appreciate the help. This is starting to drive me nuts. Thanks a lot, Jon Quote Link to comment
Yair Posted February 16, 2006 Report Share Posted February 16, 2006 First of all, what are your inputs? Second, how did you define the inputs in the CLF node? It doesn't matter what you wire into it, because it will only be coerced into the data type you defined. I think int should be "signed 32 bit integer". Have a look at the VI in Examples\DLL\Data Passing for more examples. Quote Link to comment
wolfgang Posted February 16, 2006 Author Report Share Posted February 16, 2006 My inputs are LV I32 controls. For the library function node, I'm using Signed 32 bit Integers. I've attached my little vi. I have also tried using the example method of returning void in the dll and using a pointer to an integer to get the data out, but that didn't work either. I'm wondering if it is a compiler issue (or maybe I'm exporting the function incorrectly or something), as I have called win32 dlls with no problems. Anyway, thanks for your help, Jon Download File:post-1931-1140114472.vi 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.