×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

PLC Interfacing using OPC in Visual Basic and RSLinx

PLC Interfacing using OPC in Visual Basic and RSLinx

PLC Interfacing using OPC in Visual Basic and RSLinx

(OP)
Hello Everyone.
I'm using AB PLC for an application.  I'm using RSLinx pro for the communication in the PC.  I want to make an application in Visual Basic for Read and Write data in the PLC. Any one can help me with an example of code in VB6 to get access of the data using OPC. I'm already using DDE, but it is very slow for my me.  I want almost real time writing.

I get the data form and external source, and I want to write it in the PLC, that will be use in the PLC program and in a Scada aplication that is in the PLC network.

Thanks in advance for all your comments.

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

I would suggest you buy a component rather than trying to code the interface yourself
For example look at www.opcactivex.com

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

(OP)
Thanks a lot for your comments.

I have a lot of work make in the application, so I really want to add the code.

I looked at the address that you send me, and the investment for just one application is not justified in my company, if the application that I made are running; slowly, but running.

Some one has an example of how I have to implement the code, so I can make test in the application in order to include these lines of code.

Regards.

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

eaaf
Do you really think that it is not worth investing $795 ? (Or perhaps you only need to spend 395)
How much of your time would it take to reinvent the OPC interface? What are they are paying you? Even at $5 per hour that would pay for a month and you could easily lose that and more developing the interface yourself.
Do the numbers.
There is even a free demo you can try.
I suggest that you make your management re-think.

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

(OP)
Hello FrancsL.
You're complete right. The money invested in the OPC interface, can't be compare with the hours that will take the implementation.
I have my hands tied by the budget of the department. But I think can convince them to spend some extra money in this interface.
Also I really want to do it my self, in order to gain experience in that field. and enjoy it to do it.
I already download the demo.  I will experiment with it.
Sorry me, if I insist if any body have code for this application.
thanks a lot.
Regards.

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

Well then eeaf I guess you will need a copy of the OPC Specifications.
So far as I can tell you even have to pay for these.
It's all on www.opcfoundation.org - and sample code too, but not free.
Good luck

 

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

The AB website has some examples of how its done and its not really that difficult. Unfortunately I have no examples to post for you.

If you are open to using .NET as opposed to VB6 and use an RS232 connection, then you can use this open source code to communicate:

http://sourceforge.net/projects/abdf1/

This even works in Visual Basic Express, which is the free development environment from Microsoft.

 

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

Did not know about abdf1
Mind you, after a look, one developer (no problems with that) and No Users(or people on the mailing list anyway)and No Reported Bugs and hardly any documentation. Hmmm
Hang on, it says Posted By: arj3090
That is you!
On the basis of your experience arj3090 how long should eeaf allow for writing the code he or she needs?
Francis  

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

eaaf
You do realise I hope that the OPC Data Control is in fact the same opcactivex  as I mentioned before?
Let us know how you get on.
Francis

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

FrancisL

Here are some links to video documents on using the ABDF1 driver:

http://www.youtube.com/watch?v=CiPzqc5jDlE

http://www.youtube.com/watch?v=1-5STcYWQ7k

The main download is a fully self contained demo program that can be used to get an understanding of how to use the class.


This software was developed by myself, but tested by a large number of users that I keep in direct contact with to stay on top of bugs and feature requests. It has quite a number of users around the world. As for time to write your own.... to develop, debug, and refine a thorough driver will take about 9 months.

A few other things to note is that this class supports ladder program upload/download which is not supported in any of the other commercial versions. The demo program also has a feature to list data tables, read all data, and save it to a text file. The data can then be written back to the PLC from the text file. I can assure you the features and stability is beyond anything commercially available.

RE: PLC Interfacing using OPC in Visual Basic and RSLinx

Consider the fact that you don't have to use OPC to communicate with the PLC.  There are some 3rd party tools which communicate in the PLC's native protocol, and are much faster, not to mention simpler to use.

I suggest that you consider the In-Gear components from Cimquest: http://www.ingeardrivers.com/  Specifically, have a look at the ActiveX components if you are using VB6.  I have used that product several times with VB6 to communicate directly with an Allen-Bradley PLC, and I've always had good luck.

Alternatively, if you want to go with OPC, you need an OPC client.  All I can suggest is the OPCDA client, although I hear there is also a KEPware client as well.  I believe both require you to spend money.

Scott Whitlock
PLC Programming Articles: http://contactandcoil.com/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources