Category Archives: digital

The Secret of Using Counters

Counters  are used in the majority of PLC programs. This is especially true if part of your SCADA system. Counters like the animated picture above count things. In this situation we are counting the number of turns the little guy makes. The counter is displaying the total number. This is considered a totalizing counter. If an output turned on to do something then it would be a preset (target number entered for the count) counter. There are also a wide variety of off the shelf industrial counters that you can use. The implementation of counters can be vast, however it all starts with a TIMING CHART. This is the same as the timing charts we discussed in ‘The Secret of Timers’ post.

A timing chart is the secret behind understanding of the counter that you need in your application. Making a timing chart before writing the program will ensure that all of the information will be accounted.

The timing chart is mapped out on a x and y plain. The ‘y’ plain has the state of the input on/off (1 or 0). The ‘x’ plain will show time.

The following shows a timing chart for a counter:
As you can see in this timing chart, you have an input, output and display.

Inputs:
Inputs are used usually sensors that are wired to the counter (PLC) to indicate the items that we need to count. They can be switches, photoelectric sensors, proximity sensors, encoders, etc. (Wiring of NPN / PNP devices) A counter will generally have only one input. In the case of an encoder input it is still only one input, however this is wired usually as a A, B and Z phase. Z is always the reset. A and B indicate the pulses and are leading or trailing each other by 90 degrees depending on direction. Allot of counters will also allow you to as a direction input signal. However this is all still only one input.

Outputs:
Outputs from counters are generally discrete. This means that they are on or off, similar to the inputs. Outputs will trigger when the count value matches the set value. The duration that the output is on depends on the reset signal, to start the count again. (DC Solenoids protection) Allot of the counters today will allow you to have multiple outputs. These multifunction counters can have several preset outputs that trigger when the counter set value has been reached. Batch outputs are also available on some of the industrial counters. A batch output counts the number of times that the preset has been reached. This output will be turned on when the number entered for the batch has been reached.

Set Value – SV:
This is usually on the display and shows the preset value. It is the target number of counts.

Present Value – PV:
This is usually on the display and shows the current or accumulated value.

The PLC programming is usually not that much different then the industrial counter. Allot of the manufactures will have an up counter, down counter and/or an up/down counter. Just as the name implies the display is either counting up or down. You have to refer to the instruction manual of the manufacturer you are programming for the way in which the counter will be programmed.

In the above example Do-More PLC program we have an up and a down counter. X0 is the input and X1 is the reset on both of these counters. (CT0, CT1)
The preset value is stored in memory location D0. This value is set to the number 3.
When the present value (accumulated) reaches the set value (preset) then the CT0.Done bit goes on and the output Y0 is active. Y0 will remain on until the reset input goes on.
The only difference for down counter is the display. You will see that the present value will count down to zero (0) before the CT1.Done bit is turned on.
These counters are memory retentive. So in order to make the counter non-memory retentive, use the first scan bit of the PLC to trigger the reset of the counter. (ST0 – $FirstScan)

Every PLC has counters. They all have different types depending on what you are trying to achieve. It will all start with your Timing Chart.

Watch on YouTube : Learn PLC Programming – Free 9 – The Secret of Counters

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.

The Secret of Using Timers

Timers are used in the majority of PLC programs. There are also a wide variety of off the shelf industrial timers that you can use. The implementation of timers can be vast, however it all starts with a TIMING CHART.

A timing chart is the secret behind understanding of the timer that you need in your application. Making a timing chart before writing the program will ensure that all of the information will be accounted.

The timing chart is mapped out on a x and y plain. The ‘y’ plain has the state of the input on/off (1 or 0). The ‘x’ plain will show time.

Lets take a look at a timing chart for an On-Delay Timer. This is the basic operation for an Omron H3BR industrial timer.

Power –  When dealing with PLC’s we must consider when power to the unit is removed what happens to the current time and output conditions.
Start – In this case the start signal is momentary to start the time cycle. (t) We could modify this signal to be maintained until the output switches.
Output – The output will show when it turns on. This can also indicate the opposite, and show when it turns off.
Time – Time is shown by the relationship between the start signal and the output. Our example shows timing starts on the leading edge of the Start. This could have also been on the trailing edge.

Here is the same on-delay timing chart with some more detail. Several conditions are added to the chart.

These conditions prompt us to ask the following questions.
What happens when:

  • Power is removed / restored
  • Multiple start signals are received
  • Do we need a Reset signal. If so what happens during its operation
  • Do we need a display of the time. Present Value (PV) / Set Value (SV)

As you can see the timing chart is vital in determining how the sequence will be performed. This is the exact same method that I use when determining timing sequences in a PLC program.

Lets look at an example.

When we hit the start button, the warning light then comes on. After a fixed time the warning light goes off and the motor starts. The motor will run until the stop button is hit.

We will start by using the Start / Stop Circuit we did earlier.

