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

The text of a manual · part 30 of 55

Hand-Held Terminal (Catalog Number 1747-PT1) User Manual: 18 - I/O Message and Communication Instructions, pages 257 to 266

Pages 257 to 266 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 257

Chapter 18 I/O Message and Communication Instructions

Example 2 – Program File 2 of SLC 5/02 Processor

Temperature–sensing Input Device

0

I:1.0 ] [ 5

N7:0 ( ) 1

1

S:1 ] [ 15

T4:0 (RES) N7:0 (L) 0

First Pass Bit

Bit 1 of the message word. Used for fan control.

Bit 0 of the message word. This is the interlock bit.

B3 (U) 0 TON TIMER ON DELAY Timer T4:0 Time Base 0.01 Preset 400 Accum 0

2

(EN)

4–second Timer

(DN)

First Pass Bit 3

S:1 ] [ 15 S:4 ] [ 6

1280 ms Clock Bit

MSG READ/WRITE MESSAGE Read/write WRITE Target Device 500CPU Control Block N10:0 Control Block Length 7

(EN) (DN) (ER)

B3 ] [ 0 4

N10:0 ] [ 13*

Message Write Done Bit

5

T4:0 ] [ DN

6

N11:0 N7:0 ] [ ]/[ 13* 0

Write message instruction. The source and target file addresses are N7:0 Target node: 3 Message length: 1 word.

B3 (L) 0 MSG READ/WRITE MESSAGE Read/write READ Target Device 500CPU Control Block N11:0 Control Block Length 7

(EN) (DN) (ER) B3 (L) 10

T4:0 (RES)

Read message instruction. The destination and target file addresses are N7:0 Target node: 3 Message length: 1 word. Latch – This alarm instruction notifies the application if the interlock bit N7:0/0 remains set for more than 4 seconds.

N7:0 (L) 0

Message Read Done Bit

B3 (U) 0 N11:0 (U) 15*

* MSG instruction status bits: 13 = DN 15 = EN

N10:0 (U) 15* 7

END Operation notes appear on the following page.

18–11

Page 258

Chapter 18 I/O Message and Communication Instructions

Example 2 – Program File 2 of SLC 5/01 Processor at Node 3 0

N7:0 (U) 0

S:1 ] [ 15

First Pass Bit

Bit 0 of the message word. This is the interlock bit.

T4:0 (RES) TON TIMER ON DELAY Timer T4:0 Time Base 0.01 Preset 400 Accum 0

1

Bit 1 of the message word. Used for fan control.

2

T4:0 ] [ DN

3

N7:0 ] [ 0

4

B3 ] [ 1

(EN) (DN)

B3 (L) 10 B3 ( ) 1

B3 [OSR] 0

4–second Timer

Latch Instruction – This alarm notifies the application if the interlock bit N7:0/0 is not set after 4 seconds.

N7:0 (U) 0 T4:0 (RES)

5

O:1.0 ( ) 0

N7:0 ] [ 1

6

O:1/0 energizes cooling fan.

END

Operation Notes, SLC 5/02 and SLC 5/01 Programs Message instruction parameters: N7:0 is the message word. It is the target file address (SLC 5/01 processor) and the local source and destination addresses (SLC 5/02 processor) in the message instructions. N7:0/0 of the message word is the interlock bit; it is written to the SLC 5/01 processor as a 1 (set) and read from the SLC 5/01 processor as a 0 (reset). N7:0/1 of the message word controls cooling fan operation; it is written to the SLC 5/01 processor as a 1 (set) if cooling is required or as a 0 (reset) if cooling is not required. It is read from the SLC 5/01 processor as either 1 or 0. Word N7:0 should have a value of 1 or 3 during the message write execution. N7:0 should have a value of 0 or 2 during the message read execution. Program initialization: The first pass bit S:1/15 initializes the ladder programs on Run mode entry.

18–12

SLC 5/02 processor: N7:0/0 is latched; timer T4:0 is reset; B3/0 is unlatched (rung 1), then latched (rung 3). SLC 5/01 processor: N7:0/0 is unlatched; timer T4:0 is reset. Message instruction operation: The message write instruction in the SLC 5/02 processor is initiated every 1280 ms by clock bit S:4/6. The done bit of the message write instruction initiates the message read instruction. B3/0 latches the message write instruction. B3/0 is unlatched when the message read instruction done bit is set, provided that the interlock bit N7:0/0 is reset. Communication failure: In the SLC 5/02, bit B3/10 becomes set if interlock bit N7:0/0 remains set (1) for more than 4 seconds. In the SLC 5/01, bit B3/10 becomes set if interlock bit N7:0/0 remains reset (0) for more than 4 seconds. Your application can detect this event, take appropriate action, then unlatch bit B3/10.

Page 259

Chapter 18 I/O Message and Communication Instructions

Example 3 0

1 [LBL]

B3 ] [ 1

1

B3 ] [ 1

T4:0 ]/[ DN

2

T4:0 ] [ DN

B3/1 is latched to initiate the message instruction.

3

MSG READ/WRITE MESSAGE Read/write WRITE Target Device 500CPU Control Block N7:0 Control Block Length 7

(EN) (DN) (ER)

TON TIMER ON DELAY Timer T4:0 Time Base 0.01 Preset 200 Accum 0

(EN) (DN)

2–second timer. Each attempt at transmission has a 2–second duration.

(CU)

Counter allows 5 attempts.

CTU COUNT UP Counter Preset Accum

C5:0 5 0

(DN)

CLR

N7:0 ] [ 8

CLEAR DEST

Clear the control word and jump back to rung 0 for another attempt.

N7:0 0

1 (JMP)

4

T4:0 ] [ DN

N7:0 (L) 8

N7:0/8 is the message instruction timeout bit.

5

C5:0 ] [ DN

O:1.0 (L) 0

The fifth attempt latches O:1/0.

6

N7:0 ] [ 13*

C5:0 (RES) O:1.0 (U) 0 B3 (U) 1

7

* MSG instruction status bits: 8 = TO 13 = DN 15 = EN

END

Operation Notes The timeout bit is latched (rung 4) after a period of 2 seconds. This clears the message instruction from processor control on the next scan. The message instruction is then re-enabled for a second attempt at transmission. After 5 attempts, O:1/0 is latched. A successful attempt at transmission resets the counter, unlatches O:1/0, and unlatches B3/1.

18–13

Page 260

Chapter 18 I/O Message and Communication Instructions

Service Communications (SVC)

SLC 5/02 Processors Only Service Communications

HHT Ladder Display:

HHT Zoom Display: (monitor mode)

SVC

Output Instruction

(SVC)

ZOOM on SVC –(SVC)– 2.0.0.0.1 NAME: SERVICE COMMUNICATIONS

EDT_DAT F1

F2

Ladder Diagrams and APS Displays:

F3

F4

F5

(SVC)

The SVC instruction has no programming parameters. When it is evaluated as true, the program scan is interrupted to execute the service communications part of the operating cycle. The scan then resumes at the instruction following the SVC instruction. An explanation of the processor operating cycle appears in appendix D. One status file bit is related to the SVC instruction: • Bit S:2/5 DH–485 Incoming Command Pending – Read only. This bit becomes set when the processor determines that another node on the DH–485 network has requested information or supplied a command to it. This bit can become set at any time. This bit is cleared when the processor services the request (or command). Use this bit as a condition of an SVC instruction to enhance the communications capability of your processor. You are not allowed to place an SVC instruction in an STI interrupt, I/O interrupt, or user fault subroutine. Application example: The SVC instruction is used when you want to execute a communications function, such as transmitting a message, prior to the normal service communications portion of the operating scan: Outgoing Message Command Pending Bit

S:2 ] [ 7

(SVC)

You can place this rung after a message instruction. S:2/7 will be set when the message instruction is enabled and waiting (provided no message is currently being transmitted). When S:2/7 is set, the SVC instruction is evaluated as true and the program scan is interrupted to execute the service communications portion of the operating scan. The scan then resumes at the instruction following the SVC instruction. 18–14

Page 261

Chapter 18 I/O Message and Communication Instructions

This example assumes that the Comms Servicing Selection bit S:2/15 is clear and that this is the only active MSG instruction. Important: You may program the SVC instruction unconditionally.

Immediate Input with Mask (IIM)

Immediate Input with Mask

IIM

Output Instruction

HHT Ladder Display:

(IIM)

HHT Zoom Display: (online monitor mode)

ZOOM on IIM –(IIM)– 2.0.0.0.1 NAME: IMMEDIATE INPUT w/ MASK SLOT: I1:4.0 0000 0000 0000 0000 MASK: 00FF 00FF

EDT_DAT F1

F2

F3

F4

F5

Ladder Diagrams and APS Displays: IIM IMMEDIATE IN w MASK Slot I:4.0 Mask 00FF

This instruction updates input data before the normal input scan. When the IIM instruction is enabled, the program scan is interrupted. Data from a specified I/O slot is transferred through a mask to the input data file, making the data available to instructions following the IIM instruction in the ladder program. This instruction operates on the inputs assigned to a particular word of a slot (16 bits maximum). For the mask, a 1 in an input’s bit position passes data from the physical input slot to the input data file. A 0 inhibits data from passing from the source to the destination.

Entering Parameters SLOT: Specify the slot number and the word number pertaining to the slot. A slot can have up to 8 words for fixed and SLC 5/01 and 32 words for SLC 5/02. I:0.0

Inputs of slot 0, word 0 (fixed I/O controller)

I:0.1

Inputs of slot 0, word 1 (fixed I/O controller)

I:1.0

Inputs of slot 1, word 0 18–15

Page 262

Chapter 18 I/O Message and Communication Instructions

MASK: Specify a Hex constant or register address. Refer to appendix B for information regarding masks and hexadecimal numbering.

Immediate Output with Mask (IOM)

Immediate Output with Mask

IOM

Output Instruction

HHT Ladder Display:

(IOM)

HHT Zoom Display: (online monitor mode)

ZOOM on IOM –(IOM)– 2.0.0.0.1 NAME: IMMEDIATE OUTPUT w/ MASK SLOT: O0:3.0 0000 0000 0000 0000 MASK: FF00 FF00

EDT_DAT F1

F2

F3

F4

F5

Ladder Diagrams and APS Displays: IOM IMMEDIATE OUT w MASK Slot O:3.0 Mask FF00

This instruction updates outputs before the normal output scan. When the IOM instruction is enabled, the program scan is interrupted to transfer data to a specified I/O slot through a mask. The program scan then resumes with the instruction following the IOM instruction. This instruction operates on the physical outputs assigned to a particular word of a slot (16 bits maximum). For the mask, a 1 in the output bit position passes data from the output data file to the physical output slot. A 0 inhibits the data from passing from the source to the destination. Entering Parameters SLOT: Specify the slot number and the word number pertaining to the slot. A slot can have up to 8 words for fixed and SLC 5/01 and 32 words for SLC 5/02. O:0.0

Outputs of slot 0, word 0 (fixed I/O controller)

O:1.0

Outputs of slot 1, word 0

O:2.0

Outputs of slot 2, word 1

Specification of slot/word numbers for the modular controller is similar (except that slot 0 is not applicable). 18–16

Page 263

Chapter 18 I/O Message and Communication Instructions

MASK: Specify a Hex constant or register address. Refer to appendix B for information regarding masks and hexadecimal numbering.

I/O Event-Driven Interrupts

SLC 5/02 Processors Only

I/O Interrupt Disable I/O Interrupt Enable Reset Pending I/O Interrupt

IID IIE RPI

HHT Ladder Display:

Output Instruction Output Instruction Output Instruction

(IID)

HHT Zoom Display: (monitor mode)

(IIE)

(RPI)

ZOOM on IID –(IID)– 2.4.0.0.1 NAME: I/O INTERRUPT DISABLE 1 2 3 0 0 0 0 0100 1111 1111 1111 1111 1111 1111 1111

EDT_DAT F1

F2

F3

F4

F5

ZOOM on IIE –(IIE)– 2.0.0.0.1 NAME: I/O INTERRUPT ENABLE 1 2 3 0 0 0 0 0011 0000 0000 0000 0000 0000 0000 0001

EDT_DAT F1

F2

F3

F4

F5

ZOOM on RPI –(RPI)– 2.0.0.0.1 NAME: RESET PENDING INTERRUPT 1 2 3 0 0 0 0 0000 0000 0000 0000 0000 0000 0000 0001

EDT_DAT F1

F2

F3

F4

F5

IID Ladder Diagrams and APS Displays:

I/O INTERRUPT DISABLE Slots: 2,3

IIE

RPI

I/O INTERRUPT ENABLE Slots: 2,3

RESET PENDING INTERRUPT Slots: 1–30

18–17

Page 264

Chapter 18 I/O Message and Communication Instructions

The I/O Event-Driven Interrupt function is used with specialty I/O modules capable of generating an interrupt. You specify a subroutine to be executed upon receipt of such an interrupt. Important: Refer to chapter 31, Understanding I/O Interrupts – SLC 5/02 Processor Only, before you use these instructions in your program. Programming an I/O event interrupt is done through locations in the status file. I/O Interrupt Disable and Enable (IID, IIE) These instructions are generally used in pairs to prevent I/O interrupts from occurring during time-critical or sequence-critical portions of your main program or subroutine. These are also optional and are used to disable an I/O interrupt. Reset Pending I/O Interrupt (RPI) This instruction resets the pending status of the specified slots and informs the corresponding I/O modules that you have aborted their interrupt requests. This is also optional and is used to disable an I/O interrupt. Entering Parameters IID instruction – Enter a 0 (reset) in a slot position to indicate a disabled I/O interrupt. IIE instruction – Enter a 1 (set) in a slot position to indicate an enabled I/O interrupt. RPI instruction – Enter a 0 (reset) in a slot position to indicate the pending status of an I/O interrupt is reset (aborted).

18–18

Page 265

Chapter 18 I/O Message and Communication Instructions

I/O Refresh (REF)

SLC 5/02 Processors Only I/O Refresh

HHT Ladder Display:

HHT Zoom Display: (monitor mode)

REF

Output Instruction

(REF)

ZOOM on REF –(REF)– NAME: REFRESH I/O

2.0.0.0.1

EDT_DAT F1

Ladder Diagrams and APS Displays:

F2

F3

F4

F5

(REF)

The REF instruction has no programming parameters. When it is evaluated as true, the program scan is interrupted to execute the I/O scan, which includes the service communications portion of the operating cycle (write outputs, service comms, read inputs). The scan then resumes in the program scan at the instruction following the REF instruction. You are not allowed to place an REF instruction in an STI interrupt, I/O interrupt, or user fault subroutine.

!

ATTENTION: The watchdog and scan timers are reset when executing the REF instruction. You must insure that an REF instruction is not placed inside of a non-terminating program loop. Do not place an REF instruction inside of a program loop unless the program is thoroughly analyzed.

18–19

Page 266

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