LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Constructor Node LabView Crash

Hello,
 
we are using Test Stand Version 3.5 (3.5.0.725) together with LabView 8.2.
 
We have an external created .NET DLL called ClientLibrary.dll which interacts with a Server.exe providing
several functions for communication with a device under test.
 
We use a .NET contructor node to create an .NET object (ClientLibrary.dll), .NET Invoke Node to call
functions and the .NET destructor node to close the reference.
 
Now we see the following problem. If we run the complete programm in repeatability which includes
starting Test Stand, Run the Test Sequence inside Test Stand, Call VI's using LabView Adapter
which itself uses the .NET in about 1-2 runs from 100 a LabView crash occurs.
 
We have traced the crashes and we see that the crash occurs at the .NET constructor node!
 
To get more details we also have installed the DebugView Tool to get the Debug Information from
LabView.
 
In a good run we see
 
[2488] CGenSchedulerEvents::ResetRunFuncs
[2488] Created new AppDomain: LabVIEW Domain for Run
[2488] Destroying AppDomain: LabVIEW Domain for Run
In a failed run with Crash we don't see any entry! We do not see the
 
Created new AppDomain: LabVIEW Domain for Run
 
entry in the DebugView Print.
 
So it seems as if something goes wrong during "Create new AppDomain: LabVIEW Domain for Run" !
 
Since this is some automatic action of the "contstructor node" we have no idea what we can do
to avoid the crash!
 
Is there any solution for this problem? Is this problem already known or does someone else have
similar problem using .NET contstructor nodes?
 
Greetings,
 
Gerald Nass
Dipl.-Inform. (FH), Computer Scientist
Message 1 of 4
(5,326 Views)
Hi!

Some questions:
- it always only runs once or twice before LabVIEW crashs?
- if you start the LabVIEW VI without TestStand, does it crash after 2 times? Also trying with continously run (if the Hardware can manage it)?
- could it be that there is a very small laps of time between the destructor and the new constructor?

If you LabVIEW VI is called with a high frequency, you can try to set a small delay after the destructor. It could be that the .NET destructor didn't finished to free all ressources before the constructor has been called again creating the crash in LabVIEW.

Regards
Ken
0 Kudos
Message 2 of 4
(5,314 Views)

Hello,

as we can see it normaly runs several times before the crash occur. We actually not have seen a crash in
the first run!

I've a smaller Debug VI compiled as EXE with the same actions as the VI out of the TS sequence and actually
this executable runs fine. But I see that the executable performs the Create Application Domain only at startup
an performs Destroy Application Domain at exit whereas TS with each run performs the Create Application
Somain and Destroy Application Domain step, so there are differences.

We startup TS using a batch script so a complete test run includes startup and exit of Test Stand!

Between Constructor Call and Destructor call there are several seconds of delay. But the delay only exists
due to the test sequence. We have not implemented a fixed delay after calling the destructor node.

Is it necessary to wait after calling the destructor node?

For further information I will mentition that we us .NET Remoting inside the library to cummunicate with
a server. After Constructor Call we Call a function which registers a http channel and perform function
calls on a server using the .NET Remoting.

Actually I've stripped down the VI to only perform the constructor node and the destructor node and it
seems if it runs without problem.

Maybe there are some issues inside the library function which uses .NET Remoting?

Maybe there are somthing left in the framework which causes a LV crash in a second constructor call?

Greetings,

Gerald

Message Edited by gn0778 on 05-09-2007 05:53 AM

0 Kudos
Message 3 of 4
(5,314 Views)
 
To trace down the problem we have startet TS with attached debugger and have a run with debug print.
In this run no crash occurs but there are some entries which seems not to be normal!

First-chance exception at 0x7c812a5b in LabVIEW.exe: Microsoft C++ exception: LVExcept at memory location 0x0012a3fc..

First-chance exception at 0x7c812a5b in LabVIEW.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00128834..

We see two exceptions LVExcept and EEFileLoadException (complete debug print attached).
 
Can someone explain the exceptions or give some information about the exceptions and when they occour, maybe
this give some hints for the root cause?
 
Greetings,
 
Gerald Nass
0 Kudos
Message 4 of 4
(5,265 Views)