LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview code to dll

My co-worker doesn't have a toolkit, so I am coding up a subvi with that toolkit and make it into a dll, so that he can call it in his code.  I have a few questions.

 

1. Is that the best way given the situation?

2. I tried to use the import dll function, but I have the following problems.

   a. What is included path and preprocessor definition?  Are they needed?

   b. I kept getting a not defined symbols error.  The symbol is int32_t.  What is the t behind the integer?  i tried to make all my input into string, but the parameter len is always int32_t, which is a default parameter.  What is the len parameter?  i don't really need it in my program.

c. when I send the dll, do I only need to send the dll and the .h file?  

 

Using LabVIEW 8.6.  Thanks!

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 5
(1,544 Views)

Attached is the viv that I want to convert into a dll.  

 

1. To convert a vi into dll, is the vi restricted in what kind of inputs it can have?

2. When I build the dll, I keep getting undefined symbol error.  The symbol is int32_t

3. Can a cluster be an input on my vi when I want to build an dll out of it? 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 2 of 5
(1,533 Views)

Are you just trying to get around licensing the toolkit for your coworker?

 

If you're calling the DLL from LabVIEW, there are (as far as I know) no restrictions on the controls that can be used as function parameters.  If you're calling it from another language, best to keep to simple types unless the programmer who's calling it is willing to deal with LabVIEW data types.  Clusters are fine.

 

You're getting the error about int32_t when you build the DLL, or when your import it?

 

Include path and preprocessor definitions are C preprocessor concepts.  A header (.h) file can reference other header files.  Often only the name of the file is given, and the pre-processor searches for that file in the include path.  Preprocessor definitions define macros and symbols.  It is likely that int32_t should be defined as "int" somewhere, and if you add that as a preprocessor definition it will likely work.  Did you read the help?  It's all explained there.

 

 

Message 3 of 5
(1,488 Views)

My coworker has a valid license for the toolkit, but not on his computer, so I guess I am doing this to get around licensing for him.

 

I am getting the error about in32_t when I import the DLL.

 

How do I do "It is likely that int32_t should be defined as "int" somewhere, and if you add that as a preprocessor definition it will likely work"?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 5
(1,471 Views)

@jyang72211 wrote:

My coworker has a valid license for the toolkit, but not on his computer, so I guess I am doing this to get around licensing for him.


In that case, wouldn't it be a lot easier if he just activates the license for the toolkit on his machine?


@jyang72211 wrote:

How do I do "It is likely that int32_t should be defined as "int" somewhere, and if you add that as a preprocessor definition it will likely work"?


Put "int32_t=int" in the preprocessor definition field.

Message 5 of 5
(1,469 Views)