Showing results for 
Search instead for 
Did you mean: 

Couldn't generate VI library from .dll

Go to solution

Hi All,

I'm trying to develop VI to control the digital micromirror device through the controller (DLPLCRC410EVM from Texas Instrument). I know that people have done this by generating a VI library from D4100_usb.dll. Most of the functions work fine except a few functions; for example, LoadData(), as shown in the pic 1. The warning shows that I lack some header so I added the header folder of my visual studio. That warning was gone but I still have the warning about the preprocessor as shown in the pic2.

I don't know if I did it right when I added the header folder. I don't have much experience in C language so I don't know what preprocessor I should add it make it work. or Did I lack some Labview implementation? FYI, I used LabVIEW 2019 on Windows 11 

I will be glad if anyone has any suggestions.

Thank you,





Download All
0 Kudos
Message 1 of 9

You should specify a header file which matches the dll, for example D4100_usb.h, or a header file which describes the functions inside the dll.  Ask vender if you don't have one.


George Zou
0 Kudos
Message 2 of 9

The import shared library wizard is not able to import all functions correctly. Even if you use this wizard you have to go through each parameter and function and have to check if it is correct. Some developers (including me) never use this wizard, because the wizard only works good for very simple functions. The wizard knows nothing about the meaning of the parameters so it cannnot handle functions like program_FPGA()


I only found this documentation: DLP Discovery 4100 Development Kit API Programmer’s Guide ( but it doesn't explain, anything about DataRead() and DataWrite() functions.


One example: int GetDescriptor(int*, short DeviceNum);

In best case the wizard wires a a 16 bit integer for the DeviceNum and a single 32 bit integer for the first parameter and configures it as a pointer to this integer. This is totally wrong. The int* parameter have to be a pointer a an array with enough space for the device descriptor. Otherwise, you program will crash. There might be some more functions which need a manual correction.


LoadData() and program_FPGA() are described in the PDF and you can program it by yourself.


0 Kudos
Message 3 of 9

Hi George,

Thank you for your response.


I used D4100_usb.h which is all the header that the vendor provided. However, I still got the error about the missing header. I noticed that every function that showed the error has UCHAR* in the function for example; for example, int LoadData(UCHAR* RowData, unsigned int length, short DMDType, short DeviceNumber). I'm thinking of using the Call Function Library Node in Labview to create my own function. I don't have any experience with this. I would be happy if you have any suggestions.

Thank you,


0 Kudos
Message 4 of 9

Hi Martin,

Thank you for your response. 


I see what you meant. I read the document that you provided. It's fine that it doesn't explain anything about DataRead() and DataWrite() because I only want to use the LoadData() function. I noticed that the function with error has UCHAR* as an input such as "int LoadData(UCHAR* RowData, unsigned int length, short DMDType, short DeviceNumber)" where UCHAR is Char used as an 8-bit unsigned integer and *  denotes a pointer to a value.


I'm thinking of using Call Function Library Node to create my own LoadData VI. I don't have any experience using that before so I kinda stuck. Please check the attachment when I was trying to create the library for LoadData(). I don't have any problem with any parameter except the UCHAR* RowData. I don't know how to set the RowData parameter. I would be happy if you have any suggestions.

Thank you,



0 Kudos
Message 5 of 9

Take a look at D4100_usb.h.  It probably refer other header files at the beginning of the *.h file.


UCHAR* sounds like a point of unsigned char.  i.e. U8


George Zou
0 Kudos
Message 6 of 9

Some general things, from my experiences: DLLs with their header are made for Visual Studio or other Windows based programming IDEs for C/C++/C#. Their projects already include many system libs and header by default which you would have to include manually for LabVIEW. Problem is, of course, to find out which one(s) you need. Finding a specific pragma, definition or preprocessor directive can be hard. 

What usually helped me is to make use of the Windows SDK. Once installed, most system headers are there. You could then include entire folders and the DLL import wizard should find what it needs. 

0 Kudos
Message 7 of 9
Accepted by topic author Popator

UCHAR is well described in the PDF as an 8-bit unsigned integer.


If you want to have a nice interface for LoadData, it needs some more work than just calling the DLL. But this also depends on how the DLL function really works (internal error handling).


I do not have the header file, and I don't know the calling convention. I also don't know whether the DLL is tread save or not.


you can use the attached VI as template for the LoadData() function. you have to adjust the DLL path, calling convention and maybe the error handling.

(hopefully I did not made any of these stubid errors)



0 Kudos
Message 8 of 9

Hi Kudo,

Sorry, it took me a while to modify your code so that it's compatible with my work and it works!

Thank you so much,


0 Kudos
Message 9 of 9