OPC 2.0 in VB6 - advice needed 
Author Message
 OPC 2.0 in VB6 - advice needed

I need to add OPC 2.0 functionality to an existing VB6 program so that it
can act as an OPC server to provide/accept data (limited number of data
types, interfacing with a single client). My research so far has produced a
lot of Visual C++ OPC server information, but the VB information has been
limited to OPC clients.

The advice I need is to make sure I'm proceeding along the best path (this
project has a short lead time). The commercially available OPC Servers and
development toolkits are too expensive, so I'll be coding it myself unless
someone can point me to a good source of free/cheap code. I've ordered books
on DCOM and MTS and I've been reading all of the OPC Foundation documents,
but it's unclear to me exactly how much work/learning will be involved.

If anyone has developed OPC Servers in VB6, I'd be interested in paying for
a couple of hours of phone/e-mail consulting to help me jump-start the
project and get a grasp on how much work will be involved (free advice is

if you can help.

- Dave



Mon, 12 Jul 2004 11:16:51 GMT  
 OPC 2.0 in VB6 - advice needed
Dave,

The OPC foundation has clearly split the complete specification into a
separate Custom Interface Specification and a so-called Automation Interface
Standard. The latter describes how an OPC server can be reached by clients
built with VB (or any automation compatible scripting language). However, it
is strictly a wrapper layer on top of the Custom Interface Specification.

For an OPC server to be a true OPC server it *MUST* implement the interfaces
as defined in the Custom Interface Specification. And unfortunately to you,
you can only do this using either C or C++; the interfaces are actually not
even defined as dual interfaces and are full of use of typical C/C++ types
(in particular unsigned types) and enumerators that can only be directly
used from within C/C++.

So, an OPC server must be constructed using C or C++. And even OPC clients
that want to use only the 'normal' OPC server's interfaces must be
constructed using C or C++. The Automation Interface wrapper layer makes it
possible to build clients with VB as well, but does not support building the
server side.

So, what you want is impossible. I am not sure what the OPC foundation is
planning for the .Net environment. But as far as the 2.0 specification goes,
you are out of luck. Sorry to have to be the one to bring you the bad news.

Rens Segaar
senior software engineer
Trend Technology Systems BV, The Netherlands
www.trendtts.nl


Quote:
> I need to add OPC 2.0 functionality to an existing VB6 program so that it
> can act as an OPC server to provide/accept data (limited number of data
> types, interfacing with a single client). My research so far has produced
a
> lot of Visual C++ OPC server information, but the VB information has been
> limited to OPC clients.

> The advice I need is to make sure I'm proceeding along the best path (this
> project has a short lead time). The commercially available OPC Servers and
> development toolkits are too expensive, so I'll be coding it myself unless
> someone can point me to a good source of free/cheap code. I've ordered
books
> on DCOM and MTS and I've been reading all of the OPC Foundation documents,
> but it's unclear to me exactly how much work/learning will be involved.

> If anyone has developed OPC Servers in VB6, I'd be interested in paying
for
> a couple of hours of phone/e-mail consulting to help me jump-start the
> project and get a grasp on how much work will be involved (free advice is
> always welcome as well :-). Please e-mail me at


- Show quoted text -

Quote:
> if you can help.

> - Dave



Mon, 12 Jul 2004 15:53:22 GMT  
 OPC 2.0 in VB6 - advice needed
Dave,

Please, also forward your replies on replies to the newsgroup. In this vb
COM newsgroup not that many people will be working on OPC, but some may find
the discussion interesting. It is just the way newsgroups are being used.

Anyway, on toolkits: I do not know about an open source Light-OPC project. I
do know a little about commercial toolkits. For our company OPC servers
should not only support the Data Access specification, but the Alarms &
Events specification as well. At the time we were searching for a toolkit
only two of the commercial toolkits supported both these specs, namely
Iconix and FactorySoft.

Unfortunately, the distributor of Iconix products in the Netherlands kept
(and still keeps) sending information on the Iconix Genesis SCADA-tool, but
I never got any decent info on the OPC toolkit (and I definitely believe I
clearly asked for that). So, that one was written off. The distributor of
FactorySoft did a better job and in the end we decided to buy a single user
license for their toolkit.

Ultimately, we are very sorry we did. It is not worth the (lot of) money you
have to pay for it. The quality of the software is very, very poor to the
extent that I definitely would not want to have the programmer(s) of it work
on my R&D software departement (which I am currently managing). Besides the
poor quality, it is strictly based on use of MFC and I hate MFC (lacks use
of common sense design patterns, sticks to old-style C++ programming with a
lot of pointers instead of references and is full of incomprehensible
macros).

Currently, we are working on our own (of course very good) toolkit.
Unfortunately, my company has no interest in making the end product
(commercially) available, because selling standard products (with matching
support) falls outside of our core business. It will be for internal use
only.

