08-31-2009 09:44 AM
I have a sncore sensor and the API files I gopt from the company are below.
I am unable to call them inside labview. The error I get is usually
" One or more required inputs to this function are not wired or are wired incorrectly. Show the Context Help window to see what the connections to this function should be."
I am attachning the sencore API files I have.
08-31-2009 10:02 AM
08-31-2009 01:52 PM
thanks for your quick response smercurio_fc. Yes I need to acces the PodAPI.dll.
i didnot get what you said earlier like the wrapper dll. My labview knowledge is limited.
My question also is do I need to use VISA to communicte with my device. I am very
confused regarding this issue. Also let us say if I want to call only function for example
BOOL PodGetRGBValue(HPOD *port,float *Red,float *Green,float *Blue) then what data type should I choose, as
there is no float in call library functions.
08-31-2009 05:06 PM
You would not use VISA since you have a DLL. VISA and the use of a DLL are mutually exclusive.
A wrapper DLL is a DLL that you would write to act as a go-between between LabVIEW and another DLL. This is required under certain situations. In the PodAPI DLL there are 5 functions. The function to connect to the device is PodConnect. This returns a pointer to a structure which is quite complicated - it has arrays, and pointers to other structures. You can't create a compatible datatype in LabVIEW to be able to access this structure's elements. Thus, if you needed to change one of the parameters of this structure you would need to create a wrapper DLL that locally holds in memory the pointer to the structure and exposes functions that allow LabVIEW to modify the individual parameters. These functions would use simple datatypes. If you don't need to change any of the structure's parameters then you may be able to simply treat the return value of this function as just an integer, because that's all that a pointer is. You can then pass this integer to the other functions which require a pointer to an HPOD structure. If all of this sounds like gobbledigook, then you have a larger problem in that you don't know what DLLs are.
As for the "float" question, that's just a DBL datatype in LabVIEW.
Having said all that, the PodAPI DLL does not appear to be a C DLL. At least, I cannot get a list of functions from it using the Call Library Function Node. I even tried using Dependency Walker. Are you sure it's a C DLL?
09-01-2009 03:28 PM
smercurio_fc, The API files and sample application are written in C++. I think it should work
in labview or will I face problems. I am trying to take a proper look at the code and see whatever
I can understand from it. Let know if u stumble on anything else.
thanks for your time
09-01-2009 04:59 PM
09-02-2009 01:38 AM
smercurio is right about the PodConnect() function returning a structure pointer but it is not clear if that is a problem here. If you do need to access any of the values in that structure directly then yes you have a problem. If you can live with only calling the 5 or so functions exported by that DLL (as is done in the SampleApp included in that archive), without a need to look into the HPOD structure yourself at some point then you can simply treat that HPOD * datatype as a pointer sized integer, passed by value.
Basically everywhere you see the HPOD * datatype you configure the according parameter in the Call LibraryNode to be a pointer sized integer.
If you however find out that you need to look into the values stored in that structure directly then yes you do need to write a wrapper DLL, that exports more convenient functions for LabVIEW to get at that data.
Rolf Kalbermatter
09-02-2009 03:43 PM
Can anyone create a sample to call any function from the dll files I gave.
The examples i have been searching are also not very useful. thanks
guys for u rhelp.
09-02-2009 03:48 PM
09-02-2009 04:03 PM
smercurio_fc you have ben of incredible help to me, thanks. When I search
in Ni developer zone or in simply google, many mention that C++
could be called from labview. I donot know, I will dig more into this
tonight. You also said that one could create a wrapper if I want to use dll,
there are some examples but none had clarity. If you have any examples
which could give me a proper idea.
Also if I have a C dll where to I see all the list of functions when I select
it my Call library function node as you said. Are you using the call-Lib-func node
or trying to import them from the library.