Unlocking Click PLC & Machine Simulator Integration: A Game Changer for Automation Professionals
In an increasingly sophisticated industrial automation era, seamless integration between programmable logic controllers (PLCs) and simulation tools is more crucial than ever.
Machine Simulator by Nirtec is a sophisticated yet simple software for creating virtual simulations of industrial machinery and processes. It enables you to visualize and test your systems in a virtual environment before implementing them in the real world.
Click PLCs have long been a staple for automation engineers, offering a reliable and user-friendly solution for various control processes. However, integrating Click PLCs with machine simulators unlocks a whole new level of potential. This blog post will explore the benefits and methodologies of unlocking Click PLC and machine simulator integration.
We will be using the Machine Simulator’s test conveyor example. This practical example will utilize the Click PLC Modbus TCP communications to the simulator Modbus Server driver. Let’s get started.
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 Software – Video
EasyPLC Software Suite – Quick Start – Video
Click PLC – Easy Transfer Line Programming – Video
Productivity PLC Simulator – Chain Conveyor MS – Video
Do-More PLC – EasyPLC Box Selection Program – Video
Click PLC EasyPLC Gantry Simulator – Video
Click PLC Simple Conveyor EasyPLC – Video
EasyPLC Paint Line Bit Shift – BRX Do-More PLC – Video
Click PLC – EasyPLC PLC Mixer Programming – Video
Click PLC EasyPLC Warehouse Stacker Example – Video
– Operation Video
EasyPLC Machine Simulator Productivity PLC Robotic Cell – Video
EasyPLC Simulator Robotic Cell Click PLC – Video
Palletizing Conveyor Programming Do-More PLC – Video
Palletizing Conveyor Programming – Click PLC – Video
Product Quality Verification! Do-More PLC Sequencer – Video
Revolutionize Learning PLCs with Pallet 3D Sim! – Video
Robot Packing PLC Program Development – Video
Box Dumper Easily Learn PLC Programming – Video
Innovative Solution for Mixing Ink and Bottling – Video
Benchwork 1 Do-More Practice PLC Programming – Video
LS Electric XGB PLC Easy Transfer Program – Video
Do-More PLC Automatic Robot Packing Machine – Video
Latest Machine Simulator Modbus Server Driver – Video
Machine Simulator Modbus Server to C-More HMI – Video
Creating the Ultimate Automation Training Setup
– Part 1 – Video
– Part 2 – Video
What is a Machine Simulator (EasyPLC)?
Machine Simulator by Nirtec is sophisticated yet uncomplicated software that is part of the price-competitive Machine Simulator Suite (EasyPLC). It can create virtual simulations of industrial machinery and processes, enabling engineers and automation professionals to visualize and test their systems in a virtual environment before implementing them in the real world.
The latest Modbus Server driver lets you place the Machine Simulator Scene on your network. Multiple devices, such as PLCs and HMIs, can access and control this system. This contrasts traditional machine simulators, which can only act as a Modbus client communicating with just one device. Machine Simulator by Nirtec gives you the option.
Machine Simulator Modbus Server (Automation Training Machine)
We will use a prebuilt scene in the machine simulator (MS). Start the Machine simulator and select the “Machines” icon on the top menu.
You can also select the “Open Machine – Start Simulation” on the main page.
All of the prebuilt machines will now be displayed. They have been programmed, so you can immediately start learning with this package. We will use the “0 1st Test Conveyor Example.” Selections will be displayed as you move your mouse over the machine icon. Select the exclamation point in the upper right corner.
This will display the machine description of what you need to program.
The object is to move the pallet on the roller conveyor first to the right (PLC Digital Output 0) until the photocell on the right side activates the digital input 0 to the PLC. Then, the rotation of the conveyor rollers is activated so the box moves to the left (PLC Digital Output 1) until the photocell on the left side is activated (PLC Digital Input 1). Then, reverse the rotation of the rollers, repeating the process.
Select “Close.” The “Demo” mode will demonstrate how the machine functions. Select “Start.”
The machine simulator will now load the conveyor example.
In the bottom left corner, you will see that we have “No PLC Connecti.”.
Select “I/O Drivers” on the top menu.
Under the “Driver Name,” you will see that EasyPLC is selected by default. Select “EasyPLC” to call up all of the Machine Simulator drivers. Select “ModbusServerDriver”.
The Modbus server driver uses TCP/IP protocol on Ethernet to communicate with other Modbus devices and software.
Select the “Configure” button.
We can now assign the machine Simulator digital inputs and outputs to the two different Modbus memory areas. In our case, the PLC’s coil outputs will be MS’s digital inputs. The PLC digital inputs will be MS’s digital outputs. Although our machine does not use any analog inputs, we can still set this up. Modbus PLC holding registers will be used for the Analog inputs, and the PLC analog input registers will be MS’s analog outputs.
The machine simulator uses analog scaling and subtraction factors to represent negative numbers since Modbus analog is a 16-bit word. Select OK.
Our PLC inputs and outputs are now displayed. We can now assign the inputs and outputs to our Machine Simulator I/O. This can be done by clicking and dragging the PLC input to the Machine Simulator input and the PLC output to the Machine Simulator output. However, you can select “Automatic Assignment” from the driver menu.
This will automatically assign the inputs and outputs in the order they appear, saving you time. Select automatic assignment.
Under the exit menu, select “Start Driver and Exit”.
Our test conveyor example is now ready for communication. The green “Driver Connected” indication on the bottom left of the screen indicates this.
Select “View IO” to show the MS’s input and output status. Since this is a Modbus server setup, we can use multiple Modbus clients to connect to our Machine Simulator.
IP Address of Machine Simulator
The IP address of our MS Conveyor Example will be the IP of the local computer running the software.
If you are unsure, start a command prompt on your Windows computer. Type the command “ipconfig /all” and press enter.
You will now see the IP address listed. We need this information to configure the Modbus client device, which, in our case,e is the Click PLC.
The realistic simulation environment is now on the network as a Modbus TCP (Ethernet) Server. We can now test or create control programs for our selected simulation scene. Integration with multiple Programmable Logic Controllers (PLCs), including the Click PLC, is easy, as the PLC now acts as the Modbus client. This cost-effective training tool reduces the costs and risks of working on physical machines.
What is Click PLC?
Click PLC is a compact and affordable controller designed by Koyo Electronics and sold through its subsidiary, AutomationDirect. It is ideal for small—to medium-sized automation projects. Its intuitive design, rich features such as high-speed counting, and variety of I/O options make it a favorite among many engineers. However, the need for integrated simulation tools becomes apparent as projects become increasingly complex.
Integrating Click PLC with a machine simulator creates a robust testing environment. Engineers can simulate process flows, monitor system behaviors, and troubleshoot potential issues in a virtual setting before deploying actual systems. This can significantly reduce the time and cost associated with on-site troubleshooting.
Setting up the Click PLC Configuration and Communication Ports
We can install and start this package on our computer using the free Click PLC programming software. The entire Click PLC Series can be found here.
Once the click programming software starts, you will see the startup window.
Select “Start a new project”.
The “Select a CPU module” window will now be displayed. Scroll down and select the PLC CPU that we will be programming.
Select C2-03CPU for our Click PLC that we will program and select OK.
The “User Account Setup” window will appear. Select “Disable Password Requirement” and then press OK.
We can select system configuration on the home tab under CPU or on the function tab of the navigation window under CPU configuration. The system configuration allows us to specify the input and output PLC cards we have or will install.
When the system configuration window is displayed, it shows a picture of the CPU and the current system IO. The software will determine the power available and required for configuring the Click PLC as part of the configuration. This is located under PwrBudget. Under the power supply (P/S) select the C0-01AC unit. This will provide 1300 mA of power, which is more than enough for anything we can install on the PLC. Select OK. Under Slot0, select the Select button. We will add the C0-08DR-4VC card for the slot on the CPU. Select “Module Configuration”. The Click PLC has automatic scaling for the Analog input and output points. Enter the data register DF1 to automatically set these registers. Select OK. Selecting OK again will bring us back to the system configuration window, where we can now see our Click PLC and the addresses assigned.
At the top of the window, we can name this PLC. Enter a name and select OK. The name will appear on the network, indicating which PLC we want to communicate with using the Click Programming Software.
We can now examine the communication port settings on our Click PLC.
While still in the function tab of the navigation window, we can select “Com Port 1 Setup.” The Com Port Setup Details window will be displayed. Under the port setting, we can choose all the different ports available on this PLC model. Port 1 is our Ethernet port settings. This port’s wiring and system addresses can be seen on the middle and right side of the window.
We will set a static IP address for Port 1 and ensure its location on our network. We will also set the DNS server addresses for the Ethernet port. Select OK.
Under the CPU selection on the home tab, we can select the Modbus TCP Setup… This will show us the Modbus Client and Server enables and default selections. We will leave everything as their default and select OK.
Let’s also set up the Wireless port setting on our Click PLC. Under the CPU on the home tab, select Wireless Port Setup…
Once again, our Com Port Setup Details window will display. We can enable the wireless LAN and assign a static IP address and DNS server locations to the port. The SSID and password for the existing wireless network must be entered. Select OK.
We will now save our program with a unique name. We are now ready to begin programming our communication to the Machine Simulator.
Click PLC Modbus TCP Client Subroutine
A separate subroutine will handle the Modbus TCP client communication to the machine simulator Conveyor Example.
To start a new subroutine, right-click on the Subroutine Program under the program tab of the navigation window. Then select Add New Subroutine Program (Ctrl + U). We can now enter the name of this new subroutine. Select OK.
Our new subroutine appears under the Subroutine Program heading in the navigation window. A subroutine quick guide is displayed. Select OK.
Our communication subroutine will have a send-and-receive instruction on the leading and trailing edges of the 100-millisecond contact bit.
The send command will be Modbus out of Port 1. Enter the Server (slave) IP address that we obtained previously. We will leave the server port number as the default 502 and use the slave ID 1. The Modbus function code will be 15 to write multiple coils. Our addressing will use Modbus 984, and the starting slave address will be 1. C1 will be the starting master address, and we will send 3 bits of information. The status flags will be set for internal bits to use later in our program. Select OK.
The receive command will be Modbus out of Port 1. Enter the Server (slave) IP address that we obtained previously. We will leave the server port number as the default 502 and use the slave ID 1. The Modbus function code will be 02 to read the input status. Our addressing will use Modbus 984, and the starting slave address will be 100001. C101 will be the starting master address, and we will read 3 bits of information. The status flags will be set for internal bits to use later in our program. Select OK.
Insert a rung at the beginning of the subroutine. When the first can bit (SC2) is turned on, we will set an internal bit (C1899) to indicate that a communication reset is required. This will also turn off our internal communication bit (C1900). Rung 2 will have the negative communication bit and not the sending bits for both send and receive instructions. This will also have the leading edge of the 100-millisecond clock bit flag in series to reset the communication reset bit and set the communication bit.
Using the address picker under the program tab of the navigation window, we can document all of the internal bits we are using in the program.
Rung 5 will add a communication timeout circuit. If the received success bit is not turned on in 1 second, a timer expires, and an output (Y1) will be turned on. This will indicate that communications have been lost. Rung 6 will set the output after the timer expires. Rung 7 will reset the output on the receiving success bit’s leading edge.
Use the address picker to document the timers and output.
Rung 8 will have the return. This marks the end of the program for the subroutine.
Returning to the Main Program on the navigation window, we can use the first rung to call up the communication subroutine.
Save the program.
On the home tab, select the Connect button. In the Connect to Click PLC window, select our PLC, and choose Connect. Select “Don’t read the project from the PLC” and select OK. On the home tab, select Write Project. This will compile the program in the Click Programming software and then transfer it to the PLC.
Once the Click PLC program is transferred, we can put the CPU in run mode. Our communication is now working. From the navigation window, call up the data view window. Enter the inputs and outputs for the machine simulator conveyor example.
Returning to the machine simulator, we can change the outputs in the data view window and watch the conveyor function. We can now create the logic for the conveyor.
Click PLC Control Logic for Conveyor Example
We will write this ladder logic program to control the conveyor example using the five steps for developing a PLC program. Since this is a simple circuit, we have the two inputs and outputs from the machine simulator. The Modbus TCP communication put the outputs in C1 and C2. The inputs are C101 and C102. Using the description from the conveyor example in the machine simulator, we know the sequence of operation. The last steps are writing and testing the logic.
Under the call to the subroutine, we will insert a couple of rungs on the main program.
When neither output is on, we will set C1 and reset C2, moving the box to the right. The next rung will have C1 on, and when the right sensor turns on, we will reset C1 and set C2, sending the box to the left. Returning to the previous rung, when C2 is on, and sensor C102 comes on, we will also set C1 and reset C2.
Using the address picker, we can document the inputs and outputs.
Save and transfer the program.
Testing and Operation of the System
We can now call up the data view window like before and watch our program in action for the conveyor example.
Machine Simuator allows us to conduct extensive testing of the system. We can evaluate the performance of our PLC in the simulated environment, identify any discrepancies, and rewrite the logic as needed to refine both the PLC program and the simulation model.
Unlocking the integration between Click PLC and machine simulators presents many benefits for automation professionals. Integration enhances testing environments, improves design validation, provides real-time monitoring, and facilitates training, enabling engineers to create safer, more efficient systems.
Overall, Nirtec’s Machine Simulator is an invaluable tool for optimizing automation processes, enhancing training, and ensuring system reliability through effective design validation and testing.
To learn more about the Machine Simulator and how to create the ultimate automation learning package, click here. Click here to see the entire Machine Simulator Series.
Download the Click PLC sample program here.
Watch the video below to see how the Click PLC controls the Conveyor Example.
When using the Machine Simulator Software Suite, debugging is quickly done without damaging equipment. You may modify your logic several times before you get everything right! This is all part of automation learning. To learn more about developing logic, check out our tutorials on the five steps to PLC program development.
Watch on YouTube: Unlocking Click PLC & Machine Simulator Integration
Machine Simulator (EasyPLC) Software Suite is a complete PLC, HMI, and Machine Simulator Software package. 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 install or less than USD 110 to allow different 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 need further information, please 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 inform other people 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.