Rockwell Automation 5370 Color CVIM Communications Manual User Manual

Page 92

Advertising
background image

Chapter 5
Using the RS–232 Ports

5–24

Example of Read Statistics Command:

> RS5 [CR]

This example reads the statistics block five
times.

The data returned from the statistics block consists of:

Block signature

Number of samples, maximum, minimum, average, and standard
deviation for each tool configured in the block.

The block signature is 2 bytes long. The number of samples is a 2 byte
integer. The maximum and minimum values are each 4 bytes. The format of
the data depends upon the operation (e.g. pixel count is an integer and linear
gaging is a 16.16 fixed point value). Refer to page C–24 for data formats.
Standard deviations are also 4 bytes each but are always 16.16 fixed point
values. Averages are 24.8 fixed point values. Therefore, each tool statistic
consists of 18 bytes with the exception of reference windows and the light
probe, which contain 18 bytes for each feature or a total of 54 bytes. The
statistics block is transmitted as two hexadecimal characters for each byte.
The total number of bytes including the block signature should not exceed
128 bytes. The statistics block is read once for every number of specified
samples. This means that if you read the statistics block five times with a
sample number of 50, 250 triggers will have to be processed before the five
reads are completed. The following shows the format of the returned data:

Figure 5.7
Statistics Block Returned Data Format

Set/Read Configurable
Statistics (cont’d)

Advertising