# Sequencer in PLC 5 AB

R

#### Ricardo Juarez

Hello, I need make some sequencer output in my PLC 5 program but I can´t understand very well the instruction for do that. I read several times the help manual in RSLogix 5 about SQO and BSL or BSR instruction and try do that but my sequencer doesn´t work good. My propouse is shift one Output at time using the bit S:23/0,. If someone knows something, I appreciate your help.

T

#### T. Connolly

The AB sequencer is really a fairly simple instruction. Each time the rung transitions from false to true, the sequencer positon R6:0.pos will increment by one. When it does, it will write the value from a file (1 dimensional array) position that corresponds to the value of R6:0.pos to an output word.
Simple example:
N7:0 = 0 (0000000000000000)
N7:1 = 1 (0000000000000001)
N7:2 = 2 (0000000000000010)
N7:3 = 4 (0000000000000100)
N:7:4 = 8 (0000000000001000)

The sequencer file is #N7:0. The sequencer output word is n7:5 and sequencer length is 4. The sequencer starts at zero the first time it is run. When it makes its first true transiton, it move N7:1 to N7:5. The next transition is N7:2 to N7:5. Next is N7:3 to N7:5, and next is N7:4 to N7:5. When it reaches the file length on the next transition, it will wrap back around to position 1 (not positon 0), and move N7:1 to N7:5. You can put whatever you want into the file words and do whatever you want with it. An example might be to map the bits to the outputs of a single output card to set those outputs according to the step of the sequencer. In the above example, suppose your output word is O:5.0, a 16 point output card in slot 5. O:5/0 is a tank fill valve, O:5/1 is a mixer motor, and O:5/2 is a drain valve. Using input logic on the sequencer rung, an operation is started by an operator pushing a button. The sequencer moves from state 0 to 1, the fill valve opens. When a float switch input is true, the sequencer will step again to 2, the new output word will be written to the module, turning of O:5/0, turning on O:5/1, the mixer. After mixing a time, the sequencer can be stepped again, writing the next word to the ouput module. After draining, the whole process will repeat when the sequencer steps and wraps around back to position one. This is only a simple example, you can get as elaborate as your want. You can use bits in the output word, or a compare instrucion on R6:0.pos to determine what step the sequencer is in for various actions. You can make a sequencer that will step every scan by putting an OTU R6:0.EN insturcion on a branch below the SQO instruction. I frequently do that, and then build logic in front of the sequencer that has a compare of the R6:0.pos word against constants for each step of the sequencer to build a machine state controller that can skip to a desired state, or self recover a fault to the correct state.

B

#### Bill Sturm

You can create your own sequencer in the way that you describe. I have seen people use bit shift sequencers and also integer sequencers. Integer
sequencers use an integer word to turn bits on and off according to the integer value. Either way, I recommend latching and unlatching external bits and using those bits to turn on the outputs. This way, you can have interlock and
"safety" bits in series with your output coils.

Bill Sturm