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

The text of a manual · part 13 of 20

DH-485/RS-232C Interface Module, Catalog Number 1747-KE, User Manual: 8 - Application Examples, pages 89 to 98

Pages 89 to 98 of 139, from DH-485/RS-232C Interface Module, Catalog Number 1747-KE, User Manual

The original document is the PDF (1.8 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.

Filed in the catalog under the Allen-Bradley 1747-AIC DH-485

Page 89

Chapter

8

Application Examples

This chapter contains the following application examples. • Basic configuration example using the backplane • Supplementary examples using the backplane • RSLinx software to SLC network via modem example

Basic Configuration Example Using the Backplane

This example demonstrates configuration of the interface module using the backplane. IMPORTANT

Before you begin this application, insure that the JW4 jumper is in vertical Run mode (module configuration ID=3509).

Parameter Locations In this application, the configuration parameters are in the data file N10.

1

Parameter Locations Address 0 1

2

3

4

5

6

7

8

9

N10:00

0

0

0

0

0

0

0

0

0

N10:10

DF1 port configuration parameters

N10:20

DH485 port configuration parameters

N10:30

Modem Init String characters 1...14

N10:40

Modem Init String characters 15...28

0

Publication 1747-UM005B-EN-P - March 2006

Page 90

8-2

Application Examples

Parameter Settings For this example, configure the parameters to the settings provided below. DF1 Configuration (N10:11...17) Parameter Configuration

Word and Bits Used

Communication Rate

N10:11/0...2

1200

Bits Per Character

8

N10:11/3

Parity

None

N10:11/4...5

Stop Bits

1

N10:11/6

Duplicate Packet Detection

Disabled

N10:11/7

Checksum

BCC

N10:11/8

Hardware Handshaking

Disabled

N10:11/9

Constant Carrier Detect

Disabled

N10:11/10

Duplex Setting

Full

N10:11/11

Embedded Response Detect

ADER

N10:11/12

ENQuiry Retries

2

N10:12/0...7

Modem Init String Delay

5s

N10:12/8...15

NAK Received Retries

4

N10:13/0...7

DF1 Slave Address(1)

7

N10:13/8...15

ACK Timeout

37 x 5 ms

N10:14/0...15

Message Timeout

100 ms

N10:15/0...15

(1)

5 x 5 ms

N10:16/0...15

RTS Off Delay(1)

7 x 5 ms

N10:17/0...15

RTS On Delay

(1)

Not applicable for full-duplex.

DH-485 Configuration (N10:21...27) Parameter Configuration

Word and Bits Used

Node Address

5

N10:21/0...7

Max Node Address

31

N10:21/8...15

Communication Rate

19,200

N10:22/0...3

Pass Through

Enabled

N10:22/4

Message Timeout

12000 ms

N10:23/0...15

Modem Init String Characters 1-14 (N10:31-37) cdefghijklmnop

Modem Init String Characters 15-28 (N10:41-47) A B C (null)

Publication 1747-UM005B-EN-P - March 2006

Page 91

Application Examples

8-3

Configuration Results Configuration occurs upon power up or when entering Run mode. The configuration is successful only if data file N10:0=4. If your configuration is unsuccessful, check the table below for the failed configuration block. Failed Configuration Block If N10:0= Then failure occurred in the 0

DF1 port

1

DH485 port

2

Modem Init String (characters 1...14)

3

Modem Init String (characters 15...28)

If you need to reconfigure the module, set N10:0 equal to 0 and change the incorrect parameters in N10:10-47.

Publication 1747-UM005B-EN-P - March 2006

Page 92

8-4

Application Examples

Backplane Configuration User Program The following steps summarize the user program. 1. N10:0 is initialized. 2. The DF1 port config block is copied to the interface module. 3. The results of the DF1 config are checked. 4. The DH-485 port config block is copied to the interface module. 5. The results of the DH-485 config are checked. 6. The Modem Init String (1 to 14) config block is copied to the Module. 7. The results of the Modem Init String (1 to 14) config are checked. 8. The Modem Init String (15 to 28) config block is copied to the Module. 9. The results of the Modem Init String (15 to 28) config are checked. 10. The interface module is placed in Run mode. At the end of this configuration sequence, data file N11:10-47 reflects the configuration parameters as read from the interface module. The user program for the backplane configuration example follows starting on the next page.

Publication 1747-UM005B-EN-P - March 2006

Page 93

Application Examples

N10:0 is initialized here.

8-5

N10:0 points to the Config block that is being transferred. Clear pointer.

Rung 2:0

MOV

S:1 ] [ 15

MOVE Source Dest

0 N10:0 0

Put interface module in Config Mode.

O:1 (L) 15 Reset Handshake bit.

O:1 (U) 14 This rung copies a new DF1 Config block to the interface module. Config handshake bit to the module.

EQU Rung 2:1

EQUAL Source A Source B

N10:0 0 0

O:1 ]/[ 14

Config handshake ACK bit from the module.

Copy DF1 Config to the module.

COP

I:1 ]/[ 14

COPY FILE Source Dest Length

#N10:10 #O:1.0 8

Config handshake bit to the module.

O:1 (L) 14 This rung checks the results of the DF1 Config from the interface module. Config handshake bit to the module.

EQU Rung 2:2

EQUAL Source A Source B

N10:0 0 0

O:1 ] [ 14

Config handshake ACK bit from the module.

Copy Config from the module.

COP

I:1 ] [ 14

COPY FILE Source Dest Length

#I:1.0 #N11:10 8

Config handshake bit to the module.

O:1 (U) 14 Check status and point to next Config block.

MEQ

ADD

MASKED EQUAL Source N11:10 0 Mask 07F0

ADD Source A

Compare

Dest

0

Source B

N10:0 0 1 N10:0 0

Publication 1747-UM005B-EN-P - March 2006

Page 94

8-6

Application Examples

This rung copies a new DH±485 Config block to the interface module. Config handshake bit to the module.

EQU Rung 2:3

EQUAL Source A Source B

N10:0 0 1

O:1 ]/[ 14

Config handshake ACK bit from the module.

Copy DH±485 Config to the module.

COP

I:1 ]/[ 14

COPY FILE Source Dest Length

#N10:20 #O:1.0 8

Config handshake bit to the module.

O:1 (L) 14 This rung checks the Modem Init String (1±14) from the interface module. Config handshake bit to the module.

EQU Rung 2:4

EQUAL Source A Source B

N10:0 0 1

O:1 ] [ 14

Config handshake ACK bit from the module.

Copy Config from the module.

COP

I:1 ] [ 14

COPY FILE Source Dest Length

#I:1.0 #N11:20 8

Config handshake bit to the module.

O:1 (U) 14 Check status and point to next Config block.

MEQ

ADD

MASKED EQUAL Source N11:20 0 Mask 07F0

ADD Source A

Compare

Dest

0

This rung copies a new Modem Init String (1±14) Config block to the module. Config handshake bit to the module.

EQU Rung 2:5

EQUAL Source A Source B

N10:0 0 2

O:1 ]/[ 14

Config handshake ACK bit from the module.

I:1 ]/[ 14

Source B

N10:0 0 1 N10:0 0

Copy Modem Init String (1±14) Config to the module.

COP COPY FILE Source Dest Length

#N10:30 #O:1.0 8

Config handshake bit to the module.

O:1 (L) 14

Publication 1747-UM005B-EN-P - March 2006

Page 95

Application Examples

8-7

This rung checks the Modem Init String (15±28) from the interface module. Config handshake bit to the module.

EQU Rung 2:6

EQUAL Source A Source B

N10:0 0 2

O:1 ] [ 14

Config handshake ACK bit from the module.

Copy Config from the module.

COP

I:1 ] [ 14

COPY FILE Source Dest Length

#I:1.0 #N11:30 8

Config handshake bit to the module.

O:1 (U) 14 Check status and point to next Config block.

MEQ

ADD

MASKED EQUAL Source N11:30 0 Mask 07F0

ADD Source A

Compare

Dest

0

Source B

N10:0 0 1 N10:0 0

This rung copies a new Modem Init String (15±28) Config block to the module. Config handshake bit to the module.

EQU Rung 2:7

EQUAL Source A Source B

N10:0 0 3

O:1 ]/[ 14

Config handshake ACK bit from the module.

I:1 ]/[ 14

Copy Modem Init String (15±28) Config to the module.

COP COPY FILE Source Dest Length

#N10:40 #O:1.0 8

Config handshake bit to the module.

O:1 (L) 14

Publication 1747-UM005B-EN-P - March 2006

Page 96

8-8

Application Examples

This rung checks the Modem Init String (15±28) from the interface module. Config handshake bit to the module.

EQU Rung 2:8

EQUAL Source A Source B

N10:0 0 3

Config handshake ACK bit from the module.

O:1 ] [ 14

Copy Config to the module.

COP

I:1 ] [ 14

COPY FILE Source Dest Length

#I:1.0 #N11:40 8

Config handshake bit to the module.

O:1 (U) 14 Check status and point to next Config block.

MEQ

ADD

MASKED EQUAL Source N11:40 0 Mask 07F0

ADD Source A

Compare

Dest

N10:0 0 1

Source B

0

N10:0 0

Set the interface module to Run mode. Set the Run mode bit.

EQU Rung 2:9

EQUAL Source A Source B

N10:0 0 4

O:1 ]/[ 14

I:1 ]/[ 14

O:1 (U) 15

Rung 2:10

<END>

Configuration Data Table Shown below is the configuration information for N10 in Decimal radix. Configuration Data Table Address 0 1 2 N10:0

0

4

5

6

7

8

9

0

0

0

0

0

0

0

0

N10:10 -32766 6154

1282

1796

37

100

5

7

0

0

22 12000

0

0

0

0

0

0

N10:30 -32764 25444 25958 26472 26986 27500 28014 28528

0

0

N10:40 -32763 16706 17152

0

0

N10:20 -32765 7941

Publication 1747-UM005B-EN-P - March 2006

3

0

0

0

0

0

0

Page 97

Application Examples

Supplementary Example Using the Backplane

8-9

These supplementary examples demonstrate how to use the backplane to operate the interface module’s Real Time Clock and Data Echo features. IMPORTANT

Before you begin these applications, be sure that the JW4 jumper is in vertical Run mode (module configuration ID=3509).

Real Time Clock You can use the interface module as a Real Time Clock (RTC) in conjunction with normal module operation. This example shows you how to set up the Calendar/Clock Function using the backplane.

Parameter Settings The values used by the RTC are in N10:1-7, and are initialized as shown in the table below. Parameter Settings In this example

Equals

Day

5

Month

12

Year

1993

Day of the week

4 (Wednesday)

Hours

11

Minutes

15

Seconds

30

User Program The example program shown on the following page initializes the interface module’s calendar and RTC when bit B3:0/0 is toggled from low to high. Bit B3:0/1 is toggled every 2.56 seconds, and the new RTC values that are read are then placed in data file N10:11-17.

Publication 1747-UM005B-EN-P - March 2006

Page 98

8-10

Application Examples

This rung initializes the module. Copy the RTC data. Rung 2.0

B3 ] [ 0

COP

B3 [OSR] 2

COPY FILE Source Dest Length

#N10:0 #O:1.0 8

Put Interface Module in Config mode.

O:1 (U) 13 Turn ON the handshake bit.

O:1 (L) 14 This rung gets the calendar/clock data from the module. Handshake bit from module. Rung 2:1

I:1 ] [ 14

Handshake bit to module.

O:1 ] [ 14

Get data from module.

MEQ

COP

MASKED EQUAL Source I:1.0 ±32762 Mask 07F0

COPY FILE Source Dest Length

Compare

#I:1.0 #N10:10 8

0 Unlatch handshake to module.

O:1 (U) 14

This rung sets the 2.56 second free±run counter. Move the RTC data to the module. Rung 2.2

S:4 ] [ 7

MOV

B3 [OSR] 1

MOVE Source Dest

8193 1 #O:1.0 ±16378

Turn ON the handshake bit.

O:1 (L) 14 Rung 2.3

Publication 1747-UM005B-EN-P - March 2006

<END>