Easy Steps to Program a Click PLC Sorting System

Learn how to program a Click PLC sorting station from scratch in this comprehensive tutorial! We’ll take you through the step-by-step process of designing and programming a Click PLC sorting station, covering everything from setting up the PLC to writing the code. Whether you’re a beginner or an experienced programmer, this method is ideal for anyone seeking to enhance their PLC programming skills. By the end of this tutorial, you’ll have a solid understanding of how to create a functional sorting station using a Click PLC.
Easy Steps to Program a Click PLC Sorting System
The Benchwork Sorting Station is just one of many machines in the Machine Simulator (MS), also known as EasyPLC. This sorting station features a camera that determines the color of the parts and directs them down one of three different ramps. Programming involves both automatic and manual modes, which are controlled from a push-button control panel. The Click programming software will be used to program this Click PLUS PLC.

Modbus TCP (Ethernet) will connect the Click to the Machine Simulator (EasyPLC). Discrete inputs and outputs will be controlled from the Machine Simulator (Client) to the Click PLC (Server). Using the five-step program development process, we will demonstrate how this sorting station is programmed. So, let’s get started and dive into the world of industrial automation programming!

Learn PLC programming the easy way. See below for a 10% discount on this cost-effective learning automation tool. Invest in yourself today.
Previously, we have done the following:
Easy PLC Installing the SoftwareVideo
EasyPLC Software Suite – Quick StartVideo
Click PLC – Easy Transfer Line ProgrammingVideo
Productivity PLC Simulator – Chain Conveyor MSVideo
Do-More PLC – EasyPLC Box Selection ProgramVideo
Click PLC EasyPLC Gantry SimulatorVideo
Click PLC Simple Conveyor EasyPLCVideo
EasyPLC Paint Line Bit Shift – BRX Do-More PLCVideo
Click PLC – EasyPLC PLC Mixer ProgrammingVideo
Click PLC EasyPLC Warehouse Stacker ExampleVideo
–  Operation Video
EasyPLC Machine Simulator Productivity PLC Robotic CellVideo
EasyPLC Simulator Robotic Cell Click PLCVideo
Palletizing Conveyor Programming Do-More PLCVideo
Palletizing Conveyor Programming – Click PLCVideo
Product Quality Verification! Do-More PLC SequencerVideo
Revolutionize Learning PLCs with Pallet 3D Sim!Video
Robot Packing PLC Program DevelopmentVideo
Box Dumper Easily Learn PLC ProgrammingVideo
Innovative Solution for Mixing Ink and BottlingVideo
Benchwork 1 Do-More Practice PLC ProgrammingVideo
LS Electric XGB PLC Easy Transfer ProgramVideo
Do-More PLC Automatic Robot Packing MachineVideo
Latest Machine Simulator Modbus Server DriverVideo
Machine Simulator Modbus Server to C-More HMIVideo
Creating the Ultimate Automation Training Setup
Part 1Video
Part 2 – Video
Unlock Click PLC & Machine Simulator IntegrationVideo
Master the Pneumatic Pusher Simulator Now!Video

Define the task: (Step 1 – Click PLC Sorting Station)

The first step in developing a Click or any PLC program is determining what must be done. Start the Machine Simulator (MS). Select the machine’s button on the main page or select machines from the main menu at the machine simulator window.
Easy Steps to Program a Click PLC Sorting System
All available pre-built machines for practicing PLC programming will now be displayed.
Easy Steps to Program a Click PLC Sorting System
Move your mouse over the “Benchwork Sorting Station” machine. This is the machine that we will be programming. Three items will be displayed. Click the information button on the top right of the screen.
What has to be programmed?
This will show you a description of the benchwork sorting station. Select Close.

