Saturday, October 18, 2014

Now You Can Have Robust Data Logging for Free - Part 1

Robust PLC Data Logger

With traditional loggers, software will read the memory of the PLC and store in a local computer. If the network stops or the PLC communication fails then the logging will stop.
Creating a robust PLC data logger allows the communication to be stopped for a period of time without losing any of the data for collection. This is accomplished by storing the data locally on the PLC until communication is restored. All of the data is then read without loss. The amount of time that the connection can be lost will be dependent on the memory size of the PLC and the frequency of the data collected.

This series will walk you through the steps to create and implement a robust PLC data logger using the following equipment and hardware.
  • Automation Direct - Do-More - H2-DM1E PLC (Ethernet Modbus TCP)
  • Do-more Designer 1.3 (Simulator instead of PLC mentioned above)
  • Windows based computer running IIS
  • Visual Basic 6

The following steps will be explained in details and sample programming.

PLC program
The programmable logic controller PLC will log the data in the PLC memory using indirect addressing for the data log. Information will be collected based upon shifts.
We will use the following shift schedule. Midnight, Afternoon and Days for the weekday and have two weekend shifts. Each shift will show amount of product made, utilization of the machine and rate of product made.
Also we will log a minute by minute account of the machine. This will log the amount of product made and the rate at which it is made. We can then graph the machine performance to determine if it is running correctly.

Data Collection
Visual Basic 6 will be used to log the data into a database. The information will be collected using Modbus TCP communication to the Do-More PLC and/or Simulator of the Do-more Designer. This will use an Ethernet communication cable to the PLC. The program will read the indirect address pointers in the PLC. It will then read the information collected and store the information into an Access Database. The indirect address pointers will then be reset by the program.

Data Distribution
We will set up a web server (IIS). This will allow the access database containing the information from the PLC to be available to all of the computers on the local network. (Intranet)
We will use Active Server Pages (ASP) and HTML to create programs to access this database information. Web browsers will call our ASP and HTML program so the information can be displayed on the device. This will be universal when we look at it with computers, tablets and phones.

Advanced Data Distribution
Using Raphael and SVG programming, we will graph using line graphs. We will also see how we can use dials to create dashboards on our web server.


This may sound like allot of work to do, but it is not. What we are doing is breaking down the fundamentals to display information. Using a robust logging system from the PLC ensures the reliability and your confidence of the data collected. Once the basic principles are applied, your system can expand rapidly.

Are you ready?

If you have any questions or need further information, please contact me.
Thanks,
Garry

Sunday, October 12, 2014

... and I also do PLC programming.

Programmable Logic Controller (PLC) programming is often thought as something everyone can do easily. We often design the system, install the hardware and then start to think about the PLC program and programmers. This approach can be improved. The landscape of PLC programming is changing and we must also change.

Computer Programming / PLC Programming
I believe that with all of the new functions of the PLC processor, you would be better served by someone that can do additional computer programming. Ladder logic has been taught in our schools for about 20 years or more. The basic bit programming in ladder is easily understood. Connecting to the manufacturers dedicated software  shows the power flow from left to right and shows the logic solved from top to bottom.

Some applications are fine if you are just replacing a few relays, however today's manufacturing floor must be integrated. The existing hardware in the plant must also be connected to the PLC system. This will allow connection of data logging, email, vision system, motion control, HMI, computer servers, etc.
Ladder logic and the standardization of PLC's on the plant floor has long been a topic for discussion and debate. The benefits were that anyone can look and understand the PLC logic to troubleshoot the system. Today the PLC can do allot more. Visually it can indicate /display its own troubleshooting and diagnostics to the engineer, electrician and/or operator in a variety of ways. You no longer need the skills on the plant floor all of the time. Using HMI (Human Machine Interface), computer screens, indication lights and email, just to name a few, information can be passed for troubleshooting and diagnostics. The investment in the program and integration of the system in your plant will pay for itself time and time again.

I believe that PLC programmers need more than just this programming language. They must have network and high level language skills to be capable of integrating the entire plant floor.

Let me know what you think? Are we teaching the new generation the right way?
Garry

Sunday, October 5, 2014