You will notice that we have added an internal memory bit (C0) as our Start Sequence. This is a memory retentive bit, so we can use the (ST0) $FirstScan to make this circuit non-memory retentive. If power goes off, or the PLC is put into program mode the circuit does not remember the last state. It will default to be off.
The sequence is as follows:

  • Start pressed
  • TMR starts to time (10seconds)
  • Warning output comes on
  • After TMR (10seconds)
    • Warning output goes off
    • Motor output comes on
  • Stop pressed
    • TMR is reset to 0
    • Warning light off
    • Motor is off

Every PLC has timers. They all have different types depending on what you are trying to achieve. It will all start with your Timing Chart.

Watch on YouTube : Learn PLC Programming – Free 8 – The Secret of Timers

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.

Here’s a Quick Way to Wire NPN and PNP devices

Here’s a Quick Way to Wire NPN and PNP devices

I get asked often on how to wire NPN and PNP devices to the programmable logic controller. This can be confusing at first when looking at the wiring diagrams. I have managed to destroy a few sensors in the process….. so lets get started and I will share my experiences.


NPN and PNP refer to the transistor in the output device.
NPN – Negative Positive Negative Switching. Sometimes referred to as ‘Sinking’ the load.  People have told me that when the NPN sensor blows it has a tendency to blow in an open state. (No Signal)
PNP – Positive Negative Positive Switching. Sometimes referred to as ‘Sourcing’ the load. People have told me that when the PNP sensor blows it has a tendency to blow in a closed state. (Signal On)

When the sensor blows, (malfunctions) it usually will also take out the power supply. (Fuse) It generally does not matter if you use NPN or PNP sensors provided they are all connected to the PLC using isolated commons.

You cannot mix PNP and NPN sensors on the same common point for inputs to the PLC. If you do mix the sensors, then the different common points on the PLC must be isolated from each other. This means that the commons are not connected internally to each other. Not ensuring this takes place will provide a short across the power supply and blow your sensors and supply. In general, machines tend to use all NPN or all PNP only.

Colour coding of the wires vary. Do not always rely on the colour code of the wires for connection. Refer to the wire diagrams in the documentation.

The following is a wire diagram of an open collector PNP sensor. You will notice that the load appears between the 0V (Blue)  and Switching wire (Black). When connecting to the PLC, the PLC input acts as the load. The 0V (Blue) will be attached to the common input and the Switching wire (Black) will be attached to the input number.

The following is a wire diagram of an open collector NPN sensor. You will notice that the load appears between the +V (Brown)  and Switching wire (Black). When connecting to the PLC, the PLC input acts as the load. The +V (Brown) will be attached to the common input and the Switching wire (Black) will be attached to the input number.

As you can see a direct short will be created if NPN and PNP sensors are wired into the PLC on the same common. The following shows an example of wiring of the 3 wire sensors into a PLC with isolated commons.

Watch on YouTube : Wiring NPN Sensor to PLC

Watch on YouTube : Wiring PNP Sensor to PLC

Watch on YouTube : Wiring Contact (Discrete) PLC Inputs

Wiring Interposing Relays
Watch on YouTube
: Wiring NPN and PNP Sensors into the PLC with an Interposing 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.

How to make a Start / Stop / Jog circuit in a PLC

Looking at a stop start jog circuit in the PLC will help us in understanding the differences in hard wiring the circuit and programming.

Lets start with the basic stop stop circuit.
Here is what it looks like hard wired. (Physical switches wired to outputs devices, such as motor contactor and relays.)

When the start pushbutton (NO) is pressed the power is passed through the stop pushbutton (NC) to the control relay (CR). The CR contact closes and ‘seals in’  the start pushbutton. The start pushbutton can now be released because the CR contacts allow the power to pass through to the CR.

NO – Normally Open – This refers to the state of the input  device if nothing acts upon it. 
NC – Normally Closed – This refers to the state of the input device if nothing acts upon it.

Lets take a look at the PLC program for the above wiring diagram.

The first thing that you will notice is that the input for Stop is NO contact and not NC. This is because the actual signal wired in the input is NC and we do not want to inverse this signal. You can see that the stop input is currently on in the program.
If we hit the start pushbutton then the circuit is complete and the output CR turns on.

Letting go of the start pushbutton, the output remains on because the CR input seals in the start pushbutton.

Pressing the stop pushbutton will break the circuit and turn off CR.

Letting go of the stop pushbutton will return us back to the original state shown above.

Adding a jog input to the hard wiring diagram will look something like this:

You can see that the diagram will work the exact same as the circuit above with the start and stop pushbuttons. The jog when pushed will break the sealing contact, and then make a bypass of the start pushbutton. This will keep the M coil on as long as the jog button is pressed. Letting go of the jog will stop the bypass of the start pushbutton which will stop M coil. When the jog returns to the original state M input will already be off so it will not keep M coil on.
The action on the jog is referred to as a Break before Make device. The jog pushbutton will break the circuit before making another connection.