The sorting station simulator has a demo mode. This will allow you to observe the machine’s operation, enabling us to understand the basics of how it functions. Select the demo mode for the benchwork sorting station.
Demonstration Mode Machine Simulator
The demonstration mode will only show you the automatic mode. When the tray conveyor is in operation, a cylinder holds back that part, allowing the camera system to view it. Once the part is identified as either a Red, Blue, or Black part, the appropriate fingers will be set for the correct exit ramp. The cylinder is pulled back, allowing the part to move down the tray and be directed into the proper exit for the color. The cylinder is then extended to allow the next part to be identified.
There is a full sensor that covers all of the exit ramps. This will indicate when the part has been sent down the exit ramp. If the sensor is always on, then the exit ramp is full, and the parts must be removed.

Move around the 3D virtual environment.
Move around the machine simulator
The icons at the top of the window enable you to navigate this 3D environment. The first icon is the default selection. This will allow you to move around without bumping into the components. The last icon will automatically show you around this virtual environment. The first-person mode will mimic a person in your 3D learning world. The third person will show you an operator and their relationship to the sorting station machine. Once we understand what needs to be done, we can proceed to the next step in developing the Click PLC program.
Watch the video below for a sequence of operations.

Define the Inputs and Outputs: (Step 2 – Click PLC Sorting Station)

At the top of the sorting station simulator window, the View I/O will display the inputs and outputs required for this example. The outputs are on the left-hand side, and the inputs are on the right-hand side.
View Inputs and Outputs on the Machine Simulator
While still in demo mode, you can see the operation of the inputs and outputs.
The Benchwork Sorting Station Machine will require 17 digital outputs and 18 digital inputs. If you are unsure what the output or input is doing, start the sorting station in Start mode.
Manually operate the MS Sorting Station
Select View IO at the top middle of the sorting station simulator window. We can manually run the Benchwork Sorting Station without a control system, such as a Click PLC.
Clicking on the outputs will allow you to turn them on manually. You can then monitor the inputs to see their operation. The restart button at the top of the machine simulator window resets the scene to its starting point. The following table defines the inputs and outputs (I/O) and Modbus addresses that we will use in the Click PLC for this program.

Digital Type Description Click PLC Modbus Address Machine Simulator Modbus Address
PLC Output – MS Input Start Tray 16485 – C101 16484
PLC Output – MS Input Move Finger 1 16486 – C102 16485
PLC Output – MS Input Move Finger 2 16487 – C103 16486
PLC Output – MS Input Pneumatic Cylinder Back 16488 – C104 16487
PLC Output – MS Input Output 4 16489 – C105 16488
PLC Output – MS Input Automatic Light 16490 – C106 16489
PLC Output – MS Input Manual Light 16491 – C107 16490
PLC Output – MS Input Start Light 16492 – C108 16491
PLC Output – MS Input Stop Light 16493 – C109 16492
PLC Output – MS Input BT Tray Light 16494 – C110 16493
PLC Output – MS Input BT Finger 1 Light 16495 – C111 16494
PLC Output – MS Input BT Finger 2 Light 16496 – C112 16495
PLC Output – MS Input BT Retract Stop Light 16497 – C113 16496
PLC Output – MS Input Workpart Destruction 16498 – C114 16497
PLC Output – MS Input Workpart Creator 16499 – C115 16498
PLC Output – MS Input Camera Start 16500 – C116 16499
PLC Input – MS Output Part Present 16585 – C201 16584
PLC Input – MS Output Finger 1 Advanced 16586 – C202 16585
PLC Input – MS Output Ramp Full 16587 – C203 16586
PLC Input – MS Output Finger 2 Advanced 16589 – C205 16588
PLC Input – MS Output Photocell Full 16590 – C206 16589
PLC Input – MS Output Part Blue 16591 – C207 16590
PLC Input – MS Output Part Red 16592 – C208 16591
PLC Input – MS Output Part Black 16593 – C209 16592
PLC Input – MS Output Selector Automatic 16594 – C210 16593
PLC Input – MS Output Reset 16595 – C211 16594
PLC Input – MS Output Start 16596 – C212 16595
PLC Input – MS Output Stop 165897- C213 16596
PLC Input – MS Output Advance Tray Manual 16598 – C214 16597
PLC Input – MS Output Finger 1 Manual 16599 – C215 16598
PLC Input – MS Output Finger 2 Manual 16600 – C216 16595
PLC Input – MS Output Cylinder Stop Manual 16601 – C217 16596
PLC Input – MS Output DI End Camera 16602 – C218 16597
PLC Input – MS Output Emergency Button ON 16603 – C219 16598

