10-27-2016 08:57 AM
We're using doem .net dll's to communicate through RS232 with some instruments.
But especially when we end a sequence it gives a fatal error and Teststand crashes. This rarely happens while sequence is running. We believe it's s'thing about object handling.
Is there anyone faced and solved such a problem
10-28-2016 09:19 AM
Hi Hede,
What do you mean be doem .NET dll? Does the dll succesffully communicate with the instrument when you use it in the development enviroment?
How are you handling the calls to the instrument?
What is the crash that you recieve from TestStand? Does it give you any reasons? Do you have any dump files related to the crash?
10-31-2016 02:08 AM
Yes the instrument works well in the development. Find attached the messages when the system crashes.
We create object reference in Preuutloop and our dll opens comport, applies the communication and closes comport.
The screenshot is attached
10-31-2016 09:14 AM
Hello,
Does this crash occur every time with TestStand?
Does TestStand handle any of the instrument calls or is all done through that .NET dll?
10-31-2016 10:33 AM
This crash occurs 2 different types. On one of the systems it occurs during the test run and cause no interrupt for the system (attached pictures on previous msg is about that one).
Other type occurs when we end or terminate the sequence frequently.
We handle everything within the .net code, we just send some parameters. For example we control 2 devices, one of them is a PSU and we send the Voltage value to be set and the other one is an output module and we set output address and value if it helps.
11-01-2016 04:22 AM
Hi
I expirience the same symptom with one of my .net dlls.
It happens after 75 tests, or at TS closing.
I found out there is a memory leak within the .dll (some open source c++ code wrapped somehow), eating 20 MB memory pr. test. @1,5GB memory consumption TS crashes.
11-01-2016 08:54 AM - edited 11-01-2016 08:57 AM
When TestStand unloads all .NET references and .NET modules that it is aware of, it unloads the appdomain that it executes .NET code in. From the error messages you are seeing it looks like the .NET module you are calling has a worker thread running and is not ready to be cleaned up. Perhaps an object needs to be disposed first that you might not be calling dispose on? You can also keep teststand from unloading the appdomain, if needed, by keeping a reference to a .NET object in a global variable, such as the station globals. It will however still unload the appdomain when exiting the teststand application, so you might want to see if there is some cleanup required by the .NET assembly that you are missing, which is most likely the cause of the error you are seeing.
Hope this helps,
-Doug
11-04-2016 01:26 AM
Hi dug900,
Actually i am not very expert at TS. I use file globals for the object reference. so do you resommend to keep object reference at station globals? I almost understood what you mean but couldn't understand what to try exactly?
11-04-2016 08:11 AM
@hedehodo wrote:
Hi dug900,
Actually i am not very expert at TS. I use file globals for the object reference. so do you resommend to keep object reference at station globals? I almost understood what you mean but couldn't understand what to try exactly?
Yes, but only really as a workaround. The root cause of the problem is likely either some missing cleanup you need to do for the .NET dll, or an issue with the .NET dll itself.
-Doug
12-01-2016 02:03 AM
Hi,
I am %100 is sure the problem occurs due to my .net dll which communicate hardwares through RS232