LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create DLL in LabVIEW 6i

Hi,

i have a VI (source VI),which has 3 inputs and 1 output. The VI produces the sine value of random numbers.The inputs are frequency,channel and amplitude.The output is an array of diuble name Data. Now i want to create a DLL with this VI in LV 6i. I used the Build Application or Shared Library in Tool menu.After i clicked Add Exported VI ,i drew the VI in and a dialog box appears which told me configure the fuction.I configured the parameters and the fuction name.

After i created the DLL, i use call library node to call the DLL.There was also a dialog to configure the call library node. The point i want to express is: the default of output  Data is numeric,so i changed to array,when i run this VI,it appeared a problem and then shut down the LabVIEW window. But if it was numiéric, the VI run well.

So, how can i get the output as array? Was there something needed to be configured when creating DLL wrong? If the output is numeric,is the value of Data the last value in the output array of source VI? Also, in the configuration dialog of function, in pass by item there are value and pointer to value, what is the difference?

PS. is there any detail description how to create DLL? I have read the tutorial material in NI Developer Zone, it helps little.

0 Kudos
Message 1 of 4
(3,151 Views)

Chunjonas wrote:

Hi,

i have a VI (source VI),which has 3 inputs and 1 output. The VI produces the sine value of random numbers.The inputs are frequency,channel and amplitude.The output is an array of diuble name Data. Now i want to create a DLL with this VI in LV 6i. I used the Build Application or Shared Library in Tool menu.After i clicked Add Exported VI ,i drew the VI in and a dialog box appears which told me configure the fuction.I configured the parameters and the fuction name.

After i created the DLL, i use call library node to call the DLL.There was also a dialog to configure the call library node. The point i want to express is: the default of output  Data is numeric,so i changed to array,when i run this VI,it appeared a problem and then shut down the LabVIEW window. But if it was numiéric, the VI run well.

So, how can i get the output as array? Was there something needed to be configured when creating DLL wrong? If the output is numeric,is the value of Data the last value in the output array of source VI? Also, in the configuration dialog of function, in pass by item there are value and pointer to value, what is the difference?

PS. is there any detail description how to create DLL? I have read the tutorial material in NI Developer Zone, it helps little.


Make sure the install the bug fix release 6.0.2. Creation of LabVIEW DLLs was new in 6.0 and there were some not so nice troubles with the original release of LabVIEW 6.0 (and 6.0.1 introduced a nasty optimizing bug that was shortly after fixed with 6.0.2). This especially made itself apparent when you tried to call a LabVIEW DLL from within LabVIEW, which would not work in 6.0.

 

As to detail description: It seems to me you have a problem understanding the fundamental C datatypes and how they map to LabVIEW datatypes. While the mapping can and is documented in various tutorials, the actual basic C knowledge is really very helpful to understand the various aspects of datatype configurations both in the LabVIEW DLL builder as well as in the Call Library Node configuration. While the tutorials do try to give some basic idea about this, they can not and should not even try to replace a good introductury course into C programming.

 

Rolf Kalbermatter 

Rolf Kalbermatter
My Blog
Message 2 of 4
(3,127 Views)

Hi Rolf,

 

Could you please point me to some of these useful documents on data type mapping between VI and DLL(created from this VI in LabVIEW 8.6.1)

 

Thank you in advance

 

--

Dennis

0 Kudos
Message 3 of 4
(2,993 Views)

Dennis Chau wrote:

Hi Rolf,

 

Could you please point me to some of these useful documents on data type mapping between VI and DLL(created from this VI in LabVIEW 8.6.1)

 

Thank you in advance

 

--

Dennis


They have been pointed out numerous times in many DLL related threads on this board. I have not really time to search them together but a search on something like "+LabVIEW +DLL +datatype" in Google, this forum and possibly your LabVIEW online documentation should give you many references to look through.

 

Still basic C knowledge will be mandatory otherwise you are simply the blind in a land of many possiblities and will need handholding for every Call Library Node configuration anyhow.

 

Rolf Kalbermatter

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(2,983 Views)