Note: The machine simulator will be offset by one on the Modbus Addresses.

We can use the Click PLC Software to view the address picker and determine the Modbus addresses required for the program.
Modbus Address Determination in the Click PLC

Develop a logical sequence of operation: (Step 3 – Click PLC Sorting Station)

A flow chart or sequence table is used to understand the process that needs to be controlled thoroughly. It must also answer questions like the following:

What happens when electrical power and pneumatic air is lost? What happens when the input/output devices fail? Do we need redundancy?

This step allows you to save yourself a lot of work by understanding everything about the operation. It will help prevent you from having to continually rewrite the PLC program logic. Knowing all of these answers upfront is vital in developing the PLC program.

Sequence of Operation
The push-button control panel of the Sorting Station program controls both automatic and manual movement. The operator will receive information on the machine’s status from the indicator lights. Conditions must be taken into consideration for all possibilities for switch and push-button inputs from the operator.

Logical Steps for Programming the Machine
This is the hardest part of the programming development process. Getting all of the conditions down for each output based on the inputs is critical. Let me know if you agree in the comments below.
Our Sorting Station program can be seen as a simple conveyor operation. A part is read by a camera, which sets the color and presence of the part.  The fingers are activated and confirmed. A cylinder will then allow the part to move down the tray and into the exit ramp. The full sensor will be used in conjunction with a timer to activate the part destroyer and automatically clear the exit ramps.

A PLC programmer must know everything about the sequence and operation of the machine before programming.

Ask questions or review existing documentation to ensure you understand the logical steps involved in the machine’s operation.

Develop the PLC program: (Step 4 – Click PLC Sorting Station)

Writing the ladder logic code for our Click PLC sorting station example will be the next step in our program development.
We will use the Click PLC programming software and a Click PLUS CPU. Call up the Address Picker from the Home tab. Select the display MODBUS option to see the addresses that will be used for our communication.
Enter all of the inputs and outputs for the sorting station machine
We can now enter the names for our inputs and outputs from the machine simulator for our sorting station.
Detailed information on the Click PLC can be found in our Click PLC Series. Our program will be written in ladder logic. (Ladder Diagram)
Do not worry that we do not document all of the names in our program. This can be added later as we need further variables in our program. Save and transfer our program to the Click PLC. It is good practice to save often during programming. This can save you a lot of time if the unexpected happens, such as a computer crash or a power outage.

Ladder Logic Programming
We will first program the lights on the push-button control panel. This will give the operator a visual indication of what the program is doing.
The emergency button input must be on for any light to be active. When the emergency button is activated, the automatic or manual lights will be turned on, depending on the setting of the selector switch.
The start and stop lights are only associated with the automatic mode. When the automatic mode is first turned on or when it is on and the stop input is activated, the start light will be on, and the stop light will be reset.
When automatic mode is selected and the start pushbutton is pressed, but not the stop pushbutton, the Stop Light will be active, and the Start Light will be reset. This indicates that the machine will be running. The stoplight indicates to the operator which button to use to stop the operation.
In manual mode, the start and stop lights are reset. Remember that the PLC will scan left to right, top to bottom. The reset from the manual will override any previously set condition.
Save and download the program into our Click PLUS PLC.

Ladder Logic Programming
We will program the automatic sequence starting with the tray control. When we have the stoplight (Automatic Mode), the tray will start. If we do not have the sort part released and the pneumatic cylinder is back, then we will activate the create workpart.
The camera control will be activated when the start tray is on.
Save and download the program.

