LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import Shared Library Wizard: Declarations not found

(This is a follow-up to this question:Import-Shared Library Wizard-Declarations not found)
I am trying to use some proprietary C functions in LabVIEW. At first I had trouble with the Wizard not finding all the type definitions (see above link). This is now resolved, but I am still unable to generate the vi's.

I ran through the Wizard and at the end the report it produced showed ca. 80 out of 342 functions that could not be created.
I checked the C documentation provided with the code, and saw that most of them made use of enums. Using this observation, as well as the hint on the Import shared Libary Report (see attachment), I created custom controls for these enums and I am now trying to apply these custom controls to the correct data types in the step "Configure VIs and controls".
However, Some of the functions that could not be built make use of two different enums. When I try and configure each variable with its respective enum, the Wizard only allows one enum control...? Heres an example:

The function "A3200Motion Advanced Home Async Conditional.vi" has the following variables: functionReturn, handle, taskId and axisMask. The variables taskId and axisMask are both enums. When I try to assign to taskId my custom made control, that works fine, but then I can't assign axisMask its respective custom control.

It looks like only one custom control is allowed per function. Is this corrrect? Has anyon experienced this before?
Please let me know. Cheers
Doug

0 Kudos
Message 1 of 3
(1,510 Views)

Hi bockdoug,

 

Looking at some internal documentation, there does seem to be some variability with how the Shared Library Wizard will handle using C enums.

 

I wasn't able to see the same issue only being able to set one custom control per variable - I was succesfully able to use the same custom control for multiple variables.

 

However, to step back a bit, you shouldn't need to utilize the custom controls to work with the C enums. According to my research, the enum type in C is defined as such from the ANSI C manual:

 

Each enumerated type shall be compatible with char, a signed integer type, or an unsigned integer type. The choice of type is implementation-defined. (6.7.2.2 Enumerationspecifiers)

Thus, can you just set the "Data type" for those variables to be an Unsigned 8-bit integer? Then, in LabVIEW you could just connect an enum constant or control to the input, and set the "Representation" of the enum to "Unsigned Byte".

 

Regards,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 2 of 3
(1,469 Views)

It would help a lot if you post the function prototype for a few of the functions that fail to import, along with any other relevant definitions from the header file. Or, post the entire header file, if you can. You do not need to attach the dll itself. Without seeing the specific functions you're trying to import it's hard to give you a good answer.

0 Kudos
Message 3 of 3
(1,460 Views)