Visual Basic FAQ's

Does your server support VB.net?
The current examples that are installed with the Server do contain a simple VB.net client example.  Contact Technical Support for one that is more complex.

Does your server support VB5.0?
Yes, We provide file "kepopcdaauto.dll" which we often refer to as the Automation Wrapper. This wrapper allows you to access the server via OPC. If you wish you may also access the server via DDE although it is less efficient. We recommend using VB6.0 over VB5 if it is at all possible

Does your server support VB6.0?
Yes, We provide file "kepopcdaauto.dll" which we often refer to as the Automation Wrapper. This wrapper allows you to access the server via OPC. If you wish you may also access the server via DDE although it is less efficient.

I am using VB6.0 trying to do a Synchronous Read from Cache and I am not getting any values.
In OPC the cache is updated by the last device poll. To do a read from cache you need to have the OPC Groups IsSubscribed property set to try and ensure that the Groups Update rate is set to a value that will poll the device at least once before the Cached Read. If you do not want to have the server polling the device all the time then you should do a Synchronous read from device. You will not have to subscribe the group for device reads.

I am using VB6.0 and I have several groups in my project but do not seem to be getting all the data changes.
The server has no way to know that the call back was not handled by the client application. If you have two or more groups with data change events and Group1 gets a triggered event that it is handling while an event comes in from Group2 then you can miss the event for Group2. The proper way to handle this is to use the Global Data Change event of the OPC Group collection rather than the data change event of each individual OPC group. This way all data change events will be funneled through one event handler.

I am trying to create my own VB example. What is the bare minimum code required to connect a VB project to your server?
Doing OPC in VB requires at least an Intermediate level or higher understanding of VB programming. You can connect to and read data from the server in as few as fifty or so lines of code. Click on the following links to download the VB and OPC Application Note (PDF) explaining the different objects and methods used and or download a copy of the example code. This code and application note are provided as an example only and are not a supported product of Kepware Technologies.

I cannot connect to your Server from my VB application?

If you are connecting locally or remotely it could be as simple as not have DCOM security set properly. You will also get connection failures of you are using the wrong "program ID". Lastly, when connecting remotely, you can get this error if you incorrectly identify the remote node where the server is running.

Possible solutions include:
  • For local and remote connections, make sure you use the correct program ID. This will be "Kepware.KEPServerEX.V4" if you are using the standard Kepware Server.
  • For remote connections the node name will always be the name of the PC or its IP address. You will never use the double back slashes "\\" before it.
  • Ensure that you have DCOM security properly configured. Use the Kepware Technologies DCOM Manual (PDF) for directions on properly configuring DCOM.

Didn't find what you were looking for? Try searching our extensive Knowledge Base