Ladder Logic Programming
The finger control will determine which exit the part will take. If the stop light is on and the part is present, then, depending on whether the blue or red part is present, this will set finger 1 or 2. All of the parts will set the internal bit C501, indicating that a color part has been detected.
If we have detected the color part and the trailing signal from the ramp full sensor, this will reset the detected color part. Indicating that the part has been sent down one of the exit ramps. We will also rest both finger 1 and 2 outputs, and the sort part will be released.
The Sort Part Released will be set when the automatic mode is enabled and the color part is detected. The finger 1 and finger 1 advanced, or finger 2 and finger 2 advanced, or the black part will be placed in series before setting the Sort Part Released.
Save and download the PLC program.
Watch the video below to see the programming of this sorting station.

Ladder Logic Programming
The cylinder back control will release the part to be sorted. If we have the Sort Part Release and not timer 1, then turn on the pneumatic cylinder. When the part is not present, then we will activate timer 1 for 500 milliseconds (0.5 seconds). This will release the part for sorting.
Save and download the PLC program.

Ladder Logic Programming
We will now program the Ramp Full Control. If the ramp full input is on for longer than 1000 milliseconds (1 second), then timer 2 will activate the workpart destroyer.
Save and download the Click PLC program.

Our automatic mode for our program is now complete.
We can now move on to the manual control.

Ladder Logic Programming
We will start with the tray control. If the manual tray light is on, then we will energize the tray.
The manual light will be set and reset based on the leading edge of the Advance Tray Manual pushbutton, and when the start tray is on or off. When we are not in manual mode, the light will be reset.


Finger control in manual mode will turn on the Finger 1 light and set the move finger to 1 when the Finger 1 manual pushbutton is selected. This will also happen with finger 2.
When not automatic, it will reset the automatic settings for the fingers.

Ladder Logic Programming
The cylinder back control will be activated with the manual pushbutton. This will also bypass the timer used for the automatic mode. The light for the cylinder back will be activated when the machine is in manual mode.
The reset pushbutton will turn on the light and activate the workpart destroyer. This will clear the machine ramps of the parts.
Save and download the PLC program.
Our program is now complete.
You can download this program below.

We communicate with the machine simulator using Modbus TCP (Ethernet or Wireless). The ports will be set up with a fixed IP address so the machine simulator (Modbus Client) can find the Modbus Server.
Communication Port Setup
Select Modbus TCP from the communication port on the Function tab of the navigation window. You can also use the main menu | Setup | Com Port…
The COM port setup window will now be displayed. Click on the Setup Button for Port 1.
Port 1 Static IP address
You can now set the static IP address on the Com Port Setup Details window. Make a note of the IP address. We will need this to connect to our Machine Simulator.
Modbus TCP Server Setup
Select Modbus TCP Setup from the main menu | Setup. Ensure the “Enable Modbus TCP Server” is checked for our port.

How to Program a Sorting Station - Click PLC
Ensure that the PLC is in run mode. Select “Status” to see the active status of the inputs and outputs on the ladder logic.

Test the program: (Step 5 – Click PLC Sorting Station)

