Program listing, Data file – Rockwell Automation 1746-NI8 SLC 500 Analog Input Modules User Manual User Manual

Page 68

Advertising
background image

8–3

Application Examples

Publication 1746Ć6.8 - April 1997

Program Listing

TO BCD
Source

N7:0

0 <

Dest

N7:1

0000h <

Scale w/Parameters
Input

I:3.0

0 <

Input Min.

3500
3500 <

Input Max.

20500
20500 <

Scaled Min.

0
0 <

Scaled Max.

100
100 <

Output

N7:0

0 <

Rung 2.2

Convert the scaled channel 0 data word

to BCD and write this to the LED display.

If channel 0 is ever disabled, a zero is

written to the display.

TOD

MASKED MOVE
Source

N7:1

0 <

Mask

0FFFh

4095 <

Dest

O:2.0

0 <

MVM

SCP

MOVE
Source

N10:0

Dest

O:3.0

15

Rung 2.0

First Pass Bit

] [

S:1

Initialize the 1746ĆNI8

Module Channel 0

MOV

Rung 2.1

Rung 2.3

END

The use of the masked move instruction with the 0FFF mask allows you to use outputs 12, 13, 14, and
15 for other output devices in your system. The 7Ćsegment display uses outputs 0-11.

Data File

DATA FILE N10

Offset

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

N10:0

0

0

0

0

1

1

0

0

0

0

0

0

1

1

0

1

Advertising