Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB and OPC 1

Status
Not open for further replies.

CIMTEET

Programmer
Joined
Jun 25, 2001
Messages
182
Location
US
Can anyone point me to a place where I could get a trial OPC OCX and some syntax help? It would be much appreciated.

Greg
 
I want to communicate with a PLC.
 
Cimteet,

The Iconics ( software package is "OPC to the core" and is developed specifically for communicating with PLCs. It uses VB for all its coding. I am afraid that you will not find a free ocx for PLC communication. The other option would be to get an OPC Client or Server SDK and develop your own. Here again it will cost. Still one more option get the OPC spec book (free but very in depth) and develop your own from scratch. I do a lot of PLC work so if I can be of any more help feel free. I hope this helps. Anything is possible, the problem is I only have one lifetime.
[cheers]
 
I am going to be starting a VB application that is going to use an OPC to talk to RS Linx. Could you possible start me out on how I would connect to any datapoints or directly to RS Linx.

This application is to run behind the scenes, go out every n seconds, gather information on about 200 points, and store it to a SQL Server DB.
I will also have to collect data when an alarm is tripped. So I figured this would be and OnEvent subroutine.
I have no problem getting the data from VB to SQL. My only problem is how do I get the data into VB.

Any pointers will help greatly. I thank you for your time.

I know a little VB, not a ton, but I think I could get this done if I had a little guidence.
 
I am not sure what you are going to be doing. Are you using RSLinx OPC server or are you looking to write your own OPC Server? What did you want VB to connect to? The RSLinx OPC server? Here is a link to the set up of the RSLinx OPC server.
If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
Thank you for the information.

I believe that we will be using the OPC server. I am looking over the RSLinx Training Guide online. It mentions that it now has an OPC server, at least on a quick first time skim. Hopefully the link you provided will be more than enough to get me on my way.

As far as what I want to be done.

I want a "hidden" vb app, no screens. This app will simply get data from the plc and put it into the database.

That is all the client wants at this stage. I just want VB to be able to get data from the PLC, put into variables possibly, then stuff it into a SQL Database.
This will happen at a specified frequency.
The client also wants alarms to be stored to the database when they happen. I am assuming that I can create an OnEvent Sub that will be triggered by a bit in the PLC.

 
Are you using some sort of HMI package like Wonderware, CiTect, Iconics etc for a user interface? I am just trying to get a feel for what you are up against. Most HMI packages include a logging feature that will place alarm data in a database of your choice such as SQL Server, Oracle, DB2 etc. I am not sure of the RSLinx OPC server, but many of the OPC Servers also log data to a database of choice. With this in mind, I am not sure that you will need to use VB to perform any of the task your client is asking for. Any thoughts or input?

If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
No we are not going to use any HMI products. If we were to use an HMI program then it would be much easier and we have plenty of people in the office, including me(some what) that would know how to hook up to a DB and configure it to capture alarms.

I know this is poor planning but the client wants the absolute basic.

The data flow is going to be
PLC->RS Linx->VB (if used)->SQL Database

The client is supposedly going to export the data to excel when they want to create reports.

 
I guess the next step is going to be to determine if the RS Linx OPC server will write data directly to the SQL Server. If so your job is done. If not, you are going to need some sort of VB OPC client in order to communicate with the RS Linx OPC server. There are a couple of free (last time I googled) VB OPC clients around. I have not used them, but generally speaking the free ones work marginal at best. If you can't find one that fits your needs, you may need to purchase a toolkit so that you can develope one. I have used the Iconics ToolWorX kit and I like it. When I bought the kit is was around $1500 US dollars though. It has a VB Client development kit included. Hope this helps.

If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top