We will use Modbus TCP on our Click PLUS PLC to communicate with the EasyPLC Machine Simulator. Call up the Benchwork Sorting Station in start mode.
Easy Steps to Program a Click PLC Sorting System
The status of the machine simulator will be at the bottom left of the screen. Currently, we have no PLC connected. Select IO Drivers at the top of the screen.
Easy Steps to Program a Click PLC Sorting System
The machine simulator IO number will be displayed. Ensure we select more IO than required for our sorting station machine. The EasyPLC driver is selected by default.
Easy Steps to Program a Click PLC Sorting System
Under the driver pull-down menu, select “ModBusDriver.” This driver supports both Modbus TCP (Ethernet) and Modbus RTU (Serial) protocols. Select the down arrow on the driver’s name.
Easy Steps to Program a Click PLC Sorting System
Select the configure button.
Modbus TCP Setup MS
We can now enter the information for our Modbus driver. Select TCP/IP. This means the Ethernet port on the computer will communicate with the Click PLC. The digital inputs from MS to the Click PLC will be C101 to C118. This will start at address 16484 due to the offset of 1. Digital outputs from MS to the Click PLC will be C201 to C218. This will begin at address 16584 due to the offset of 1. Select the OK button.
Easy Steps to Program a Click PLC Sorting System
You will now see the inputs and outputs specified for the Modbus driver. We can now manually assign the driver outputs to the PLC inputs and the driver inputs to the PLC outputs. However, the automatic assignment works well and will save you time.
Select Automatic Assignment from the driver option in the main menu.
Easy Steps to Program a Click PLC Sorting System
This will automatically assign the PLC IO to the Machine Simulator IO. Select Start Driver and exit from the main menu.
Easy Steps to Program a Click PLC Sorting System
On the bottom left side of the window, the driver communicates with the Click PLUS PLC.
Easy Steps to Program a Click PLC Sorting System
Ensure that the Click PLC is in run mode. We can see the operation of our sorting station machine. Try all of the manual operations from the pushbutton control panel.
Select View IO to know the input and output status of the machine simulator. Please select the automatic mode. Select the start pushbutton to start the automatic sorting machine.
Easy Steps to Program a Click PLC Sorting System
The digital inputs and outputs of the MS will correspond to the PLC controller.
Data View
Using the Data View window of the Click programming software, we can also watch the input and output operations.

Using a Machine Simulator (MS) to test the program will ensure that our program works. Troubleshooting is quickly done without damage to any physical hardware.

You can practice your modification and debugging by modifying the sorting station operation in the following way:
– Utilize the Click Remote Mobile App to control this sorting machine. Additional internal contacts will need to be added to the program to control this from your phone.
– Add a counter for each of the exit conveyors. The counter will show the number of each color on the appropriate exit conveyor. The reset will also reset these three counters.
– Calculate the rate of the parts sorted per hour. This can be calculated in the PLC ladder logic during automatic mode.
Let me know how you make out in the comments below.

To learn more about using the five steps to develop a PLC program, click here. Click here to learn more about the Click PLUS PLC.

Download the Click PLC sample program here.

Watch the video below to see the five steps of program development applied to the sorting station machine. The machine simulator is one of the best applications to help you learn PLC programming.

Watch on YouTube: Master PLC Sorting Station Programming in 20 Minutes!

The Machine Simulator (EasyPLC) Software Suite is a comprehensive package that includes PLC, HMI, and machine simulator software. This PLC automation learning package includes the following:
Easy PLC – PLC Simulation allows programming in Ladder, Grafcet, Logic Blocks, or Script.
HMI System – Easily create a visual human-machine interface (HMI)
Machine Simulator – A virtual 3D world with real-time graphics and physical properties. PLC programs can be tested using EasyPLC or through other interfaces. (Modbus RTU, TCP, etc.)
Machine Simulator Lite – Designed to run on Android Devices.
Machine Simulator VR – Virtual Reality comes to life so you can test, train, or practice your PLC programming.

Purchase your copy of this automation learning package for less than USD 95 for a single computer installation or less than USD 110 to allow access on multiple computers.
Receive 10% off the price by typing in ACC in the comment section when you order. http://www.nirtec.com/index.php/purchase-price/
Learn PLC programming the easy way. Invest in yourself today.

If you have any questions or require additional information, please do not hesitate to contact me.
Thank you,
Garry


If you’re like most of my readers, you’re committed to learning about automation technology. The numbering systems used in PLCs are not challenging to understand. We will walk through them, including Bits, Decimals, Hexadecimals, ASCII, and Floating Points.

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


Use the information to educate others on how numbering systems work. Sign up now.

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

 

Leave a Comment