Tag Archives: plc ladder logic basics

Click PLC Modbus ASCII Protocol

Modbus is a communication method used for transmitting information over serial lines between electronic devices. The device requesting the information is called the Modbus Master (Client) and the devices supplying information are Modbus Slaves (Servers). This protocol was originally developed by Modicon systems.
Modbus protocol comes in basically three different types. Ethernet (Modbus TCP) or Serial (Modbus RTU or Modbus ASCII). Modbus TCP and Modbus RTU come as standard protocols in the productivity series of PLCs.

We will connect the Click PLC to a Solo process temperature controller. This will be done using the Modbus ASCII protocol over serial RS485 communication wire. (Media) The present and set values (PV / SV) will be read from the Solo controller and the set value will be written when required. Let’s get started. Keep on Reading!

Click PLC to Modbus TCP RTU Remote IO Controller BX-MBIO

The Click PLC can communicate to a remote I/O (input and output) controller modules using the Modbus protocol for communications. The BX-MBIO provides both Modbus RTU and Modbus TCP interfaces. Modbus RTU is a serial communication and Modbus TCP is an Ethernet communication. Modbus RTU is supported over an RS-485 serial connection. Modbus TCP is supported over an Ethernet connection. They function as listening/replying devices (slave, server) and can connect with any mastering (master, client) device that communicates using the Modbus protocol.
Previously we looked at the BX-MBIO Modbus RTU TCP Remote IO Controller wiring and configuration.
Modbus RTU TCP Remote IO Controller BX-MBIO
BX-MBIO Hardware Video
BX-MBIO Powering and Configuring Video

We will connect the Click Ethernet PLC to the Modbus remote IO. This will be done using the Modbus TCP and Modbus RTU protocol. Ethernet and serial RS485 communication to the BX-MBIO unit will be the media.
The BX-MBIO remote I/O expansion units feature the following:
• RJ45 Ethernet port for communications via Modbus TCP
• RS485 serial port for communications via Modbus RTU
• Supports up to 8 additional Expansion Modules (Add the discrete or analog I/O you require)
• AC and DC powered units available
• AC powered units include an integral 24VDC auxiliary output power supply
• Power connector and serial port connector included
Let’s get started. Keep on Reading!

Click PLC Logging Data with Time and Date Stamp

The Click PLC can perform indirect addressing. This means that I can ask for information to be moved to and from locations in the PLC using a pointer that will indicate the address.

Stephen Covey in The 7 Habits of Highly Effective People said: “Begin With the End in Mind.” This is especially true when looking at storing or logging data within the programmable logic controller. (PLC) It is important to fully define what you want to accomplish with your program.

In our Click PLC example, we want to take a series of consecutive memory locations (DS1 to DS10) and store them in memory areas DS100 to DS4100 each minute. We will be able to store 400 entries (400 minutes) in our storage area. Every entry will include the real-time clock (RTC) of the Click. This will show the date and time of each entry. Let’s get started! Keep on Reading!

Click PLC PID using Factory IO

A PID (Proportional, Integral, and Derivative) control is possible with the Click PLC. A sample program was written for this PLC by Bernie Carlton in the following thread from the Automation Direct Forum. This was based on the math/process presented by Tim Wescott on is paper titled PID without a Ph.D. We will be using this sample program along with a Factory IO scene to demonstrate PID control using our Click PLC.

Here are some references on PID control:
PID without a Ph.D. By Tim Wescott
Understanding PID in 4 minutes
PID Control – A brief introduction
PID Controllers Explained
Who Else Wants to Learn about On-Off and PID Control?
Our Factory IO scene will be controlling the level of water in a tank. PID will be used to maintain the level based on a dial pot knob on the control panel. We will also discuss the math that the PID loop uses. Let’s get started! Keep on Reading!

Click PLC Analog Dusk to Dawn Program

A dusk to dawn sensor usually is discrete on/off of the lighting control. If we want to vary the lights to mimic more of the sunset and rise, we would use an analog output to control the lights. I was recently asked about such a program. Every day they wanted the lights to go off at 10 pm and come back on at 6 am. At 9:30 pm the lights would be on at 70% or 7volts of a 0-10V signal. In the next half hour, the program will bring the lights from 70% down to 0%. In the morning the lights will come back on within the half-hour from 0% to 70%. Poultry Farms are one place that would utilize this program.

We will be developing a program that will do this with our Click PLC. Let’s get started! Keep on Reading!

Click PLC High Speed Counting – Part 2

The Ethernet Click PLC high speed counter has seven different modes of operation. In Part 1 we discussed the High Speed Count Mode, Interval Measurement Mode,
Duration Measurement Mode and Frequency Measurement Mode.

This 100 KHz counter can accept Up, Down, Up/Down, Pulse/Direction or Quadrature (with Z) inputs.
We will be looking at the last three different high speed counter modes available in the click. (External Interrupt, Pulse Catch, Filter) This is all setup through a user friendly graphical user interface. We will also combine the Frequency Measurement and the High Speed Count in one application. Let’s get started! Keep on Reading!

Click PLC High Speed Counting – Part 1

The Click PLC family has been updated, and now has the ability to use high speed counting. This is available on all of the Ethernet units that have DC inputs. The faster processor on the Ethernet unit (3 to 10 times faster than the basic unit) allows this capability. There are seven (7) different modes of operation for the high speed counter available so adaption to your automation solution is easy. The input can count Up, Down, Up/Down, Pulse/Direction or Quadrature (with Z). Maximum speed on the high speed counter inputs are 100 kHz. That is 100,000 pulses per second.

We will be looking at the different high speed counter modes available in the click. This is all setup through a user friendly graphical user interface. Let’s get started! Keep on Reading!

Click PLC HMI Rotary Encoder Dial Input

Rotary encoders are modern digital devices that have taken over from the potentiometer in stereos and many other applications. This is because of their fine digital control and they can fully rotate without end stops. We can connect the rotary encoder into the PLC using just two digital inputs. This human machine interface (HMI) has the advantage over touch screens and other methods of control into the PLC. The operator can control the rate and set point with the dial (rotary encoder) without looking at the control. This will allow the operator to concentration on other tasks.

We will be connecting a rotary encoder with dial into the Click PLC. The signals being sent from the rotary encoder will be explained. Different methods of programming this input in our PLC will be discussed. Let’s get started. Keep on Reading!

Click PLC Update Firmware

Firmware is usually PLC operating system code that is written into a read only memory. The BIOS (Basic Input Output System) of a PC (personal computer) is a good example of firmware. It provides the low level interface between the hardware and software. The Click PLC firmware comes with the programming software.

We will be updating our firmware of our Click PLC from 2.10 to 2.30. Let’s get started! Keep on Reading!

Click PLC Send and Receive Instructions

Receive and Send instructions will allow you to send and receive serial data to an external device. The communication method that you setup can be ASCII or Modbus. ASCII (American Standard Communication for Information Interchange) can be used to send to devices such as a printer. Receiving ASCII can be used for connecting barcode scanners to the PLC. The barcode will be read as an ASCII string in the PLC. Modbus serial communication (Modbus RTU) is a standard protocol used in many automation devices. We will demonstrate the Send and Receive instruction by communicating Modbus to a Solo Temperature Controller. Our example will read the current process (PV) value and write the set point value (SV) in the controller.  Keep on Reading!