LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I can't be the first to ask this question... Giga-tronics 8888A - USB ?

Hi- I've searched the board and don't see a reference to this.  At least I've tried not to duplicate a previous question... 🙂

 

I am updating a measurement app that is developed with CVI 8.1.

All previous instrument comms have used GPIB.  

App works beautifully, but needs an upgrade on an instrument.

The owner of the app now wants to add a USB comms device, a Giga-tronics  8888-A.

http://www.gigatronics.com/product/c/GT-8888A-USB-Power-Sensor

 

The device comes with the necessary .dll, .lib and .h.

However, if I attempt a static link the linker cannot find the function calls.

 

Next I attempted a dynamic link and successful loaded the .lib, but again the function could not be found.

In that case LoadExternalModule (pathname) was successful, but GetExternalModuleAddr (module_id, funname, &status)

returned an error.  (yes, I checked spelling).

 

Has anyone had these problems before?  

What are the typical problems I should look for with 3rd part libs?  

Any typical "Fixes" to recommend?

 

Thank you.

//

 

0 Kudos
Message 1 of 14
(3,474 Views)

 

I generally find myself doing this on 3rd party libraries to be able to use them properly.

 

From what you have described, it looks like it will solve your problem of static linking.

 

 

 

 

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 14
(3,467 Views)

Hi- thanks for the tip.  Reading through the description I am curious- is the lib file created based on scanning and interpreting the include file, or based on reading and interpreting the DLL file?

 

0 Kudos
Message 3 of 14
(3,455 Views)

ebalci - thank you for the help.  This has started me down the correct path- 

 

One new question is that the "generate dll import library" now barks at this line:

GTPM_API STATUS __stdcall GTPM_GetExtendedAveraging(unsigned long instrumentHandle, BOOLEAN *pEnabled, long *pExtAveraging);

with the error "missing parameter type".

 

It does not understand the BOOLEAN type.  I understand the c does not have this type, so how do we ensure that the "generate dll import library" knows this type? 

 

Since this is a third party .h, .lib and .DLL then maybe I am left to contacting giga-tronics and getting support from them.    Thanks again for the help.

0 Kudos
Message 4 of 14
(3,445 Views)

Could you direct us to where the dll, .h and lib file can be found or post it here? BOOLEAN is probably a typedef and not the standard bool type, which C doesn't have.

Rohama K.
0 Kudos
Message 5 of 14
(3,430 Views)

Hi-

thank you for the offer to look at this.

Attached are the three files- .h, .lib & .dll, and also the "programming manual" from Giga-tronics.

Any guidance is greatly appreciated.

 

0 Kudos
Message 6 of 14
(3,426 Views)

I get the following error when trying to generate a DLL import library:

Error: Unable to create import library. Error in header file at line 189, column 5: Syntax error; found ‘identifier’ expecting ‘}’.

 

Did you get this error at any point?

Rohama K.
0 Kudos
Message 7 of 14
(3,422 Views)

if I recall I think that was due to the formating of the enum & struct statements in the header file.  Is that line number on one of the "enum" or "struct" declarations?

I believe that is due to strict adherance to "c".

 

Had to reformat all enums to read as so the cmopiler would understand them

they were originally 

enum FRUIT

{

apple,

pear

} ;

 

had to change them to

 

typedef enum

{

apple,

pear

} FRUIT;

0 Kudos
Message 8 of 14
(3,419 Views)

I was able to successful build the library by adding the following to the header file:

1. typedef int BOOLEAN; 

* You may want to add #define for true and false.

2. struct before every struct in the function prototypes. 

 

 

 

 

 

Rohama K.
0 Kudos
Message 9 of 14
(3,411 Views)

Hi Rohama -   thank you .  Can you take the next step to see if you can actually call any of the functions from the DLL?    That final step, successfully calling the functions, is where I am now tripping up.  Not sure why...

//  thank you.

0 Kudos
Message 10 of 14
(3,409 Views)