Rockwell Automation 1746-HSCE2 Multi-Channel High Speed Counter Module User Manual

Page 54

Advertising
background image

Publication 1746-UM002B-EN-P - August 2004

4-4 Configuration and Programming

Reading the Data

In the following example, the 1746-HSCE2 module is located in slot 3.
The rate value, in floating point rate value format, is located in input
data file words 4 and 5 (I:3.4 and I:3.5). To view the rate value for
counter 1, use the copy instruction as shown below.

The source is the input data file, and the destination is the floating
point file. The length is 1, the number of elements of the destination
file in the COP instruction.

Writing the Data

In the following example the floating point value is copied into
integer words 1 and 2 of the Minimum/Maximum Rate Value
programming block (N10:0-7). The 1746-HSCE2 module is located in
slot 3.

The source is the floating-point file, and the destination is an integer
data file. The length is 2, the number of elements being copied into
the destination file using the copy instruction.

Converting from Two-Word Integer to Floating-Point Format

You can use RSLogix500™ programming software to convert the
values from integer to floating-point notation using the compute
instruction, as shown.

In this example, the 1746-HSCE2 module is located in slot 3, the
upper 4 digits of the rate value are stored in the input data file word 4
(I:3.4), and the lower 3 digits of the rate value are stored in input data
file word 5 (I:3.5). The compute instruction is as follows:

The destination is in the floating-point file F8.

Copy File
Source

#I:3.4

Dest

#F8:1

Length

1

COP

COP

Copy File
Source

#F8:1

Dest

N10:1

Length

2

CPT

Compute
Dest

F8:1

Expression ( I:3.4 * 1000 ) + I:3.5

CPT

Advertising