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

The text of a manual · part 9 of 12

Direct Communication Module (Cat. No. 1747-DCM) User Manual: 6 - Programming

Pages 43 to 52 of 80, from Direct Communication Module (Cat. No. 1747-DCM) User Manual

The original document is the PDF (429 KB). 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-DCM

Page 43

Chapter

6

Programming This chapter shows you how to program ladder logic in the supervisory processor/scanner and the distributed SLC to transfer data via the DCM. Topics include: • overview • programming examples • status words • applications using status word bits

Overview

Both the supervisory processor/scanner and the distributed SLC transfer data to and from the DCM automatically via their I/O and the RIO scan. The DCM, as a common memory site for both supervisory and distributed processors, has two addresses; one for the supervisory processor/ scanner and one for the SLC. The supervisory processor/scanner address is the DCM logical rack address as set by DCM SW-1 switches 1 through 6. The distributed SLC address is determined by the slot where the DCM is physically installed. The supervisory processor/scanner and distributed SLC addresses can be different; however, the bit position part in each word must be the same. In the programming examples on the following page, an Examine If Open contact similar to the one shown below is used in each output rung: I:4.0 ]/[ 08

This instruction checks that the Logical OR bit of the status word is false. Whenever any of the status word bits (except the User Status Flag bit) is set, it is indication that a condition has occurred in your logic program that may require inspection. If this happens you would normally want to inhibit some outputs by using a ladder logic instruction. Using an Examine If Open (XIO) instruction examining the Logical OR bit (word 0, bit 8 for SLC; word 0, bit 10 for PLC) is the easiest way of doing this.

6–1

Page 44

Chapter 6 Programming

Programming Examples

DCM 1

0

Input

SLC Processor

Physical Slot #

Output

Power Supply

The following programming examples are typical of applications using the DCM. In each example the portion of the scanner image assigned to the DCM is logical rack 2, starting group 0, 1 full rack, and is located in SLC physical slot 3.

1

2

3

4

5

6

Physical Input into PLC – Physical Output from SLC

Input

PLC

SLC

PLC Processor

IN

RIO Scanner

I:000 ] [ 00

RIO

DCM

SLC Processor

Output

O:021 ( ) 00

I:3.1 ] [ 00

I:3.0 ]/[ 08

O:1.0 ( ) 00

OUT

Logical Or Status Bit

In the example above, PLC output O:021/00 controls the (on/off) status of DCM input I:3.1/00. I:3.1/00 is used as a conditional ladder logic along with the Logical OR input status bit to control SLC output O:1.0/00.

6–2

Page 45

Chapter 6 Programming

Physical Input into SLC – Physical Output from PLC DCM

SLC Processor

Input

RIO Scanner

RIO

PLC Processor

Output

ÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ ÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ SLC

IN

O:3.1 ( ) 00

I:2.0 ] [ 00

I:021 ] [ 00

PLC

I:020 ]/[ 10

O:001 ( ) 00

OUT

Logical Or Status Bit

Physical Input into Both PLC and SLC (Logical AND) – Physical Output from SLC

Input

PLC Processor

RIO Scanner

RIO

DCM

SLC Processor

Input Output

PLC

SLC

IN

I:000 ] [ 00

O:021 ( ) 00

IN

I:2.0 ] [ 00

I:3.1 ] [ 00

I:3.0 ]/[ 08

O:1.0 ( ) 00

OUT

Logical Or Status Bit

6–3

Page 46

Chapter 6 Programming

Physical Input into First SLC – Physical Output from Second SLC For this example the second SLC has a logical PLC rack address of 3 and an SLC slot address of 4. PLC with RIO scanner

First SLC Processor

Input

SLC

IN

I:2.0 ] [ 00

DCM

DCM

RIO

O:3.1 ( ) 00

I:4.1 ] [ 00

Second SLC Processor

I:4.0 ]/[ 08

O:1.0 ( ) 00

Output

OUT

Logical Or Status Bit

PLC (No physical input into the PLC)

I:021 ] [ 00

I:020 ]/[ 10

O:031 ( ) 00

Logical Or Status Bit

When transmitting data from a PLC to an SLC, if the Clear On Fault (CLR ON FLT) is active (switch is OFF), the instruction to examine the Logical OR bit of the status word can be omitted as long as clearing the DCM input image table puts SLC outputs into a safe state for the specific application.

6–4

Page 47

Chapter 6 Programming

Status Words

The first word of the DCM I/O image is the status word. The status word indicates the status of communication and data between the RIO scanner and the DCM. Depending on what logical rack size the DCM is configured for, it will transfer the following number of I/O words: Rack Size

Number of RIO Words Transferred

Total Words

1/4 Logical Rack

One (plus one Status Word)

2

1/2 Logical Rack

Three (plus one Status Word)

4

3/4 Logical Rack

Five (plus one Status Word)

6

Full Logical Rack

Seven (plus one Status Word)

8

The figure below shows how I/O bits are transferred from the scanner to two DCMs, each configured as a 1/2 logical rack device. Bit Number: Decimal

Status Word:

15

Word 0

RR

Word 1

Data Words:

Word 2 Word 3

Status Word:

Word 4 Word 5

Data Words:

Word 6

ÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍ ÍÍÍÍÍÍÍ 14

13

12

RR

11

10

R

RR RR

9

8

R

R

R

7

6

5

4

3

2

1

0

R

R

R

R

R

R

R

R

DCM 1 1/2 Rack Device

R

R

R

R

R

R

R

R

DCM 2 1/2 Rack Device

Word 7

R = Reserved for future use

RIO Scanner Input Status Word Examination (Decimal) This is the input status word sent in a data transfer from a supervisory processor/RIO scanner to a DCM. These bits can be used as conditional logic in your SLC program to flag DCM, RIO, or supervisory processor system errors and/or status. Scanner status bits not defined below are reserved for future use.

ÉÉ ÉÉÍÍ ÉÉ ÉÉÉÉ ÉÉÉÉ ÉÉ ÉÉÉÉ ÉÉ ÉÉÉÉ ÉÉÉÉ ÉÉ ÉÉ ÉÉ ÍÍ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ DCM

15

14

Reserved Bits Status Bits

13

12

11

10

9

8

7

6

5

4

3

2

1

0

Logical OR of other Status Word bits. It is set when any other bit is set. It is cleared when all other bits are cleared.

Program/Test/Fault Mode bit. This bit is set whenever the supervisory processor is in the Program, Test, or Fault Mode. DCM Initialization bit. This bit is set when the DCM is in its power-up initialization. It will be cleared when valid data is received from the supervisory processor output image table. Communication Error bit. This bit is set whenever the DCM detects an RIO communication error. It is cleared when the Communication error is cleared.

6–5

Page 48

Chapter 6 Programming

DCM/SLC Output Status Word Examination (Octal) This is the output image status word sent in a data transfer from a DCM to a supervisory processor/scanner. These bits can be used as conditional logic in your supervisory processor program to flag DCM or SLC system errors and/or status. DCM/SLC status bits not defined below are reserved for future use. Both the decimal and octal bit addresses are shown below to assist you in programming your supervisory (PLC) processor and distributed SLC processor.

ÉÉÉÉ ÉÉ ÉÉÉÉ ÉÉ ÉÉÉÉ ÉÉÉÉ ÉÉ ÉÉÉÉ ÉÉ ÉÉÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉÉÉ ÉÉÉÉ ÉÉ ÉÉ ÉÉÍÍ ÍÍ ÍÍÍÍ ÉÉÉÉ ÉÉ ÉÉ ÉÉÉÉ ÉÉ ÉÉ ÉÉÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÍÍ ÍÍ ÍÍ ÍÍ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ ÉÉ SLC

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

PLC

17

16

15

14

13

12

11

10

7

6

5

4

3

2

1

0

Logical OR of Status Word bits 11 and 12 (9 and 10 for SLC). It is set when either 11 or 12 (9 or 10) is set. It is cleared when 11 or 12 (9 or 10) is cleared.

Reserved Bits Status Bits

Program/Test/Fault Mode bit. This bit is set whenever the SLC controlling the DCM is in the Program, Test, or Fault Mode. DCM Output Data Invalid bit.➀ This bit is set when DCM output image data could be invalid. User Status Flag bit. This status bit is available for you to use in your application. ➀

6–6

Always use the DCM Output Data Invalid bit to determine the validity of SLC data sent from the DCM to the scanner. If you use the Program/Test/Fault Mode bit you may incorrectly receive an indication that the SLC data being sent from the DCM to the scanner is valid. This occurs because for a brief period after the Program/Test/Fault mode bit is cleared the data sent from the DCM to the scanner will not be valid.

Page 49

Chapter 6 Programming

Applications Using I/O Status Word Bits

You can use the status bits in your ladder logic to monitor various conditions of the remote processor and the RIO network. Some examples for using the status word bits are given here. Each of the examples shows how ladder logic rungs could be programmed in the SLC processor to respond to the condition of a status bit from the RIO scanner. Important: The application examples assume the portion of the scanner image assigned to the DCM is logical rack 2, starting group 0, 1 full rack, and is located in SLC physical slot 3.

RIO Scanner Status Word Using the Program/Test/Fault Mode Bit When the RIO scanner’s supervisory processor is in Program, Test, or Fault Mode, its outputs are automatically inhibited (reset off) unless Hold Last State is used. However, outputs sent to the DCM (DCM inputs) are not automatically inhibited. If you want to inhibit any one SLC output controlled by a DCM input, you can use an Examine If Open (XIO) instruction addressed to the Program/Test/Fault Mode bit (I:3.0/9 in the example below). This assumes an SLC output is being driven by an input (I:3.1/0) from the scanner to the DCM, as shown below. DCM Conditional

Program/Test/Fault

SLC

I:3.1 ] [ 00

I:3.0 ]/[ 09

O:1.0 ( ) 00

Input

Status Bit

Output

SLC Rung to Monitor RIO Scanner Status Bit 09

If you want to clear the DCM’s entire input image (data from the RIO scanner when the RIO scanner’s supervisory processor is in Program/Test/ Fault Mode), you can set the DCM Clear On Fault DIP switch to the OFF position. Please refer to chapter 4, Module Configuration, for more information on this DIP switch.

DCM/SLC Output Status Word Using the Data Invalid Bit Whenever the distributed SLC leaves Program/Test/Fault Mode and enters Run Mode, there is a time period after the Program/Test/Fault Mode bit is cleared when the data sent from the DCM/SLC to the RIO scanner is invalid. For this reason, the Program/Test/Fault Mode bit should not be used by the RIO scanner’s supervisory processor to determine the validity of data sent from the DCM. Instead, both processors’ programs should use the DCM output Data Invalid bit (12 octal).

6–7

Page 50

Chapter 6 Programming

To ensure that the DCM output Data Invalid bit is cleared (signifying to the RIO scanner’s supervisory processor that data is valid), the SLC ladder logic rung shown below must be included as the last rung in your SLC ladder logic program. SLC Rung addresses bit 10 (decimal); RIO Scanner ’s supervisory processor receives bit 12 (octal).

O:3.0 (U) 10

The RIO scanner’s supervisory processor ladder logic program should use the DCM output Data Invalid bit to condition any supervisory processor outputs whose state is dependent upon valid data from the DCM/distributed SLC. An example of a PLC-5 processor rung that requires this conditioning is shown below. PLC-5 Rung SLC addresses bit 10 (decimal); PLC receives bit 12 (octal).

I:021 ] [ 00

I:020 ]/[ 12

O:000 ( ) 00

This rung uses data from the DCM (word 1, bit 0 PLC address I:021/00) to energize a PLC-5 output: bit 0, of rack 0, module group 0. It is conditioned with the Data Invalid bit. By using the DCM output Data Invalid bit in this example, the PLC-5 will not energize the output shown above unless the data received from the SLC/DCM is valid. Using the User Status Flag Bit This status bit (13) is available for your particular application. It is cleared on powerup and thereafter is never operated on by the DCM. After powerup this bit is only set (1) or cleared (0) by your SLC ladder logic program. A typical application using this bit would be to inform the RIO scanner’s supervisory processor that the SLC is disabling the slot where the DCM is located. If the DCM slot is disabled while the SLC is in the Run Mode, data sent to the RIO scanner will be last state data (invalid). Without using the User Status Flag bit, no indication that data is not being updated would be sent to the RIO scanner (that is, neither the Program/Test/Fault Mode bit nor the Invalid Data bit would be set). If your SLC ladder logic program sets the User Status Flag bit prior to disabling the DCM slot, the supervisory processor can use this bit in its ladder logic where appropriate.

!

ATTENTION: Make certain that you have thoroughly examined the effects of disabling the DCM slot before doing so in your application.

An example of how rungs might be programmed in the two processors to indicate disabling of the DCM slot is shown on the next page.

6–8

Page 51

Chapter 6 Programming

SLC Rungs User Status Flag Bit

Set User Status Flag Bit

O:13.0 (L) ➂ 11

Condition(s) ➀

IOM IMMEDIATE OUT w MASK Slot 0:3.0 Mask 0800

➃

Disable DCM

Condition(s)

S2:11 (U) 03

➀

➃

Enable DCM

Condition(s)

Clear User Status Flag Bit

Condition(s)

S2:11 (L) 03

➁

O:3.0 (U) ➂ 11

➁

➀

Condition(s) to set User Status Flag bit is the same condition(s) to disable the DCM slot. When setting the User Status Flag bit, an Immediate I/O (IOM) instruction must be used. ➁ Condition(s) to clear User Status Flag bit is the same condition(s) to enable the DCM slot. ➂ The SLC addresses this bit as bit 11 (decimal); the PLC-5 receives this bit as bit 13 (octal). ➃ S2:11-S2:12 – These two words are bit mapped to represent the 30 possible I/O slots in an SLC system. S2:11/0 represents I/O slot 0 up through S2:12/14 which represents slot 30. S2:12/15 is unused.

After programming the SLC to set and clear the User Status Flag bit, this bit can be used to condition any PLC-5 output in this example whose state is dependent upon the data from the distributed SLC being valid. PLC-5 Rung I:021 ] [ 00

I:020 ]/[ 13

O:000 ( ) 00

The PLC-5 rung uses data from the DCM (word 1, bit 0) to energize PLC-5 output 0. It is conditioned on the User Status Flag bit being cleared. If the SLC is programmed to set the User Status Flag bit prior to disabling the DCM slot, the PLC-5 will never energize output 0 when data from the SLC is invalid. For more information on how to enter PLC ladder logic, see your PLC-5 programming manual.

6–9

Page 52

Chapter 6 Programming

RIO Scanner Input Status and DCM/SLC Output Status Using the Logical OR Bit Whenever any of the status word bits (except the User Status Flag bit) are set, the Logical OR bit is set. Using an Examine If Open (XIO) instruction examining the Logical OR bit (word 0, bit 8 for SLC; word 0, bit 10 for PLC-5) in your ladder logic, you could inhibit any outputs or processors when this bit is set. SLC Rung to Monitor PLC-5 Status Bit 08

6–10

I:3.1 ] [ 00

I:3.0 ]/[ 08

O:1.0 ( ) 00