LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create a .NET interop assembly to do some signal processing

Solved!
Go to solution

Trying to create a .NET interop assembly to do some signal processing.

 

A trivial assy that outputs a random number works fine when called from a .NET 2.0 application.

 

After including some signal processing VIs the same process locks up with a window that does not completely draw itself.

 

I have found another person having the same problem, but his workaround did not work for me:
http://forums.ni.com/ni/board/message?board.id=170&message.id=491882

 

I have attached my example files that demonstrate the problem, InteropDemo.zip.

 

In the instructions here:
http://zone.ni.com/reference/en-XX/help/371361F-01/lvhowto/building_a_net_assembly/
It mentions referencing an assembly "NationalInstruments.LabVIEW.Interop.dll"
but after installing Labview 2009sp1 it does not appear that this assembly was installed into the GAC by the LabVIEW installer.

Any iedas?

0 Kudos
Message 1 of 7
(4,428 Views)

after you build the interop.dll, have you add to the references of your C#??

it seem working fine when build the dll from analysis.vi

 

 

regards,

Simon

Message Edited by simon76 on 05-19-2010 08:30 PM
0 Kudos
Message 2 of 7
(4,415 Views)
Solution
Accepted by topic author IanBarnes

Ian,

Per my workaround, I added the following line of code to main()...

 

           InteropDemo.Analysis.analysis(out amplitude);

 

This addition, if the theory is correct, loads analysis.dll in a way that works so it can be used later when you click the analysis button on the form.  Clicking the "random" button loads and runs a completely different dll: randoms.dll, which is not associated with the problem.

 

Good luck!

Steve

Message 3 of 7
(4,385 Views)

One more thing.  If you wanted to make an init() method, just create an empty VI and add it to analysis.dll, not randoms.dll.  Call init() in main and you should be go to go.  Of course this is still just a workaround to a troubling national instruments bug.

Cheers.

0 Kudos
Message 4 of 7
(4,382 Views)

sketel wrote:

One more thing.  If you wanted to make an init() method, just create an empty VI and add it to analysis.dll, not randoms.dll.  Call init() in main and you should be go to go.  Of course this is still just a workaround to a troubling national instruments bug.

Cheers.


 

Hi Steve, thanks so much - this has fixed my problem. What I did not realise is that you have to call the dummy init in main, not in the bulk of your code. I am not sure what difference this makes, but it fixes my problem.

 

I have raised a call with NI and will post back when I hear from them.

 

Thanks again 🙂

Cheers, Ian.

0 Kudos
Message 5 of 7
(4,339 Views)

sketel wrote:

Ian,

Per my workaround, I added the following line of code to main()...

 

           InteropDemo.Analysis.analysis(out amplitude);

 

This addition, if the theory is correct, loads analysis.dll in a way that works so it can be used later when you click the analysis button on the form.  Clicking the "random" button loads and runs a completely different dll: randoms.dll, which is not associated with the problem.

 

Good luck!

Steve


 

I have since found the fix does not fix the problem in all cases.

I have run into another scenario where the software stalls when using the signal analysis tools.

 

Labview .net interop assembly

with signal analysis tools

  |

 \/

C# .net 2.0 assembly

 

 

1) If I call my C# .net assembly from a .net executable it works.

2) If I call my C# .net assembly from Labview, it locks up.

3) If I call my C# .net assembly with the signal analysis removed from the Labview .net assembly from Labview it works.

 

Any ideas?

0 Kudos
Message 6 of 7
(4,218 Views)

I have since found that this new problem occurs if the analysis tools are used or not - so perhaps it's unrelated to the original problem. You can delete point #3 in the provious message.

 

Dealing with our NI rep he has replicated and acknowledged the problem. I sent him the sample code attached.

 

He has assigned me a CAR number 164604 but no timeline for a fix - which is a problem for me.

 

Cheers,

Ian.

0 Kudos
Message 7 of 7
(4,159 Views)