This article will discuss an Omron PLC sample code related to Liquid Temperature Control System in a tank using CX-Programmer. The PLC system aims to maintain the liquid temperature within the range of 30-40 degrees Celsius. In this system, the liquid can only be manually added to or removed from the tank using a valve. The system can provide a warning alarm if the temperature exceeds the maximum limit or falls below the minimum limit.
Program Objective

This system has an Input Valve and an Output Valve to control the liquid in the tank. The heater is used to heat the liquid, and the exhaust fan is used to reduce the liquid temperature.
Input Valve and Output Valve can be operated manually using buttons
Manual Mode:
In Manual mode, the Heater and Exhaust Fan can only be operated using buttons.
Auto Mode:
- In Auto Mode, the Selector Switch must be changed to Auto Mode.
- Next, the Heater or Exhaust Fan will automatically turn ON to adjust the fluid temperature.
- When the fluid temperature is above 40 degrees, the exhaust fan will turn ON to reduce the temperature.
- When the liquid temperature is below 30 degrees, the heater will turn ON to increase the liquid temperature.
When the liquid temperature is above 50 degrees or below 25 degrees, the alarm will turn ON, this indicates that the liquid temperature is not within normal limits.
Omron PLC Sample Code

IO Mapping
| S.No. | Comment | Input (I) | Output (Q) | Memory Bit | Memory Word |
|---|---|---|---|---|---|
| 1 | PB_START | 0.00 | |||
| 2 | PB_STOP | 0.01 | |||
| 3 | AUTO/MANUAL | 0.02 | |||
| 4 | HEATER_BUTTON | 0.03 | |||
| 5 | EXHAUST_FAN_BUTTON | 0.04 | |||
| 6 | PB_VALVE_IN | 0.05 | |||
| 7 | PB_VALVE_OUT | 0.06 | |||
| 8 | VALVE_INPUT | 100.00 | |||
| 9 | VALVE_OUTPUT | 100.01 | |||
| 10 | HEATER | 100.02 | |||
| 11 | EXHAUST_FAN | 100.03 | |||
| 12 | ALARM_OVER_HEAT | 100.04 | |||
| 13 | ALARM_LOW_TEMPERATURE | 100.05 | |||
| 14 | SYSTEM_ON | W0.00 | |||
| 15 | HEATER_MANUAL | W0.01 | |||
| 16 | EXHAUST_FAN_MANUAL | W0.02 | |||
| 17 | EXHAUST_FAN_AUTO | W0.03 | |||
| 18 | HEATER_AUTO | W0.04 | |||
| 19 | PV_TEMPERATURE | D0 |
Liquid Temperature Control System

RUNG 0 (SYSTEM ON)
In this Rung, the memory bit SYSTEM_ON (W0.00) will be in the HIGH state when the PB_START (0.00) button is Pressed. Because it uses the KEEP(011) instruction, the memory bit SYSTEM_ON (W0.00) will remain in the HIGH state even though the PB_START (0.00) button has been Released.
The memory bit SYSTEM_ON (W0.00) will be in the LOW state if the PB_STOP (0.01) button is Pressed.
RUNG 1 (HEATER & EXHAUST FAN MANUAL MODE)
In this Rung, the memory bit HEATER_MANUAL (W0.01) will be in the HIGH state if the NO contact of the memory bit SYSTEM_ON (W0.00) is in the HIGH state and the HEATER_BUTTON (0.03) button is Pressed.
The memory bit EXHAUST_FAN_MANUAL (W0.02) will be in the HIGH state if the NO contact of the memory bit SYSTEM_ON (W0.00) is in the HIGH state and the EXHAUST_FAN_BUTTON (0.04) button is Pressed.
RUNG 2 (VALVE INPUT AND OUTPUT OPEN)
In this Rung, the Output VALVE_INPUT (100.00) will be OPEN if the NO contact of the memory bit SYSTEM_ON (W0.00) is in the HIGH state and the PB_VALVE_IN (0.05) button is Pressed.
The VALVE_OUTPUT (100.01) output will be OPEN if the NO contact of the memory bit SYSTEM_ON (W0.00) is in the HIGH state and the PB_VALVE_OUT (0.06) button is Pressed.

RUNG 3 (EXHAUST FAN AND HEATER AUTO MODE)
In this Rung, the memory bit EXHAUST_FAN_AUTO (W0.03) will be in the HIGH state if the NO contacts of the memory bit SYSTEM_ON (W0.00) and the Selector Switch AUTO/MANUAL (0.02) are in the HIGH state and the value in the memory word PV_TEMPERATURE (D0) is Greater Than 40.
The memory bit HEATER_AUTO (W0.04) will be in the HIGH state if the NO contacts of the memory bit SYSTEM_ON (W0.00) and Selector Switch AUTO/MANUAL (0.02) are in the HIGH state and the value of the memory word PV_TEMPERATURE (D0) is Less Than 30.

RUNG 4 (HEATER AND EXHAUST FAN OUTPUT)
In this Rung, the HEATER (100.02) output will be ON if the NO contacts of the memory bits SYSTEM_ON (W0.00), HEATER_AUTO (W0.04), and HEATER_MANUAL (W0.01) are in the HIGH state.
In this Rung, the output EXHAUST_FAN (100.03) will be ON if the NO contacts of the memory bits SYSTEM_ON (W0.00), EXHAUST_FAN_AUTO (W0.03), and EXHAUST_FAN_MANUAL (W0.02) are in the HIGH state.

RUNG 5 (ALARM)
In this Rung, the output ALARM_OVER_HEAT (100.04) will be ON if the NO contact of the memory bit SYSTEM_ON (W0.00) and Selector Switch AUTO/MANUAL (0.02) are in the HIGH state and the value in the memory word PV_TEMPERATURE (D0) is Greater Than 50.
The ALARM_LOW_TEMPERATURE (100.05) output will be ON if the NO contact of the memory bit SYSTEM_ON (W0.00) and the AUTO/MANUAL (0.02) Selector Switch in the HIGH state, and the value in the memory word PV_TEMPERATURE (D0) is Less Than 25.
Read Next:
- PLC Programming for Storage and Supply Tank System
- Omron PLC Exercise to Sort Products by 10g, 15g, 20g
- Omron PLC Logic for Dual Conveyor Packing System
- Data Comparison Instructions in Omron PLC Example
- Communicate Modbus Poll Software with Mitsubishi PLC