nistam Posted April 11, 2008 Report Share Posted April 11, 2008 Hi guys, Using Visual Basic 2005 and Measurement studio Enterprise 8.1, i must create an application that reads an integer value from a remote OPC server running WINCC 6.0. My code is simple and as following: dim Value as integerdim dst as new Datasocketdst.connect("opc://my-server/OPCServer.WinCC/my-item")Value=ctype(dst.data.value,integer) The above code works fine when i run it as a windows application. BUT, no user will be operating the computer that this application will run. That's why i decided to create a Windows Service, using the same code. But as a service, it does run though, but it does not return any value. The value is always zero and no errors are produced. The service starts with user credentials that have access to the remote OPC server. As i said, as a Windows applicaction, it runs fine. Do any of you have done something similar and had such problems Regards! Nikos Quote Link to comment
nistam Posted April 12, 2008 Author Report Share Posted April 12, 2008 Forget it! I was also using the following code: dst.ReadMode=Readmode.Synchronous which i removed and now it works! Thanks! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.