NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

upgrade operator interface to VB.NET problems

Hi,
My company is in the process of upgrading an operator interface for Teststand, that is written in VB6, to VB.NET. This interface that we wrote works fine under VB6. But under the VB.NET version, what it does when the test launches is it does not execute the test steps until some action is made by the operator. Like we have a trace window that looks to see what the current step is. If that window is opened one step is executed. If the window is closed and opened again another step is executed, and so on. The test never just goes and executes on its own. It is like every step has to be prompted to execute for some reason. Does anyone have an idea what could be wrong?

Thanks,
Kenny
0 Kudos
Message 1 of 5
(3,443 Views)
I think I know the problem. TestStand sends one message at time to your OI. It will not send the next message until you destroy the current message. However, in VB.NET, everything is garbage collected so the message doesn't get destroyed when your message handler returns, even though no one is using it.

In the next version of TestStand, the UIMessage object will have an Acknowledge method that .NET OIs should call to unblock the message queue in place of relying on the destruction of the message.

I've talked with National Instruments support. They are going to contact you via email to provide further assistance with this issue.

- James
0 Kudos
Message 2 of 5
(3,443 Views)
Wow James. That makes since. Thank you so much for the response! So do you think it would be possible to manually dispose of the message? Although I am not sure which object to destroy. I think I saw somewhere how to manually get rid of the objects that were in 'garbage collection'. I guess I will wait on NI to contact me about this. Should I just contact them?

Kenny
0 Kudos
Message 3 of 5
(3,443 Views)
Sadly, it looks like .NET COM interop assemblies don't implement IDisposable for their wrapped classes, so I don't know how you could explicit dispose of the message.

You can call System.GC.Collect(), but you must do that when no .net code is holding a reference to the message, so it probably won't work in your event handler. You might be able to create a kludge where your event handler posts a message of some sort to your application to trigger a garbage collection each time after the event handler returns.

However, I think NI support might have a better option that they must discuss with you offline. If you don't get an email shortly, please do contact support@ni.com.

- James
0 Kudos
Message 4 of 5
(3,443 Views)
Hi Kenny! You're not alone. I am trying to migrate our company's OI from LabVIEW to VB.NET. I started by writing a tiny (~40 lines) of VB.NET to create a new execution (on a fixed .seq) and pull the events from the message queue. No joy. Message queue does not behave correctly, similar to what you reported. Created the equivalent in VB6. No problem at all. Have the good folks at NI provided you with a solution? Hi James Gray! Any chance someone can help me as well? Maybe an early TS engine class. I'd be happy to beta test for your team! Thanks in advance.
0 Kudos
Message 5 of 5
(3,443 Views)