Category Archives: PLC

Now You Can Have Robust Data Logging for Free – Part 2

Now You Can Have Robust Data Logging for Free – Part 1
Now You Can Have Robust Data Logging for Free – Part 2 

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.

Hardware:
Do-More Designer
https://www.automationdirect.com/adc/Shopping/Catalog/Programmable_Controllers/Do-more_Series_(BRX,_H2,_T1H)_PLCs_(Micro_Modular_-a-_Stackable)
We will demonstrate everything in the PLC simulator, but the hardware would be the following:

  1. Qty 1 – H2-DM1E – Do-more PLC H2 series CPU module, three built-in communications ports: (1) RS-232 port; (1) USB port; (1) Ethernet port
  2. Qty 1 – D2-03B-1 (110/220 VAC) 3-slot base (includes power supply)
  3. Qty 1 – D2-08ND3 – 8 pt. 12-24 VDC current sinking/sourcing, 1 common (2 common terminals), removable terminal

Software:
The software will be broken down into several elements. Understanding each element and how it relates to the program is important.

Shift Bits- These are the shifts that employees will work.
C0 – Internal Bit – Weekend – 12 – 12am
C1 – Internal Bit – Weekend – 12 – 12pm
C2 – Internal Bit – Weekday – 12- 8am
C3 – Internal Bit – Weekday – 8 – 4pm
C4 – Internal Bit – Weekday – 4- 12pm

Total Shift Seconds – This is the number of seconds that have elapsed on each shift. If the PLC was not in run mode then this would not function. This will be used to determine the percentage of the shift that the machine was running.
D0 – Total Shift Seconds – Weekend 12-12am
D1 – Total Shift Seconds – Weekend 12-12pm
D2 – Total Shift Seconds – Weekday 12-8am
D3 – Total Shift Seconds – Weekday 8-4pm
D4 – Total Shift Seconds – Weekday 4-12pm
Note: 8 hour shift = 8 x 60 x 60 = 28800 seconds
         12 hour shift = 12 x 60 x 60 = 43200 seconds
Shift Seconds Reset – Use the leading edge of the shift bit to reset the shift seconds and the total shift seconds.

Next we have to determine if the machine is running or not. If it is running then count the number of seconds for the shift.
The input X0 is a signal off of a proximity sensor for a length counter. Every pulse of the input will represent 0.303 meters of product.

Machine Running Bit:
Determine if the machine has stopped. If the count input stops counting for 2 seconds then the output stop bit turns on.
Timers are used for both the on and off condition of the input. The input can stop when the input is on or it can stop when the input is off.
Stop Bit – C10 – Will be on if the machine has stopped counting

Shift Seconds – This is the total number of seconds that the machine has run for each shift.
D10 – Shift Seconds – Weekend 12-12am
D11 – Shift Seconds – Weekend 12-12pm
D12 – Shift Seconds – Weekday 12-8am
D13 – Shift Seconds – Weekday 8-4pm
D14 – Shift Seconds – Weekday 4-12pm

We will stop here and continue the PLC program in part 3.
If you have any questions or need further information, please contact me.
Happy programming,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

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.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

… 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



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

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




If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Creating More Than Just A PLC Program

A collection of random thoughts on PLC programming and doing more than just basic logic. Making your program intuitive.

PLC programs usually just control the logic between the inputs and outputs. If this turns on and that is not on, then this output is on, bla bla bla. Programmable logic controller programs can go far beyond just the basic logic. Modern processing power has enabled allot more features that can be programmed.

Traditional PLC programs are written so everyone can understand the ladder programming. This is not the case anymore. There should be no need for anyone to review the ladder program. Error messages, alarms and sequencing should automatically make troubleshooting simple. If something is not working, your system should direct personal how and what to do to fix it.

Touch screens, LED indicators, stack lights, custom user error messages, display boards and logging software are just a few methods of displaying information to the operator, electrician, mechanic, supervisors, managers and even owners of the equipment.

Your program can track the basic hours of operation and trigger maintenance events from these hours. What needs to be done after 100, 500, 1000 hours? Just like the service on your car, you should plan for the service on your machine through the use of program.

If a pneumatic cylinder is used here are a few things that you can track in the program:

  • Number of cylinder cycles
    • Life expectancy
  • Time it takes to complete cycle (Sensors on both ends of the cylinder)
    • Determine if a seal is leaking
    • Pressure of the incoming supply if multiple cylinders are monitored

Here is a good reference for Bimba Cylinders.
https://www.bimba.com/sites/default/files/Library%20Archives/Catalogs/Bimba/Bimba_Reference_Handbook.pdf

Alarm Screens:

Alarms should be easily identified and located.
Remember: A picture is worth a thousand words.