Sometimes in programming a PLC it can be beneficial to think of the inputs as Make before Break. Inputs are made before the previous ones are broken. The programmable controller will scan the program from left to right, top to bottom. The outputs from the rung above are available to the rungs below. Here is a previous article on PLC scanning.
Lets take a look at PLC program with a jog that will not work.

Even though this looks like it would work… Remember that the contacts in the PLC are make before break. You can jog the unit and it will turn on but as soon as you release your finger off of the pushbutton the not jog input will seal the CR in. The output will not be able to turn off.

We must consider the delay from on to off when looking at the PLC program for this circuit.
Here is a circuit that will work:

Notice that we create a delay from on to off by turning on an intermediate bit in the program.

Another way to do start stop circuits in the PLC is to use the instructions Set (SET)  and Reset (RST).
The set will have all of the conditions to turn on a bit in memory and the reset will have all of the conditions to turn off a bit in memory. These instructions are used to make the program easier to view and troubleshoot.
Here is the same logic above using the set and reset instructions.

Notice that X10 Jog2 is in parallel with the Start. We use a trailing edge one shot in parallel with the Stop. This sets our delay so the output will turn off.

Watch on YouTube :  Learn PLC Programming – Free 4

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.

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.

Here’s a Quick Way to Connect RS232 Equipment

Most programmable controllers will come with a RS232 communication port. This recommended standard (RS) has voltage signals in the range between 3 to 15 volts DC with respect to the ground/common pin. RS232 devices are classed either DTE (data terminal equipment) or DCE (data communication equipment).
The maximum cable length for the communication cable is 15m, however depending on the environment I have seen this as much as 50m without an issue.
Most RS232 connectors are 9 pin like the diagram below, but they can also come in 25 pin or RJ45 connectors.

 

A minimum 3 wire RS232 connection consists of only the transmit data, receive data and ground. This is commonly used if full handshaking is not required.

Pin 2 RD ————————– Pin 3 TD
Pin 3 TD ————————– Pin 2 RD
Pin 5 Ground ———————- Pin 5 Ground
Pin 7 RTS                                       Pin 8 CTS
Pin 8 CTS                                       Pin 7 RTS
Cable Shield

Note: I always jump Pin 4 and 6 out together on each side.
The shield on the connection cable should only be connect to one housing when making the cable. I usually connect it on the PLC end.

5 wire RS232 connection consists of the  transmit data, receive data, ground, request to send (RTS), clear to send (CTS)

Pin 2 RD ————————– Pin 3 TD
Pin 3 TD ————————– Pin 2 RD
Pin 5 Ground ———————- Pin 5 Ground
Pin 7 RTS  ———————— Pin 8 CTS
Pin 8 CTS  ———————— Pin 7 RTS
Cable Shield

Note: The shield on the connection cable should only be connect to one housing when making the cable. I usually connect it on the PLC end.

RS232 is a one to one communication method. (1:1) This means it is designed to communicate to one device. If multiple devices are needed,(1:N) RS422 or RS485 should be used by way of converters.
RS232 must have the same settings on each end. (Port Settings)
These include the following parameters:
Bits per second:  9600 (Baud Rate)
Data Bits: 8
Parity: None
Stop Bits: 1
Flow Control: None

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.

Here’s a Quick Way to Understand PLC Inputs and Outputs

The term I/O means Input/Output. I/O can come in two different types; Discrete or Analog Most people starting out leaning about programmable logic controls (PLC) are taught all about discrete input and outputs. Data is received from devices such as push-buttons, limit-switches etc. and devices are turned on such as motor contactor, lights, etc. Discrete input and output bits are either on or off. (1 or 0) The following program will show a motor control circuit stop start. Motor off:

Motor on:

Analog inputs Common input variables for analog are temperature, flow, pressure, etc. They are converted to an electrical signal into a PLC analog input. Standard electrical signals are 0 – 20 mA, 4 – 20 mA, 0 – 10 volts DC, -10 – 10 volts DC. Note: It is recommended that a 4 – 20 mA signal is best. If voltage is required, a resistor can be added to get a voltage input. Analog outputs Common output variables for analog are speed, flow, pressure, etc. They are converted from a word in the PLC to the output of the analog. The range of signal is then outputted to the device to control the position, rate, etc. Standard electrical signals to the device are 4 – 20 mA, 0 – 10 volts DC, -10 – 10 volts DC. Both Analog Inputs and Outputs use words to determine the signal going to or from the device. Example: 4 – 20 mA current Input – 8 bit resolution 4 mA = 000000002 = 0016 20 mA = 11111111= FF16 Example: 4 – 20 mA current Output – 8 bit resolution 0016 = 000000002 = 4 mA FF16 = 111111112 =20 mA For a review of numbering systems, follow the link below: What everyone should know about PLC numbering systems

 

Let me know if you have any questions or need further information.
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.