LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate a .net Dll file?

Hi :

 

I had a problem , the problem is like this:

 

I want to generate a .net dll file from a Labview program,the labview program is very simple: jia.jpg

 

this program is in a Labview  project, i useBuild Specifications-New-.Net Interop Assembly to generate a dll,

 

 

when i add the source file  it need to Define the Vi Prototype,like this:file.jpg

how should i set the returnvalue?

 

 When I use another Labview program to call this DLL , it will like this:

s.jpg

 

and every time i run the program, it will dead there,and i muse use the Task Manger to stop the Labview.

 

Do someone know where is the problem? Thanks!

 

 

 

0 Kudos
Message 1 of 4
(2,816 Views)

You need to click on the "VI Output" dropdown and select which indicator to use as the return value. You can then select "xy" and simply delete it from the list of parameters since the function's return value will be the sum.

 

The reason why it crashes now is because the .NET assembly is expecting the address of a memory location where it will write the sum. You are passing in a value, and the .NET assembly is trying to write to the memory location specified by the actual value of the control. So, if the control's value is zero, the .NET assembly is trying to write to memory location zero. Crash.

0 Kudos
Message 2 of 4
(2,798 Views)

Hi , thank you very much!

 

As your mean I tried to delete the "xy" after i set the returnvalue's VI Output to"xy", like this:

returnxy.jpg

 

but the delete button is grey and can not kilck,so i can not delete the "xy" from the list of parameters ,

click.jpg

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

Strange. I can't replicate the behavior that you are seeing. Do you have some example code that shows this behavior? What LabVIEW version are you using?

0 Kudos
Message 4 of 4
(2,755 Views)