First Day Learning about OPC

recondaddy

Member
Join Date
Apr 2006
Location
Atlanta, GA
Posts
77
Hey everyone,

I'm doing a lot of reading, today, about OPC, and I need some guidance.

Here's what I want to do: I want to create an OPC client application in VB.NET that interfaces with the OPC server in RSLinx Classic OEM. What I'll eventually do is monitor a tag value in a PLC and when it goes high, I'll pull a group of PLC tag values into the client and write them to a database.

I'm not yet interested in the nuts and bolts of how I'm gonna do it -- I'm trying to get a high level understanding of OPC so I know where I'm going.

I've set up links to an Excel spreadsheet using RSLinx, before, so I'm familiar with DDE/OPC topics and how to set them up. My question comes in regard to OPC Groups and OPC Items and how they relate to what I'm trying to do.

Am I correct in understanding that an OPC item, in this case, would be the connection to the tag, itself? What role would an OPC Group play in what I'm trying to do? In looking at other peoples' source code, I see them adding OPC Items to OPC Groups. What is the purpose of an OPC Group in the code that I'll write? Will I have only one OPC Group? Several?

I don't even know if I'm asking the right questions. I guess I'm asking how someone with experience would do what I'm trying to do.

Thanks for any help you can provide.
 
Hello,

An OPC item must be in a group. Read about the purpose of groups to understand why.

As to reading a tag and then pulling a group of tags based on the value of the tag, the tag (X) would need to be in a group 'Group A.'

All the other tags would need to be in 'Group B.'

Then you disable GB and enable GB when tag X changes to the state you want. Then do read on GB.

Or you could just put all the tags in one group, set up callbacks for changes, and then create a log entry for the other tags when tag X changes.

Many ways to do what you want.

Good luck,

Mark
http://www.peakhmi.com/
 
Is your goal to solve this problem or learn about OPC and Windows programming involving PLCs?

If you're trying to solve the problem, FactorySQL (now renamed the SQL Bridge module in the Ignition platform, with the limited license for $1000) can do exactly that - just set up an "OPC->DB" group that runs on a trigger (the tag you're watching). It would take under 5 minutes to configure. You probably wouldn't even need RSLinx. Call up Inductive Automation for a web demo and they'll show you how; you can even try it out first for free with an evaluation copy. Other OPC data logging programs exist that do the same thing. Don't re-invent the wheel for such a simple task.

If you're interested in learning about .NET programming with PLCS, there are a lot of resources out there. Archie has a free (LGPL) HMI project that's done in .NET. You can join the OPC Foundation to download their library of "reference code". As earlier noted Matrikon and a few other companies have free resources available. As far as the OPC portion of your question, you'll be subscribing to the OPC tags via RSLinx to read their values. You program then goes through its logic and writes to your DB as necessary. It's more or less a polled architecture - ie, the PLC will never "tell you" that a value goes high. The OPC Server (RSLinx) can help you out between polling and caching values.

Here's what I want to do: I want to create an OPC client application in VB.NET that interfaces with the OPC server in RSLinx Classic OEM. What I'll eventually do is monitor a tag value in a PLC and when it goes high, I'll pull a group of PLC tag values into the client and write them to a database.

I'm not yet interested in the nuts and bolts of how I'm gonna do it -- I'm trying to get a high level understanding of OPC so I know where I'm going.

I've set up links to an Excel spreadsheet using RSLinx, before, so I'm familiar with DDE/OPC topics and how to set them up. My question comes in regard to OPC Groups and OPC Items and how they relate to what I'm trying to do.

Am I correct in understanding that an OPC item, in this case, would be the connection to the tag, itself? What role would an OPC Group play in what I'm trying to do? In looking at other peoples' source code, I see them adding OPC Items to OPC Groups. What is the purpose of an OPC Group in the code that I'll write? Will I have only one OPC Group? Several?

I don't even know if I'm asking the right questions. I guess I'm asking how someone with experience would do what I'm trying to do.

Thanks for any help you can provide.
 
Last edited:

Similar Topics

I've gotten to the learning curve where I can program a call for pump to come on at set point but I'm not sure how to turn the same pump off when...
Replies
1
Views
50
I want to pick up an Allen Bradley PLC so I can practice writing programs. I have 10 years as a maintenance tech and a good understanding of...
Replies
8
Views
221
Hi all, i have started a new chapter in my career with a local company. a lot of their plc's is omron and i have the cx version 9.75 software...
Replies
25
Views
4,156
Can you guys recommend a course or book for my son to start learning PLC programming? He’s telling me he’s thinking of taking some $100 course...
Replies
31
Views
6,981
Hello All, I have recently had the opportunity to dabble in TIA portal for the first time. Been working in automation for almost a decade now and...
Replies
18
Views
2,594
Back
Top Bottom