Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 38 of 55

Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 24 - Sequencer Instructions

Pages 323 to 332 of 486, from Hand-Held Terminal (Catalog Number 1747-PT1) User Manual

The original document is the PDF (1.5 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Allen-Bradley 1747-PT1

Page 323

Chapter

A–B

24

Sequencer Instructions This chapter covers sequencer instructions including Sequencer Output, Sequencer Compare, and Sequencer Load. These instructions are generally used in machine control. Instructions for use with fixed, SLC 5/01, and SLC 5/02 processors: • Sequencer Output (SQO). It transfers 16-bit data to word addresses for the control of sequential machine operations. • Sequencer Compare (SQC). It compares 16-bit data with stored data to monitor machine operating conditions or for diagnostic purposes. Instruction for use with the SLC 5/02 processor only: • Sequencer Load (SQL). It loads 16-bit data into a file at each step of sequencer operation. All application examples shown are in the HHT zoom display.

Sequencer Instructions Overview

The following general information applies to sequencer instructions.

Applications Requiring More than 16 Bits When your application requires more than 16 bits, parallel (branch) multiple sequencer instructions.

Effect on Index Register in SLC 5/02 Processors Sequencer instructions alter the contents of the index register, S:24. Details appear with the specific instructions.

24–1

Page 324

Chapter 24 Sequencer Instructions

Sequencer Output (SQO), Sequencer Compare (SQC)

Sequencer Output Sequencer Compare HHT Ladder Display:

HHT Zoom Display: (online monitor mode)

SQO SQC (SQO)

Output Instructions

(SQC)

ZOOM on SQO –(SQO)– 2.3.0.0.2 NAME: SEQUENCER OUTPUT FILE: #B10:1 CONTROL: R6:20 MASK: 0F0F LENGTH: 4 DEST: O0:2.0 POSITION:0 EN DN ER 0 0 0 EDT_DAT F1

F2

F3

F4

F5

ZOOM on SQC –(SQC)– 2.3.0.0.2 NAME: SEQUENCER COMPARE FILE: #B10:11 CONTROL: R6:21 MASK: FFF0 LENGTH: 4 SOURCE: I1:1.0 POSITION:0 EN DN ER FD 0 0 0 0 EDT_DAT F1

F2

F3

F4

Ladder Diagrams and APS Displays: SQO SEQUENCER OUTPUT File #B10:1 Mask 0F0F Dest O:2.0 Control R6:20 Length 4 Position 0

(EN) (DN)

SQC SEQUENCER COMPARE File #B10:11 Mask FFF0 Source I:1.0 Control R6:21 Length 4 Position 0

24–2

(EN) (DN) (FD)

F5

Page 325

Chapter 24 Sequencer Instructions

Entering Parameters • File (SQO, SQC) – This is the address of the sequencer file. You must use the file indicator # for this address. Sequencer file data is used as follows: Instruction

Sequencer File Stores

SQO SQC

Data for controlling outputs Reference data for monitoring inputs

• Mask (SQO, SQC) – This is a hex code or the address of the mask word or file through which the instruction moves data. Set mask bits to pass data, reset mask bits to mask data. Use a mask word or file if you want to change the mask according to application requirements. If the mask is a file, its length will be equal to the length of the sequencer file. The two files track automatically.

• Source (SQC) – This is the address of the input word or file from which the instruction obtains data for comparison to its sequencer file. For input data file addresses, the HHT requires that you enter the slot and word number. For example, I:3.0. • Destination (SQO) – This is the address of the output word or file to which the instruction moves data from its sequencer file. For output data file addresses, the HHT requires that you enter the slot and word number. For example, O:4.0. Important: You can address the mask, source, or destination of a sequencer instruction as a word or file. If you address it as a file (using file indicator #), the instruction automatically tracks through the source, mask, or destination file as the instruction tracks step-by-step through its sequencer file.

• Control (SQO, SQC) – This is the instruction’s address and control element (R6 data file) that stores the status byte of the instruction, the length of the sequencer file, and the instantaneous position in the file. 15

13

11

08

EN

DN

ER

FD

00

Length of sequencer file Position

Note: You cannot use the control address for any other instruction.

24–3

Page 326

Chapter 24 Sequencer Instructions

Status Bits of the Control Element EN (bit 15) – The enable bit is set by a false-to-true rung transition and indicates the SQO or SQC instruction is enabled. It follows the rung condition. DN (bit 13) – The done bit is set by the SQO or SQC instruction after it has operated on the last word in the sequencer file. It is reset on the next false-to-true rung transition after the rung goes false. ER (bit 11) – The error bit is set when the processor detects a negative position value, or a negative or zero length value. This results in a major error if not cleared before the END or TND instruction is executed. FD (bit 08) – SQC only. The found bit indicates that a match has been found between a compare of a word or file of input data, through a mask, to a word or file of reference data for equality. When the status of all non-masked bits in an input word match those of the corresponding reference word, the found bit is set. The found bit is set when a match exists, otherwise it is cleared. This bit is assessed each time the SQC instruction is evaluated while the rung is true.

• Length (word 1) – This is the number of words of the sequencer file starting at position 1. Position 0 is the startup position. The instruction resets (wraps) to position 1 at each cycle completion. The address assigned for a sequencer file is step zero. Sequencer instructions use length + 1 words of data table for each file referenced in the instruction. This applies to the source, mask, and/or destination if addressed as files. A length value that points past the end of the programmed file causes a runtime major error to occur. If you alter a length value with your ladder program, make certain that the altered value is valid.

• Position (word 2) – This is the word location or step in the sequencer file from which the instruction moves data in a SQO instruction or to which the instruction compares data in an SQC instruction. A position value that points past the end of the programmed file causes a runtime major error to occur. If you alter a position value with your ladder program, make certain that the altered value is valid. Application note: You may use the reset (RES) instruction to reset a sequencer. All control bits (except FD) will be reset to zero. The Position will also be set to zero. The RES instruction should be addressed to the control register (R data file) you are using.

Operation – Sequencer Output This output instruction steps through the sequencer file whose bits have been set to control various output devices.

24–4

Page 327

Chapter 24 Sequencer Instructions

When the rung goes from false–to–true, the instruction increments to the next step (word) in the sequencer file. Data stored there is transferred through a mask to the destination address specified in the instruction. Current data is written to the corresponding destination word every scan that the rung remains true. The done bit is set when the last word of the sequencer file is transferred. Upon the next false-to-true rung transition, the instruction resets the position to step one, that is, automatically cycles. At startup, if the position is = 0 when you switch the processor from the program mode to the Run mode, instruction operation depends on whether the rung is true or false on the first scan: • If true, the instruction transfers the value in step 0. • If false, the instruction waits for the first rung transition from false–to–true and transfers the value in step 1. Mask data by resetting bits in the mask word. The bits mask data when reset, pass data when set. Unless you set mask bits, the instruction will not change the value in the destination word. The mask can be fixed by entering a hex code. The mask can be a variable by entering an element address or a file address for changing the mask with each step. The following figure indicates how the SQO instruction functions: SQO SEQUENCER OUTPUT File #B10:1 Mask 0F0F Dest O:14.0 Control R6:20 Length 4 Position 2

Destination O:14.0

(EN) (DN)

15 0000

8 0101

7 0000

0 1010

External Outputs associated with O:14

Mask Value 0F0F 15 0000

8 1111

7 0000

0 1111

Sequencer Output File #B10:1 Word Step B10:1 0000 0000 0000 0000 0 2 1010 0010 1111 0101 1 3 1111 0101 0100 1010 2 4 0101 0101 0101 0101 3 5 0000 1111 0000 1111 4

Current Step

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15

ON ON

ON ON

Effect on Index Register in SLC 5/02 Processors The value present in the index register S:24 is overwritten when the sequencer output instruction is true. The index register value will equal the position value of the instruction.

24–5

Page 328

Chapter 24 Sequencer Instructions

Operation – Sequencer Compare The SQC instruction compares a word or file of input data, through a mask, to a word or file of reference data for equality. When the status of all non-masked bits in an input word match those of the corresponding reference word, the instruction sets the found bit (FD) in the respective control word. Otherwise, when the input word does not match, the found bit (FD) is cleared. Mask data by resetting bits in the mask word. The bits mask data when reset, pass data when set. Unless you set mask bits, the instruction will not compare bits in the reference file against the input value. The mask can be fixed by entering a hex code. The mask can be a variable by entering an element address or a file address for changing the mask at each step. When the rung goes from false–to–true, the instruction increments to the next step (word) in the sequencer file. Data stored there is transferred through a mask and compared against the source data for equality. If the source data equals the reference data, the FD bit is set in the SQC’s control file or word (R6:x/FD). Current data is compared against the source every scan that the rung evaluates as true. Applications of the SQC instruction include machine diagnostics. The following figure explains how the SQC instruction functions: SQC SEQUENCER COMPARE File #B10:11 Mask FFF0 Source I:3.0 Control R6:21 Length 4 Position 2

Input Word I:3.0

(EN) (DN)

0010

0100

1001

1101

(FD) Mask Value FFF0 1111

1111

1111

0000

Sequencer Compare File #B10:11 Word Step B10:11 0 12 1 13 0010 0100 1001 1010 2 14 3 15 4 The FD bit R6:21/FD is set in this example, since the input word matches the sequencer reference value using the mask value.

Effect on Index Register in SLC 5/02 Processors The value present in the index register S:24 is overwritten when the sequencer compare instruction is true. The index register value will equal the position value of the instruction. 24–6

Page 329

Chapter 24 Sequencer Instructions

Sequencer Load (SQL)

SLC 5/02 Processors Only Sequencer Load

SQL

HHT Ladder Display:

HHT Zoom Display: (online monitor mode)

Output Instruction

(SQL) ZOOM on SQL –(SQL)– 2.3.0.0.2 NAME: SEQUENCER LOAD FILE: #N7:30 LENGTH: 4 SOURCE: I1:1.0 POSITION:0 CONTROL: R6:4 EN EU DN EM 0 0 0 0 EDT_DAT F1

F2

F3

F4

F5

Ladder Diagrams and APS Displays: SQL SEQUENCER LOAD File #N7:30 Source I:1.0 Control R6:4 Length 4 Position 0

(EN) (DN)

This instruction loads data into a sequencer load file. The source of this data can be an I/O or storage word address, a file address, or a program constant.

Entering Parameters • File – This is the address of the sequencer file where the source data is loaded into. You must use the file indicator # for this address.

• Source – This can be a word address, file address, or a program constant (–32768 to 32767) indicating the value or location whose contents are loaded into the sequencer file. For input addresses, the HHT requires that you enter the slot and word number. For example, I:3.0. If the source is a file address, its file length will be equal to the length of the sequencer load file (LENGTH). The two files will track automatically, per the position value.

• Control – This is a control file address. The status bits, length value, and position value are stored in this element. Do not use the control file address for any other instruction. The 3-word control element: 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 EN

DN

ER

Length Position

24–7

Page 330

Chapter 24 Sequencer Instructions

Status Bits • EN (bit 15) – The enable bit. This bit is set on a false-to-true transition of the SQL rung and reset on a true-to-false transition. • DN (bit 13) – The done bit. This bit is set after the instruction 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. • ER (bit 11) – The error bit. This bit is set when the processor detects a negative position value, or a negative or zero length value. This results in a major error if not cleared before the END or TND instruction is executed. Use an OTU with address S:5/2 to avoid a CPU fault. • Length (word 1) – This is the number of steps of the sequencer load file (and also of the source if the source is a file address), starting at position 1. Position 0 is the startup position. The instruction automatically resets (wraps) to position 1 at each cycle completion. The position address assigned for a sequencer file is step zero. Sequencer instructions use length plus 1 word of data for each file referenced in the instruction. This applies to the source if addressed as a file. A length value that points past the end of the programmed file causes a runtime major error to occur. If you alter a length value with your ladder program, make certain that the altered value is valid.

• Position (word 2) – This is the word location or step in the sequencer file to which data is moved. A position value that points past the end of the programmed file causes a runtime major error to occur. If you alter a position value with your ladder program, make certain that the altered value is valid.

24–8

Page 331

Chapter 24 Sequencer Instructions

Operation Instruction parameters have been programmed in the SQL instruction shown below. Input word I:1.0 is the source. Data in this word is loaded into integer file #N7:30 by the sequencer load instruction. SQL SEQUENCER LOAD File #N7:30 Source I:1.0 Control R6:4 Length 4 Position 2

External inputs associated with I:1.0

(EN) (DN) Source I:1.0 15 0000

8 0101

7 0000

0 1010

Sequencer Load File #N7:30 Word Step N7:30 0000 0000 0000 0000 0 31 1010 0010 1111 0101 1 32 0000 0101 0000 1010 2 33 0000 0000 0000 0000 3 34 0000 0000 0000 0000 4

Current Step

00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15

ON ON

ON ON

When rung conditions change from false–to–true, the SQL enable bit (EN) is set. The control element R6:4 increments to the next position in the sequencer file, and loads the contents of source I:1.0 into this location. The SQL instruction continues to load the current data into this location each scan that the rung remains true. When the rung goes false, the enable bit (EN) is reset. The instruction loads data into a new file element at each false–to–true transition of the rung. When step 4 is completed, the done bit (DN) is set. Operation cycles to position 1 at the next false-to–true transition of the rung after position 4. If the source were a file address such as #N7:40, files #N7:40 and #N7:30 would both have a length of 5 (0–4) and would track through the steps together per the position value. The SQL LENGTH parameter is still 4.

Effect on Index Registers in SLC 5/02 Processors The value present in the index register S:24 is overwritten when the sequencer load instruction is true. The index register value will equal the position value of the instruction.

24–9

Page 332

This page is a scan with no text; see it in the PDF.