LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multithreading problem in LabVIEW using .net assembly

Hy there

We are developing a LabVIEW 7.0 application that uses a .NET assembly.
The assembly cummunicates to a driver an uses a ssecond thread to
control the hardware.
Testing the assembly out of .NET (manged c++) works fine but using the
assembly with
LabVIEW causes race conditions. Using a debug viewer shows that even
Debug.WriteLine ( "stuff"); results in multiple calls.
That means if i use the assembly out of LabVIEW and watching the output
shows that
One Debug.WriteLine () prints 2-3 times the same string instead of only once
as aspected.

Does anybody know anything about problems regarding LabVIEW and .NET
components?

What can I do to get more control on my multithreaded assembly?

Thanks for any hint! Sebasti
an Dau!
0 Kudos
Message 1 of 2
(2,506 Views)
Hi Sebastian,

This is definitely a tricky one. Are you instantiating the .NET object multiple times in LabVIEW by calling its constructor? If so, and these constructors are being called in parallel, it could be that there are race conditions that you will notice in your C++.NET code.

Otherwise, because of the multithreading in your .NET program, it could be that there was a potential for a race condition there and it simply was not being exhibited when run out of the .NET environment.

There is also another discussion forum post regarding threading in LabVIEW. Refer to the post by Greg
McKaskle, especially, as he is one of the principal LabVIEW architects.

Good luck!

Kileen C.
NI
0 Kudos
Message 2 of 2
(2,506 Views)