NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does application being debugged and Visual Studio/XP hang when Visa SerialSession DisableEvent Method Is Called in .Net Environment?

In some (most?) installations, my mixed VB.Net/C#.Net application hangs (together with Visual Studio and, sometimes XP) when the method DisableEvent() is called on an instance of Visa's SerialSession. I am using Measurement Studio version 7.0 for the Visa code.
This method is called in the process of closing the SerialSession (DisableEvent(), then , then Dispose()).
I have three systems on which this sequence works fine and 3 on which it fails.
On one of the failing systems I have installed a complete .Net/Measurement Studio development environment and have traced the cause to this call.
Because Visual
Studio is trashed, I can't make any progress.
What is configured incorrectly on my failing systems?
0 Kudos
Message 1 of 6
(3,708 Views)
If you could capture the VISA calls in NI Spy and attach a log file, that would help pinpoint where the hang is or is not occurring. In other words, whether it's in the NI-VISA driver or it's in the Measurement Studio VisaNS layer.

Dan Mondrik
National Instruments
0 Kudos
Message 2 of 6
(3,708 Views)
Thanks for the response.
I have captured and attached two NISpy files, one captured on a machine exhibiting the problem ("CaptureProblem.spy") and one captured on a machine working correctly("CaptureOK.spy"), both executing the same steps.
The application code is virtually identical on both machines (certainly no differences involving I/O).
The process of capturing the problem NISpy file allowed me to learn a bit more. I found the "hanging" of Development Studio and XP was temporary as the call to DisableEvent returned after a few minutes, releasing them. Subsequent calls to disconnect the handler and to close the SerialSession also completed after a very long time. You can see these times in the NISpy log files. Note there are small (few second)
delays caused by my having stepped through each call in the debugger.
Hopefully these files will help to identify the problem.
Thanks for your help.
Download All
0 Kudos
Message 3 of 6
(3,708 Views)
Hey palley,

Can you create a very simple project that is able to reproduce this problem? It would be best if the project did little or no I/O just so I can see if I can reproduce the problem and perhaps figure out what is going on. Try to keep the code narrowed down to one cs or vb file and include any instructions or steps required to make the system hang. I�ll try to get an answer for you as soon as possible.

-Josh
0 Kudos
Message 4 of 6
(3,708 Views)
I have discovered the problem is associated, in at least one case, with the specific serial port I/O device installed on the computer exhibiting the problem. Another .NET serial communication package experienced problems (different symptoms) with the same comm port.
The I/O device is a Belkin F5U109 USB-to-serial-port adapter and the computer is a Dell Optiplex 170L running XP.
Other machines (including Dell and generic machines, all running XP) do not exhibit the problem with the Belkin adapter.
Replacing the Belkin unit with a PCI-based serial port card resolved the problem on the workstation. We have not yet resolved the problem on the laptop since our options are more limited.
I have put in a request to Belkin to see if they have any mor
e-recent drivers available than the one we are using.
With this additional information are you still willing to attempt to resolve this issue and, if so, do you still see your suggestion as the next best step? We would like to see the issue resolved because we've found the Belkin (and other brand) USB adapters to be very useful. Their usefulness will be diminished if we can't trust they will work on any machine we need to use.
Thanks.
0 Kudos
Message 5 of 6
(3,708 Views)
If non VISA bases serial applications are having the same problem, then I am sure it has something to do with the Belkin driver or hardware. If the Belkin driver is to blame then there is very little we can do and it would be impossible for me to reproduce the problem without the adapter. If you are ever able to reproduce the problem using the built in ports let me know and I can look into this issue further and try to reproduce it on my machine.

I agree that those USB to serial adapters are very nice. I use a NI USB-232/1. I would suggest trying a NI USB to serial adapter like the NI USB-232 (http://sine.ni.com/apps/we/nioc.vp?cid=12363〈=US). NI's hardware and drivers are meant for industrial applications and I can assure
you that I have never seen my NI USB-232 block or hang my computer. I hope you are able to get your application working and let us know if we can help in any other way.

-Josh
0 Kudos
Message 6 of 6
(3,708 Views)