04-10-2008 10:06 PM
The link you provided explains the problem:
"If the function(s) you wish to call contains complex data types, you need to manually use a Call Library Function Node function in LabVIEW to directly call the DLL, defining the prototype within the configuration dialog (if the DLL has been compiled with a Type Library, parameter data and return types will be defined automatically). Note that if your complex data type is a struct with more than primitive data types (int, double, char), it is easiest to create a wrapper DLL from a C-based language. Since C/C++ constructs do not always directly correlate to LabVIEW data types, a wrapper DLL can appropriately extract the contents of the complex structure and translate them to primitive terms. For instance, if you have a struct in C which contains a char * (a string or character array), you can create a wrapper function which LabVIEW will call that takes in a char * type directly, puts that into a structure, and then in turn calls the DLL. Note that if you have the DLL source code, you can directly modify the DLL so that it takes in a char * instead of the struct.
Note: There is a very helpful example in the Labview Example finder that explains how to handle several different data types to be used with the Call Library Function Node. The example is named Call DLL.vi. Refer to this example when dealing with complex data types such as arrays or strucs. To Find this example go to the LabView Example Finder (Help»Find Examples) and select the Directory Structure radio button. In the directories list, select dll and then data passing then Call Native Code.llb. The Call DLL.vi example is under that directory"
04-14-2008 11:01 AM
Hi SS,
Looking at the library, the custom controls are empty clusters. The functions listed in the report have those data types as parameters, which is why they will not run. You will need to add elements to ALCcontext.ctl and ALCDevice.ctl. You can then drag those custom controls to any front panel and wire them as inputs to the Call Library Function Nodes that need them. You can also place either control on the front panel, right click and select Change to Indicator. Then they can be used to display the data returned from the DLL through the Call Library Function Node outputs.
04-14-2008 02:48 PM
04-16-2008 10:22 AM
Hi SS,
A custom control allows you to specify properties and then use that control on any front panel. You can also create a type definition when customizing the control.
In your case, each control is a cluster that is passed to the DLL. The custom controls need to match the function parameters. Are ALCdevice and ALCcontext type definitions in the C code? If they are structs, your LabVIEW custom controls should include the data that is in those structs. For example, if the struct contains a double and a character, you will want to place numeric and string controls in the cluster. The example Call DLL.vi mentioned in your post above shows how C data types correspond to LabVIEW data types.
04-16-2008 11:35 AM
04-21-2008 12:42 AM
Hi SS,
It looks like information on the elements of ALCdevice and ALCcontext is in openal-0.0.8\src\al_types.h. The structs include more than just the basic data types, which makes it more difficult to create custom controls. I will need to go through the code more before I can tell what the equivalent data would be in LabVIEW.
03-04-2009 08:24 AM
Hi SS,
I'm working on the use of OPENAL with LabView.
Did you find some issues or functionnal exemples ?
I'm ready to share any relevant information about that.
Best regards,
Benoît
03-05-2009 03:31 PM
Hi Benoît,
ShotSimon may or may not be monitoring this thread still since the last post was nearly a year ago. As far as I know there are still not any examples of using LabVIEW with OpenAL. You will likely want to use an OpenAL dll with the traditional LabVIEW shared library tools (Call Library Function Node, Import Shared Library Wizard, etc).