Home > electrical-training-simulator > PLC programming lessons > lesson 5

PLC Programming Lesson 5: Stationary Carwash Sequencer

Use SQO sequencers, timing data, and a 3D carwash environment to control a complete wash cycle

Lesson objective: Create a stationary carwash application using a pair of SQO output sequencers. One sequencer controls the wash-cycle output states and the second provides timing values for each sequencer step. An N7:8 output buffer separates sequencer data from the physical outputs.

Before you begin: Access to the PLCLogix 500 or PLCLogix 5000 training simulator is required to complete the hands-on lesson series. Complete Lessons 1-4 first if you are new to PLCLogix. The screenshots and addressing in this lesson use PLCLogix 500. Focus: SQO sequencers, TON timing, integer-file data, output buffering, physical I/O mapping, and 3D I/O World testing.

I/O and Application Requirements

 

Lesson 5: In this lesson we will create a stationary carwash application. We will begin by listing the physical I/O addressing scheme and defining the file memory used by the application. The example uses a pair of SQO output sequencers to provide output control and timing for the wash cycle.

 

Instruction Help is available if you need assistance with the SQO sequencer. The application uses an output buffer between the sequencer values and the physical I/O. This allows a virtual control relay to isolate the physical outputs when it is de-energized. In general, it is a good habit not to drive physical output addresses directly when a simple memory buffer can be used.

Physical I/O
AddressDeviceDescription
I:1/0N.C. push buttonStop PB
I:1/1N.O. push buttonStart PB
I:1/3Proximity sensorOne-shot
O:2/0Green bulbEnter Indicator
O:2/1Red bulbIn Use Indicator
O:2/2Pump motorWash Pump Motor
O:2/3Pump motorRinse Pump Motor
O:2/4Air blower motorAir Blower
O:2/5Green bulbIn Position Indicator
O:2/6Green bulbExit Indicator
O:2/7SolenoidHot Wax Dispenser

 

Data File Memory
Address RangeFilePurpose
N7:0-N7:6N7 Integer FileWash Cycle Pattern
N7:8N7 Integer FileOutput Buffer
N7:10-N7:16N7 Integer FileWash Cycle Timing

 

Example Requirements:

  1. Use a standard start/stop station with a seal-in and virtual control relay to cut continuity on rungs that address physical I/O.
  2. Use one TON timer to time each stage of the wash cycle.
  3. Use these wash-cycle durations: Wash 25 seconds, Rinse 15 seconds, Hot Wax 10 seconds, and Air Dry 18 seconds.
  4. Use Enter, In Position, In Use, and Exit indicators to direct customers at the appropriate times during the process.
  5. Do not post sequencer values directly to the physical outputs. Use N7:8 as an output buffer between the sequencer and the physical I/O.

Define the Wash Cycle Steps

 

Before programming, define how many steps are required, what output conditions are needed for each step, and what happens after the Start PB is pressed.

  1. Step 1: Turn on the Enter indicator and wait for the car to reach the proximity sensor.
  2. Step 2: When the proximity sensor detects the car, turn off the Enter indicator. Turn on the In Position indicator and the wash pump. Run the wash pump for 25 seconds.
  3. Step 3: Shut down the wash pump and start the rinse pump. Run the rinse pump for 15 seconds.
  4. Step 4: Shut off the rinse pump and apply Hot Wax for 10 seconds.
  5. Step 5: Shut down the Hot Wax applicator, turn off the In Position indicator, start the Air Blower, and turn on the Exit indicator. Maintain this state for 18 seconds while the car clears the carwash exit.
  6. Step 6: Clear the wash-cycle outputs, turning everything off.

Sequencer coordination: One SQO controls the wash-cycle output states and a second SQO supplies the timing information for each wash-cycle step. Both sequencers use the same R6:0 control structure so their pointers advance together. The first step occurs when Start PB is pressed. The timed portion begins when the car is in position.

 

The output-condition values are stored from N7:1 through N7:6. A “1” in an output location means the field device connected to that output is turned on for that step.

The wash-cycle sequencer table feeds the N7:8 output buffer, which then drives the physical O:2 outputs.