Changing Landscape of PLC Programming

Today's new processing and networking power the future looks bright for programmable logic controllers and it's programming. This has allowed the role of the PLC to expand.

System Design:

The PLC design has changed significantly. Computer processing power has now added the following to programmable controllers:

  • Micro USB slots (Data Storage)
  • Ethernet ports 
  • WiFi 
  • RS232 / RS422 / RS485 (Serial Ports) 
  • Canbus
  • Profibus
  • DeviceNet
  • Several digital I/O bus systems like ASi Bus
System design more than ever is done by asking even more question on what is required when installing a PLC system. 
Traditional Questions to Ask:
  • Number of input signals? Voltage levels? (Discrete on/off inputs.)
  • Number of output signals? Voltage levels? (Discrete on/off outputs.)  
  • Number of analog input signals? Voltage and/or Current levels?
  • Number of analog output signals? Voltage and/or Current levels?
  • Operator Interface required? HMI - Human Machine Interface - This is now a touch or function key LCD or LED screen.
  • Etc.
Additional Questions to Ask:
  • Drives / Motors  - What are you connecting to and the communication system required?
  • Computer network - Will this join your computer network? What is the connection cable and communication protocol?
  • Do you need data collection?
    • Do you need data displayed and/or controlled on a remote device such as a tablet or phone?
  • Do you need email and/or text messages sent out by the PLC?
  • Etc.

Programming:

PLC
There has been a movement to standardize PLC programming. IEC 61131-3 is the standard for PLC programming. It defines three programming methods:
  1. Ladder Diagram - Graphical structure 
  2. Function Block Diagram - Graphical structure
  3. Structured Text - Textual structure
  4. Instruction List - Textual structure
  5. Sequential Function Chart - Graphical and Textual structure
The above methods to program PLC's all will do a good job. It depends on how you were originally taught about programming and the experience that your have. Not all PLC's will be able to program in the 5 different ways. Some will only provide a couple. You will have to see the programming manual of the make and model of the PLC that you want to program.

IEC 61131-3 is good, however this does not mean that every programmable controller will program the same way. It will look familiar between programming ladder in AB vs Siemens vs Omron vs Direct Automation, but the key strokes in the software will be different. Manufactures in my opinion will not come to an agreement to have the software exactly the same for all PLC programming. Why should they take away from their market share?

HMI - Human Machine Interface
Just about every manufacturer's HMI screen will be programmed with different software. Due to the proprietary nature of communications, I would always use the manufacturers HMI with their PLC. The communications is usually direct to the memory areas, and faster response time.

Computer
I believe it is always best to have some computer background information. All of our lives are based upon desktop, laptop, tablets and smart phones. Each of these will have an operating system like Windows, iOS, Android etc.
Higher level languages such as Visual Basic (VB6) will give you the ability to run self contained programs that can install on a computer and communicate to the network. I have used this to retrieve information out of the PLC's on the production floor and save this information into a database.
The computer languages are not always the easiest to learn, but with the tutorials and information on the web this becomes easier. Once you learn one language well, then this will create a building block of knowledge for you to understand even more.
Microsoft Visual Studio is a free download and fully functional computer environment. This will include the latest visual basic product. 

Computer Network
The ability to share information in the company is important. You cannot find a manufacturing plant without a computer network. This is usually confined to the 'front office' and is for email, engineering and accounting. We need to get the information from the plant floor to everyone on the Intranet and/or Internet. This can be done through setting up a web server and using basically HTML and ASP to deliver real time data to the network from the PLC.
http://www.w3schools.com/
W3school has help me to deliver real time data via email and web pages to the computer network.
HTML stands for hyper text markup language and is used for all web pages.
ASP stands for active server pages and is used to communicate from a database to web pages.
HTML, ASP, Javascript, VBscript, etc are all languages that are used to define information that gets shared on a computer network through a web server via a web client.



We have an abundance of information and ways to learn programming. The language and way will change depending on what you want to do. PLC programming is not just the logic behind discrete input and outputs on a machine, it is the entire system. It is the sharing and use of information for the organization.
I believe that we are going and growing in the right direction with information sharing...

How do you see this change?
Let me know.
Garry