VB and PLC's

I have used VB to communicate to PLC's for a couple of years now. I would strongly recommend getting VB6 to start out which supports all windows operating systems. As for this issue of the MSComm control, chances are you are not going to need it. MSComm was more designed to send ASCII out your serial port which won't do you much good when controlling via a propietary communications protocol such as DF1 from AB or K-Sequence from Automation Direct. It very time consuming and tedius to make your own communications driver for the protocol you wish to use. What I have done is purchase a third party communications driver for the plc system I want to talk to. All you have to do is include the ActiveX or DLL in your VB project and learn which methods to call to send or receive data. It is actually very simple with the right tools such as a third party control. These controls range in price from $40 to $1500. Most of the time you can download a demo of the control which has slightly less capabilities but will communicate to plc. You will have to do a search with a string something like "PLC Mitsubishi ActiveX Visual Basic".
 
Since you're using a Mitsubishi, I think that I can offer you some direction here. I was curious about the same thing a couple of years ago and followed the path I describe below.

The least expensive way to learn using VB to PLC (i.e. Mitsu FX type) communication is using VBA which comes with applications like Excel, Word, AutoCad, etc. This, coupled with a Mitsubishi application called MelDDE (used to cost about $150, an ActiveX control will cost $400+) will allow you control of all the data registers, timers, counters, bits and boops of the PLC. You don't need the MSCOMM control. The application turns the PLC into a DDE server. I understand that OLE is now the prefered linking of applications but this will do as a learning exercise.

MelDDE's examples are sparse but allow you the rudiments of communication with Excel (specifically) and then you can develop methods of not writing the DDE formulas in the spreadsheet but creating the link formulas in VB and reading & writing from/to the PLC to any application that supports DDE.

Much of what you learn this way is applicable with full blown VB5 & 6 (I know nothing about VB.net)

There is a learning curve involved here but nothing that a little research on the I-net won't solve.

Finally, NOPE ... I don't have any VB background and I've never had occasion to use this knowledge. I write PLC code and just wanted to try something cool.

... rab
 
Active X? This is something else I'm going to have to purchase along with the VB software? banghead I'm going to look at all the replys in detail and make some sort of decision. Again, I don't think I'm willing to pay that kind of money for VB6, but the VB.Net looks good.
I'm still a little confused on what version will absolutly work for my intentions and probably need to do some more research. I definatly want to do this, but the wife is going to kill me if I end up spending a lot of money.
Hang in there with me guys, I'm still wet behind the ears on this VB stuff.
Tim
 
Tim ...

Don't know if you're responding to my post re: MelDDE but I mean to say that with MelDDE you don't need an ActiveX control.

I looked at the Narly software site and am not sure what level of software would help you out there but in talking to Cliff J (the writer of the control) I think that you're in the $400 range. Again, this is not going with the MelDDE idea.

... rab
 
RBergmann had some good ideas , but if you are going to spend $400 on an ActiveX control you don't need to use DDE.You don't need anything other than a slimmed down version of VB 6 that comes with a book costing $30. If you go to

http://www.vhmiautomation.com/PLCDIndv.html

you can get all of the ActiveX controls for the major PLC manufacturers for around $100.

It really is not as complicated as you think. Three steps are involed.

1. Purchase a book on VB6 that comes with VB6 on a disc.

2. Purchase an ActiveX for the plc you want. ( OR all of them)

3. Learn how to operate the ActiveX in VB6 (pretty simple), and off you go reading and writing to your plc data registers.

Here is a listing of the ActiveX methods and properties from the
above website.


[attachment]

mitserial.jpg
 
zmanvortex ...

You've got me interested. As I mentioned earlier, I'm not a VB programmer and finding methods of PLC connectivity has been a challenge.

I'm always interested in stuff like this.

... rab
 
zmanvortex ...

Oops! I could only find ActiveX reference for the A series Mitsu not the FX. Most of my customers are smaller and the FX series by far is the most popular.

My guess is that Tim has access to an FX series PLC. This is the "brick" style (some have special module options). The A series is a "rack" type system.

... rab
 
Yeah, RBergmann I got hooked by the bug too and it is REALLY fun talking to a plc from a computer program that I created.
I actually wrote a small program in Visual Basic that controlled the outputs on a plc DIRECTLY, I didn't even have one ladder of plc logic in the plc, I was just writing to the output registers. I showed this to my plc instructor and he just about flipped.

It takes time but once you get the hang of Visual Basic you will understand how easy my method of PC to PLC comm really is.

