Jump to content

Create Windows Service that reads from OPC

Recommended Posts

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



Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.