The cycle-step timing values are stored as decimal values at N7:11 through N7:16. Steps 1 and 6 use a value of zero because those steps are not time-dependent.

The timing sequencer uses values stored at N7:11-N7:16; the first and last steps are zero because they are not timed.

Load or create the example file and set up the 2D interface switches according to the I/O table above. Before entering the N7 data, examine how the ladder application is organized.

The Example Program

 

Rung 0: A standard stop/start seal-in rung energizes a virtual seal-in contact used for the lock-up function and enables the timing rung. Once the car is in position, the timer can begin.

 

Rung 1: Latch and unlatch the Car Flag bit. The bit is latched when the car reaches the proximity sensor and is reset when the wash cycle ends using the sequencer control structure Done (DN) bit.

 

Rung 2: A TON timer times the cycle steps. Each step's time value is loaded into the timer preset T4:2/PRE. Steps 1 and 6 use zero because they are not time-dependent.

 

Rung 3: Contains the two SQO sequencers. Their pointer is advanced as follows:

  1. Pressing Start PB advances the pointer one position. The N.C. contact that opens when the seal-in is locked prevents the Start PB from advancing the pointer again during the cycle.
  2. The proximity sensor advances the pointer one additional position.
  3. The timer Done bit advances the pointer for the remainder of the wash cycle.
The example ladder program contains the seal-in, Car Flag logic, cycle timer, paired SQO sequencers, and output-buffer logic.

Rung 4: The MOV instruction transfers the sequencer data to the virtual output buffer at N7:8. The MOV executes while the virtual control relay remains energized. When the seal-in is broken, the physical outputs are cleared.

Enter the Sequencer Output and Timing Data

 

Open the Integer file under Data Files in the Project Tree. With the radix set to Binary, enter the output-table values by setting the required bits to “1”.

 

Although N7:0 is used in the sequencer File field, the actual wash-cycle step data begins at N7:1 and continues through N7:6.

Enter the wash-cycle output patterns in Binary radix at N7:1-N7:6.

Next, enter the step-timing values at N7:11 through N7:16. Set the radix to Decimal, click the required memory locations, and enter the timing values shown in the source lesson/program.

Enter the timing values at N7:11-N7:16 using Decimal radix.

After the output and timing data are entered, save the program before testing.

Test the Program with the 2D Interface

 

  1. Step 1: Go Online and press Start_PB. The Enter indicator should turn on.
  2. Step 2: Press the I:1/3 momentary contact to simulate the proximity sensor detecting the car's arrival. The Enter indicator should turn off and the In Use and In Position indicators should turn on. The wash cycle and timer should then proceed according to the programmed sequence.
  3. Step 3: Observe the remaining cycle steps and the O:2 output indicators. Confirm that the programmed outputs and timing behave as intended.

3D Stationary Carwash I/O World

 

In addition to the 2D Interface, PLCLogix provides 3D environments that can be used with ladder-logic applications. For this lesson, select I/O Worlds > Stationary Carwash.

Select Stationary Carwash from the I/O Worlds menu.

The Stationary Carwash environment opens with a control panel, a functioning carwash, and a vehicle to wash.

The 3D Stationary Carwash provides the vehicle, wash equipment, control panel, and simulated field devices.

Click I/O Map to view the environment's input and output mapping. The 3D carwash uses the same I/O assignments used by the lesson program. For example, the wash pump is controlled by output O:2/2.

The Stationary Carwash I/O Map shows the addresses used by the 3D field devices.

Go Online and press Start PB to begin the process. When the car reaches the second beam inside the wash, the proximity sensor is triggered and the wash cycle starts. The timer advances the programmed steps until the car exits. At the end of the cycle, the outputs turn off. Press Start PB again to wash another car.

Run the Stationary Carwash online and confirm that the complete programmed sequence operates the simulated wash correctly.
Self-assessment: There is no separate online test for this lesson. Your completed PLC program and correct simulated carwash operation are the assessment. Verify the output patterns, cycle timing, indicators, output buffer, proximity-sensor transition, and complete 3D carwash sequence.
Assigned by an instructor or supervisor? Save your finished PLC program and share it with them when you complete the lesson.

Need access to the required simulator? PLCLogix 500 Simulator   |   PLCLogix 5000 Simulator