Establish sequencing of events that can be stepped through forward and backwards can allow maintenance personal to easily troubleshoot the system without going through possibly hundreds of lines of ladder logic.
Please see the following links for sequencing your program:
Building a PLC Program That You Can Be Proud Of – Part 1
Building a PLC Program That You Can Be Proud Of – Part 2

With Ethernet connections built into most modern PLC CPUs, it is now  possible for the PLC to automatically send email to your exchange server.
Automation Direct Do-More CPU is one of these PLCs.
https://www.automationdirect.com/adc/Shopping/Catalog/Programmable_Controllers/Do-more_Series_(BRX,_H2,_T1H)_PLCs_(Micro_Modular_-a-_Stackable)

When programming PLC’s for logging data, information must be stored in the PLC for later retrieval. Most commercially available software for logging data does not consider the event of loosing the communication cable. If an interruption on your communication lines happen, data cannot be retrieved from the PLC. The PLC can use indirect addressing to store the logged information. Logging software can read the pointer to the logged data, read the data and then reset the pointer. The duration and amount of information that you are logging will determine the amount of time the communication can be disabled before loosing data. I usually log daily summaries as well as detailed information in the process. My detailed data will be lost in 2 hours but my log daily will take one month.

What other options do you see with a modern PLC?

I look forward to your comments,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Get Rid Of Surges That Are Destroying Your PLC Outputs

DC Solenoids are the worse culprits for electrical surges on your system. When the electrically generated field collapses an opposite polarity voltage is generated. This voltage spike can be high enough to weld the contacts on a PLC output relay.

To protect your PLC output relay, use a diode to ensure that when the solenoid switches off the voltage spike is released through the diode instead of the relay.

 

The diode should be rated to handle 10 times the voltage that you are switching and enough for the current flow of the circuit.

Parts of the diode:

The cathode of the diode is marked by a band.  The electron flow will only occur in one direction.

Installation:
Install the diode as close as possible in parallel with the solenoid. The cathode should be wired to the positive source of the solenoid. (Dissipate negative polarity voltage spike)

Note: You could also install an interposing device to handle the surge such as a SSR. (Solid State Relay) This is generally more money, space in the panel and wiring.

Note: Allot of solenoids come already with surge suppressing diodes from the manufacturer. If not, you will usually need this information when troubleshooting and discover your welded contacts of the output relay.

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



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Building a PLC Program That You Can Be Proud Of – Part 2

In part 1 we looked at writing PLC programs to control a traffic light using discrete bits and then using timed sequencing using indirect addressing.  We will now look at how we can use indirect addressing for inputs as well as output to control the sequence in the program.

Lets look at an example of controlling pneumatic (air) cylinders.

Video of  Pneumatic Cylinder Sequencing on YouTube.

This site contains a video of the three cylinders and the sequence required.

This program will have the following inputs. Even thought no sensors are mounted on the cylinders, it is best to have sensor inputs when the cylinder is extended (out) and retracted (in)
Inputs:
Cylinder 1 In – X1
Cylinder 1 Out – X2
Cylinder 2 In – X3
Cylinder 2 Out – X4
Cylinder 3 In – X5
Cylinger 3 Out – X6
Start PB NO – X7
Stop PB NO – X8
Step PB NO – X9

This program will have the following outputs.
Outputs:
Cylinder 1 In – Y1
Cylinder 1 Out – Y2
Cylinder 2 In – Y3
Cylinder 2 Out – Y4
Cylinder 3 In – Y5
Cylinger 3 Out – Y6

We will use the following pointers:
V0 – Output pointer starting at address V2000
V1 – Input pointer starting at address V1000
V10 will be the input word
V20 will be the output word

Before we start and write the code lets look at the sequence that we are trying to accomplish. The best way to do this is a chart indicating the inputs and output. I use either graph paper or a spreadsheet software to configure the sequence.
I usually start with the outputs configure the sequence that I would like to see. Then based upon the output sequence, I figure out the input sequence.

Note: Here is the location for a quick review of numbering systems from a previous post.

Once the sequence has been established, the next step is writing the program.
Input program that will set the input bits in V10.

Control part of the program:
The first scan will reset the input and output pointers.
The input pointer is compared to the input word V10. If they are equal then the output pointer and input pointer are incremented. If the STEP input is hit, then the output and input pointers are incremented.
The output pointer is then compared to the maximum value (end of sequence). If it is greater than or equal to the maximum value then the pointers will be reset.
Line 12 will move the outputs indirectly to the output word.

Output program that will set the actual outputs based upon the bits in V20

As you can see the actual program is very small however the sequence can be thousands of steps. This is a very straight forward and powerful method of programming. Programming this sequence using bits, timers and no indirect addressing would be very difficult and hard to read. Modifications would have to be a complete re-write of the program.

Modifications:
The entire program sequence could change without further lines of code. Only the values in the registers would need to be modified. This could lead to different sequences for different products.
We used a step input to have the program move forward through the sequence. It would be just as easy to add a step reverse function for the program. We would just have decrement the pointers and check to make sure when we were at the beginning of the sequence.

