I know this is going to be a bit of a stab in the dark but does anyone know where I can get a control to allow me to communicate with an Allen Bradley PLC (ControlLogix), i.e. reference internal registers as well as real I/O?
Printable View
I know this is going to be a bit of a stab in the dark but does anyone know where I can get a control to allow me to communicate with an Allen Bradley PLC (ControlLogix), i.e. reference internal registers as well as real I/O?
Well I know b/a about plcs but I'm good at Googleing! Here's one link I found when I did a search in Google for "Allen Bradley PLC" "visual basic"
thanks for the link but i forgot to mention that i need it over ethernet.
I think i have found a way to use RSLinx (Allen Bradley OPC server) but if anyone knows of a direct control i would still be interested.
Did this ever get resolved MIK?
I did get the interface working in a fashion but before i completed the project another solution was chosen by the powers that be using a SCADA application.
I used RsiOPCAuto.dll which i think i downloaded from the web you can get all the info you need from buying RSLinx OMD (I think that is what it is called) but it cost about £5000 so it was desided not to persue this solution.
Are you looking for anything in particular?
Good to hear back from you, MIK.
I will upload a pic of a solution I recently designed. Apparently I need an OPC server but have no clue how to use one... My PLC is also the AB ControlLogix.
In my diagram, the thing called "RSLinx Service" I think has to be an OPC server. Is that a DLL or an EXE? I'm pretty new to that.
In my diagram, the thing called "PLC host, ActiveX EXE Service" will be a VB app which needs to use the "RSLinx Service like an ActiveX EXE or DLL.
My boss has a $2700 liscence to some kind of OPC server on his machine so I can't directly use it. He may give it to me later (I hope).
Check out my solution and let me know if you remember any of this, Thanks!
Dave
RSLinx is an OPC Server. You need to install a copy of RSlinx on your computer (any version other than RSlinx Lite). Once you have done this you need to set up a 'topic' which should be described in the help of RSlinx. The code i found as an example is attached. You will need to find a copy of RsiOPCAuto.dll (i think this is installed when you install RSLinx) and referance this in your project.
Well I spose after a year I can post an update...
This is the architecture I got working last year and solidified in May-05.
Right now, it only works with the RSLinx OPC Server, but I am very interested to hook into more OPC Servers. I just don't have any more PLC Hardware at the moment. Does anyone know if emulators work with OPC Servers?
exactly what is PLC? never heard of it, i suppose!
It is a specialized computer that controls motors, drives, sensors, lights, etc...
all right. is it called Programmable Logic Controls or Controllers or something like this?? read about it somewhere!!Quote:
Originally Posted by Dave Sell
Yap - Not sure if you can tell from the diagram, but the VB app has lights and buttons and registers that replicate PLC data and allow for remote control. Also note the Web Interface, for really, really remote access.
If you're interested in communicating with PLCs other than AB, check out Kepware. I used it on a VersaView to communicate with a GE 90-30 PLC over Ethernet. I'm trying to do some data acquisition with a Compact Logix over Ethernet into VB using a DDE link through RSLinx, but the fastest I can get it to sample is 60 samples per second. I would try Kepware, but the only version we have is what came with RSView which is very limited. It's basically just for communicating between AB Panel/VersaViews and anyone else's PLCs. I checked into a full-blown version a while ago, but for the amount of money that it costs, I figured I'd just use RSLinx instead since I already have it.
If you were able to sample faster than 60 samples per second with OPC through Linx, could you share that with me please? I'm looking for at least 100 with 200 being ideal. I'm using the Visual Basic that is built-in to Excel because I want to export the manipulated data into Excel. It says it's 6.3, but it doesn't seem to me to be a full-blown version since it doesn't look like it has as many options as the one I used in college. It's been over 5 years since I've used VB though, so I'm a bit out of the loop. Also, I need to set up a timer so that I can input how many samples per second I want and have it sample at those intervals.
Any help is appreciated.
I have not yet optimized my communications architecture for the highest samples/second. I recently was forced to optimize the system for the highest number of tags in the system.
I have 4 HMIs and 1 server as shown in the above diagram. Each HMI loads 500-600 tags when the program loads and is allowed to dynamically load and unload tags at runtime.
In all, the system has 1,400 unique tags loaded, many of them are duplicated (some tags are viewed by all the HMIs).
You're ability to capture tags/second will be reduced inversely by the number of tags you are reading.
My above architecture does not work as you might expect; the server only broadcasts a tag name/value pair if the tag in the PLC changes. All the HMI clients never "ask" what a tag value is.
If I had a PLC emulator, I could help you out. Do you know where I can get one that works with OPC stuff?
AB has software called RSLogix Emulate 5000 that we got in our Toolkit, but I haven't used it before. I just installed it here after lunch today to check it out and see if it would work with my DDE link, but I can't get Linx to see the virtual chassis to even go "online" with the program. I'll be off tomorrow, but our AB distributor tech guru is supposed to be in the area Monday, so I'll check with him.
Yes, we are planning on buying that "everything-in-one-package" deal from Rockwell for our team of consultants which should include the emulator. Is there any way I can try it out, maybe a 15-day trial? I really need to know if the OPC server will recognize the emulator like a real PLC.
Keep me informed of your tech guru's feedback if you please.
As far as your sample-rate question, do you need 100-200/s on a remote HMI (across the network)? Because I believe you could get faster than 100-200/s if you are doing everything on the server, and you use straight VB, not VBA embedded in Excel. You can always export your results from VB to Excel, as I am doing. (Excel is not even required to be installed for this).
Right now, I'm only reading 1 analog channel until I get the data transfer to a rate that is acceptable. The most I'll need to transfer is probably 10-15 analog channels, a few miscellaneous integers, and a few words worth of bits. My application is nowhere near as complex as yours is. I need a simple data collection system that I can hand the laptop to a mechanical engineer for him to take in the field to pretty much plug in and go to it on any machine. The analog channels are the only ones I'd need to transfer fast because we want to watch for current spikes, pressure spikes, and voltage dips. Ideally, I would like to set up a timer in the PLC and have it kick the analog data to the laptop at intervals on that timer. Since Logix timers are set up in 1000ths of a second, I could theoretically set a compare to spit out the data table every 5 1000ths of a second to give me 200 samples per second (If everything can keep up). At that point, scan times may be an issue though. Meanwhile, I'm going to try to get regular VB and see what that does for me.
I'll let you know about the emulate software.
I think you misunderstand the intent of my software, it is not special-purpose, but rather general-purpose.
It is a foundation upon which I build custom HMI-PLC control solutions for clients.
At any rate, I can design a "thing" that does everything you have described, but it will take me some time, and I can't do it for free. Would you like me to send you an esitmate for me to make the software you have described above?
If so, send me a pm with your email address.
Thanks for the offer, but I need to know how to do this so that I can write software that is machine-specific. Every one of our machines is custom-built to the customer's specs. One project I'll be using a PLC-5, the next a Control Logix, the next a GE... you get the idea.
As far as an emulator, our tech guy didn't have a chance yesterday to come over, but he got the emulator to run on his laptop. He didn't try the DDE stuff that I've been messing with. For some reason, my Linx won't create a Virtual Backplane for me. Next time he's over, I'll give it a shot on his laptop. Meanwhile, check with your AB distributor and see about a trial, or they may be able to send someone over with a laptop that has it on.
Keep me posted on how you make out if you get to it before I do.
Finally, like I said before, I've been out of the VB loop for quite a while now. What is the best version for me to get? I can get .NET Standard 2003 for $100 just looking quickly online. Is that adequate or should I get something else?
Better than that, these versions are FREE for about a year (and then they will cost some money)
http://msdn.microsoft.com/vstudio/ex...pport/install/
This is precisely the software I intend to make. Can it be done? It would need to allow the choosing of the PLC at run-time, and auto-browse for all the tags in the PLC (can OPC Server allow this? I will find out.)Quote:
Originally Posted by msb198
Then once a PLC has been chosen, and tags displayed in a tree-view, you should be able to select some tags for data acquisition (dumped to Excel file for later analysis).
I currently use VB6 for OPC development. I have toyed with OPC in VS2003; it is adequate but I prefer straight COM.Quote:
Originally Posted by msb198
Well its really nice to someone who is after PLC control here .. i stabed my head so many times on that .. well here is something what i m upto .. i m using PIC microcontroller with CAN protocols to replace the PLC .. my task is to take a data from user ( in ladder logic form ) .. convert that ladder logic to some sort of methodology ( i mean . create some text file having that code expressed in terms of words and alphabets ) and then pass that file over to RS232 of my PC ... .. well over the time . i have developed sort of vb program that allows user to draw a ladder logic diagram of his choice in my workspace .. now how can i scan that diagram .. like power flow ... how should i convert that to text file ... can someone guide me .. i can attach my project aswell . if u say so ..
So essentially you're trying to write a ladder logic editor for a PIC? I wish I could help you out there. Actually, I had a personal project that I wanted to use a PIC controller for, but ended up designing it with TTL chips because I couldn't remember enough about programming PICs from college (we didn't spend too much time with them). I didn't build it yet, and I would love to use a PIC to greatly simplify the circuit and decrease cost. What PIC are you using? It sounds like what you are doing would be right in line with what I would want to do. Give me a little more info and maybe I can help you out a little.
BTW, AB has a great tech note and example that shows OPC communication through an Excel macro that works with RSLinx. An hour of off-and-on messing with it and I had a form in VB with no Excel references made up that works great based off the example. Next step is to try a Koyo PLC through Kepware with the same program...
http://domino.automation.rockwell.co...F?OpenDocument
well MSB198 we are using PIC16f877A
and it has really taken a hell out of me of keep thinking how can i scan my ladder logic diagram .. i started learning VB only for that very purpose and till now i have been able to let user draw any ladder logic diagram in my work space at run time ... how could i ever scan that .. :confused:
Here's a reply for Dave Sell and one for Dastard.
Dave Sell, I got the emulator working on my pc and ran a VB exe that I made with OPC. The result? I change (force) the value in Logix5000 while "online" with the virtual processor and it changes in the program. Hope that's what you're looking for. It's a part of that Toolkit if your company is getting that.
Dastard, How do you have the elements saved in VB? Are you saving them in an array with arguements making the program an array of records? Is each rung an array in a program array then so that you have an even more complex system of an array of an array of records?
I was told we are getting that Toolkit or we already have it. Was that a sample VB project that you used to do that? Am I to understand you updated (downloaded) new ladder logic to a PLC using VB code?
Actually that was not one of my goals. My goal is to autobrowse a network for PLCs regardless of PLC type using the OPC Server. Even if I have to choose the PLC type from a drop-down or somehting, that'd be OK. I want to at least autobrowse for all the tags and offer them to the user for data aquisition and store records in Excel.
I can do everything except all the autobrowsing stuff.
I did use pieces of a sample program from the link I posted earlier. I did not download to the processor, only read and write tags to it. So far I have only tried it with Logix although the code looks like any OPC server should be able to use it easily. Like I said before, once I get it working good with Linx, I'll change it to Kepserver since it seems that we have enough of their software to communicate with Koyo, Siemens, GE, etc... As far as autobrowsing, check the Knowledgebase on Allen Bradley's site. I could almost swear there was something there on that for Linx. I'm sure if you got it figured out in Linx, doing it in another package would be simple.
I thought you were trying to emulate an AB processor with the computer and do OPC with the virtual processor. That's what I was talking about getting working today. That's pretty slick for testing code, but obviously the scan times for your ladder program are much shorter with the computer, so if checking scan times are an issue for you like they are me, it isn't 100% accurate, but like I said, it's good to test code without physically being connected to a processor.
Tomorrow I start writing code to test the speed of data collection. I think I'll read 10 values into an array inside the Logix processor then pass those 10 to the VB program with OPC while I'm collecting the next 10 samples.
BTW, not included in Toolkit is RSLinx SDK which just includes a manual on using Linx to communicate with other programs, but it's additional cost. I checked today while the local AB guru was in the office.
Yep I want to do this also!Quote:
Originally Posted by msb198
speed of the emulator? or speed of a real PLC?Quote:
Originally Posted by msb198
How is this different than using OPC server?Quote:
Originally Posted by msb198
Ok, do you understand how I emulated the Logix processor? Need any more info there?
I'm trying to test the PLC and OPC transfer speeds, not the emulator.
Actually, RSLinx SDK is just RSLinx with the literature to show you how to use info from Linx in other programs using OPC/DDE. So you're pretty much just paying for a manual. According to our distributor's AB guy, there's nothing different on the software side vs regular RSLinx.
I haven't done it yet, but I think I understand this part.Quote:
Originally Posted by msb198
Let me know what you find out.Quote:
Originally Posted by msb198
Figures.Quote:
Originally Posted by msb198
Took me a little while to get back into this after vacation and machine startups. Anyway, with a Compact Logix PLC on Ethernet, I can get a sample every 8/1000ths of a second. I think even when I get all my code written, I will be able to get my 100 samples per second this way. I also checked out if I could communicate with the Compact Logix through Linx at the same time as another brand of PLC through Kepware and I can. Our Kepware is not the full blown so there's a 1 hour limit on the OPC connection then it shuts down. It'll work for what I need it for though.
Hi,
You can control and monitor your PLC using OPC server and OPC Client such as SCADA software or OPC ActiveX control. You can download OPC server to test with your PLC. I suggest KEPServerEx form http://www.kepware.com. And if you use VB, VB.NET, C# or VBA, then you can use low cost OPC ActiveX control to create your own application. You can connect to PLC within unlimited tag counts. My team has an OPC ActiveX product, http://www.scadathai.com. You can create SCADA application easy and quickly in fews of code lines. You can download it to try and connect to OPC Server within unlimited tags. There are some tutorials and example for developer too.
Well it has been another year so I s'pose I could post my architecture again...
DCOM is removed from the system now, and N clients can connect to N servers hosting N OPC topics.
Communications is TCP/IP, 1 port per Topic.
6 months later, Client view:
Server perspective:
An ICONICS simulated OPC Server is now supported as well as an A/B PLC. This becomes useful in a distributed environment.