You are on page 1of 5

Menu

1 of 1

http://plcguide.mrplc.com/menu.shtml

Menu
Command Index
Basic Instructions
Timer & Counter
Compare
Data
Math
Register and Sequencer
Program Control
Communication
Programming References
Example Programs
PLC GuestBook
Links
Down Loads

Send Comments

2001-2006
All Rights Reserved
Your IP Address is: 117.222.1.67

02-07-2013 16:06

PLC Programming Command Guide Reference Web Site

1 of 4

http://plcguide.mrplc.com/regsequ/sql.html

Sequencer Load (SQL)


[Command Table] [Main Course Page] [Group Index]

The SQL instruction is used to store 16-bit data into a sequencer


load file throughout each step of the sequencer operation. The data
can come from Input, Output or a storage word address, a file
address, or a constant.

The symbol for the sequencer load command is illustrated above. The SQL command
is placed on
the right side of the rung as an output. When the rung transfers from false-to-true the enable bit (EN) of
the SQL commamd is set. The position of the sequencer file is then incremented to the next position by
the control file. The contents of the source file is then loaded into this file. This is continued for each scan
that hte rung remains true. The enable bit is reset when the rung changes to false.
With each false-to-true transtion the instruction loads data into a new file. When the final step is
completed the done bit (DN) is set. On the next false-to-true transition of rung the operation returns to
step one. When the source file address is set as #N7:40 and #N7:30 or similar the length is % and would
track through the steps together per the position value.

Instruction Parameters
Several parameters must be set when programming this instruction. A definition and explanation is of
each is given below.

FILE
The file is the address of the sequencer file. The file indicator(#) for the address must be used.

SOURCE
The source can be specified by either using a file address, word address, or a constant. When a file
address is used the file length equals the length of the sequencer load file. These files will step
automatically, per the positon value.

02-07-2013 16:06

PLC Programming Command Guide Reference Web Site

2 of 4

http://plcguide.mrplc.com/regsequ/sql.html

CONTROL
The control parameter is a file address. The status bits, length value, and position value are stored in
this element. The control file address can not be used for any other instruction.

Error Bit ER(11)


This bit is set when the processor detects a negative position value, or a negative or zero
length value. (When SLC processors are used this results in a major error if not cleared
before the END or TND instruction is executed. When using the Micrologix 1000 controllers
when the ER bit is set the mirror error bit (S5:2) is also set. Both of the bits must be cleared.)

Done Bit DN(bit 13)


The done bit is set by SQL instruction after it has operated on the last word in the sequencer
load file. It is reset on the next false-to-true rung transition after the rung goes false.

Enable EN(bit 15)


The enable bit is set by a false-to-true rung transition and indicates the SQL instruction is
enabled.

LENGTH
The length is the number of steps of the sequencer load file starting at position 1. The maximum
number of words is 255 ( in MicroLogix 1000 controllers the max. is 104 words). The zero position
is the startup position. At the end of each cycle the instruction resets to position 1. Step zero is the
position address assigned to the sequencer file. For each file referenced by the instruction uses
length plus on word. This applies only if the source is addressed as a file.(A run time major error
will occur if the length value points past the end of the programmed file.)

POSITION
The position is the word location or step the sequencer file from/to which the instruction moves
data. (A run time major error occurs if the postion value points past the end of the programmed
file.)

Programming Problem

02-07-2013 16:06

PLC Programming Command Guide Reference Web Site

3 of 4

http://plcguide.mrplc.com/regsequ/sql.html

The example of a palletized conveyor system is used below to demostrate how the sequencer command is
used. When the proximity sensor (I:1/15) is enabled by the pallet, the magnet code of the pallet is loaded
into the sequencer file. This allows an inventory of the pallets to be set up.

The IIM command places the input word into the I:1.0 file when the sensor is enabled. The sequencer load
command then loads the word from I:1.0 into the sequencer file.

The diagram above shows the input word that is to set to the sequencer file.

The diagram shows words containing the pallet codes that have been loaded into the sequencer file.

02-07-2013 16:06

PLC Programming Command Guide Reference Web Site

4 of 4

http://plcguide.mrplc.com/regsequ/sql.html

[Back] [Next Command]

02-07-2013 16:06

You might also like