03-01-2010 11:44 AM
I am trying to import a dll into 2009,
I've used Tools, Import, hsared library (.dll), I then don't get a choice on the next window "specify create or update mode" is selected. On the next window i have put the path to the dll and header in. There is them another windo with "include paths" and "preprocessor definitions" on, if I don't select anything here and hit next then the dll funtions have an x next to them on the following window.
I've attached the manual which includes some other programming tips but for VB and C++.
I hope someone can help.
regards
Stephen
Solved! Go to Solution.
03-01-2010 05:15 PM - edited 03-01-2010 05:17 PM
Since you don't include the mt.h file in your post it is hard to say anything specific, but I guess this header file includes other header files such a s Windows SDK files.
Another possibility is that it only defines the function pointer datatypes but doesn't declare the actual function prototypes at all. The shared library import wizard can not guess that the function pointer datatypes would correspond to a similarily named exported function and not seeing an actual function prototype that matches any exported function name is has to throw its hands into the air and simply give up.
But seeing that the DLL only exports three very simple functions, creating the according VIs yourself using the Call Library Node should be an easy exercise, if you at least know a minimum amount about C datatypes.
03-02-2010 03:57 AM
Rolf,
Here's the header file, does that help?
Stephen
03-02-2010 04:34 AM
// Header file for use with mtb.dll
typedef bool (*Type_InitMotoBee)();
typedef bool (*Type_SetMotors)(int on1, int speed1, int on2, int speed2, int on3, int speed3, int on4, int speed4);
typedef void (*Type_Digital_IO)(int *inputs, int outputs);
This file has indeed two problems. The first is the use of the bool datatype that is only a C++ datatype but not a standard C datatype. I don't think the import Wizard supports that but the solution would be do add an according define such as #define bool char to the defines part of the import wizard.
The bigger problem is that it only defines function pointer types but no function prototypes.
You can fix that by adding following lines at the end:
bool InitMotoBee(void);
bool SetMotors(int on1, int speed1, int on2, int speed2, int on3, int speed3, int on4, int speed4);
void Digital_IO(int *inputs, int outputs);
With this and the according bool define in the import wizard settings it should work
03-11-2010 06:11 AM
Thanks Rolf,
That worked really well.
Regards
Stephen
01-10-2011 08:10 PM
Hi. i am new to Labview and have been learning how to use it for the past 3 months. i have maanged to build a design layout and now want to focus on making the functions work. i have 5 sildes which i want to use to control 5 motors. i have a K8055 usb interface board and wanted help on how to use a slide to move the motor. any help is greatly appreciated
Joe
01-11-2011 01:43 AM
Where is the connection to the original topic? Please start a new thread about this and be prepared to provide a lot more information. This one is a bit like saying I have engine XYZ and want to build a car. Please help me with that.