07-09-2008 09:29 AM
07-10-2008 06:06 PM
Hello MadSeb,
Thank you for posting on the NI Discussion Forums. What operating system are you running on? When I run a Windows service application that accesses data from a data socket variable, I can launch a Windows Form Application that also reads from the same data socket just fine. I am also using VB.NET and Visual Studio 2008, on a Windows XP machine.
Just to clarify, are you saying that the Windows Form Application will not read from the shared variable, or that it will not even start? If it does not even start, will a Windows Form Application that does not read from the data socket start?
07-14-2008 09:13 AM - edited 07-14-2008 09:17 AM
Just to clarify, are you saying that the Windows Form Application will not read from the shared variable, or that it will not even start?
It will not even start....
If it does not even start, will a Windows Form Application that does not read from the data socket start?
Yes.
Btw, same issue is explained by my supervisor in this thread: http://forums.ni.com/ni/board/message?board.id=232&thread.id=7299
07-14-2008 11:57 AM
07-15-2008 01:48 PM
07-15-2008 01:55 PM
07-15-2008 01:55 PM - edited 07-15-2008 01:56 PM
07-16-2008 11:49 AM
MadSeb,
I am still not sure that there is some kind of “data collision” causing this issue. Some more information is needed to determine the source of the issue.
Do you have the development environment for Visual Studio on the machine that you are running into the issue with? If so, launch the service application, and then launch the form application in debug mode to find out exactly where in your code the application is hanging. I find it very peculiar that the UI will not even load, since it should not have to wait for any kind of connection for the OPC server to proceed. This should help us determine if it is something in the code that is causing the hang.
It would also be helpful to check the code of the service application. Since this cannot be run in debug mode, it would be useful to copy the bulk of the code into a form application, and then see if running it also halts other form applications that access the same variable from launching.
As I mentioned before, I was able to launch a service application and a form application to successfully access the same variable. The only difference was that I was using the National Instruments Data Socket Server, where as you are using the Industrial Automation OPC Server. On that note, can you perform the tasks on the Data Socket Server instead to see if the behavior changes? If your applications both need write access to the connection, you can follow these instructions to enable multiple writers.
Hopefully the results of one of these tests will lead us to some more concrete answers as to what is going on.
07-17-2008 09:53 AM
Do you have the development environment for Visual Studio on the machine that you are running into the issue with? If so, launch the service application, and then launch the form application in debug mode to find out exactly where in your code the application is hanging. I find it very peculiar that the UI will not even load, since it should not have to wait for any kind of connection for the OPC server to proceed. This should help us determine if it is something in the code that is causing the hang.
It would also be helpful to check the code of the service application. Since this cannot be run in debug mode, it would be useful to copy the bulk of the code into a form application, and then see if running it also halts other form applications that access the same variable from launching
I tried this. Everything works fine when I convert the service into a form application.
07-23-2008 04:29 PM
MadSeb,
Let's talk about this issue over email and update the forum once we've reached a solution.