Technical Article

Common Sequencer Functions: SQO, SQI/SQL, SQC

October 05, 2020 by Anish Devasia

Sequencer functions are used to perform a specific output pattern that needs continuous repeating. When there are more than three steps in a process, it is generally better to use a sequencer function rather than simple routines.

Sequencer functions help to create a concise ladder program by enabling a smaller number of instructions to perform complex tasks. Some manufacturers call sequencer functions “drum controllers.” This article explains the use of sequencer functions in Allen-Bradley SLC500 series PLCs.

The parameters used for sequencer functions are:

  • File: Represents the memory address of the sequencer file. We must create a file with Boolean bits representing the various steps in the sequential output.
  • Mask: Represents the address that gives the sequence instructions. 
  • Dest: This is the address of the output file that receives data transferred from the sequencer file.
  • Control: This shows the address of the control element that stores the status byte, length, and position of the file.
  • Length: Indicates the number of steps in a sequence. 
  • Position: Represents which exact step is executed at any given time.

 

        

Figure 1. SQO representation in ladder diagram

 

SQO (Sequencer output) function

SQO controls various output devices with a file that encodes the steps and sequences. Figure 2 shows a PLC ladder diagram for a simple implementation of SQO. The steps to repeat can be given as an input file to #B3, encoding the steps represented in bits. I:0 is a normally open (N.O) switch. When it first energizes, the first step executes. When it energizes for a second time, the second step executes.

 

Figure 2. PLC Ladder Logic Diagram for SQO

 

Let’s consider four light bulbs which will energize in a specific order:

  • Step 1: L1 and L2 turn on.
  • Step 2: L3 and L4 turn on.
  • Step 3: L1 and L3 turn on.
  • Step 4: L2 and L4 turn on.

These steps can be encoded in bits in B3, as shown below. Mask 00F(h) represents which bits represent the information. B3:0 represents the starting position of the setup. B3:1 represents the first step, and so on. Bit 0 is for the status of L1, Bit 1 for L2, Bit 2 for L3, and Bit 4 for L4. The high value of the bit (1) indicates a bright light, and the low value (0) indicates the light is off. We have mapped the required Boolean values in each step to the sequencer file.

 

Bit 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
B3:0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
B3:1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  1
B3:2  0  0  0  0  0  0  0  0  0  0  0  0  1  1  0  0
B3:3  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  1
B3:4  0  0  0  0  0  0  0  0  0  0  0  0  1  0  1  0

 

In this setup in the starting position, B3:0 executes. When I:0 energizes, B3:1 state executes, and so on. The same sequence of steps is repeated over and over without the need for writing looping functions. The ladder logic is clean and straightforward. The advantages become more pronounced when the number of steps is large. Using timers, the SQO can operate with fixed or variable time delays. To increase the number of outputs beyond the memory limit of a single SQO, they can connect in parallel. 

 

Sequencer Load (SQL) or Sequencer Input (SQI) function

Sequencer load functions collect the input data from the input modules and store the memory data. Some manufacturers call the same function sequencer input function. As with SQO, Implementation of sequencer load functions happens in multiple ways, based on user requirements. Let us consider a situation where we must record the signal at the input module in every operational minute. The set-up for the requirement will look like the image below.

 

Figure 3. PLC ladder logic diagram for a SQL/SQI application

 

The input module to be read is I:1 at an interval of one minute (60 seconds). Timer T4 energizes the SQL at intervals of one minute, and the input I:1 records at #B3:0 of SQL. If I:1 is closed, it is represented as 1 at #B3:0. When I:1 is open, it is represented as 0. The state of I:1 records every minute in a sequence. #B3 is a three-bit data file and can store 256 data points. The capacity of the setup increases by cascading two or more sequencers. 

 

Sequencer Compare (SQC) function

As the name indicates, SQC compares an input to the provided data. The memory file stores the data to be compared and SQC connects to the input. If the input signal is equal to the word stored in the data file #B3, SQC determines that they are the same and energizes the “Bit found” coil. Figure 4 shows a ladder diagram for a simple SQC application.

 

Figure 4. PLC ladder logic diagram for a sequencer compare application

 

In the diagram I:1 is the input to be analyzed and fed to SQC with R6:0 control. SQC compares it with the data stored in the file, #B3:0. If the input signal and the data stored in the SQC are the same, it energizes the FD coil. 

SQC is commonly used to check if some machine or its part is functioning according to the specification. The output of the machine is fed as the input to SQC. The expected specification saves in file #B3:0. SQC is be able to determine if the specifications are met.

SQO, SQL, and SQC are used to manipulate input and output modules of a PLC. Sequencers aren’t necessary to logically design functions. However, having these sequencer functions makes designing a ladder logic simpler and reduces the chances of error.