Troubleshooting:
When troubleshooting this program we would only need to look at the compares to determine what input and or output is not working correctly.

Integration with a touch panel display is simplified when using this type of programming method.

What other advantages do you see?

In Part 3 we will build on the traffic light sequencing used in part one with inputs for pedestrian and car detection.

Contact me for the above program. I will be happy to email it to you.
If you have any questions or need further information please contact me.
Thank you,
Garry

You can download the software and simulator free at the following address. Also listed are helpful guides to walk you through your first program.
Do-more Designer Software

How to use video’s for Do-more Designer Software




If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Building a PLC Program That You Can Be Proud Of – Part 1

What is the best way to program a PLC? 
My answer is simple. The best way is one in which someone can look at your program and understand it. I cannot stress enough the need for good documentation of your program. The best programs are ones that I can return to after several years and understand what it is doing within a few minutes. Programs should read like a book. This will aid in troubleshooting, modifying or teaching.

How do you approach a PLC program?
You must know everything about the logic or process before starting your program. Making a flow chart is one good method to learning the logic and process. The flow chart will bring out questions like the following:
What happens after a power outage? (In each condition of the outputs)
What happens if a sensor is not made? How long do you wait?
What are the critical items to monitor? (Ex. Air Pressure, Weight, Length, etc)
What happens…
Once you have written your program and are in the troubleshooting stage you can usually go back and add to your flow chart. Usually there is always something that needs to be added, changed or modified based upon the actual functioning of the program.
Consider each project a complete leaning opportunity.

Once you know what you want to do with the PLC and have a good understanding of the logic flow, then it is time to start coding. Remember that there is no write or wrong method to program the PLC, either the program will work or it will not work.

Let’s look at an example. We will start with something that we all know how it works.
Traffic Lights

We will look at three programming examples for the lights. Two different approaches to programming will be used, but the program function is the same. The last example will modify the logic for a car being sensed.

Logic:
First Example:
Traffic Light Program
Sample program for traffic light intersection with lights facing North /South and West /East.
Green is on for 5 seconds
Yellow is on for 2 seconds
Red has an overlap of 3 seconds
This program uses discrete bits and timers to accomplish this task.
The $FirstScan bit will reset the timers so if power is lost, the lights will start with Red / Red overlap before starting the sequence again.
The outputs are controlled by when the timers are on (Done) or off (Not Done)
North / South Traffic Lights
West / East Traffic Lights

You will notice that this program is fully documented and easy to understand.

This program is based upon time events. The base rate is one second. If we create a list of what the outputs look like after each second and then send them to the physical output channel we will have the second type of approach to this logic…

Logic:
Second Example:
Traffic Light Program

Sample program for traffic light intersection with lights facing North /South and West /East.
Green is on for 5 seconds
Yellow is on for 2 seconds
Red has an overlap of 3 seconds

This program uses indirect addressing to program
Lets look at the list of outputs we want based upon the following addresses: (Notice the Bit location)
Y0 – Red_Light_NS
Y1 – Yellow_Light_NS
Y2 – Green_Light NS
Y8 – Red_Light_WE
Y9 – Yellow_Light_WE
Y10 – Green_Light_WE

We have 20 steps to do in the sequence based upon 1 second increments. (V1000 to V1019)

Here is what the hex values translated to binary look like:
(Review of numbering systems from previous blog)

The $FirstScan bit will reset the pointers so if power is lost, the lights will start with Red / Red overlap before starting the sequence again.

Lets look at the program:

The $FirstScan bit will move  the number 1000 into V0. V0 will act as our pointer for the list of outputs. (V1000 to V1019)
Every 1 second ($1Second) V0 will increment by a value of 1. We will then compare the value to 1020 which indicates the end of the sequence. If the value is greater or equal to then our pointer is reset to the value of 1000. This is done by moving the number 1000 into V0.
The last step is moving our output word indirectly V0 to our output word V1. Indirectly means that the value in V0 will point to a memory location dictated by the number it contains.
ex: V0 has a value of 1000 so this means that V[V0] will move V1000 into our output word.