If you do not need the Alarms & Events specification, but only the Data
Access part, other commercial toolkits besides the ones I have mentioned
above may be suitable to your needs. I believe you can find some reviews on
several of such toolkits on the CERN web-site (just use Google and search
for CERN and OPC; that should lead to into the right direction, although I
have not tried this).

On the other hand, if you need to build an OPC server only once, why use a
toolkit at all. An OPC server is nothing more than an ordinary COM server
with (a lot of) OPC specific interfaces to implement. It is not that hard to
build one, that is, if you know your way around when it comes to COM
programming. And I think there is your real challenge. If you want to make
the step from vb to C++ you may not find this to be an easy step. I can tell
from what I see in my departement where one of the very good vb programmers,
with reasonable knowledge of plain 'C' as well, currently has a very hard
time understanding C++ code I have produced sometime in the past.

Once you think you can manage C++ a bit, the next step is learning COM
programming, which requires you to mix C and C++ programming styles a bit,
plus most likely requires you to dive into Windows multi-threading, requires
at least a little knowledge of IDL and requires a basic understanding of
concepts such as COM apartments and marshalling.

I am not trying to talk you out of trying it. I am simply telling you that
whatever way you choose, you may not find it an easy job. Anyway, I hope all
of this helps a bit.
Good luck,

Rens Segaar
senior software engineer
Trend Technology Systems BV, The Netherlands
www.trendtts.nl

Quote:
> Rens,

> Bad news, but thank you for clarifying it - I couldn't tell before if VB
> just wasn't the language of choice for OPC or if it was actually
technically
> impossible. I've never had the time to fully learn C++, but I guess this
> will be the motivation I need.

> Do you have any opinion on the commercial development toolkits vs. the
free
> code from the open source Light-OPC project? The cost of the commercial
kits
> is somewhat high given that I'll only be using it for one project.

> Thanks,

> Dave



Tue, 13 Jul 2004 16:05:59 GMT  
 OPC 2.0 in VB6 - advice needed
Rens,

Thank you again for your replies. Based on what you've told me and on my
continued reading of OPC Foundation documents, I think adding OPC
functionality is beyond the scope of this project. For now, I'll tackle the
problem in more manageable steps, starting with developing a basic DCOM
server in VB with my own interface, then moving to C++ and adding the OPC
interfaces later if necessary.

Others have told me that .NET makes everything much easier. I've seen
preliminary articles on OPC and .NET, so that may also be a route to take in
the future. For now, my DCOM/VB book just arrived from Amazon, so I'm going
to start reading ...

Thanks,

Dave
----------------------------

Quote:
> Anyway, on toolkits: I do not know about an open source Light-OPC project. I
> do know a little about commercial toolkits...
> On the other hand, if you need to build an OPC server only once, why use a
> toolkit at all. An OPC server is nothing more than an ordinary COM server
> with (a lot of) OPC specific interfaces to implement. ...
> I am not trying to talk you out of trying it. I am simply telling you that
> whatever way you choose, you may not find it an easy job. Anyway, I hope all
> of this helps a bit.



Sun, 18 Jul 2004 11:04:50 GMT  
 OPC 2.0 in VB6 - advice needed

Hello Dave,

Regarding OPC Clients: You mentionned that there are many OPC Clients
for VB available.
I need to implement an OPC client in my VB application. Can you give me
an advice where I can get an OPC Client for VB from ? Is there FreeWare
?

Can you recommend a product ?

Many thanks for your advive.

Best regards

Peter Deiss

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 10 Aug 2004 04:54:10 GMT  
 OPC 2.0 in VB6 - advice needed
Take a look at:

http://dialspace.dial.pipex.com/town/estate/on50/index.shtml
(the OPC Programmer's Connection)

All the OPC free stuff I know off is here.

Rens Segaar
senior software engineer
Trend Technology Systems BV, The Netherlands
www.trendtts.nl


Quote:

> Hello Dave,

> Regarding OPC Clients: You mentionned that there are many OPC Clients
> for VB available.
> I need to implement an OPC client in my VB application. Can you give me
> an advice where I can get an OPC Client for VB from ? Is there FreeWare
> ?

> Can you recommend a product ?

> Many thanks for your advive.

> Best regards

> Peter Deiss

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Tue, 10 Aug 2004 15:49:48 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. opc-connection via dcom to an opc.Simatec-Server in VB/VBA

2. OPC 2.0 Wrapper for PPC/WCE3.0

3. VB6 MCSD Advice needed..

4. Need VB6 self-study advice

5. Please help...Need advice how to do a screensaver with VB6

6. *** New to VB6, need some advice. ***

7. Need advice on Security - VB6 ADO 2.5 - jet 4

8. need advice on reporting tools for VB6

9. Need advice on Security - VB6 ADO 2.5 - jet 4

10. Free .NET Omron Hostlink OPC Server

11. OPC Using .Net

12. OPC automation Wrapper

 

 
Powered by phpBB® Forum Software