I have even purchased an ActiveX control called SLCComm for $39 which will communicate with AB Micrologix and SLC series Plc's. The cool thing about this ActiveX is that it would even dial your modem for you and connect through the phone lines to another plc. Cool Huh.

Just have to hit the books on VB.
 
zmanvortex ...

It took me about a month just to establish communication and then open a fresh spreadsheet, format it (titles with text style and font) and then enter data from the PLC's registers, indexing rows as I went along.

It's a kick alright. Now if I could find a cheap ActiveX. I've requested info on the Mitsu ActiveX to see if they know its potential to work on the FX series (I have a whole bunch of them).

... rab
 
Alright, Zman you got me interested.
If I get the Mitsubishi serial port master driver on the link you've provided then get the slim down version of VB6 then I'm ready to go?
Or am I? I don't have to purchase the ActiveX control? Is the ActiveX DLL's the same thing? Sorry for my ignorance on this subject. Can I use VB.Net to do this instead of VB6? The reason I'm asking is that Rs, on a previous reply had a link to VB.net software in my price range. Really it doesn't matter which one I use, it's the price. Any help would be greatly appreciated.

RBergmann,
Actually I am going to be using the A series and FX series plc's. For right now I'm focusing on the A series. Thanks for the info.
Tim
 
Tim, I am a VB6 freak, I have never used VB.Net but have read a lot about it. I would probably be a good idea to go with VB.Net and it will work ( I'll explain in a moment). It would be a good idea because you would be learning the latest and greatest. The only difference between VB6 and VB.net is the environment and tools you use to program, and it is not a whole lot different. The underlying framework is the same. Microsoft would not dare put out something that would not allow all of the ActiveX and controls that other people (and Microsoft) have made, not work with VB.Net.

An ActiveX in simple terms is nothing more than a bunch of functions or routines that perform a desired operation (such as talking to a plc). The MSComm ActiveX was designed to talk to and through modems or other devices that used the ASCII protocol using serial comms (It can also talk in binary but that is another subject). You cannot write or read to most plc's data tables using ASCII characters, you have to use their own protocol that they have developed.

Instead of using an ActiveX Communications control, someone could write their own code to talk to a plc, but they would have to learn the protocol of the plc manufacturer, and then write the code (Usually in the C or C++ language). This would be a very time consuming task. With the ActiveX a person could use it in any number of applications (including Microsoft Office Software) without having to write the actual commmunications code, just include the ActiveX in your Visual Basic ( or Excel, or Access) program and use the documented functions to talk. It seems too easy doesn't it, but believe me once you learn how to program in VB (or VBA if you use Office products), it is very easy.

The issue of the A series and FX series Mitsubishi, I have never used these products but maybe if you search hard enough someone might have developed an ActiveX for the FX series for a lot less money than the big guys.

As far as a DLL goes, it is not really a whole lot different, just a little more code writing to get it to work, but you will learn about that as your VB knowledge grows.

I hope both of you keep me informed of your progress , and if there are any questions that you don't want to post here on the subject you can email me at [email protected]
 
Tim ...

I received a response regarding the use of the ActiveX with the FX PLC. Phil, the developer, told me that he hasn't tested it with the FX series so ... when you get up to speed, I'd be interested if it works with the FX too.

Thanks for all your info, zmanvortex.

... rab
 
Zman,
This is a link Rs poasted for VB.Net. Its VB.Net Standard.
http://shop.microsoft.com/Referral/...=11133&typeID=4
Can you look at it and give me a thumbs up or down for my needs to communicate with a plc? Another question,I hate to do this, but I'm just a little confused on if your telling me that I will or will not need to buy an ActiveX control. I've got the Mits. driver from the link you've provided on my list of things to get. Hey, I'm farther than what I was yesterday. :D
If this thing doesn't start my wifes car on a cold winter morning, shes going to kill me. ;)
Thanks for the information on the ActiveX control. When you start doing this stuff, you can't stress enough about supplying details.
Thanks to you and everyone else for there patience.
Cheers,
Tim
 

Similar Topics

Hi, I am trying to set up a plc. I've never done any programming with ladder logic previously. I'm trying to set up a a program to turn a device...
Replies
6
Views
106
Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
2
Views
49
Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
0
Views
30
I'm trying to integrate a Beckhoff IPC with a Controllogix PLC. There is some documentation, on the Beckhoff website, on how to do a PLC-PLC comms...
Replies
0
Views
64
Back
Top Bottom