Set the outputs
Our physical outputs are set by casing our output word (V1) into bits. Depending on the programmable controller this can be done my moving to a word that can be addressed by bits or in our case we can cast the word into bits. [V1:#]

This program code is allot smaller than the first using discrete bits and timers. With documentation it is also easier to read.

One of the advantages of indirect addressing to program is that it makes modifications easier. Lets modify the last program…

The North will stay green until a car approaches from the West. It will remain green for 1 more second before turning yellow and completing the cycle. If the car is always there then the lights will always function.
X0 – Car West/East

Just a couple of contacts have been added to the logic on the line that increments the pointer. The setting of the outputs do not change.
If the value at V0 is equal to 1006 then stop incrementing V0. X0 (Car at intersection) comes then the pointer will increment. The cycle will complete and continue until X0 is not present. It will then stop when the pointer V0 equals 1006 again.

Watch on YouTube : Building a PLC Program That You Can Be Proud Of

In part 2 we will look at indirect addressing with a sequence that is event driven, not timed like the above.

Contact me for the above programs. I will be happy to email them to you.
If you have any questions or need further information please contact me.
Thank you,
Garry

You can download the software and simulator free at the following address. Also listed are helpful guides to walk you through your first program.
Do-more Designer Software

How to use video’s for Do-more Designer Software

One of the better PLC programming books is PLC Programming for Industrial Automation by Keven Collins. Here is the link to the free download.

http://staffweb.itsligo.ie/staff/kcollins/plc/plcprogramming.pdf




If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Who Else Wants To Know How A PLC Scans?

Programmable Logic Controllers (PLC) will scan very quickly. This can be anywhere from 1 to 20 ms, which translates into 1000 to 500 times each second. But what exactly is a scan?

A scan is when the PLC will complete the following:

Read Inputs:
Look at all of the inputs to the programmable controller. Digital, Analog, Communication
Execute Program:
Solve the logic to determine the output status. PLCs generally will solve the logic from left to right, top to bottom. The output of the rung before is available for the next rung.
This is like some of the popular bands of PLCs like MitsubishiAllen Bradley, Siemens, Omron, Automation Direct, etc. There are some exceptions like older Modicon models which solve the logic top to bottom, left to right. Always refer to the manufactures manual to ensure the program execution method.
Diagnostics and Communication:
The PLC will do a self check. It will verify that no errors exists in memory, cards attached, etc. This is critical because the PLC in an industrial application can have devastating effects if something malfunctions and the machine continues to function erratically. The PLC will stop executing, return the outputs to a normal state and indicate an error has occurred.
Communication will happen to the remote I/O, operator panels, etc.
Update Outputs:
Outputs are set according to the PLC program. (Digital, Analog) This is where the physical items will start moving. (Motors, Valves etc.)
To understand the scan, lets take a look at an example.
The following program will look at input X0 and set an internal bit for one scan one the rising edge of the input and one on the trailing edge of the input. The rising edge is when the input transitions from off to on and the trailing edge is when the input transitions from on to off.
The bits will only be on for one scan so we will increment an internal word by one when the bits go on. This way we will be able to see the bit increment in the word.
Leading edge one shot (one scan) bit. When the input signal goes on (X0) and C1 is not on, then C0 is turned on. The next rung will have C0 and X0 on so C1 turns on.
Remember: The PLC will scan from left to right, top to bottom and the outputs from the previous rung are available for the next.
C0 is on so the increment will add one to D0.
The next scan X0 is still on, C1 is now on so output C0 is turned off. C0 has been now on for one scan from the transition from off to on.
Trailing edge one shot (one scan) bit. When the input signal goes ooff (X0) and C3 is not on, then C2 is turned on. The next rung will have C2 and not X0 on so C3 turns on.
C2 is on so the increment will add one to D1.
The next scan X0 is still off, C3 is now on so output C2 is turned off. C2 has been now on for one scan from the transition from on to off.

Contact me for the above program. I will be happy to email it to you.
If you have any questions or need further information please contact me.
Thank you,
Garry

You can download the software and simulator free at the following address. Also listed are helpful guides to walk you through your first program.
Do-more Designer Software

How to use video’s for Do-more Designer Software




If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Who Else Wants To Lean PLC Programming For Free?

I have always been an old school programmer. Hardware in front of you hooked up to all of the I/O. I have recently looked at the automation direct do-more designer software solution. The Do-More Designer Software will allow you to build your ladder logic, download into a simulator (comes with the software) and run the code. The price of all of this… FREE

I will not get into allot of details because the documention available already will get you through the software step by step.
– Download the software
– Install the software
– Use the YouTube videos for help with getting around the software and making your first program.

The following are several links to help you discover the plc programmer in you:

Automaion Direct – Do-more Programming Software
http://www.automationdirect.com/adc/Overview/Catalog/Software_Products/Programmable_Controller_Software/Do-more_PLC_Programming_Software

http://www.aboutplcs.com/do-more/software/

http://www.aboutplcs.com/do-more/software/simulator.html

The simulator has allot of great features, including PID simulation.

Do-more PLC – How to videos on youtube
https://www.youtube.com/playlist?list=PLPdypWXY_ROoJx-HnK9gj2Z5a-i7th-UK

Update: Here is a video from YouTube about the simulator basic instructions:
http://www.youtube.com/watch?v=ZnRSw3ykW6k#t=274
https://www.youtube.com/watch?v=4JiMzBHPa7E

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



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.