Converting results data – Rockwell Automation 5370 Color CVIM Communications Manual User Manual

Page 55

Advertising
background image

Chapter 4
Using the Remote I/O Link

4–18

Some of the results data described in Appendix C is stored in a “16 point 16”
format while other data is stored as a 32 bit integer. Refer to the following
chart:

WINDOW

FORMAT

Luminance

16.16*

Object Counting

32 bit

Pixel Counting

32bit

Color ID

32 bit

Color Match

32 bit

GAGE

FORMAT

Linear Measure

16.16

Object

32 bit

Pixels

32 bit

Edge

32 bit

Angular Measure

16.16

Light Probe

16.16

Reference Line

16 bit

Reference Window

16 bit

Reference Window Theta

16.16

*16.16 means that the first 16 bits indicate the integer and the second 16 bits
the fraction (refer to Appendix A for more information). If you are
transferring results data to a PLC, you may need to convert the “16 point 16”
format to a PLC floating point number. You can convert results data using
the following equation:

PLC Floating Point Number = Integer +

Fraction
65536.0

The following example assumes that you are converting a “16 point 16”
value of 2.75. The value 2.75 is stored as follows:

15** 14 13 12 11 10 9

8

7

6

5

4

3

2

1

0

PLC

Bit#
Integer

N7:1 = 2

= 0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

0

Fraction

N7:2 = .75

= 1

1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

** This bit is the sign bit in PLC integer files (1 = Negative 0 = Positive)

To help you, we have provided the following sample program. The program
begins on the next page.

Converting Results Data

Advertising