Using a PC as an HMI

D

Thread Starter

Don W.

I have done several machine and process control projects using a PLC with a touchscreen type HMI such as units available from Total Control and many others. I know it is possible to use a PC as the HMI and would like to learm more about doing this. My basic objective here is to use a PC as the HMI for control and monitoring just like would be done with an off the shelf HMI.

My present knowledge and understanding of doing this is very limited and I don't expect to get an education here. I would like to get answers to a few basic questions and perhaps links, etc. to more detailed information.

I know that PLC manufacturers offer software packages to do this but that is not an option for me. The ones I have looked at are far too expensive for what I'm doing. I believe this can be done using Visual Basic or something similar. Am I correct about that? Point me in the right direction please.
 
You will get a chorus of answers from people who will tell that it's a lot of work. I will skip that and stick with answering your questions.

Yes it is possible to write an HMI program to run on a PC. That is after all what the automation vendors have themselves done. You would just be writing something that isn't reconfigurable.

Your biggest problem to doing this on a budget is going to be protocols. Most industrial protocols are proprietary, and a single driver for them can sometimes be more expensive than a complete HMI panel.

Having said that though, there are a few open protocols. Modbus (TCP, RTU, and ASCII) is one of the few open protocols available, so there are quite a few free drivers available for that. Have a search on SourceForge and Google and take your pick. A few manufacturers (such as Omron) document some of their protocol openly, so you can write your own protocol software if necessary.

If you are using AB or Siemens though, the protocols for their current products are proprietary (the same is true for a number of other brands as well). If that is what you are using, then you are probably out of luck and will be stuck with paying whatever they (or their licensees) want to charge for drivers. Some of their older serial protocols are documented, but you might need extra communications modules to use them.

So the first question to ask yourself is, what PLCs are you using, and what protocols can it use?

As for programming languages, yes you could do it with MS VB. MS VB wouldn't be my own first choice (I prefer working with Python), but you could make it work.

It is also possible to create web based HMI systems. I am working on an open source/free software project that will allow web based HMI systems to be created using ordinary web page techniques. The Sourceforge project page is here:

http://sourceforge.net/projects/mblogic/

The mbhmi package has a demo version that illustrates what can be done. I have to integrate that into the MBServer package before it will be useful in production, but that is probably about a month away from release. It can talk Modbus TCP, but you would still have problems with proprietary AB or Siemens drivers.

That may not help you much today, but is shows what is possible as another alternative. You might look around to see if something similar is available.
 
K
Hi,

I assume that you don't have or want to spend any money. The real problem is the driver required to connect to a PLC. You could use the Kepware OPC server that gives you 2 hours in demo mode, or get your PLC to use a simple comms protocol such as Modbus, etc. You can use VB, after all it is a programming language, you can even use Excel with a dde link to Kepware if you want and display graphs and animation in real time (sort of). The thing is you need to look at the PLC interface first, most PLCs will have a simple ASCII interface port/card available.

Kevin
 
W

William Sturm

If you plan to learn simple VB or C# programming, then search for vendors of VB PLC drivers.  There are several to choose from.  Buy a book on VB or C# and have at it.  I have done it many times.
 
K

Ken Emmons Jr.

I think the GUI part is easy with VB or VC++, but the communications is the tougher part. I would see if your PLC vendor offers a DLL or ActiveX interface to read/write variables in the PLC, most of the big guys do. Other than that if your PLC has a Modbus interface you could use some freeware Modbus libraries.

KEJR
 
Sure, it is possible to develop with VB and it is very easy. If you plan to use OMRON, I have developed a freeware Ethernet communications library for OMRON, and I am planning to give RS232 communication support to it.

You can download it from
http://code.google.com/p/indafins/downloads/list

Including sample source code and a draft documentation.

Also you can find some tutorials at
http://indanotes.blogspot.com/

for PC - PLC communication basics, for example:
http://indanotes.blogspot.com/search/label/PC PLC Communication

includes a case study about PC - PLC communications.

I don't like VB, but I prefer to use VB because:
- It is easy to learn, a programmer that already knows any programming language, can learn to code VB in two weeks time.
- It compensates some syntax errors by own, for example it does not cares case sensitivity. So programmer can have extra focus on algorithm instead of programming language considerations.
- You can do whatever you want and you can find lots of documentation on Internet.
- VB uses the same structure with VBA, so you can also use MS Office. You can even use Microsoft Power Point Presentations as HMI
- In my opinion, code readability is much more important than execution speed of code. In each 6 months time, you can find a better PC to upgrade and speed up your project, however if your programmer has gone, it may be difficult to read existing code for the new programmer. VB language is easy to read.
- VB6.0 is obsolete but stable (Yes, I know; PC stability is another problem. It is subject of an another discussion. I am going to publish a post about PC stability in my blog). Runs fast. You can still find documentation on Internet, but the attainability of VB6.0 related documentation decreases day by day as VB.Net popularity increases.
- VB.Net is new, it has more capabilities and tools but not mature at all. Your programs may be affected with new patches of Microsoft.

As a conclusion, PC is a cheaper choice if you are using open documented communication protocols.
 
Automated Solutions offers many industrial protocol drivers (.NET, ActiveX, OPC, etc.) that allow you to build HMI applications in VB, C#, C++, and several other major platforms.

30-day fully functioning trial versions are available for download for all products.

ActiveX Controls and .NET component are runtime-free (for many applications, depends on use) and OPC Servers are very reasonably priced.

http://automatedsolutions.com/

 
1: You had better know the protocol, or you can also use the knowledge of OPC.

2: You must build communication with the PLC. Using method of "SCADA" is best, I think!

In fact, have been imitating the TD400 (it is the Siemens product) communication with S7-200.

I want to use a software taking the place of "TD400". It is difficult.
Even though I know a little about PPI protocol. Can someone give me some advice?
 
Top